Mercurial > dotfiles
comparison vim/vimrc @ 411:6a0c9e43e34e
Merge changes.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 20 Dec 2017 09:17:09 -0800 |
parents | 5bbd5963591c |
children | 4a2468f72e44 |
comparison
equal
deleted
inserted
replaced
406:f2e130a94842 | 411:6a0c9e43e34e |
---|---|
186 | 186 |
187 " How to show invisible characters | 187 " How to show invisible characters |
188 set listchars=eol:$,tab:>-,trail:-,extends:>,precedes:<,nbsp:%,conceal:. | 188 set listchars=eol:$,tab:>-,trail:-,extends:>,precedes:<,nbsp:%,conceal:. |
189 | 189 |
190 " Nice auto-complete menu. | 190 " Nice auto-complete menu. |
191 set complete=.,w,b,u,t | 191 set complete=.,w,b |
192 set completeopt=longest,menuone,preview | 192 set completeopt=longest,menuone,preview |
193 | 193 |
194 " Column indicators. | 194 " Column indicators. |
195 set colorcolumn=72,79 | 195 set colorcolumn=72,79 |
196 | 196 |
279 let g:ctrlp_lazy_update = 350 | 279 let g:ctrlp_lazy_update = 350 |
280 endif | 280 endif |
281 | 281 |
282 " }}} | 282 " }}} |
283 | 283 |
284 " FZF {{{ | |
285 | |
286 | |
287 | |
288 " }}} | |
289 | |
284 " Gutentags {{{ | 290 " Gutentags {{{ |
285 | 291 |
286 let g:gutentags_cache_dir = s:vim_home.'/tags' | 292 let g:gutentags_cache_dir = s:vim_home.'/tags' |
287 let g:gutentags_ctags_exclude = ['venv', 'build', 'static', 'node_modules'] | 293 let g:gutentags_ctags_exclude = ['venv', 'build', 'static', 'node_modules'] |
288 let g:gutentags_ctags_extra_args = ['--options='.s:vim_home.'/ctagsrc'] | 294 let g:gutentags_ctags_extra_args = ['--options='.s:vim_home.'/ctagsrc'] |
297 | 303 |
298 " flake8 includes pyflakes, pep8, and mccabe | 304 " flake8 includes pyflakes, pep8, and mccabe |
299 " I could maybe replace pyflakes with frosted? | 305 " I could maybe replace pyflakes with frosted? |
300 let g:syntastic_python_checkers = ['flake8'] ", 'pylint'] | 306 let g:syntastic_python_checkers = ['flake8'] ", 'pylint'] |
301 let g:syntastic_python_python_exec = 'python3' | 307 let g:syntastic_python_python_exec = 'python3' |
308 let g:syntastic_python_flake8_args='--ignore=W191,W391' | |
302 | 309 |
303 " }}} | 310 " }}} |
304 | 311 |
305 " Supertab {{{ | 312 " Supertab {{{ |
306 | 313 |
464 autocmd FileType php setlocal matchpairs-=<:> | 471 autocmd FileType php setlocal matchpairs-=<:> |
465 augroup END | 472 augroup END |
466 | 473 |
467 augroup VimRCFileType_c | 474 augroup VimRCFileType_c |
468 au! | 475 au! |
469 autocmd FileType c,c++,cpp,cs setlocal foldmethod=syntax | 476 autocmd FileType c,c++,cpp setlocal foldmethod=syntax |
470 autocmd FileType c,c++,cpp,cs setlocal colorcolumn=120 | 477 autocmd FileType c,c++,cpp setlocal colorcolumn=120 |
478 augroup END | |
479 | |
480 augroup VimRCFileType_csharp | |
481 au! | |
482 autocmd BufNewFile,BufRead *.xaml setlocal filetype=xml | |
483 autocmd FileType cs setlocal foldmethod=syntax | |
484 autocmd FileType cs setlocal colorcolumn=120 | |
471 augroup END | 485 augroup END |
472 | 486 |
473 augroup VimRCFileType_css | 487 augroup VimRCFileType_css |
474 au! | 488 au! |
475 autocmd BufNewFile,BufRead *.less setlocal filetype=less | 489 autocmd BufNewFile,BufRead *.less setlocal filetype=less |
545 " Toggle invisible characters | 559 " Toggle invisible characters |
546 nnoremap <leader>i :set list!<cr> | 560 nnoremap <leader>i :set list!<cr> |
547 | 561 |
548 " Clear search matches | 562 " Clear search matches |
549 nnoremap <leader><space> :noh<cr>:call clearmatches()<cr> | 563 nnoremap <leader><space> :noh<cr>:call clearmatches()<cr> |
550 | |
551 " Ctrl-P mappings. | |
552 nnoremap <silent> <C-p> :CtrlP<cr> | |
553 nnoremap <silent> <C-o> :CtrlPBuffer<cr> | |
554 nnoremap <silent> <C-u> :CtrlPTag<cr> | |
555 nnoremap <silent> <C-y> :CtrlPBufTag<cr> | |
556 nnoremap <silent> <Tab> :CtrlPMRUFiles<cr> | |
557 nnoremap <silent> <F8> :CtrlPBookmarkDir<cr> | |
558 | 564 |
559 " Switch between FR and US keyboard layouts. | 565 " Switch between FR and US keyboard layouts. |
560 nnoremap <C-l>f :setlocal keymap=french<cr> | 566 nnoremap <C-l>f :setlocal keymap=french<cr> |
561 nnoremap <C-l>u :setlocal keymap=<cr> | 567 nnoremap <C-l>u :setlocal keymap=<cr> |
562 | 568 |
619 " Keep search matches in the middle of the window. | 625 " Keep search matches in the middle of the window. |
620 nnoremap n nzvzz | 626 nnoremap n nzvzz |
621 nnoremap N Nzvzz | 627 nnoremap N Nzvzz |
622 | 628 |
623 " YCM mappings. | 629 " YCM mappings. |
624 nnoremap <Leader>jj :YcmCompleter GoToImprecise<cr>zv | 630 augroup VimRC_YouCompleteMe |
625 nnoremap <Leader>jd :YcmCompleter GoToDefinition<cr>zv | 631 autocmd! |
626 nnoremap <Leader>jh :YcmCompleter GoToDeclaration<cr>zv | 632 autocmd FileType cpp nnoremap <Leader>jj :YcmCompleter GoToImprecise<cr>zv |
627 nnoremap <Leader>ji :YcmCompleter GoToInclude<cr> | 633 autocmd FileType cpp nnoremap <Leader>jd :YcmCompleter GoToDefinition<cr>zv |
628 nnoremap <Leader>jc :YcmCompleter GetDoc<cr> | 634 autocmd FileType cpp nnoremap <Leader>jh :YcmCompleter GoToDeclaration<cr>zv |
635 autocmd FileType cpp nnoremap <Leader>ji :YcmCompleter GoToInclude<cr> | |
636 autocmd FileType cpp nnoremap <Leader>jc :YcmCompleter GetDoc<cr> | |
637 augroup END | |
638 | |
639 " OmniSharp mappings | |
640 augroup VimRC_OmniSharp | |
641 autocmd! | |
642 autocmd FileType cs setlocal omnifunc=OmniSharp#Complete | |
643 autocmd BufEnter,TextChanged,InsertLeave *.cs SyntasticCheck | |
644 autocmd CursorHold *.cs call OmniSharp#TypeLookupWithoutDocumentation() | |
645 autocmd FileType cs nnoremap <Leader>jj :OmniSharpGotoDefinition<cr> | |
646 autocmd FileType cs nnoremap <Leader>x :OmniSharpFixIssue<cr> | |
647 autocmd FileType cs nnoremap <Leader>fx :OmniSharpFixUsings<cr> | |
648 autocmd FileType cs nnoremap <Leader>tt :OmniSharpTypeLookup<cr> | |
649 autocmd FileType cs nnoremap <Leader>dc :OmniSharpDocumentation<cr> | |
650 augroup END | |
651 | |
652 " ProjectRoot mappings | |
653 let s:no_auto_projectroot_buftypes = [ | |
654 \'help', 'nofile', 'quickfix'] | |
655 | |
656 function! s:AutoProjectRootCD() abort | |
657 try | |
658 if index(s:no_auto_projectroot_buftypes, &buftype) == -1 | |
659 ProjectRootCD | |
660 endif | |
661 catch | |
662 " Silently ignore invalid buffers | |
663 endtry | |
664 endfunction | |
665 | |
666 augroup VimRC_ProjectRoot | |
667 autocmd! | |
668 autocmd BufEnter * call <SID>AutoProjectRootCD() | |
669 augroup END | |
670 | |
671 nnoremap <leader>cd :ProjectRootCD<cr> | |
672 | |
673 " Ctrl-P mappings. | |
674 if index(g:pathogen_disabled, 'ctrlp') < 0 | |
675 nnoremap <silent> <C-p> :CtrlP<cr> | |
676 nnoremap <silent> <C-o> :CtrlPBuffer<cr> | |
677 nnoremap <silent> <C-u> :CtrlPTag<cr> | |
678 nnoremap <silent> <C-y> :CtrlPBufTag<cr> | |
679 nnoremap <silent> <Tab> :CtrlPMRUFiles<cr> | |
680 nnoremap <silent> <F8> :CtrlPBookmarkDir<cr> | |
681 endif | |
682 | |
683 " FZF mappings. | |
684 if index(g:pathogen_disabled, 'fzf') < 0 | |
685 nnoremap <silent> <C-p> :Files | |
686 nnoremap <silent> <C-o> :Buffers | |
687 endif | |
629 | 688 |
630 " }}} | 689 " }}} |
631 | 690 |
632 " Folding {{{ | 691 " Folding {{{ |
633 | 692 |
636 | 695 |
637 " Don't fold too much. | 696 " Don't fold too much. |
638 set foldnestmax=2 | 697 set foldnestmax=2 |
639 | 698 |
640 " Folds are defined by markers in the text. | 699 " Folds are defined by markers in the text. |
641 set foldmethod=marker | 700 set foldmethod=marker"{{{"}}} |
642 | 701 |
643 " Toggle folds with <space>. | 702 " Toggle folds with <space>. |
644 nnoremap <space> za | 703 nnoremap <space> za |
645 | 704 |
646 " Create folds with <space> (in visual mode). | 705 " Create folds with <space> (in visual mode). |
680 function! s:ToggleNERDTree() abort | 739 function! s:ToggleNERDTree() abort |
681 NERDTreeToggle | 740 NERDTreeToggle |
682 endfunction | 741 endfunction |
683 | 742 |
684 function! s:FindInNERDTree() abort | 743 function! s:FindInNERDTree() abort |
685 NERDTreeFind | 744 ProjectRootExe NERDTreeFind |
686 normal zz | 745 normal zz |
687 endfunction | 746 endfunction |
688 | 747 |
689 " }}} | 748 " }}} |
690 | 749 |