forked from jmhobbs/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc.symlink
386 lines (286 loc) · 7.68 KB
/
vimrc.symlink
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
" jmhobbs vimrc
"
" Odds and ends taken from:
" https://github.com/nicknisi/dotfiles/blob/master/vim/vimrc.symlink
" https://github.com/jerodsanto/dotfiles/blob/master/vimrc
"
" :PlugUpdate
"
set nocompatible
""""""""""""""
" Plug Setup "
""""""""""""""
call plug#begin('~/.vim/plugged')
" AIRLINE
Plug 'bling/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Document Tree View
Plug 'scrooloose/nerdtree'
" Close the buffer, leave the window
Plug 'vim-scripts/BufClose.vim'
Plug 'vim-scripts/BufOnly.vim'
" External Syntax Checking
Plug 'scrooloose/syntastic'
" Fancy Status Line
" Plug 'scrooloose/vim-statline'
" Find Yo Files
Plug 'ctrlpvim/ctrlp.vim'
" ack.vim
Plug 'mileszs/ack.vim'
" Python Stuff
Plug 'klen/python-mode'
" Go Stuff
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
" Extra Syntax Highlighters
Plug 'hallison/vim-markdown'
Plug 'groenewege/vim-less'
" Editor Config
Plug 'editorconfig/editorconfig-vim'
" Jinja, Nunjucks & Twig
"Plug 'ervandew/Jinja'
Plug 'lepture/vim-jinja'
" Diff markers in the gutter
Plug 'mhinz/vim-signify'
" nim Stuff
Plug 'zah/nim.vim'
" VCL highlighting
Plug 'fgsch/vim-varnish'
" neocomplete
Plug 'Shougo/neocomplete.vim'
Plug 'vim-scripts/rubycomplete.vim'
Plug 'vim-scripts/sqlcomplete.vim'
" deocomplete
"if has('nvim')
" Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
"else
" Plug 'Shougo/deoplete.nvim'
" Plug 'roxma/nvim-yarp'
" Plug 'roxma/vim-hug-neovim-rpc'
"endif
"let g:deoplete#enable_at_startup = 1
call plug#end()
""""""""""""""""
" / Plug Setup "
""""""""""""""""
filetype plugin indent on
" Detect twig/jinja filetype
au BufRead,BufNewFile *.twig set filetype=htmljinja
au BufRead,BufNewFile *.jinja set filetype=htmljinja
" Be Pretty!
set t_Co=256
set background=dark
colorscheme molokai
" UTF-8 FTW!
set encoding=utf-8
" Keep backup/swap centrally
set backupdir=~/.vim/backup
set dir=~/.vim/backup
set noswapfile
" Tabs == 2 spaces
set tabstop=2
set shiftwidth=2
set smartindent " Try to be clever vim
set expandtab " Spaces, not tabs
syntax enable " Syntax highlighting
set incsearch " Incremental search
set ignorecase " Case-insensitive search by default
set smartcase " Case-sensitive search if uppcase is used
set wildmenu " Turn on tab completion menu
set wildmode=list:longest " Make tab completion work like shell
set scrolloff=3 " Start scrolling viewport 3 lines ahead of cursor
set nofoldenable " No code folding
set number " Show line nunbers
set laststatus=2 " Status line on
set showmatch " Show matching braces
set nowrap " No line wrapping
set list " I like seeing invisible characters
" Set invisible characters
set listchars=tab:-∙,trail:∙,precedes:«,extends:»
" Faster autocomplete with less searching
set complete-=i
" Ignore these when globbing
set wildignore+=*.pyc,*.log,*.otf,*.woff
" STFU Bells
set noerrorbells
set novisualbell
set t_vb=
autocmd! GUIEnter * set vb t_vb=
"""""""""""""""
" AIRLINE "
"""""""""""""""
set guifont=Source\ Code\ Pro\ for\ Powerline:h14
let g:Powerline_symbols = 'fancy'
set fillchars+=stl:\ ,stlnc:\
set term=xterm-256color
set termencoding=utf-8
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
let g:airline_powerline_fonts=1
let g:airline_theme="papercolor"
"""""""""""""""""
" Misc Mappings "
"""""""""""""""""
" Change the leader
let mapleader = ","
let g:mapleader = ","
" =j indents as JSON
nmap =j :%!python -m json.tool<CR>
" Expand %% into the current directory of the current file
cnoremap %% <C-R>=expand('%:h').'/'<cr>
" Remove extra whitespace
nmap <leader><space> :%s/\s\+$<cr>
" Open/Close NERDTree with control-n
nmap <silent> <c-n> :NERDTreeToggle<CR>
" leader+r executes file
nnoremap <leader>r :!%:p
"""""""""""""""""""
" / Misc Mappings "
"""""""""""""""""""
""""""""""""""""""""
" Buffer Shortcuts "
""""""""""""""""""""
" Next Buffer
nmap <leader>n :bn<cr>
" Previous Buffer
nmap <leader>p :bp<cr>
" Close Buffer but not split
nmap <leader>q :BufClose<cr>
nmap <silent> <c-d> :BufClose<CR>:bn<cr>
" Switch between current and last buffer
nmap <leader>. <c-^>
nmap <leader>, <c-^>
""""""""""""""""""""""
" / Buffer Shortcuts "
""""""""""""""""""""""
""""""""""""""""""""
" Window Shortcuts "
""""""""""""""""""""
" Resize vertical splits
map <silent> <C-l> <C-w><
map <silent> <C-h> <C-w>>
""""""""""""""""""""""
" / Window Shortcuts "
""""""""""""""""""""""
"""""""""""""""
" Python Mode "
"""""""""""""""
let g:pymode_lint = 1
let g:pymode_lint_write = 1
let g:pymode_lint_checker = "pyflakes,pep8"
let g:pymode_lint_minheight = 1
let g:pymode_lint_maxheight = 3
let g:pymode_lint_ignore = "E501"
let g:pymode_folding = 0
let g:pymode_breakpoint = 0
let g:pymode_utils_whitespaces = 0
let g:pymode_doc = 0
let g:pymode_rope = 0
let g:pymode_rope_autoimport = 0
let g:pymode_rope_lookup_project = 0
let g:pymode_rope_complete_on_dot = 0
" https://github.com/klen/python-mode/issues/384
set completeopt=menu
"""""""""""""""""
" / Python Mode "
"""""""""""""""""
"""""""""""
" Go Mode "
"""""""""""
let g:go_fmt_command = "goimports"
let g:go_info_mode = 'gocode' " use gocode until I can fix the blocking issue
"""""""""""""
" / Go Mode "
"""""""""""""
"""""""""""""
" CtrlP.vim "
"""""""""""""
let g:ctrlp_working_path_mode = 'r'
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.yardoc\|log|tmp|\.gems|vendor$',
\ 'file': '\.so$\|\.dat$|\.DS_Store$'
\ }
"""""""""""""""
" / CtrlP.vim "
"""""""""""""""
"""""""""""
" Ack.vim "
"""""""""""
if executable("rg")
let g:ackprg = 'rg --vimgrep --smart-case'
else
let g:ackprg = 'ag --vimgrep --smart-case --skip-vcs-ignores'
endif
cnoreabbrev rg Ack!
cnoreabbrev ag Ack!
cnoreabbrev ack Ack!
"""""""""""""
" / Ack.vim "
"""""""""""""
""""""""""""
" NERDTree "
""""""""""""
" Ignore .pyc files
let NERDTreeIgnore = ['\.pyc$']
""""""""""""""
" / NERDTree "
""""""""""""""
"""""""""""""""
" neocomplete "
"""""""""""""""
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#sources#syntax#min_keyword_length = 3
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
"""""""""""""""""
" / neocomplete "
"""""""""""""""""
""""""""""""""""
" rubycomplete "
""""""""""""""""
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
""""""""""""""""""
" / rubycomplete "
""""""""""""""""""
"""""""""""""""
" sqlcomplete "
"""""""""""""""
let g:sql_type_default = 'psql'
"""""""""""""""""
" / sqlcomplete "
"""""""""""""""""
"""""""""""
" signify "
"""""""""""
let g:signify_vcs_list = ['git']
let g:signify_sign_change = '±'
"""""""""""""
" / signify "
"""""""""""""
"""""""""""""
" syntastic "
"""""""""""""
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_sh_shellcheck_args = "-e 1090,1091"
let g:syntastic_loc_list_height = 3
"""""""""""""""
" / syntastic "
"""""""""""""""
" My PATH broke for some reason :(
let $PATH .= ':/usr/local/bin:/Users/johnhobbs/go/bin'