- Open Automator
- Choose "New Document"
- Locate "Run AppleScript" and double-click it
- Paste the Applescript code into the box
- Save as
/Applications/TerminalVim.app
- In Finder, select some file you want to open in Vim, e.g. a .rb file.
- Hit
⌘I
to open the “Get Info” window. - Under “Open with:”, choose
TerminalVim.app
. You may need to select “Other…” and then browse. - Hit the “Change All…” button and confirm.
Now all .rb files in Finder will open in Vim.
This option does not bring the terminal to the foreground if the stager is on ((