Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
0 points
alphard
12y ago
0 comments
Share
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
undefined | Better HN
0 comments
default
newest
oldest
wahnfrieden
12y ago
Wow, elegant. Thank you!
j
/
k
navigate · click thread line to collapse