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