-
Notifications
You must be signed in to change notification settings - Fork 0
/
dein.toml
805 lines (716 loc) · 24.9 KB
/
dein.toml
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
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
# Dependencies
#############################################################################
# Plugin manager
# https://github.com/Shougo/dein.vim
[[plugins]]
repo = 'Shougo/dein.vim'
# Open browser
# https://github.com/tyru/open-browser.vim
[[plugins]]
repo = 'tyru/open-browser.vim'
on_map = '<Plug>'
on_cmd = ['OpenBrowser', 'OpenBrowserSearch']
on_fn = 'openbrowser#open'
# HTTP API
# https://github.com/mattn/webapi-vim
[[plugins]]
repo = 'mattn/webapi-vim'
# Provides functions to find fenced code blocks and their filetype.
# https://github.com/Shougo/context_filetype.vim
[[plugins]]
repo = 'Shougo/context_filetype.vim'
# Code Snippets for Neosnippet
# https://github.com/Shougo/neosnippet-snippets.vim
[[plugins]]
repo = 'Shougo/neosnippet-snippets'
hook_source = '''
let g:neosnippet#data_directory = $VIM_CACHE.'/vim-neosnippet'
let g:neosnippet#enable_preview = 1
'''
# User Interface
#############################################################################
# Colorscheme
# https://github.com/chriskempson/base16-vim
[[plugins]]
repo = 'chriskempson/base16-vim'
# Status bar
# https://github.com/vim-airline/vim-airline'
[[plugins]]
repo = 'vim-airline/vim-airline'
hook_source = '''
let g:airline_powerline_fonts = 1
" Disable autoloading extension in runtimepath
let g:airline#extensions#disable_rtp_load = 1
" Manually enable extensions
let g:airline_extensions = ['quickfix', 'hunks']
" Disable airline in the preview window
let g:airline_exclude_preview = 1
" Performance optimization by not re-evaluating the colors of the theme.
let g:airline#themes#base16#constant = 1
" Don't display crypt.
let g:airline_detect_crypt = 0
" Show vim-signify change hunks.
let g:airline#extensions#hunks#enabled = 1
let g:airline#extensions#hunks#non_zero_only = 1
if dein#tap('syntastic')
let g:airline_extensions = g:airline_extensions + ['syntastic']
endif
if dein#tap('neomake')
let g:airline_extensions = g:airline_extensions + ['neomake']
endif
if dein#tap('ale')
let g:airline#extensions#ale#enabled = 1
endif
'''
# UI for editing commit messages
# https://github.com/rhysd/committia.vim
[[plugins]]
repo = 'rhysd/committia.vim'
on_ft = 'gitcommit'
hook_source = '''
" Only use from git cli, not to conflict with other git plugins (gina.vim).
let g:committia_open_only_vim_starting = 1
let g:committia_hooks = {}
function! g:committia_hooks.edit_open(info)
setlocal spell
" If no commit message, start with insert mode
if a:info.vcs ==# 'git' && getline(1) ==# ''
startinsert
end
endfunction
'''
# Undo history visualizer
# https://github.com/mbbill/undotree
# ---------------------------------------------------------------------------
# ,tu - toggle undo tree
[[plugins]]
repo = 'mbbill/undotree'
on_cmd = 'UndotreeToggle'
hook_source = '''
let g:undotree_SetFocusWhenToggle = 1
let g:undotree_SplitWidth = 35
let g:undotree_DiffpanelHeight = 20
'''
hook_add = '''
nnoremap <silent> <leader>tu :<C-u>UndotreeToggle<cr>
'''
# United interfaces
# @todo Denite once plugin support is there.
# https://github.com/Shougo/unite.vim
[[plugins]]
repo = 'Shougo/unite.vim'
depends = 'neomru.vim'
hook_source = '''
let g:unite_enable_start_insert = 1
let g:unite_enable_short_source_names = 1
let g:unite_enable_smart_case = 1
let g:unite_data_directory = $VIM_CACHE.'/vim-unite'
" Always cache no matter how many files.
let g:unite_source_rec_max_cache_files = -1
let g:unite_source_rec_find_arg = ['\(',
\ '-name', '.git', '-o', '-name', '.cache',
\ '-name', 'node_modules', '-o', '-name', 'bower_components',
\ '-name', '.cpan', '-o', '-name', '.Trash',
\ '-name', 'Caches',
\ '\)', '-prune', '-print']
if executable('ag')
let g:unite_source_grep_command = 'ag'
let g:unite_source_grep_default_opts = '-i --line-numbers --nogroup --nocolor'
let g:unite_source_grep_recursive_opt = ''
elseif executable('ack')
let g:unite_source_grep_command = 'ack'
let g:unite_source_grep_default_opts = '--no-heading --no-color -a'
let g:unite_source_grep_recursive_opt = ''
endif
" Enable yank history, even if not performant.
let g:unite_source_history_yank_enable = 1
" Start insert mode in unite-action buffer.
if exists('unite#custom#profile')
call unite#custom#profile('action', 'context', { 'start_insert' : 1 })
" Custom filters @todo
" call unite#custom#source(
" \ 'buffer,file_rec,file_rec/async,file_rec/git', 'matchers',
" \ ['converter_relative_word', 'matcher_fuzzy',
" \ 'matcher_project_ignore_files'])
call unite#custom#source(
\ 'file_mru', 'matchers',
\ ['matcher_project_files', 'matcher_fuzzy',
\ 'matcher_hide_hidden_files', 'matcher_hide_current_file'])
" call unite#custom#source(
" \ 'file_rec,file_rec/async,file_rec/git,file_mru', 'converters',
" \ ['converter_file_directory'])
call unite#filters#sorter_default#use(['sorter_length'])
call unite#filters#matcher_default#use(['matcher_fuzzy'])
" Optimize file_rec search
call unite#custom#source('file_rec/async', 'converters', [])
"call unite#custom#source('file_rec/async', 'sorters', [])
call unite#custom#source('file_rec/async', 'max_candidates', 10)
endif
autocmd MyAutoCmd FileType unite call s:unite_settings()
function! s:unite_settings()
call unite#custom#alias('file', 'h', 'left')
call unite#custom#default_action('directory', 'narrow')
imap <buffer> <C-j> <Plug>(unite_select_next_line)
imap <buffer> <C-k> <Plug>(unite_select_previous_line)
imap <silent><buffer><expr> <C-x> unite#do_action('split')
imap <silent><buffer><expr> <C-v> unite#do_action('vsplit')
imap <silent><buffer><expr> <C-t> unite#do_action('tabopen')
nmap <buffer> <Esc> <Plug>(unite_exit)
imap <buffer> <BS> <Plug>(unite_delete_backward_path)
imap <buffer> jj <Plug>(unite_insert_leave)
imap <buffer> <Tab> <Plug>(unite_complete)
imap <buffer> <C-p> <Plug>(unite_toggle_auto_preview)
nmap <buffer> <C-p> <Plug>(unite_toggle_auto_preview)
endfunction
'''
hook_add = '''
noremap <leader>f :<C-u>Unite -resume -buffer-name=files file_rec/async<CR>
noremap <leader>m :<C-u>Unite -resume -buffer-name=files file_mru<CR>
noremap <leader>b :<C-u>Unite -resume -buffer-name=buffers -quick-match buffer<CR>
noremap <leader>y :<C-u>Unite -resume -buffer-name=history history/yank<CR>
noremap <leader>g :<C-u>Unite -resume -buffer-name=grep grep:.<CR>
noremap <leader>l :<C-u>Unite -resume -buffer-name=line line<CR>
noremap <leader>ll :<C-u>Unite -silent -direction=botright -auto-resize location_list<CR>
noremap <leader>ql :<C-u>Unite -silent -direction=botright -auto-resize quickfix<CR>
noremap <leader>c :<C-u>Unite -silent -winheight=29 -start-insert menu:cheatsheet<CR>
noremap <leader>x <Plug>(unite_redraw)
'''
# Show a diff using Vim its sign column.
# https://github.com/mhinz/vim-signify
[[plugins]]
repo = 'mhinz/vim-signify'
hook_source = '''
" Only support git
let g:signify_vcs_list = ['git']
" Update signs when entering a buffer that was modified.
let g:signify_update_on_bufenter = 1
" Update signs when vim gains focus
" let g:signify_update_on_focusgained = 0
let g:signify_sign_add = '+'
let g:signify_sign_delete = '_'
let g:signify_sign_delete_first_line = '‾'
let g:signify_sign_change = '~'
let g:signify_sign_changedelete = g:signify_sign_change
'''
# Quickfix plugin for Unite
# https://github.com/osyo-manga/unite-quickfix
[[plugins]]
repo = 'osyo-manga/unite-quickfix'
depends = 'unite.vim'
# Displays function signatures from completions in the command line.
# https://github.com/Shougo/echodoc.vim
[[plugins]]
repo = 'Shougo/echodoc.vim'
hook_source = '''
let g:echodoc_enable_at_startup = 1
'''
# Visual experience
###########################################################
# Rainbow parentheses
# https://github.com/junegunn/rainbow_parentheses.vim
[[plugins]]
repo = 'junegunn/rainbow_parentheses.vim'
# Highlight matches for the word under the cursor
# https://github.com/qstrahl/vim-matchmaker
[[plugins]]
repo = 'qstrahl/vim-matchmaker'
hook_source = '''
let g:matchmaker_enable_startup = 1
" Avoid conflicts with EasyMotion
let g:matchmaker_matchpriority = 0
'''
# Folding (@todo)
# https://github.com/LeafCage/foldCC.vim
[[plugins]]
repo = 'LeafCage/foldCC.vim'
# Tools
##########################################################
# Syntax checker (vim 8 and neovim)
# https://github.com/neomake/neomake
[[plugins]]
repo = 'neomake/neomake'
if = "has('nvim') || has('channel') && has('job') && has('patch-8.0.0027')"
hook_source = '''
autocmd! BufWritePost * Neomake
" Sass maker that ignores file import errors.
let s:sass_errorformat =
\ '%E%\m%\%%(Syntax %\)%\?%trror: %m,' .
\ '%+C %.%#,' .
\ '%C on line %l of %f\, %.%#,' .
\ '%C on line %l of %f,' .
\ '%-G %\+from line %.%#,' .
\ '%-G %\+Use --trace for backtrace.,' .
\ '%W%>DEPRECATION WARNING on line %l of %f:,' .
\ '%+C%> %.%#,' .
\ '%W%>WARNING: on line %l of %f:,' .
\ '%+C%> %.%#,' .
\ '%W%>WARNING on line %l of %f: %m,' .
\ '%+C%> %.%#,' .
\ '%W%>WARNING on line %l of %f:,' .
\ '%Z%m,' .
\ '%W%>WARNING: %m,' .
\ '%C on line %l of %f\, %.%#,' .
\ '%C on line %l of %f,' .
\ '%-G %\+from line %.%#,' .
\ 'Syntax %trror on line %l: %m,' .
\ '%-G%.%#'
let g:neomake_sass_maker = {
\ 'exe': 'sass',
\ 'args': ['--check'],
\ 'errorformat': s:sass_errorformat,
\ 'postprocess': {
\ entry -> entry.text =~# 'File to import not found or unreadable'
\ || entry.text =~# 'Undefined mixin'
\ || entry.text =~# 'Undefined variable'
\ ? extend(entry, {'valid': -1})
\ : entry}
\ }
let g:neomake_scss_enabled_makers = ['sass']
" Twig
let g:neomake_twig_twiglint_maker = {
\ 'exe': 'twig-lint',
\ 'args': ['--format=csv', 'lint'],
\ 'errorformat': '"%f"\,%l\,%m',
\ 'postprocess': { entry -> extend(entry, {'type': 'E'}) }
\ }
let g:neomake_twig_enabled_makers = ['twiglint']
" YAML
" Relaxed and don't care about line length
let g:neomake_yaml_yamllint_args = ['-f', 'parsable', '-d',
\ "{extends: relaxed, rules: {line-length: {max: 120}}}"
\ ]
" Ansible
" [ANSIBLE0013] Use shell only when shell functionality is required
" [ANSIBLE0011] All tasks should be named
" [ANSIBLE0018] Deprecated always_run
let g:neomake_ansible_ansiblelint_args = ['-p', '--nocolor', '-x', 'ANSIBLE0011,ANSIBLE0013,ANSIBLE0018']
'''
# # Syntax checker (vim 8 and neovim)
# # https://github.com/w0rp/ale
# [[plugins]]
# repo = 'w0rp/ale'
# Syntax checker (vim 7, vim 8 uses neomake)
# https://github.com/vim-syntastic/syntastic
# ---------------------------------------------------------------------------
# ,ts - toggle syntastic
[[plugins]]
repo = 'vim-syntastic/syntastic'
if = "!has('nvim') && !(has('channel') && has('job') && has('patch-8.0.0027'))"
hook_source = '''
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_auto_jump = 1
let g:syntastic_loc_list_height = 3
" Only run on save
let g:syntastic_check_on_open = 0
" Run all checkers that apply
let g:syntastic_aggregate_errors = 1
" Use :sign interace to mark syntax errors
let g:syntastic_enable_signs = 1
" Prettier icons
let g:syntastic_error_symbol = "✗"
let g:syntastic_warning_symbol = "⚠"
let g:syntastic_style_error_symbol = "S✗"
let g:syntastic_style_warning_symbol = "S⚠"
let g:syntastic_scss_sass_quiet_messages = {
\ 'regex': 'File to import not found or unreadable'
\ }
" tidy is annoying
let g:syntastic_html_checkers = []
let g:syntastic_markdown_mdl_exec = 'markdownlint'
let g:syntastic_markdown_mdl_args = ''
let g:syntastic_stl_format = '[%E{Error 1/%e: line %fe}%B{, }%W{Warning 1/%w: line %fw}]'
'''
hook_add = '''
nnoremap <silent> <leader>ts :<C-u>SyntasticToggle<cr>
'''
# Project based code conventions.
# https://github.com/editorconfig/editorconfig-vim
[[plugins]]
repo = 'editorconfig/editorconfig-vim'
# Run commands quickly
# https://github.com/thinca/vim-quickrun
# ---------------------------------------------------------------------------
# ,qb - execute current buffer.
[[plugins]]
repo = 'thinca/vim-quickrun'
on_map = '<Plug>'
on_cmd = 'Quickrun'
hook_source = '''
let g:quickrun_no_default_key_mappings = 1
'''
hook_add = '''
nnoremap <silent> <leader>qb <Plug>(quickrun)
'''
# Converts GitHub markdown to html.
# https://github.com/superbrothers/vim-quickrun-markdown-gfm
# ---------------------------------------------------------------------------
# ,qm - render current markdown buffer in browser.
[[plugins]]
repo = 'superbrothers/vim-quickrun-markdown-gfm'
depends = ['open-browser.vim', 'vim-quickrun', 'webapi-vim']
on_ft = 'markdown'
hook_source = '''
if !exists('g:quickrun_config') | let g:quickrun_config = {} | endif
let g:quickrun_config['markdown'] = {
\ 'type': 'markdown/gfm',
\ 'outputter': 'browser'
\ }
'''
hook_add = '''
nnoremap <silent> <leader>qm :<C-u>QuickRun markdown<CR>
'''
# File Explorer
# https://github.com/Shougo/vimfiler.vim
# ---------------------------------------------------------------------------
# ,fb - open vimfiler in buffer
# ,fe - open vimfiler explorer
#
# t - toggle tree
# T - toggle tree recursively
# q - close vimfiler
# <tab> - switch to other window
[[plugins]]
repo = 'Shougo/vimfiler.vim'
depends = 'unite.vim'
on_map = {n = '<Plug>'}
on_if = "isdirectory(bufname('%'))"
hook_source = '''
let g:vimfiler_as_default_explorer = 1
" Fancier icons
let g:vimfiler_tree_leaf_icon = ' '
let g:vimfiler_tree_opened_icon = '▾'
let g:vimfiler_tree_closed_icon = '▸'
let g:vimfiler_file_icon = ' '
let g:vimfiler_readonly_file_icon = '✗'
let g:vimfiler_marked_file_icon = '✓'
autocmd MyAutoCmd FileType vimfiler call s:vimfiler_settings()
function! s:vimfiler_settings()
nmap <buffer> <Tab> <Plug>(vimfiler_switch_to_other_window)
endfunction
'''
hook_add = '''
nnoremap <silent> <leader>fb :<C-u>VimFiler -invisible<CR>
nnoremap <leader>fe :<C-u>VimFilerExplorer<CR>
'''
# Gist manager
# https://github.com/lambdalisue/vim-gista
# ---------------------------------------------------------------------------
# ,gl - list gists
# ,gg - create or update gist
# ,gp - create a private gist
# ,gb - open gist in browser
# ,gy - yank the url of the gist
[[plugins]]
repo = 'lambdalisue/vim-gista'
depends = ['open-browser.vim']
on_cmd = 'Gista'
on_map = '<Plug>(gista-'
hook_source = '''
let g:gista#github_user = 'oxyc'
let g:gista#default_yank_method = 'url'
" Yank the URL autmatically on save
let g:gista#auto_yank_after_post = 1
let g:gista#auto_yank_after_save = 1
'''
hook_add = '''
if dein#tap('vim-gista-unite')
nnoremap <silent> <leader>gl :<C-u>Unite gista<CR>
else
nnoremap <silent> <leader>gl :<C-u>Gista list<CR>
endif
nnoremap <silent> <leader>gg :<C-u>Gista post<CR>
nnoremap <silent> <leader>gp :<C-u>Gista post --private<CR>
nnoremap <silent> <leader>gb :<C-u>Gista browse<CR>
nnoremap <silent> <leader>gy :<C-u>Gista browse --yank<CR>
'''
# Unite interface for Gista
# https://github.com/lambdalisue/vim-gista-unite
[[plugins]]
repo = 'lambdalisue/vim-gista-unite'
depends = ['vim-gista', 'unite.vim']
# Git commands
# https://github.com/lambdalisue/gina.vim
# ---------------------------------------------------------------------------
# <s>gs - git status
# <s>gc - git commit
# <s>gd - git diff --cached
# <s>gD - git diff
# <s>gb - open in browser
# <s>gy - yank the url of the file
# <s>gp - git push
# <s>gl - git log
# <s>gL - git log for current file
[[plugins]]
repo = 'lambdalisue/gina.vim'
on_cmd = 'Gina'
hook_add = '''
nnoremap <silent> <space>gs :<C-u>Gina status<CR>
nnoremap <silent> <space>gc :<C-u>Gina commit<CR>
nnoremap <silent> <space>gd :<C-u>Gina diff --cached<CR>
nnoremap <silent> <space>gD :<C-u>Gina diff<CR>
nnoremap <silent> <space>gb :<C-u>Gina browse<CR>
nnoremap <silent> <space>gy :<C-u>Gina browse --yank<CR>
nnoremap <silent> <space>gp :<C-u>Gina push<CR>
nnoremap <space>gl :<C-u>Gina log --pretty=oneline<CR>
nnoremap <space>gL :<C-u>Gina log --pretty=oneline --<CR>
'''
# Enhanced repeating with `.`
# https://github.com/tpope/vim-repeat
[[plugins]]
repo = 'tpope/vim-repeat'
# Most Recently Used
# https://github.com/Shougo/neomru.vim
[[plugins]]
repo = 'Shougo/neomru.vim'
hook_source = '''
let neomru_dir = $VIM_CACHE.'/vim-neomru'
if !isdirectory(neomru_dir)
call mkdir(neomru_dir, 'p')
endif
let g:neomru#directory_mru_path = neomru_dir.'/dir'
let g:neomru#file_mru_path = neomru_dir.'/file'
'''
# Snippet plugin
# https://github.com/Shougo/neosnippet.vim
[[plugins]]
repo = 'Shougo/neosnippet.vim'
depends = ['neosnippet-snippets', 'context_filetype.vim']
# Navigation experience
#############################################################################
# Extended % matching for HTML, PHP etc.
# https://github.com/tmhedberg/matchit
# ---------------------------------------------------------------------------
# % - cycle forward
# a% - select mathing group in visual mode
[[plugins]]
repo = 'tmhedberg/matchit'
on_map = ['nxo', '%', 'g%']
hook_source = '''
" Fix matchpairs for PHP
" https://zmievski.org/files/talks/vancouver-2007/vim-for-php-programmers.pdf
let b:match_skip = 's:comment\|string'
let b:match_words = '<?\(php\)\?:?>,\<switch\>:\<endswitch\>,' .
\ '\<if\>:\<elseif\>:\<else\>:\<endif\>,' .
\ '\<while\>:\<endwhile\>,\<do\>:\<while\>,' .
\ '\<for\>:\<endfor\>,\<foreach\>:\<endforeach\>' .
\ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .
\ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .
\ '<\@<=\([^/?][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>,' .
\ '<:>'
'''
hook_post_source = 'silent! execute "doautocmd Filetype" &filetype'
# Toggle/Navigation marks
# https://github.com/kshenoy/vim-signature
[[plugins]]
repo = 'kshenoy/vim-signature'
# Extended f, F, t and T for more convenience.
# https://github.com/rhysd/clever-f.vim
# ---------------------------------------------------------------------------
# f - find next character
# F - find previous character
# t - find next character (preceding cursor)
# T - find previous character (preceding cursor)
[[plugins]]
repo = 'rhysd/clever-f.vim'
on_map = '<Plug>(clever-f-'
hook_source = '''
let g:clever_f_smart_case = 1
let g:clever_f_chars_match_any_signs = ';'
'''
# Vim motions on speed.
# https://github.com/easymotion/vim-easymotion
# ---------------------------------------------------------------------------
# s - init jump
# t - init backwards jump
# <s>h/l
# n - repeat search forward
# N - repeat search backwards
# ,, - easy motion
[[plugins]]
repo = 'easymotion/vim-easymotion'
depends = 'vim-repeat'
on_map = '<Plug>(easymotion-'
hook_add = '''
" Jump to anywhere you want with minimal keystrokes.
nmap s <Plug>(easymotion-s2)
nmap t <Plug>(easymotion-t2)
" JK motions: Line motions
map <space>h <Plug>(easymotion-linebackward)
map <space>l <Plug>(easymotion-lineforward)
'''
# Code alignment.
# https://github.com/junegunn/vim-easy-align
# ---------------------------------------------------------------------------
# ,a - start interactive alignment
[[plugins]]
repo = 'junegunn/vim-easy-align'
on_map = ['<Plug>(EasyAlign)', '<Plug>(LiveEasyAlign)']
hook_source = '''
let g:EasyMotion_smartcase = 1
" keep cursor colum when JK motion"
let g:EasyMotion_startofline = 0
" remove ; as a target, as it's difficult to press on swedish keyboard.
let g:EasyMotion_keys = 'asdghklqwertyuiopzxcvbnmfj'
'''
hook_add = '''
" Start interactive EasyAlign in visual mode.
vmap <Enter> <Plug>(LiveEasyAlign)
" Start interactive EasyAlign for a motion/text object.
nmap <leader>a <Plug>(LiveEasyAlign)
'''
# Edit experience
#############################################################################
# Automatically set paste
# https://github.com/roxma/vim-paste-easy
#[[plugins]]
#repo = 'roxma/vim-paste-easy'
# Comment code
# https://github.com/tpope/vim-commentary
# ---------------------------------------------------------------------------
# gcc - comment out line
# gc - comment out motion
[[plugins]]
repo = 'tpope/vim-commentary'
depends = 'vim-repeat'
# Toggle changes in a diff.
# https://github.com/twe4ked/vim-diff-toggle
# ---------------------------------------------------------------------------
# <space> - toggle diff add/edit/del
[[plugins]]
repo = 'twe4ked/vim-diff-toggle'
on_ft = 'diff'
# Insert or delete brackets, parens, quotes in pair
# @todo if problems consider https://github.com/Raimondi/delimitMate
# @see https://github.com/jiangmiao/auto-pairs/issues/171
# https://github.com/jiangmiao/auto-pairs
[[plugins]]
repo = 'oxyc/auto-pairs'
rev = 'features-neovim'
hook_source = '''
let g:AutoPairsFlyMode = 0
let g:AutoPairsShortcutFastWrap = ''
let g:AutoPairsShortcutBackInsert = ''
" let g:AutoPairsOnlyAtEOL = 1
" let g:AutoPairsOnlyBeforeClose = 1
let g:AutoPairsBalanceImmediately =1
let g:AutoPairsMultilineClose = 0
'''
# Wisely add "end" in ruby, endfunction/endif/more in vim script, etc
# https://github.com/tpope/vim-endwise
[[plugins]]
repo = 'tpope/vim-endwise'
on_ft = ['lua', 'ruby', 'sh', 'zsh', 'vim', 'c', 'cpp', 'xdefaults', 'snippets']
# @todo
# Use CTRL-A/CTRL-X to increment dates, times, and more
# https://github.com/tpope/vim-speeddating
# ---------------------------------------------------------------------------
# <C-a> - Increase number under cursor
# <C-x> - Decrease number under cursor
[[plugins]]
repo = 'tpope/vim-speeddating'
depends = 'vim-repeat'
on_map = '<Plug>SpeedDating'
# @todo
# Pairs of handy bracket mappings
# https://github.com/tpope/vim-unimpaired
[[plugins]]
repo = 'tpope/vim-unimpaired'
depends = 'vim-repeat'
on_map = '<Plug>'
# Quoting/parenthesizing made simple
# https://github.com/tpope/vim-surround
[[plugins]]
repo = 'tpope/vim-surround'
depends = 'vim-repeat'
on_map = '<Plug>'
# Autocompletion (vim)
# https://github.com/Shougo/neocomplete.vim
[[plugins]]
repo = 'Shougo/neocomplete.vim'
depends = 'context_filetype.vim'
if = "has('lua')"
hook_source = '''
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#enable_fuzzy_completion = 1
let g:neocomplete#enable_auto_select = 1
" Minimum length of keyword becoming the target
let g:neocomplete#sources#syntax#min_keyword_length = 3
" Begin autocompleting at 1 character
let g:neocomplete#auto_completion_start_length = 1
let g:neocomplete#enable_auto_delimiter = 1
" Maximum targets
let g:neocomplete#max_list = 10
let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
let g:neocomplete#data_directory = $VIM_CACHE.'/vim-neocomplete'
'''
# Filetype plugins
###########################################################
# TOML syntax highlighting
# https://github.com/cespare/vim-toml
[[plugins]]
repo = 'cespare/vim-toml'
# HTML5 syntax highlighting
# https://github.com/othree/html5.vim
[[plugins]]
repo = 'othree/html5.vim'
# PHP syntax highlighting (not lazy)
# https://github.com/othree/html5.vim
[[plugins]]
repo = 'StanAngeloff/php.vim'
# CSS3 syntax highlighting (not lazy)
# https://github.com/hail2u/vim-css3-syntax
[[plugins]]
repo = 'hail2u/vim-css3-syntax'
# JavaScript syntax highlighting (not lazy)
# https://github.com/pangloss/vim-javascript
[[plugins]]
repo = 'pangloss/vim-javascript'
# JSON syntax highlighting
# https://github.com/elzr/vim-json
[[plugins]]
repo = 'elzr/vim-json'
on_ft = 'json'
hook_source = '''
let g:vim_json_syntax_conceal = 0
'''
# Improved PHP omnicompletion and syntax
# https://github.com/shawncplus/phpcomplete.vim
[[plugins]]
repo = 'shawncplus/phpcomplete.vim'
# Context aware PHP Omnicompletion
# https://github.com/m2mdas/phpcomplete-extended
[[plugins]]
repo = 'm2mdas/phpcomplete-extended'
hook_source = '''
let g:phpcomplete_index_composer_command = 'composer --no-ansi --no-interaction'
autocmd MyAutoCmd FileType php setlocal omnifunc=phpcomplete_extended#CompletePHP
'''
# https://github.com/Shougo/neoinclude.vim
[[plugins]]
repo = 'Shougo/neoinclude.vim'
# Twig syntax highlighting (not lazy)
# https://github.com/beyondwords/vim-twig
[[plugins]]
repo = 'beyondwords/vim-twig'
# React syntax highlighting (not lazy)
# https://github.com/beyondwords/vim-twig
[[plugins]]
repo = 'mxw/vim-jsx'
# Dockerfile syntax highlighting (not lazy)
# https://github.com/ekalinin/dockerfile.vim
[[plugins]]
repo = 'ekalinin/dockerfile.vim'
# Ansible syntax highlighting
# https://github.com/pearofducks/ansible-vim
[[plugins]]
repo = 'pearofducks/ansible-vim'
# Vim syntax highlighting for Blade templates
# https://github.com/jwalton512/vim-blade
[[plugins]]
repo = 'jwalton512/vim-blade'
# Syntax Highlight for Vue.js components
# https://github.com/posva/vim-vue
[[plugins]]
repo = 'posva/vim-vue'