Created
May 5, 2011 17:43
-
-
Save brettbuddin/957498 to your computer and use it in GitHub Desktop.
Switch between .h and .c, .m, .cc or .cpp files quickly. Change the function name to whatever you want. She's ugly.
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
function! Switch() | |
if expand('%:e') == 'h' | |
try | find %:t:r.m | |
catch | |
try | find %:t:r.c | |
catch | |
try | find %:t:r.cc | |
catch | |
try | find %:t:r.cpp | catch | endtry | |
endtry | |
endtry | |
endtry | |
else | |
find %:t:r.h | |
endif | |
endfunction | |
command! Switch call Switch() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment