nvim/after/plugin/c.vim
Alexander Gehrke 7cdac89502 Clean up
2023-06-27 11:52:49 +02:00

11 lines
329 B
VimL

"{{{ 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()
"}}}