Skip to content

Instantly share code, notes, and snippets.

@SilverEzhik
Forked from charlietran/TerminalVim.scpt
Last active May 13, 2023 14:17
Show Gist options
  • Save SilverEzhik/cec3f065e7ab7b93d9102df70fa60d9b to your computer and use it in GitHub Desktop.
Save SilverEzhik/cec3f065e7ab7b93d9102df70fa60d9b to your computer and use it in GitHub Desktop.
Double click files to open them in vim in a new iTerm window.
on run {input, parameters}
-- handle opening multiple files
set str to ""
repeat with i from 1 to length of input
set cur to item i of input
set str to str & " " & quote & POSIX path of cur & quote
end repeat
tell application "iTerm"
create window with profile "fast" -- use a profile with a lighter shell
tell front window
tell current session
write text ("vim" & str & "; exit")
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