Mercurial > dotfiles
comparison vim/vimrc @ 485:25bdfc963612
Some vimrc tweaks.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 24 Sep 2020 23:11:23 -0700 |
parents | 759ccf5befb2 |
children | b452486b97c5 |
comparison
equal
deleted
inserted
replaced
484:759ccf5befb2 | 485:25bdfc963612 |
---|---|
160 set shiftwidth=4 | 160 set shiftwidth=4 |
161 set softtabstop=4 | 161 set softtabstop=4 |
162 set smarttab | 162 set smarttab |
163 set expandtab | 163 set expandtab |
164 | 164 |
165 " Auto-reload files that have changed outside of Vim (which is useful | |
166 " when reverting/syncing/whatever from the shell). | |
167 set autoread | |
168 | |
165 " Default encoding | 169 " Default encoding |
166 set encoding=utf-8 | 170 set encoding=utf-8 |
167 | 171 |
168 " Clipboard buffer. | 172 " Clipboard buffer. |
169 set clipboard=unnamed | 173 set clipboard=unnamed |
206 else | 210 else |
207 set background=dark | 211 set background=dark |
208 let g:solarized_termcolors = 256 | 212 let g:solarized_termcolors = 256 |
209 let g:solarized_termtrans = 1 | 213 let g:solarized_termtrans = 1 |
210 endif | 214 endif |
211 colorscheme solarized | 215 if ludo#platform() == "windows" && &term == "win32" |
216 " Windows terminal sucks with colours, so pick an appropriate theme. | |
217 colorscheme xterm16 | |
218 else | |
219 colorscheme solarized | |
220 endif | |
212 | 221 |
213 " Enable file type detection. | 222 " Enable file type detection. |
214 filetype indent plugin on | 223 filetype indent plugin on |
215 | 224 |
216 " }}} | 225 " }}} |
240 let g:ackprg = 'rg --vimgrep' | 249 let g:ackprg = 'rg --vimgrep' |
241 elseif executable('ag') | 250 elseif executable('ag') |
242 let g:ackprg = 'ag --vimgrep' | 251 let g:ackprg = 'ag --vimgrep' |
243 endif | 252 endif |
244 | 253 |
245 nnoremap <leader>a :Ack!<Space> | 254 nnoremap <Leader>a :Ack!<Space> |
246 nnoremap <leader>f :Ack! /<C-R><C-W>/ | 255 nnoremap <Leader>f :Ack! <C-R><C-W> %:h<Tab> |
247 vnoremap <leader>f "zy:Ack! /<C-R>z/ | 256 vnoremap <Leader>f "zy:Ack! <C-R>z %:h<Tab> |
248 | 257 |
249 " }}} | 258 " }}} |
250 | 259 |
251 " Ctrl-P {{{ | 260 " Ctrl-P {{{ |
252 | 261 |
554 augroup END | 563 augroup END |
555 | 564 |
556 augroup VimRCFileType_c | 565 augroup VimRCFileType_c |
557 au! | 566 au! |
558 autocmd FileType c,c++,cpp setlocal foldmethod=syntax | 567 autocmd FileType c,c++,cpp setlocal foldmethod=syntax |
559 autocmd FileType c,c++,cpp setlocal colorcolumn=120 | 568 autocmd FileType c,c++,cpp setlocal colorcolumn=240 |
560 autocmd FileType c,c++,cpp setlocal synmaxcol=200 | 569 autocmd FileType c,c++,cpp setlocal synmaxcol=250 |
561 autocmd FileType c,c++,cpp nnoremap <buffer> <localleader>z :call <SID>ToggleCppFolding()<CR> | 570 autocmd FileType c,c++,cpp nnoremap <buffer> <localleader>z :call <SID>ToggleCppFolding()<CR> |
562 augroup END | 571 augroup END |
563 | 572 |
564 augroup VimRCFileType_csharp | 573 augroup VimRCFileType_csharp |
565 au! | 574 au! |
566 autocmd BufNewFile,BufRead *.xaml setlocal filetype=xml | 575 autocmd BufNewFile,BufRead *.xaml setlocal filetype=xml |
567 autocmd FileType cs setlocal foldmethod=syntax | 576 autocmd FileType cs setlocal foldmethod=syntax |
568 autocmd FileType cs setlocal colorcolumn=120 | 577 autocmd FileType cs setlocal colorcolumn=240 |
569 autocmd FileType cs setlocal synmaxcol=200 | 578 autocmd FileType cs setlocal synmaxcol=250 |
570 augroup END | 579 augroup END |
571 | 580 |
572 augroup VimRCFileType_css | 581 augroup VimRCFileType_css |
573 au! | 582 au! |
574 autocmd BufNewFile,BufRead *.less setlocal filetype=less | 583 autocmd BufNewFile,BufRead *.less setlocal filetype=less |
728 autocmd FileType cpp nnoremap <Leader>jj :YcmCompleter GoToImprecise<cr>zv | 737 autocmd FileType cpp nnoremap <Leader>jj :YcmCompleter GoToImprecise<cr>zv |
729 autocmd FileType cpp nnoremap <Leader>jd :YcmCompleter GoToDefinition<cr>zv | 738 autocmd FileType cpp nnoremap <Leader>jd :YcmCompleter GoToDefinition<cr>zv |
730 autocmd FileType cpp nnoremap <Leader>jh :YcmCompleter GoToDeclaration<cr>zv | 739 autocmd FileType cpp nnoremap <Leader>jh :YcmCompleter GoToDeclaration<cr>zv |
731 autocmd FileType cpp nnoremap <Leader>ji :YcmCompleter GoToInclude<cr> | 740 autocmd FileType cpp nnoremap <Leader>ji :YcmCompleter GoToInclude<cr> |
732 autocmd FileType cpp nnoremap <Leader>jc :YcmCompleter GetDoc<cr> | 741 autocmd FileType cpp nnoremap <Leader>jc :YcmCompleter GetDoc<cr> |
742 autocmd FileType cpp nnoremap <Leader>jt :YcmCompleter GetType<cr> | |
733 autocmd FileType cpp nnoremap <Leader>je :YcmShowDetailedDiagnostic<cr> | 743 autocmd FileType cpp nnoremap <Leader>je :YcmShowDetailedDiagnostic<cr> |
734 augroup END | 744 augroup END |
735 endif | 745 endif |
736 | 746 |
737 " OmniSharp mappings | 747 " OmniSharp mappings |