aboutsummaryrefslogtreecommitdiffstats
path: root/.vimrc
blob: 75c21bf1bb6a794caf5638378a1d68c9b76bbf5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
" Enable Vim features
set nocompatible

" BEGIN VUNDLE CONFIG
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" Vundle, a plugin manager for vim
Plugin 'gmarik/Vundle.vim'

" gruvbox colorscheme
Plugin 'morhetz/gruvbox'

" Syntastic syntax checking
" Install developer tools for syntax checking
" Install flake8 for Python PEP8
Plugin 'scrooloose/syntastic'

" YouCompleteMe completions
"Plugin 'Valloric/YouCompleteMe'
" If YCM is unavailable for your platform, try SuperTab instead
"Plugin 'ervandew/supertab'

" Emmet, an HTML/CSS macro engine
" The trigger key is Ctrl-y-,
Plugin 'mattn/emmet-vim'

" File tree
" Use :NERDTree to open the tree
Plugin 'scrooloose/nerdtree'

" Sublime Text style multiple cursors
" Use Ctrl+n to highlight matches and Ctrl+b to undo highlight
Plugin 'terryma/vim-multiple-cursors'

" Fancy statusbar
" Powerline fonts recommended
Plugin 'bling/vim-airline'
Plugin 'bling/vim-bufferline'

" Git integration
Plugin 'tpope/vim-fugitive'
Plugin 'airblade/vim-gitgutter'

" CtrlP fuzzy search
" Use Ctrl+P to search a project for a file
Plugin 'kien/ctrlp.vim'

" Ansible syntax and indentation
Plugin 'chase/vim-ansible-yaml'

" Salt syntax and indentation
Plugin 'saltstack/salt-vim'

" Automatically close parentheses, etc.
Plugin 'Raimondi/delimitMate'

" Hotkeys for commenting/uncommenting
" g-c-c to toggle a line, g-c-Motion to toggle a motion
Plugin 'tpope/vim-commentary'

" Markdown Preview
" Use :PrevimOpen while editing Markdown to open a live preview
Plugin 'kannokanno/previm'

" Highlight trailing whitespace
" Use :StripWhitespace to remove trailing shitespace
" Plugin 'ntpeters/vim-better-whitespace'

" Jump around Vimium-style 
" Use Leader-Leader-Motion <target> to jump around
Plugin 'easymotion/vim-easymotion'

call vundle#end()
filetype plugin indent on
" END VUNDLE CONFIG

" Allow the use of project-specific vimrc
set exrc
set secure

" Color scheme
" If using a Base16 terminal theme designed to keep the 16 ANSI colors intact
" (a "256" variation) and have successfully modified your 256 colorspace with
" base16-shell you must uncomment the following line
" let base16colorspace=256
" try
" colorscheme 256_jungle
" catch
" colorscheme slate
"endtry
let g:gruvbox_italic=1
colorscheme gruvbox
set background=dark
syntax on

" Unicode, because this is the future
set encoding=utf-8

" Sane defaults for indentation
" set expandtab
set softtabstop=4
set shiftwidth=4
set autoindent

" Show line numbers
set number

" Highlight current line
" set cursorline

" Highlight columns 80 and 120
"set colorcolumn=80,120

" Allow mouse
set mouse=a

" Spell check
set spell
set spellsuggest=best,10

" Wrap searches
set wrapscan
let mapleader = ","

" Smart search case sensitivity
set ignorecase
set smartcase

" Show completions when using commands like :edit
set wildmenu

" Allow switching buffer even if current buffer contains unsaved changes
set hidden

" Disable scratch preview window
set completeopt-=preview

" Use comma as the leader key
let mapleader=','

" Use Alt+hjkl to switch between windows
nmap <silent> <A-h> :wincmd h<CR>
nmap <silent> <A-j> :wincmd j<CR>
nmap <silent> <A-k> :wincmd k<CR>
nmap <silent> <A-l> :wincmd l<CR>

" Airline tweaks
" Always show statusline
set laststatus=2
" Use Powerline fonts
let g:airline_powerline_fonts = 1

" CtrlP tweaks
" keybinds
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'

" Multiple cursors tweaks
" Since we bound Ctrl+P, we have to rebind previous selection
let g:multi_cursor_prev_key='<C-b>'

" Command to open browser for Markdown Preview
let g:previm_open_cmd = 'google-chrome-stable'

" Syntastic Tweaks
" Display a statusline message if errors are detected
let g:syntastic_stl_format = '%E{Errors: %e}%B{,}%W{Warnings: %w}'
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
" Automatically populate the list of error -> line number mappings
" (Disabled by default for compatibility)
let g:syntastic_always_populate_loc_list = 1
" Check files when they are opened
let g:syntastic_check_on_open = 1
" Don't check files when they are closed
let g:syntastic_check_on_wq = 0

" GitGutter tweaks
" Display diff markers between index and HEAD
let g:gitgutter_diff_args = ' HEAD '

" If using SuperTab instead of YCM, list completions top-to-bottom
" let g:SuperTabDefaultCompletionType = "<c-n>"
"
set clipboard=unnamedplus