- 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.
Tried the last version. Often there is an error:
Steps to reproduce:
.txt
file) (Step 9 of the original instruction)