Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
alphard
· 13y ago · 0 comments
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
Comments
[–]
wahnfrieden
13y ago
Wow, elegant. Thank you!