]> git.rmz.io Git - dotfiles.git/commitdiff
vim: add clang-format plugin
authorSamir Benmendil <me@rmz.io>
Thu, 15 Sep 2016 12:38:57 +0000 (13:38 +0100)
committerSamir Benmendil <me@rmz.io>
Thu, 15 Sep 2016 12:48:47 +0000 (13:48 +0100)
vim/ftplugin/cpp.vim
vim/vimrc

index 542503a79c2d015e3dd639259d61b23ed6277640..be1b64d268ce04f2e39a1bf5511204616dc74170 100644 (file)
@@ -24,6 +24,13 @@ augroup END
 nnoremap <buffer> gd :YcmCompleter GoTo<CR>
 nnoremap <buffer> <C-W>d :vs<CR>:YcmCompleter GoTo<CR>
 
+" format with =
+map <buffer> = <Plug>(operator-clang-format)
+vnoremap <buffer> = :ClangFormat<CR>
+" restore = mapping to g=
+nnoremap <buffer>g= =
+vnoremap <buffer>g= =
+
 setlocal errorformat=
 setlocal errorformat+=%f:%l:%c:\ %trror:\ %m
 setlocal errorformat+=%f:%l:%c:\ %tarning:\ %m
index c6aee808e02f8389f501dee99b7b13826d64b4d5..1d929256d6b47b82eb2a8d562727c2e8901f6699 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -69,6 +69,7 @@ Plugin 'ompugao/ctrlp-ros'
 Plugin 'vim-latex/vim-latex'
 Plugin 'alx741/vinfo'
 Plugin 'derekwyatt/vim-protodef'
+Plugin 'ram-z/vim-clang-format'
 " needs editing colorscheme
 " Plugin 'jeaye/color_coded'
 " Check LucHermites plugins: https://github.com/LucHermitte/lh-cpp