Skip to content

Instantly share code, notes, and snippets.

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 lichtschlag/9e0c3dd5a6fd60642675309f7619b01b to your computer and use it in GitHub Desktop.
Save lichtschlag/9e0c3dd5a6fd60642675309f7619b01b to your computer and use it in GitHub Desktop.
Open Visual Studio Code from Terminal
code () {
if [[ $# = 0 ]]
then
open -a "Visual Studio Code" -n
else
[[ $1 = /* ]] && F="$1" || F="$PWD/${1#./}"
open -a "Visual Studio Code" -n --args "$F"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment