From 42e846b50a91e692558c9ba313fb88612cbd14ab Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Sat, 28 Dec 2019 19:39:24 +0100 Subject: Created vim ftplugin for C++. --- files/vim/ftplugin/cpp/cpp.vim | 24 ++++++++++++++++++++++++ files/vim/ftplugin/cpp/snips/template.txt | 5 +++++ 2 files changed, 29 insertions(+) create mode 100644 files/vim/ftplugin/cpp/cpp.vim create mode 100644 files/vim/ftplugin/cpp/snips/template.txt diff --git a/files/vim/ftplugin/cpp/cpp.vim b/files/vim/ftplugin/cpp/cpp.vim new file mode 100644 index 0000000..6b4807d --- /dev/null +++ b/files/vim/ftplugin/cpp/cpp.vim @@ -0,0 +1,24 @@ +" ~/.vim/ftplugin/cpp/cpp.vim +" C++-specific vim configuration + +highlight Comment ctermfg=darkgreen + +" Column marker: 80 characters +call matchadd('ColorColumn', '\%81v', 100) + +nnoremap C :sp ~/.vim/ftplugin/cpp/cpp.vim +nnoremap E :Errors + +nnoremap c :w:!g++ "%"; ./a.out +nnoremap E :Errors + +nnoremap gt :YcmCompleter GoTo +nnoremap gr :YcmCompleter GoToReferences +nnoremap gd :YcmCompleter GetDoc +nnoremap gT :YcmCompleter GetType +nnoremap fi :YcmCompleter FixIt +nnoremap e :YcmDiags + +inoremap if if (<+++>) {<++>}?<+++>cf> +inoremap for for (<+++>; <++>; <++>) {<++>}?<+++>cf> +nnoremap temp :-1r ~/.vim/ftplugin/cpp/snips/template.txtGdd?<+++>cf> diff --git a/files/vim/ftplugin/cpp/snips/template.txt b/files/vim/ftplugin/cpp/snips/template.txt new file mode 100644 index 0000000..8479d26 --- /dev/null +++ b/files/vim/ftplugin/cpp/snips/template.txt @@ -0,0 +1,5 @@ +#include + +int main() { + <+++> +} -- cgit v1.2.1