Skip to content

Instantly share code, notes, and snippets.

@davidrhodus
Created April 5, 2019 22:59
Show Gist options
  • Save davidrhodus/0d5a91c3d6a6745c761afed1b3f32541 to your computer and use it in GitHub Desktop.
Save davidrhodus/0d5a91c3d6a6745c761afed1b3f32541 to your computer and use it in GitHub Desktop.
vscode path with ZSH
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