execute '%s/^\(.*\)$/"\1"/'
endfunction
+function InsertIncludeGuardsWithoutEndif()
+ let gatename = substitute(expand("%:t"), "\\.", "_", "g") . '_' . strpart(system('pwgen -c 16 1'), 0, 16)
+ execute "normal! i#ifndef " . gatename
+ execute "normal! o#define " . gatename
+endfunction
+
+function AddIncludeGuards()
+ execute "normal! Go#endif"
+ execute "normal! gg"
+ call InsertIncludeGuardsWithoutEndif()
+endfunction
+
+autocmd BufNewFile *.{h,hpp} call AddIncludeGuards()
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""