diff options
Diffstat (limited to 'files/vim/ftplugin/cpp')
-rw-r--r-- | files/vim/ftplugin/cpp/cpp.vim | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/files/vim/ftplugin/cpp/cpp.vim b/files/vim/ftplugin/cpp/cpp.vim index 6b4807d..e2072c1 100644 --- a/files/vim/ftplugin/cpp/cpp.vim +++ b/files/vim/ftplugin/cpp/cpp.vim @@ -1,24 +1,28 @@ " ~/.vim/ftplugin/cpp/cpp.vim " C++-specific vim configuration -highlight Comment ctermfg=darkgreen +let mapleader = " " " Column marker: 80 characters -call matchadd('ColorColumn', '\%81v', 100) +match ColorColumn /\%81v/ +setlocal textwidth=80 nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/cpp/cpp.vim<CR> nnoremap <buffer> <leader>E :Errors<CR> nnoremap <buffer> <leader>c :w<CR>:!g++ "%"; ./a.out<Space> -nnoremap <buffer> <leader>E :Errors<CR> -nnoremap <buffer> <leader>gt :YcmCompleter GoTo<CR> -nnoremap <buffer> <leader>gr :YcmCompleter GoToReferences<CR> -nnoremap <buffer> <leader>gd :YcmCompleter GetDoc<CR> -nnoremap <buffer> <leader>gT :YcmCompleter GetType<CR> +nnoremap <buffer> gd :YcmCompleter GoTo<CR> +nnoremap <buffer> gr :YcmCompleter GoToReferences<CR> +nnoremap <buffer> gh :YcmCompleter GetType<CR> +nnoremap <buffer> gD :YcmCompleter GetDoc<CR> +nnoremap <buffer> gR :YcmCompleter RefactorRename<Space> nnoremap <buffer> <leader>fi :YcmCompleter FixIt<CR> nnoremap <buffer> <leader>e :YcmDiags<CR> +nnoremap <buffer> <leader>temp :-1r ~/.vim/ftplugin/cpp/snips/template.txt<CR>Gdd?<+++><CR>cf> + +let mapleader = "," + inoremap <buffer> <leader>if if (<+++>) {<CR><++><CR>}?<+++><CR>cf> inoremap <buffer> <leader>for for (<+++>; <++>; <++>) {<CR><++><CR>}?<+++><CR>cf> -nnoremap <buffer> <leader>temp :-1r ~/.vim/ftplugin/cpp/snips/template.txt<CR>Gdd?<+++><CR>cf> |