-
-
Save bsharpe/26c75699563c6899b418aa77d0b93bde to your computer and use it in GitHub Desktop.
Semantic history command for iTerm2 and Visual Studio Code Insiders 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/code-insiders -g $FILE_PATH | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment