Last Updated: December 28, 2016
· lorin

iterm2 cmd-click to open file in vim in terminal

You'll need to grab one of the iterm2 nightly builds, for this to work, since coprocesses don't seem to be in the releases yet.

This will enable you to cmd-click on a filename in iTerm2 and have it launch vim within the same iterm2 window:

Click on: Preferences -> Profiles -> Advanced

Under "Semantic History", choose "Run coprocess..". In the text field, put:

echo vim \1 +\2