Skip to content

Instantly share code, notes, and snippets.

Created Feb 24, 2013
What would you like to do?
vim header file hook to include template
fun! CppHeaderFileHook()
let l:filename = tolower(expand("%"))
let l:filename = substitute(l:filename, ".hh$","_HH_", "")
let l:filename = toupper(l:filename)
source ~/templates/cpp_header.template
execute "silent %s/FILENAME_HH_/".l:filename."/g"
autocmd BufNewFile *.hh call CppHeaderFileHook()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment