Created
December 6, 2016 20:18
-
-
Save Luciaisacomputer/151786279f4e0266ee657d5a0c142dda to your computer and use it in GitHub Desktop.
Open Visual Studio Code From Terminal
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
#Just copy this into your preferred terminal | |
function code { | |
if [[ $# = 0 ]] | |
then | |
open -a "Visual Studio Code" | |
else | |
local argPath="$1" | |
[[ $1 = /* ]] && argPath="$1" || argPath="$PWD/${1#./}" | |
open -a "Visual Studio Code" "$argPath" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment