Skip to content

Instantly share code, notes, and snippets.

@remy-actual
Forked from brablc/TerminalVim.scpt
Created September 16, 2016 15:53
Show Gist options
  • Select an option

  • Save remy-actual/071852832d0e21ab67e555ecbccd9774 to your computer and use it in GitHub Desktop.

Select an option

Save remy-actual/071852832d0e21ab67e555ecbccd9774 to your computer and use it in GitHub Desktop.
Open Vim in Terminal (iTerm) from Finder - copied from http://thepugautomatic.com/2015/02/open-in-iterm-vim-from-finder/ and updated to open in the current terminal
on run {input, parameters}
set myPath to POSIX path of input
set cmd to "vim " & quote & myPath & quote
tell application "iTerm"
activate
set myTerm to (current terminal)
tell myTerm
set mySession to (make new session at the end of sessions)
tell mySession to exec command cmd
end tell
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment