/
plugins.vim
515 lines (382 loc) · 13.3 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
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
""""""""""""""""""""""""""""""""""""""""""""""""""
" => PLUGINS
""""""""""""""""""""""""""""""""""""""""""""""""""
call plug#begin('~/.vim/plugged')
" Interactive command execution
Plug 'Shougo/vimproc.vim', { 'do': 'make' }
" Unite. The interface to rule almost everything
" Plug 'Shougo/unite.vim'
" Most Recently Used
Plug 'Shougo/neomru.vim'
" Add filetype glyphs (icons)
Plug 'ryanoasis/vim-devicons'
" Command-line fuzzy finder
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
if has('nvim')
" Asynchronous completion for neovim
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" Tern-based JavaScript editing support
Plug 'carlitux/deoplete-ternjs', { 'do': 'npm install -g tern', 'for': ['javascript', 'javascript.jsx'] }
else
" Code completion
Plug 'Valloric/YouCompleteMe', { 'do': './install.sh' }
endif
" Emmet for vim
Plug 'mattn/emmet-vim'
" Code search and view tool
Plug 'dyng/ctrlsf.vim'
" BufExplorer quickly and easily switch between buffer
Plug 'jlanzarotta/bufexplorer'
" Tree explorer for vim.
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" Asynchronous Lint Engine
Plug 'w0rp/ale'
" Cache file automatically
Plug 'MarcWeber/vim-addon-mw-utils'
" Lean & mean status/tabline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Comment stuff out
Plug 'tpope/vim-commentary'
" Visually select larger regions of text using the same key combination
Plug 'terryma/vim-expand-region'
" Git wrapper
Plug 'tpope/vim-fugitive'
" SCSS syntax highlighting
Plug 'cakebaker/scss-syntax.vim', { 'for': 'scss' }
" Markdown syntax highlighting
" Plug 'plasticboy/vim-markdown', { 'for': 'markdown' }
" Enable repeating supported plugin maps
Plug 'tpope/vim-repeat'
" ES2015 code snippets
Plug 'epilande/vim-es2015-snippets', { 'for': ['javascript', 'javascript.jsx'] }
" React code snippets
Plug 'epilande/vim-react-snippets', { 'for': ['javascript', 'javascript.jsx'] }
" Ultimate snippet solution
Plug 'SirVer/ultisnips'
" Snippet files for various programming languages
Plug 'honza/vim-snippets'
" Quoting/parenthesizing made simple
Plug 'tpope/vim-surround'
" Display indention levels with vertical lines
Plug 'Yggdroot/indentLine'
" Tmux statusline generator with support for airline
Plug 'edkolev/tmuxline.vim'
" Undo history visualizer
Plug 'mbbill/undotree', { 'on': 'UndotreeToggle' }
" Preview colors in source code
Plug 'ap/vim-css-color'
" CSS3 syntax support
Plug 'hail2u/vim-css3-syntax'
" Vim motions on speed
" Plug 'easymotion/vim-easymotion'
" Shows a git diff in the gutter
Plug 'airblade/vim-gitgutter'
" Instant Markdown previews
Plug 'suan/vim-instant-markdown', { 'for': 'markdown' }
" Jade syntax highlighting
" Plug 'digitaltoad/vim-pug', { 'for': ['jade', 'pug'] }
" Javascript indentation and syntax support
Plug 'pangloss/vim-javascript', { 'for': ['javascript', 'javascript.jsx'] }
" React JSX syntax highlighting & indenting
Plug 'mxw/vim-jsx', { 'for': ['javascript', 'javascript.jsx'] }
" Yet Another JavaScript Syntax
Plug 'othree/yajs.vim', { 'for': ['javascript', 'javascript.jsx'] }
" ES.Next syntax
Plug 'othree/es.next.syntax.vim', { 'for': ['javascript', 'javascript.jsx'] }
" Syntax for JavaScript libraries
Plug 'othree/javascript-libraries-syntax.vim', { 'for': ['javascript', 'javascript.jsx'] }
" Block comments based on a function signature
Plug 'heavenshell/vim-jsdoc', { 'for': ['javascript', 'javascript.jsx'] }
" Syntax for styled-components
Plug 'fleischie/vim-styled-components', { 'for': ['javascript', 'javascript.jsx'] }
" Sublime Text style multiple selections
" Plug 'terryma/vim-multiple-cursors'
" Seamless navigation between tmux panes and vim splits
Plug 'christoomey/vim-tmux-navigator'
" Zoom in/out of windows
Plug 'troydm/zoomwintab.vim'
" Gotham colorscheme
" Plug 'whatyouhide/vim-gotham'
" Oceanic Next colorscheme
Plug 'mhartington/oceanic-next'
" Solarized colorscheme
" Plug 'altercation/vim-colors-solarized'
" Vim Orgmode
Plug 'jceb/vim-orgmode', { 'for': 'org' }
" Increment dates, times, and more
Plug 'tpope/vim-speeddating', { 'for': 'org' }
" Insert or delete brackets, parens, quotes in pair
Plug 'jiangmiao/auto-pairs'
" Tern-based JavaScript editing support
" Plug 'ternjs/tern_for_vim', { 'do': 'npm install' }
" EditorConfig for consistent coding style
Plug 'editorconfig/editorconfig-vim'
" Provides additional text objects
Plug 'wellle/targets.vim'
" Speed up Vim by updating folds only when called-for
Plug 'Konfekt/FastFold'
" Metrics, insights, and time tracking
" Plug 'wakatime/vim-wakatime'
call plug#end()
""""""""""""""""""""""""""""""""""""""""""""""""""
" => PLUGIN SPECIFC CONFIGURATIONS
""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""
" bufExplorer plugin
""""""""""""""""""""""""""""""
let g:bufExplorerDefaultHelp=0
let g:bufExplorerShowRelativePath=1
let g:bufExplorerFindActive=1
let g:bufExplorerSortBy='mru'
map <leader>o :BufExplorer<cr>
""""""""""""""""""""""""""""""
" MRU plugin
""""""""""""""""""""""""""""""
let MRU_Max_Entries = 400
""""""""""""""""""""""""""""""
" Unite.vim
""""""""""""""""""""""""""""""
" Use the fuzzy matcher for everything
" call unite#filters#matcher_default#use(['matcher_fuzzy'])
" call unite#filters#converter_default#use(['converter_relative_word'])
" call unite#filters#sorter_default#use(['sorter_rank'])
" call unite#custom#source('file_mru,file_rec,file_rec/async', 'converters', 'converter_relative_word')
" Restrict mru to display files for current project
" call unite#custom#source(
" \ 'file_mru', 'matchers',
" \ ['matcher_project_files', 'matcher_fuzzy'])
" call unite#custom#profile('default', 'context', {
" \ 'cursor_line_highlight' : 'CursorLine',
" \ 'start_insert': 1,
" \ 'winheight': 10,
" \ 'direction': 'botright',
" \ })
" Set up some custom ignores
" call unite#custom_source('file_rec,file_rec/async,file_mru,file,buffer,grep',
" \ 'ignore_pattern', join([
" \ '\.git/',
" \ 'tmp/',
" \ '.sass-cache',
" \ 'node_modules/',
" \ 'bower_components/',
" \ 'dist/',
" \ '.pyc',
" \ ], '\|'))
" let g:unite_data_directory='~/.vim/.cache/unite'
" let g:unite_source_history_yank_enable=1
" let g:unite_source_rec_max_cache_files=5000
" let g:unite_source_file_mru_limit=200
" let g:unite_source_rec_async_command =
" \ ['ag', '--follow', '--nocolor', '--nogroup',
" \ '--hidden', '-g', '']
" let g:unite_source_grep_command = 'ag'
" let g:unite_source_grep_default_opts = '-s -H --nocolor --nogroup --column'
" let g:unite_source_grep_recursive_opt = ''
" let g:unite_prompt='❯ '
" nnoremap <C-f> :<C-u>Unite -buffer-name=files file_mru file_rec/async:!<CR>
" nnoremap <leader>f :<C-u>Unite -no-split -no-resize -direction=topleft -buffer-name=mru file_mru<CR>
" nnoremap <leader>y :<C-u>Unite -no-start-insert history/yank<CR>
" nnoremap <leader>/ :<C-u>Unite grep:.<CR>
" Custom mappings for the unite buffer
" autocmd FileType unite call s:unite_keymaps()
" function! s:unite_keymaps()
" " Enable navigation with control-j and control-k in insert mode
" imap <buffer> <C-j> <Plug>(unite_select_next_line)
" imap <buffer> <C-k> <Plug>(unite_select_previous_line)
" " Exit unite with Esc while in insert mode
" nmap <buffer> <Esc> <Plug>(unite_exit)
" imap <buffer> <Esc> <Plug>(unite_exit)
" endfunction
""""""""""""""""""""""""""""""
" FZF
""""""""""""""""""""""""""""""
let g:fzf_layout = { 'down': '40%' }
" Jump to the existing window if possible
let g:fzf_buffers_jump = 1
" Search project files, respecting git ignore
nnoremap <silent> <C-f> :FZF<CR>
" Search all files, e.g. node_modules/
nnoremap <silent> <leader>af :call fzf#vim#files('',
\ {'source': 'ag --hidden --ignore .git -f -g "" -u', 'down': '40%'})<CR>
" Search MRU buffers
nnoremap <silent> <leader>f :Buffers<CR>
nnoremap <silent> <leader>` :Marks<CR>
" [Tags] Command to generate tags file
" let g:fzf_tags_command = 'ctags -R --exclude=.git --exclude=node_modules --exclude=test'
nnoremap <silent> <leader>t :Tags<CR>
nnoremap <silent> <leader>b :BTags<CR>
""""""""""""""""""""""""""""""
" NERDTree
""""""""""""""""""""""""""""""
let g:NERDTreeWinPos = "left"
let g:NERDTreeShowHidden=1
let NERDTreeIgnore = ['\.js.map$', '\.DS_Store$']
let g:NERDTreeWinSize=35
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
map <silent> <C-e> :NERDTreeToggle<CR>
""""""""""""""""""""""""""""""
" vim-multiple-cursors
""""""""""""""""""""""""""""""
" let g:multi_cursor_next_key="\<C-s>"
""""""""""""""""""""""""""""""
" vim airline
""""""""""""""""""""""""""""""
let g:airline#extensions#branch#displayed_head_limit = 10
let g:airline_powerline_fonts = 1
if has("gui_running")
let g:airline_theme="luna"
else
let g:airline_theme="oceanicnext"
endif
" Automatically truncate sections
let g:airline#extensions#default#section_truncate_width = {
\ 'b': 100,
\ 'x': 100,
\ 'y': 105,
\ 'z': 50,
\ 'warning': 50,
\ }
""""""""""""""""""""""""""""""
" vim-easymotion
""""""""""""""""""""""""""""""
" map s <Plug>(easymotion-s)
" map <leader>s <Plug>(easymotion-s2)
" map <leader>_ <Plug>(easymotion-prefix)
" " match lower & upper case
" let g:EasyMotion_smartcase = 1
" let g:EasyMotion_use_smartsign_us = 1
" map <leader>l <Plug>(easymotion-lineforward)
" map <leader>j <Plug>(easymotion-j)
" map <leader>k <Plug>(easymotion-k)
" map <leader>h <Plug>(easymotion-linebackward)
" let g:EasyMotion_startofline = 0 " keep cursor colum when JK motion
""""""""""""""""""""""""""""""
" vim-fugitive
""""""""""""""""""""""""""""""
map <leader>gg :GitGutterToggle<CR>
map <leader>gs :Gstatus<CR>
set diffopt+=vertical
""""""""""""""""""""""""""""""
" Deoplete
""""""""""""""""""""""""""""""
if has('nvim')
" Enable deoplete.
let g:deoplete#enable_at_startup = 1
if !exists('g:deoplete#omni#input_patterns')
let g:deoplete#omni#input_patterns = {}
endif
augroup omnifuncs
autocmd!
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=tern#Complete
augroup end
let g:tern_request_timeout = 1
let g:tern_show_argument_hints = 'on_hold'
let g:tern_show_signature_in_pum = 0
" Automatically close preview window after autocompletion
autocmd CompleteDone * if pumvisible() == 0 | pclose | endif
endif
""""""""""""""""""""""""""""""
" Ultisnips
""""""""""""""""""""""""""""""
" Trigger configuration
let g:UltiSnipsExpandTrigger="<C-l>"
" let g:UltiSnipsJumpForwardTrigger="<Tab>"
" let g:UltiSnipsJumpBackwardTrigger="<S-Tab>"
""""""""""""""""""""""""""""""
" vim-instant-markdown
""""""""""""""""""""""""""""""
let g:instant_markdown_slow = 1
let g:instant_markdown_autostart = 0
""""""""""""""""""""""""""""""
" vim markdown
""""""""""""""""""""""""""""""
let g:vim_markdown_folding_disabled=1
""""""""""""""""""""""""""""""
" undotree
""""""""""""""""""""""""""""""
map <leader>u :UndotreeToggle<CR>
let g:undotree_WindowLayout = 3
let g:undotree_SplitWidth = 35
let g:undotree_SetFocusWhenToggle = 1
if has("persistent_undo")
set undodir='~/.undodir/'
set undofile
endif
""""""""""""""""""""""""""""""
" ZoomWin
""""""""""""""""""""""""""""""
nnoremap <silent> <leader>z :ZoomWinTabToggle<cr>
""""""""""""""""""""""""""""""
" CtrlSF
""""""""""""""""""""""""""""""
" Prompt CtrlSF using ALT+f
nmap <M-f> <Plug>CtrlSFPrompt
vmap <M-f> <Plug>CtrlSFVwordPath
" Toggle CtrlSF result display
map <M-t> :CtrlSFToggle<CR>
let g:ctrlsf_indent = 2
""""""""""""""""""""""""""""""
" Vim Orgmode
""""""""""""""""""""""""""""""
let g:org_export_emacs="/usr/local/bin/emacs"
let g:org_agenda_files = ['~/Desktop/Notes/daily-notes.org']
let g:org_todo_keywords = ['TODO', '|', 'DONE']
let g:org_aggressive_conceal = 1
""""""""""""""""""""""""""""""
" Tmuxline
""""""""""""""""""""""""""""""
let g:tmuxline_preset = {
\"a" : "#S",
\"b" : "#(ifconfig en0 | grep 'inet ' | awk '{print $2}')",
\"c" : "",
\"win" : "#I #W",
\"cwin" : "#I #W",
\"x" : ["♫ #(source ~/.tmux/current-pianobar-song.sh)"],
\"y" : ["%a", "%b %d", "%R"],
\"z" : "#h",
\'options' : {'status-justify' : 'left'}}
let g:tmuxline_separators = {
\ 'left' : '',
\ 'left_alt': '',
\ 'right' : '',
\ 'right_alt' : '',
\ 'space' : ' '}
""""""""""""""""""""""""""""""
" vim-jsdoc
""""""""""""""""""""""""""""""
let g:jsdoc_allow_input_prompt=1
let g:jsdoc_input_description=1
let g:jsdoc_underscore_private=1
let g:jsdoc_enable_es6=1
""""""""""""""""""""""""""""""
" vim-javascript
""""""""""""""""""""""""""""""
let g:javascript_plugin_jsdoc = 1 " Enables syntax highlighting for JSDocs.
""""""""""""""""""""""""""""""
" vim-jsx
""""""""""""""""""""""""""""""
let g:jsx_ext_required = 0 " Allow JSX in normal JS files
""""""""""""""""""""""""""""""
" ALE
""""""""""""""""""""""""""""""
let g:ale_sign_error = 'E'
let g:ale_sign_warning = 'W'
let g:ale_open_list = 1
let g:ale_echo_msg_format = '[%linter%] %s'
""""""""""""""""""""""""""""""
" EditorConfig
""""""""""""""""""""""""""""""
let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
""""""""""""""""""""""""""""""
" indentLine
""""""""""""""""""""""""""""""
let g:indentLine_color_gui = '#65737E'
""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""