# HG changeset patch # User Ludovic Chabant # Date 1495572988 25200 # Node ID b570ad9917c0422978cccb1f5c43e2b8aad6cf2c # Parent c3a863440b1a744595f62785ebf037f65fb2ca10 Add local pre-override for vimrc. Bunch of other vim tweaks. diff -r c3a863440b1a -r b570ad9917c0 vim/vimrc --- a/vim/vimrc Mon Apr 03 13:08:08 2017 -0700 +++ b/vim/vimrc Tue May 23 13:56:28 2017 -0700 @@ -31,12 +31,18 @@ " Get our vim directory. let s:vim_home = expand(":h") +" Local pre-override. +let s:local_vimrc_pre = s:vim_home.'/vimrc-local-pre' +if filereadable(s:local_vimrc_pre) + execute 'source' s:local_vimrc_pre +endif + " Make sure `filetype` stuff is turned off before loading Pathogen. syntax off filetype off " Disable some plugins. -let g:pathogen_disabled = [] +let g:pathogen_disabled = get(g:, 'pathogen_disabled', []) call add(g:pathogen_disabled, 'vimroom') call add(g:pathogen_disabled, 'minibufexpl') call add(g:pathogen_disabled, 'ragtag') @@ -255,7 +261,7 @@ let g:ctrlp_cache_dir = s:vim_home.'/cache' " Remember things. -let g:ctrlp_clear_cache_on_ext = 0 +let g:ctrlp_clear_cache_on_exit = 0 " Don't include some stuff in the most recently used list. let g:ctrlp_mruf_exclude = 'hg\-editor\-\d+\.txt' @@ -364,7 +370,7 @@ \'colorscheme': 'solarized', \'active': { \ 'left': [ ['mode', 'paste'], - \ ['fugitive', 'lawrencium', 'readonly', 'filename'], + \ ['fugitive', 'lawrencium', 'readonly', 'relativepath', 'modified'], \ ['ctrlpmark'] ], \ 'right': [ ['lineinfo'], \ ['percent'], @@ -430,6 +436,12 @@ endfunction " }}} +" YouCompleteMe {{{ + +let g:ycm_always_populate_location_list = 1 + +" }}} + " }}} " File-Specific Settings {{{ @@ -454,8 +466,8 @@ augroup VimRCFileType_c au! - autocmd FileType c,c++,cpp setlocal foldmethod=syntax - autocmd FileType c,c++,cpp setlocal colorcolumn=120 + autocmd FileType c,c++,cpp,cs setlocal foldmethod=syntax + autocmd FileType c,c++,cpp,cs setlocal colorcolumn=120 augroup END augroup VimRCFileType_css @@ -572,8 +584,9 @@ nnoremap [j " Copy the current buffer's info. -nnoremap cp :let @+ = expand('%:p') -nnoremap cf :let @+ = expand('%:h') +nnoremap cp :let @+ = expand('%:p'):echo @+ +nnoremap cf :let @+ = expand('%:h'):echo @+ +nnoremap cw :let @+ = getcwd():echo @+ " Make the diff navigation also center things. nnoremap ]c ]czvzz @@ -608,9 +621,9 @@ nnoremap N Nzvzz " YCM mappings. -nnoremap jj :YcmCompleter GoToImprecise -nnoremap jd :YcmCompleter GoToDefinition -nnoremap jh :YcmCompleter GoToDeclaration +nnoremap jj :YcmCompleter GoToImprecisezv +nnoremap jd :YcmCompleter GoToDefinitionzv +nnoremap jh :YcmCompleter GoToDeclarationzv nnoremap ji :YcmCompleter GoToInclude nnoremap jc :YcmCompleter GetDoc @@ -621,6 +634,9 @@ " Start with one level of open. set foldlevel=1 +" Don't fold too much. +set foldnestmax=2 + " Folds are defined by markers in the text. set foldmethod=marker @@ -670,13 +686,6 @@ normal zz endfunction -function! s:AutoProjectRootCD() abort - if &buftype == '' - ProjectRootCD - endif -endfunction -autocmd BufEnter * call AutoProjectRootCD() - " }}} " Local override {{{