nvim/after/plugin/c.vim

13 lines
331 B
VimL
Raw Normal View History

2021-08-11 10:25:50 +00:00
"{{{ c header gates
function! s:insert_gates()
let gatename = substitute(toupper(expand("%:t")), "\\.", "_", "g")
execute "normal! i#ifndef " . gatename
execute "normal! o#define " . gatename
execute "normal! Go#endif /* " . gatename . " */"
normal! kk
endfunction
autocmd BufNewFile *.{h,hpp} call <SID>insert_gates()
"}}}