Skip to content

Instantly share code, notes, and snippets.

@fcamel
Created December 18, 2009 03:25
Show Gist options
  • Save fcamel/259264 to your computer and use it in GitHub Desktop.
Save fcamel/259264 to your computer and use it in GitHub Desktop.
"open A_test.X if current file name is A.X
"open A.X if current file name is A_test.X
function OpenCorrespondingFile()
let d = split(expand("%"), '_test')
if len(d) == 1
let name = expand("%:r") . "_test." . expand("%:e")
else
let name = d[0] . d[1]
endif
exec 'vsplit ' name
endfunction
map ,, :call OpenCorrespondingFile()<C-M>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment