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 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""