diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2021-07-15 01:57:30 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2021-07-15 01:57:30 +0200 |
commit | 14791883624bf10227a6ffa9172c8030b87d4675 (patch) | |
tree | 8245e91cf4da07344dd1148b32c51d2b8c33f76d /stow/vim/.vim/ftplugin/cpp | |
parent | b8b7563bd9cf1731cb5dc2e34ed88d5bc1e336c8 (diff) | |
download | configs-14791883624bf10227a6ffa9172c8030b87d4675.tar.gz configs-14791883624bf10227a6ffa9172c8030b87d4675.zip |
Lots of renames: stow can't handle folder with --dotfiles option.
Diffstat (limited to 'stow/vim/.vim/ftplugin/cpp')
-rw-r--r-- | stow/vim/.vim/ftplugin/cpp/cpp.vim | 28 | ||||
-rw-r--r-- | stow/vim/.vim/ftplugin/cpp/snips/template.txt | 6 |
2 files changed, 34 insertions, 0 deletions
diff --git a/stow/vim/.vim/ftplugin/cpp/cpp.vim b/stow/vim/.vim/ftplugin/cpp/cpp.vim new file mode 100644 index 0000000..e2072c1 --- /dev/null +++ b/stow/vim/.vim/ftplugin/cpp/cpp.vim @@ -0,0 +1,28 @@ +" ~/.vim/ftplugin/cpp/cpp.vim +" C++-specific vim configuration + +let mapleader = " " + +" Column marker: 80 characters +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> 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> diff --git a/stow/vim/.vim/ftplugin/cpp/snips/template.txt b/stow/vim/.vim/ftplugin/cpp/snips/template.txt new file mode 100644 index 0000000..90ef863 --- /dev/null +++ b/stow/vim/.vim/ftplugin/cpp/snips/template.txt @@ -0,0 +1,6 @@ +#include <iostream> + +int main() { + <+++> + return 0; +} |