Skip to content

Instantly share code, notes, and snippets.

@awidegreen
Created February 24, 2013 22:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
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"
endfun
autocmd BufNewFile *.hh call CppHeaderFileHook()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment