commit 692043327cf351077dcf5a33eb6410224caead67
parent 6439915eff268eba0bb38aeb24306b0757545807
Author: Thomas Vigouroux <tomvig38@gmail.com>
Date: Wed, 10 Nov 2021 14:31:08 +0100
Add C mapping and llvm filetype
Diffstat:
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/after/ftplugin/c.vim b/after/ftplugin/c.vim
@@ -1,4 +1,4 @@
-" Last Change: 2021 Aug 20
+" Last Change: 2021 Nov 08
setlocal expandtab
setlocal textwidth=80 " Nvim uses this
@@ -13,3 +13,11 @@ setlocal commentstring=//%s
if !empty(findfile('.clang-format', ';'))
setlocal formatprg=clang-format\ -style=file
endif
+
+if expand("%:e") == "c"
+ let b:ext = "h"
+else
+ let b:ext = "c"
+end
+
+nnoremap <buffer> <Leader>c <cmd>execute printf("edit %s.%s", expand("%:p:r"), b:ext)<CR>
diff --git a/lua/plugins.lua b/lua/plugins.lua
@@ -88,5 +88,8 @@ return require"packer".startup(function(use)
-- sunjon <3
use 'sunjon/extmark-toy.nvim'
+
+ -- filetypes
+ use 'rhysd/vim-llvm'
use 'tamarin-prover/editors'
end)