]> git.sthu.org Git - vimconf.git/commitdiff
plugins: Add clang format mappings
authorStefan Huber <shuber@sthu.org>
Thu, 6 Jan 2022 08:44:13 +0000 (09:44 +0100)
committerStefan Huber <shuber@sthu.org>
Thu, 6 Jan 2022 08:44:13 +0000 (09:44 +0100)
plugins-noroot-nolowendbox.vim

index 443a012727ec23924d7a1516c3e17dc010592ee1..a9fe99c3c183a13fd150510d522c0561ad20c8fb 100644 (file)
@@ -282,4 +282,12 @@ EOF
     " Do not show diagnostic window of vim-clang
     let g:clang_diagsopt = ''
 
+    augroup ClangFormatSettings
+        au!
+        au FileType c,cpp,objc,javascript,java,typescript,protobuf,cuda,vala
+                    \ vmap <buffer><leader>cf <Plug>(operator-clang-format)
+        au FileType c,cpp,objc,javascript,java,typescript,protobuf,cuda,vala
+                    \ nmap <buffer><leader>cf :ClangFormat<CR>
+    augroup END
+
 endfunction