Skip to content

Instantly share code, notes, and snippets.

@karatechops
Created November 5, 2019 21:46
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 karatechops/72cdc47104787b9ec7f6ca117679d8dd to your computer and use it in GitHub Desktop.
Save karatechops/72cdc47104787b9ec7f6ca117679d8dd to your computer and use it in GitHub Desktop.
a script to open vscode from 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