Rocky
Rocky

Reputation: 5716

What does %:p:h mean in vim?

I know :cd %:p:h will change the working directory to the dir for current editing file. But what's the magic in %:p:h?

Upvotes: 28

Views: 12991

Answers (1)

Rocky
Rocky

Reputation: 5716

From http://vimdoc.sourceforge.net/htmldoc/cmdline.html#filename-modifiers,

:p Make file name a full path.

:h Head of the file name (the last component and any separators removed)

Upvotes: 29

Related Questions