Skip to content

Instantly share code, notes, and snippets.

@markotom
Created March 24, 2017 08:46
Show Gist options
  • Save markotom/00c95b2caa5dfd8b79024c5bf4905ad8 to your computer and use it in GitHub Desktop.
Save markotom/00c95b2caa5dfd8b79024c5bf4905ad8 to your computer and use it in GitHub Desktop.
Open Visual Studio Code from command line
function vs {
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