Re:Vim Splits – Move Faster and More Naturally
by wahnfrieden on Thursday April 18, 2013 @01:48PM
(#5571975)
Isn't there some way of using % to open a file relative to the current one perhaps? To get the best of both worlds.
[ Parent
| on HN ]
Re:Vim Splits – Move Faster and More Naturally
by alphard on Thursday April 18, 2013 @02:23PM
(#5572174)
I'm using the following to expand "%%" in command mode to the full path of the current open file's directory:
cabbr <expr> %% expand('%:p:h')
You could also use :. instead of :p to get the relative path, see :help c_% and :help filename_modifiers
Re:Vim Splits – Move Faster and More Naturally
by wahnfrieden on Thursday April 18, 2013 @05:34PM
(#5573261)
Wow, elegant. Thank you!