# HG changeset patch # User Ludovic Chabant # Date 1601014283 25200 # Node ID 25bdfc963612f573597b0afa9c0a4421d66f01ed # Parent 759ccf5befb215f030e09c392c920185ad04644a Some vimrc tweaks. diff -r 759ccf5befb2 -r 25bdfc963612 vim/vimrc --- a/vim/vimrc Thu Sep 24 23:10:38 2020 -0700 +++ b/vim/vimrc Thu Sep 24 23:11:23 2020 -0700 @@ -162,6 +162,10 @@ set smarttab set expandtab +" Auto-reload files that have changed outside of Vim (which is useful +" when reverting/syncing/whatever from the shell). +set autoread + " Default encoding set encoding=utf-8 @@ -208,7 +212,12 @@ let g:solarized_termcolors = 256 let g:solarized_termtrans = 1 endif -colorscheme solarized +if ludo#platform() == "windows" && &term == "win32" + " Windows terminal sucks with colours, so pick an appropriate theme. + colorscheme xterm16 +else + colorscheme solarized +endif " Enable file type detection. filetype indent plugin on @@ -242,9 +251,9 @@ let g:ackprg = 'ag --vimgrep' endif -nnoremap a :Ack! -nnoremap f :Ack! // -vnoremap f "zy:Ack! /z/ +nnoremap a :Ack! +nnoremap f :Ack! %:h +vnoremap f "zy:Ack! z %:h " }}} @@ -556,8 +565,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 setlocal synmaxcol=200 + autocmd FileType c,c++,cpp setlocal colorcolumn=240 + autocmd FileType c,c++,cpp setlocal synmaxcol=250 autocmd FileType c,c++,cpp nnoremap z :call ToggleCppFolding() augroup END @@ -565,8 +574,8 @@ au! autocmd BufNewFile,BufRead *.xaml setlocal filetype=xml autocmd FileType cs setlocal foldmethod=syntax - autocmd FileType cs setlocal colorcolumn=120 - autocmd FileType cs setlocal synmaxcol=200 + autocmd FileType cs setlocal colorcolumn=240 + autocmd FileType cs setlocal synmaxcol=250 augroup END augroup VimRCFileType_css @@ -730,6 +739,7 @@ autocmd FileType cpp nnoremap jh :YcmCompleter GoToDeclarationzv autocmd FileType cpp nnoremap ji :YcmCompleter GoToInclude autocmd FileType cpp nnoremap jc :YcmCompleter GetDoc + autocmd FileType cpp nnoremap jt :YcmCompleter GetType autocmd FileType cpp nnoremap je :YcmShowDetailedDiagnostic augroup END endif