Fast access to file path in vinegar.vim

Suppose that some/long/path/to/foo.txt is not in git repo yet. You want to remove it, anyway. vinegar.vim gives you a handy shortcut for getting a file path.

  • Press - to get to the directory containing the file
  • Press ! to get the file path
  • Add missing rm to: :! some/long/path/to/foo.txt

The final result is:

:!rm some/long/path/to/foo.txt

When you press ! vinegar.vim positions the cursor right after the bang (!). This way you can use arbitrary shell command from within Vim.
This protip has been written in 705 seconds