Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.
0 votes
in vifm by
edited by


I am trying to convert the result of %c:p so that the path looks like C:\\somedir\\somedir2\test.txt.

This is what I was trying

:echo expand("%c:p:gs/\//H/")

1 Answer

0 votes
edited by
Best answer


  1. Use single quotes.
  2. / can't be escaped, but can be replaced with a different character.
  3. Not sure why, but there needs to be 4 slashes in the replacement or it doesn't work.
:echo expand('%c:p:gs!/!\\\\!')

UPDATE. Double escaping of backslashes won't be needed in versions that follow v0.12 (commit that fixes it).


thanks! that worked perfect.