Created
May 5, 2020 23:51
-
-
Save logston/fc41fab5db95dc78574a8e8432bfd78f to your computer and use it in GitHub Desktop.
Small script to open file in Vim in Tmux in Terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on run {input} | |
| set the_path to POSIX path of input | |
| set cmd to "vim " & quoted form of the_path | |
| tell application "Terminal" | |
| activate | |
| tell application "System Events" | |
| keystroke "b" using {control down} | |
| delay 0.1 | |
| keystroke "c" | |
| keystroke return | |
| end tell | |
| do script "cd" in window 1 | |
| do script cmd in window 1 | |
| end tell | |
| end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment