forked from Xuyuanp/vimrc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplugins.vim
489 lines (406 loc) · 15.7 KB
/
plugins.vim
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
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
" NERDtree {{{
call dein#add('scrooloose/nerdtree', {'on_cmd': 'NERDTreeToggle'})
call dein#add('Xuyuanp/nerdtree-git-plugin')
call dein#add('jistr/vim-nerdtree-tabs')
map <C-E> :NERDTreeToggle<CR>
let NERDTreeShowBookmarks = 1
let NERDTreeIgnore =
\ ['\.idea', '\.iml', '\.pyc', '\~$', '\.swo$', '\.git', '\.hg', '\.svn', '\.bzr', '\.DS_Store', 'tmp', 'gin-bin']
let NERDTreeShowHidden = 1
let NERDTreeChDirMode = 2
let NERDTreeMouseMode = 2
let g:nerdtree_tabs_open_on_gui_startup = '1'
" }}}
" colorscheme {{{
call dein#add('miconda/lucariox.vim')
call dein#add('tomasr/molokai')
call dein#add('kadekillary/subtle_solo')
let g:rehash256 = 1
call dein#add('altercation/vim-colors-solarized')
let g:solarized_termcolors = 256
let g:solarized_termtrans = 1
let g:solarized_contrast = "low"
let g:solarized_visibility = "low"
let g:solarized_bold = 1
let g:solarized_underline = 1
let g:solarized_italic = 1
" }}}
" Airline - lean & mean status/tabline for vim that's light as air {{{
call dein#add('vim-airline/vim-airline')
call dein#add('vim-airline/vim-airline-themes')
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
set t_Co=256
let g:airline_theme = 'simple'
let g:airline_powerline_fonts = 1
let g:airline#extensions#branch#enabled = 1
let g:airline#extensions#syntastic#enabled = 1
let g:airline_detect_paste = 1
let g:airline#extensions#whitespace#enabled = 1
let g:airline_detect_modified = 1
let g:airline#extensions#tagbar#enabled = 1
let g:airline#extensions#tagbar#flags = 'p'
" }}}
" Go {{{
call dein#add('fatih/vim-go', {'on_ft': ['go']})
let g:go_highlight_operators = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_fmt_command = "goimports"
let g:go_snippet_engine = "neosnippet"
let g:go_fmt_fail_silently = 1
let g:go_autodetect_gopath = 1
let g:go_def_mapping_enabled = 0
au Filetype go nnoremap gd :GoDef<CR>
au FileType go nmap <Leader>s <Plug>(go-def-split)
au FileType go nmap <Leader>v <Plug>(go-def-vertical)
au FileType go nmap <Leader>ii <Plug>(go-implements)
au FileType go nmap <Leader>d <Plug>(go-doc)
au FileType go set completeopt+=preview
autocmd BufRead,BufNewFile ~/.cache/go-build/* set syntax=go
" }}}
" Python {{{
call dein#add("davidhalter/jedi-vim")
call dein#add("tell-k/vim-autopep8")
" }}}
" Python {{{
call dein#add("davidhalter/jedi-vim")
" }}}
" ALE {{{
call dein#add('w0rp/ale')
let b:ale_linters = {'javascript': ['eslint']}
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 1
" }}}
" Javascript {{{
call dein#add('pangloss/vim-javascript')
" let g:javascript_plugin_jsdoc = 1
" let g:javascript_plugin_ngdoc = 1
let g:javascript_plugin_flow = 1
call dein#add('mxw/vim-jsx')
let g:jsx_ext_required = 0
call dein#add('mattn/emmet-vim')
au FileType javascript set shiftwidth=2
au FileType javascript set softtabstop=2
" }}}
" Neomake {{{
call dein#add('neomake/neomake')
autocmd! BufWritePost * Neomake
let g:neomake_serialize = 1
let g:neomake_serialize_abort_on_error = 1
" }}}
" Syntastic {{{
call dein#add('scrooloose/syntastic')
let g:syntastic_error_symbol = '✗'
let g:syntastic_warning_symbol = '⚠'
let g:syntastic_style_error_symbol = '✠'
let g:syntastic_style_warning_symbol = '≈'
let g:syntastic_auto_jump = 2
let g:syntastic_go_checkers = ['golint','govet','errcheck']
" Disable inherited syntastic
let g:syntastic_mode_map = {
\ "mode": "passive",
\ "active_filetypes": [],
\ "passive_filetypes": []
\ }
" }}}
" Surround - quoting/parenthesizing made simple {{{
call dein#add('tpope/vim-surround')
" }}}
" Completion {{{
if has('nvim')
call dein#add('Shougo/deoplete.nvim', {'on_i': 1})
call dein#add('zchee/deoplete-go', {'build': 'make', 'on_ft': 'go'})
call dein#add('Shougo/neco-vim', {'on_ft': 'vim'})
let g:deoplete#enable_at_startup = 1
let g:deoplete#max_menu_width = 200
let g:deoplete#max_list = 15
let g:deoplete#enable_smart_case = 1
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> deoplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> deoplete#smart_close_popup()."\<C-h>"
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function() abort
return deoplete#close_popup() . "\<CR>"
endfunction
elseif has('lua')
" TODO: neocomplete
else
" TODO: neocomplcache
endif
" }}}
" Tcomment - An extensible & universal comment vim-plugin that also handles embedded filetypes {{{
call dein#add('tomtom/tcomment_vim')
" }}}
" git {{{
call dein#add('tpope/vim-git')
" show a git diff in the gutter(sign column) and stages/reverts hunks'
call dein#add('airblade/vim-gitgutter')
let g:gitgutter_highlight_lines = 0
let g:gitgutter_realtime = 1
let g:gitgutter_eager = 1
" gitk for vim
call dein#add('gregsexton/gitv')
" a Git wrapper
call dein#add('tpope/vim-fugitive')
autocmd Filetype gitcommit setlocal spell textwidth=72
" }}}
" auto-pairs - insert or delete brackets, parens, quotes in pair {{{
call dein#add('jiangmiao/auto-pairs')
" }}}
" bufferline - super simple vim plugin to show the list of buffers in the command bar {{{
call dein#add('bling/vim-bufferline')
let g:bufferline_echo = 0
" }}}
" indentLine - display the indent levels with thin vertical lines {{{
call dein#add('Yggdroot/indentLine')
let g:indentLine_char = '┆'
" }}}
" Unite - unite and create user interfaces {{{
call dein#add('Shougo/unite.vim')
" MRU plugin of unite
call dein#add('Shougo/neomru.vim')
" outline source for unite.vim
call dein#add('Shougo/unite-outline')
call dein#add('soh335/unite-outline-go')
let g:unite_abbr_highlight = 'Comment'
let g:unite_source_history_yank_enable = 1
let g:unite_source_rec_max_cache_files = 5000
if !exists('g:unite_source_menu_menus')
let g:unite_source_menu_menus = {}
endif
let g:unite_source_menu_menus.git = {
\ 'description' : ' gestionar repositorios git
\ ⌘ [espacio]g',
\}
let g:unite_source_menu_menus.git.command_candidates = [
\['▷ tig ⌘ ,gt',
\'normal ,gt'],
\['▷ git status (Fugitive) ⌘ ,gs',
\'Gstatus'],
\['▷ git diff (Fugitive) ⌘ ,gd',
\'Gdiff'],
\['▷ git commit (Fugitive) ⌘ ,gc',
\'Gcommit'],
\['▷ git log (Fugitive) ⌘ ,gl',
\'exe "silent Glog | Unite quickfix"'],
\['▷ git blame (Fugitive) ⌘ ,gb',
\'Gblame'],
\['▷ git stage (Fugitive) ⌘ ,gw',
\'Gwrite'],
\['▷ git checkout (Fugitive) ⌘ ,go',
\'Gread'],
\['▷ git rm (Fugitive) ⌘ ,gr',
\'Gremove'],
\['▷ git mv (Fugitive) ⌘ ,gm',
\'exe "Gmove " input("destino: ")'],
\['▷ git push (Fugitive, salida por buffer) ⌘ ,gp',
\'Git! push'],
\['▷ git pull (Fugitive, salida por buffer) ⌘ ,gP',
\'Git! pull'],
\['▷ git prompt (Fugitive, salida por buffer) ⌘ ,gi',
\'exe "Git! " input("comando git: ")'],
\['▷ git cd (Fugitive)',
\'Gcd'],
\]
function! s:unit_settings()
nmap <buffer> Q <Plug>(unite_exit)
nmap <buffer> <Esc> <Plug>(unite_exit)
endfunction
autocmd FileType unite call s:unit_settings()
if executable('hw')
" Use hw (highway)
" https://github.com/tkengo/highway
let g:unite_source_grep_command = 'hw'
let g:unite_source_grep_default_opts = '--no-group --no-color'
let g:unite_source_grep_recursive_opt = ''
elseif executable('ag')
" Use ag (the silver searcher)
" https://github.com/ggreer/the_silver_searcher
let g:unite_source_grep_command = 'ag'
let g:unite_source_grep_default_opts =
\ '-i --vimgrep --hidden --ignore ' .
\ '''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr'''
let g:unite_source_grep_recursive_opt = ''
elseif executable('pt')
" Use pt (the platinum searcher)
" https://github.com/monochromegane/the_platinum_searcher
let g:unite_source_grep_command = 'pt'
let g:unite_source_grep_default_opts = '--nogroup --nocolor'
let g:unite_source_grep_recursive_opt = ''
elseif executable('ack-grep')
" Use ack
" http://beyondgrep.com/
let g:unite_source_grep_command = 'ack-grep'
let g:unite_source_grep_default_opts =
\ '-i --no-heading --no-color -k -H'
let g:unite_source_grep_recursive_opt = ''
elseif executable('jvgrep')
" Use jvgrep
" https://github.com/mattn/jvgrep
let g:unite_source_grep_command = 'jvgrep'
let g:unite_source_grep_default_opts =
\ '-i --exclude ''\.(git|svn|hg|bzr)'''
let g:unite_source_grep_recursive_opt = '-R'
endif
nmap <Space> [unite]
nnoremap [unite] <Nop>
nnoremap <silent> [unite]<space> :<C-U>Unite -auto-resize -buffer-name=mixed -toggle buffer file_mru file bookmark file_rec/async:!<CR><C-U>
nnoremap <silent> [unite]f :<C-U>Unite -auto-resize -silent -buffer-name=files -start-insert -toggle file<CR><C-U>
nnoremap <silent> [unite]e :<C-U>Unite -auto-resize -silent -buffer-name=recent -start-insert file_mru<CR>
nnoremap <silent> [unite]y :<C-U>Unite -auto-resize -silent -buffer-name=yanks history/yank<CR>
nnoremap <silent> [unite]l :<C-U>Unite -auto-resize -silent -buffer-name=line -start-insert line<CR>
nnoremap <silent> [unite]b :<C-U>Unite -auto-resize -silent -buffer-name=buffers buffer<CR>
nnoremap <silent> [unite]/ :<C-U>Unite -auto-resize -silent -buffer-name=search -no-quit grep:.<CR>
nnoremap <silent> [unite]m :<C-U>Unite -auto-resize -silent -buffer-name=mappings mapping<CR>
nnoremap <silent> [unite]o :<C-U>Unite -auto-resize -silent -buffer-name=outline outline<CR>
nnoremap <silent> [unite]g :<C-U>Unite -auto-resize -silent -buffer-name=menu -start-insert menu:git<CR>
" }}}
" haskell {{{
call dein#add('eagletmt/neco-ghc', {'on_ft': ['haskell']})
call dein#add('eagletmt/ghcmod-vim', {'on_ft': ['haskell']})
call dein#add('itchyny/vim-haskell-indent', {'on_ft': ['haskell']})
let g:haskellmode_completion_ghc = 0
autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
let g:necoghc_enable_detailed_browse = 1
autocmd FileType haskell set formatprg=pointfree
" }}}
" tabular - Vim script for text filtering and alignment {{{
call dein#add('godlygeek/tabular')
" }}}
" ctrlsf - An ack/ag powered code search and view tool, in an intuitive way with fairly more context. {{{
call dein#add('dyng/ctrlsf.vim')
let g:ctrlsf_context = '-B 5 -A 3'
let g:ctrlsf_width = '30%'
" }}}
" EasyAlign - A simple, easy-to-use Vim alignment plugin. {{{
call dein#add('junegunn/vim-easy-align')
vnoremap <CR><Space> :EasyAlign\<CR>
vnoremap <CR>2<Space> :EasyAlign2\<CR>
vnoremap <CR>-<Space> :EasyAlign-\<CR>
vnoremap <CR>-2<Space> :EasyAlign-2\<CR>
vnoremap <CR>: :EasyAlign:<CR>
vnoremap <CR>= :EasyAlign=<CR>
vnoremap <CR><CR>= :EasyAlign!=<CR>
" }}}
" tagbar - Vim plugin that displays tags in a window, ordered by class etc {{{
call dein#add('majutsushi/tagbar')
nmap <C-t> :TagbarToggle<CR>
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
let g:tagbar_show_linebumbers = 1
" }}}
" neo-snippet - plugin contains neocomplcache snippets source {{{
call dein#add('Shougo/neosnippet')
call dein#add('Shougo/neosnippet-snippets')
" Plugin key-mappings.
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
" SuperTab like snippets behavior.
imap <expr><TAB> neosnippet#jumpable() ?
\ "\<Plug>(neosnippet_jump)"
\: pumvisible() ? "\<C-n>" : "\<TAB>"
smap <expr><TAB> neosnippet#jumpable() ?
\ "\<Plug>(neosnippet_jump)"
\: "\<TAB>"
let g:neosnippet#snippets_directory='~/.vim/snippets'
" For snippet_complete marker.
if has('conceal')
set conceallevel=2 concealcursor=i
endif
" }}}
" rainbow parenthesizing {{{
call dein#add('luochen1990/rainbow')
let g:rainbow_active = 1
" }}}
" neocomplete.vim
call dein#add('Shougo/neocomplete.vim')
"Note: This option must be set in .vimrc(_vimrc). NOT IN .gvimrc(_gvimrc)!
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplete.
let g:neocomplete#enable_at_startup = 1
" Use smartcase.
let g:neocomplete#enable_smart_case = 1
" Set minimum syntax keyword length.
let g:neocomplete#sources#syntax#min_keyword_length = 3
" Define dictionary.
let g:neocomplete#sources#dictionary#dictionaries = {
\ 'default' : '',
\ 'vimshell' : $HOME.'/.vimshell_hist',
\ 'scheme' : $HOME.'/.gosh_completions'
\ }
" Define keyword.
if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns['default'] = '\h\w*'
" Plugin key-mappings.
inoremap <expr><C-g> neocomplete#undo_completion()
inoremap <expr><C-l> neocomplete#complete_common_string()
" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
return (pumvisible() ? "\<C-y>" : "" ) . "\<CR>"
" For no inserting <CR> key.
"return pumvisible() ? "\<C-y>" : "\<CR>"
endfunction
" <TAB>: completion.
" inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
" Close popup by <Space>.
"inoremap <expr><Space> pumvisible() ? "\<C-y>" : "\<Space>"
" AutoComplPop like behavior.
"let g:neocomplete#enable_auto_select = 1
" Shell like behavior(not recommended).
"set completeopt+=longest
"let g:neocomplete#enable_auto_select = 1
"let g:neocomplete#disable_auto_complete = 1
"inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<C-x>\<C-u>"
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
" autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
" autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" Enable heavy omni completion.
if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns = {}
endif
"let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
"let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
"let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
" For perlomni.vim setting.
" https://github.com/c9s/perlomni.vim
let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::'