How can I expand the full path of the current file to pass to a command in Vim? December 14, 2022 by Tarik :!mycommand %:p Related: :!cd %:p:h