Skip to content

Instantly share code, notes, and snippets.

@adow
Last active November 12, 2018 14:35
Show Gist options
  • Save adow/47131a56663d8695dfac4b58dc50ecc1 to your computer and use it in GitHub Desktop.
Save adow/47131a56663d8695dfac4b58dc50ecc1 to your computer and use it in GitHub Desktop.
Open file in iTerm vim for MacOS Mojave
on run {input, parameters}
set filename to POSIX path of input
set cmd to "clear;cd `dirname " & filename & "`;vim " & quote & filename & quote
tell application "iTerm"
create window with default profile
set bounds of front window to {300, 30, 1000, 1000}
tell the current window
tell the current session
write text cmd
end tell
end tell
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment