Skip to content

Instantly share code, notes, and snippets.

@jpbochi
Created August 10, 2016 14:35
Show Gist options
  • Save jpbochi/5a9d30eef1497c0efdfa9110b370ebc8 to your computer and use it in GitHub Desktop.
Save jpbochi/5a9d30eef1497c0efdfa9110b370ebc8 to your computer and use it in GitHub Desktop.
iterm-open.sh
#!/bin/sh
# copied from https://gist.github.com/sos4nt/5245210
# In iTerm's Preferences > Profiles > Default > Advanced > Semantic History,
# choose "Run command..." and enter "/your/path/to/iterm_open_with \1 \2".
file "$1" | grep -q "text"
if [ $? -ne 0 ]; then
/usr/bin/open $1
else
/usr/local/bin/atom $1:$2
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment