From 2a1cb4ef0cf9fa8f7abe8933b93cf572bb7ec08c Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Sun, 20 Feb 2022 21:16:57 -0500 Subject: [PATCH] Change vim c header template --- vimrc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/vimrc b/vimrc index e767a5c..5bcc990 100644 --- a/vimrc +++ b/vimrc @@ -481,10 +481,11 @@ EOS endfunction function! s:InsertCHeaderGates() - let l:gatename = substitute(toupper(expand("%:t")), "\\.", "_", "g") - call append(0, '#ifndef '. l:gatename) - call append(line('$'), '#define '. l:gatename) - call append(line('$'), '#endif') + call append(0, '#pragma once') + "let l:gatename = substitute(toupper(expand("%:t")), '\\.', '_', 'g') + "call append(0, '#ifndef '. l:gatename) + "call append(line('$'), '#define '. l:gatename) + "call append(line('$'), '#endif') endfunction " sh template @@ -547,8 +548,8 @@ EOS autocmd BufNewFile *.sh call append(0, s:ShellScriptTemplate()) " C/C++ file. - autocmd BufNewFile *.{c,cc,cpp,h,hpp} call append(0, s:CFileTemplate()) - autocmd BufNewFile *.{h,hpp} call s:InsertCHeaderGates() + autocmd BufNewFile *.{c,cc,cpp,h,hpp,inl} call append(0, s:CFileTemplate()) + autocmd BufNewFile *.{h,hpp,inl} call s:InsertCHeaderGates() augroup END """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""