Last active
February 19, 2017 02:21
-
-
Save megalithic/1f0c8b7d085ecb74a0a8 to your computer and use it in GitHub Desktop.
open a selected file in finder within a new tmux window within an iTerm2 (termception).. dump this into an automator doc and save it as an app:
This file contains 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
set filename to POSIX path of input | |
set cmd to "cd `dirname " & filename & "`; vim " & filename | |
tell application "iTerm" | |
tell the current window | |
# Uncomment the next line if you want to create a new iTerm tab instead. | |
#create tab with default profile | |
tell the current session | |
tell application "iTerm" to activate | |
delay 1 | |
# Create a new tmux window | |
tell application "System Events" to keystroke "t" using command down | |
delay 1 | |
# Execute our command | |
write text cmd | |
end tell | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this makes some assumptions of your setup with iterm2 and tmux. i'll eventually have it detect existing tmux sessions and if non exists will just open a regular ole iterm2 tab instead of a new tmux window using my cmd+t keybinding.