changeset 485:25bdfc963612

Some vimrc tweaks.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 24 Sep 2020 23:11:23 -0700
parents 759ccf5befb2
children b452486b97c5
files vim/vimrc
diffstat 1 files changed, 18 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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 <leader>a :Ack!<Space>
-nnoremap <leader>f :Ack! /<C-R><C-W>/ 
-vnoremap <leader>f "zy:Ack! /<C-R>z/ 
+nnoremap <Leader>a :Ack!<Space>
+nnoremap <Leader>f :Ack! <C-R><C-W> %:h<Tab>
+vnoremap <Leader>f "zy:Ack! <C-R>z %:h<Tab>
 
 " }}}
 
@@ -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 <buffer> <localleader>z :call <SID>ToggleCppFolding()<CR>
 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 <Leader>jh :YcmCompleter GoToDeclaration<cr>zv
         autocmd FileType cpp nnoremap <Leader>ji :YcmCompleter GoToInclude<cr>
         autocmd FileType cpp nnoremap <Leader>jc :YcmCompleter GetDoc<cr>
+        autocmd FileType cpp nnoremap <Leader>jt :YcmCompleter GetType<cr>
         autocmd FileType cpp nnoremap <Leader>je :YcmShowDetailedDiagnostic<cr>
     augroup END
 endif