Skip to content

Instantly share code, notes, and snippets.

@Luciaisacomputer
Created December 6, 2016 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Luciaisacomputer/151786279f4e0266ee657d5a0c142dda to your computer and use it in GitHub Desktop.
Save Luciaisacomputer/151786279f4e0266ee657d5a0c142dda to your computer and use it in GitHub Desktop.
Open Visual Studio Code From Terminal
#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