Skip to content

Instantly share code, notes, and snippets.

@kpmeen
Created October 7, 2016 06:50
Show Gist options
  • Save kpmeen/6138573714bf071822d0c80c34713428 to your computer and use it in GitHub Desktop.
Save kpmeen/6138573714bf071822d0c80c34713428 to your computer and use it in GitHub Desktop.
oh-my-zsh plugin for opening files with M$ Visual Studio Code.
# Visual Studio Code
# https://code.visualstudio.com/Docs/setup
local _vsc_paths > /dev/null 2>&1
_vsc_paths=(
"$HOME/Applications/Visual Studio Code.app"
"/Applications/Visual Studio Code.app"
)
for _vsc_path in $_vsc_paths; do
if [[ -a $_vsc_path ]]; then
alias vsc="open -a '$_vsc_path'"
break
fi
done
alias code='vsc .'
@kpmeen
Copy link
Author

kpmeen commented Oct 7, 2016

Place the file in a folder called ~/.oh-my-zsh/custom/plugins/visual-studio-code/. Then run source ~/.zshrc.

You can now type code in any directory to open the editor and start editing files within the current directory. Or type vsc myfile.js to open a specific file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment