Hi,
A while ago I found a function that easily switches between source and
header files.
function! SwitchSourceHeader()
"update!
let base=expand("%:r")
let extension=expand("%:t:e")
if ( extension == "cpp" )
let extension="h"
let alt=base . "." . extension
else
let alt=base . ".cpp"
endif
find `=alt`
endfunction
I have been using it for a while, and it's doing what it is supposed to.
Now I have a new requirement. The source file is now either a ".c" file or a
".cpp" file (never a situation where both files exist).
I tried changing the function to match that but wasn't able to find a
working solution.
Any help is appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---