sponsor Vim development Vim logo Vim Book Ad

switch files : switch between .c and .h files or different path and same filename easily

 script karma  Rating -5/5, Downloaded by 659    Comments, bugs, improvements  Vim wiki

created by
Marc Weber
script type
function! vl#lib#files#switch_files#SwitchFileUI()
  map <m-s><m-b> :call vl#lib#files#switch_files#SwitchFile()<cr>
somewhere to get the default mapping.

Then use lines like this
call vl#lib#files#switch_files#SwitchFileRegisterLocalRegexSwap('.h$', ['.cpp', '.cc' ])
autocmd BufRead,BufNewFile /pr/*nix,/pr/*nix/*.sh call vl#lib#files#switch_files#SwitchFileRegisterLocalRegexSwap('/pr/mynix/','/pr/svnnix/')

for each buffer to tell the script how to find alternates.

There is also some support to add custom functions. Drop me an email if you want to know more
install details
Just source the file and follow the instructions.
You'll be asked before any action is taken.

If you don't feel comfortable installing to .vim insntall to another arbitrary directory and add it to your runtimepath
(let runtimepath+= ..)

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vimlib_switch_File_support_installer_sourceme.zip 0.1 2007-11-16 7.0 Marc Weber Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
SourceForge.net Logo