Skip to content

Instantly share code, notes, and snippets.

@sos4nt
Created March 26, 2013 13:06
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save sos4nt/5245210 to your computer and use it in GitHub Desktop.
Save sos4nt/5245210 to your computer and use it in GitHub Desktop.
Semantic history command for iTerm2 and Sublime Text 3. In iTerm's Preferences > Profiles > Default > Advanced > Semantic History, choose "Run command..." and enter "/your/path/to/iterm_open_with \1 \2".
#!/bin/sh
file "$1" | grep -q "text"
if [ $? -ne 0 ]; then
/usr/bin/open $1
else
/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl $1:$2
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment