Created
February 24, 2013 22:47
-
-
Save awidegreen/5026082 to your computer and use it in GitHub Desktop.
vim header file hook to include template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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