Last active
April 26, 2019 14:54
-
-
Save ollpu/f6972e09ec6e0dee96a373bb5896e8ae to your computer and use it in GitHub Desktop.
VIM Include Guard Generator
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
func! IncludeGuard() | |
let l:h = tr(toupper(expand("%:t")), ".", "_") | |
call append(0, "#ifndef ".h) | |
call append(1, "#define ".h) | |
call append(2, "") | |
call append(line("$"), "") | |
call append(line("$"), "#endif") | |
endfunc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment