Skip to content

Instantly share code, notes, and snippets.

@iurysza
Created April 12, 2021 12:23
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 iurysza/2b97a040974d23f5ba8eeaacc7760320 to your computer and use it in GitHub Desktop.
Save iurysza/2b97a040974d23f5ba8eeaacc7760320 to your computer and use it in GitHub Desktop.
Script to open a file in vim. Can be used with mac's Automator to create an application and set as the default app of some file extension.
on run {input, parameters}
set myPath to POSIX path of input
set cmd to "vim " & quote & myPath & quote
tell application "iTerm2"
tell current window
create tab with default profile
tell 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