-
-
Save paresharma/9f6f206d90f127043f71 to your computer and use it in GitHub Desktop.
Semantic history command for iTerm2 and Atom editor. In iTerm's Preferences > Profiles > Default > Advanced > Semantic History, choose "Run command..." and enter "/your/path/to/iterm_open_with \1 \2".
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
#!/bin/sh | |
file "$1" | grep -q "text" | |
if [ $? -ne 0 ]; then | |
/usr/bin/open $1 | |
else | |
if [[ -z "$2" ]]; then | |
FILE_PATH="$1" | |
else | |
FILE_PATH="$1:$2" | |
fi | |
/usr/local/bin/atom $FILE_PATH | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment