I use Fork and I'm trying to set up a custom command that will open a file in Vim. I'm not using MacVim, so the command needs to open a terminal, preferably iTerm2.
Executing /usr/local/bin/vim
doesn't work because there's no terminal, so my command needs to launch a terminal and run Vim inside it. I think the open
command should work:
/usr/bin/open /usr/local/bin/vim --args <absolute_file_path>
This opens a new iTerm2 tab and Vim launches inside it, but the file isn't opened. :ls
shows that I'm editing a new buffer. If I pass the -h
flag instead of a filename, Vim opens normally, so it's definitely not receiving the argument (or else it would display the help text instead of opening).
I get the same result even if I run the open
command at the terminal, so I don't think this is Fork's issue.
Is there a command I can execute that will launch a terminal and run Vim inside it, passing an argument to Vim?