Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am jasperfung on github.
* I am jasperfung (https://keybase.io/jasperfung) on keybase.
* I have a public key ASDyOZFgPFopm62NLNPJSuAUOam-6bxGhMXEAtG5joQu_Qo
To claim this, I am signing this object:
@jasperfung
jasperfung / iterm_open_with
Created May 4, 2016 08:15 — forked from sos4nt/iterm_open_with
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