Skip to content

Instantly share code, notes, and snippets.

@zunda
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zunda/9866352 to your computer and use it in GitHub Desktop.
Save zunda/9866352 to your computer and use it in GitHub Desktop.
An AppleScript to start vim inside iTerm
#!/usr/bin/osascript
on run argv
tell application "iTerm"
make new terminal
tell the last terminal
make new session
tell the last session
activate
exec command "vim " & argv
end tell
end tell
end tell
end run
@zunda
Copy link
Author

zunda commented Mar 30, 2014

I don't understand why make new session creates another terminal when this script starts up iTerm2. If iTerm2 has already been running, this script creates one new terminal and starts a session with vim inside it as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment