Created
October 7, 2016 06:50
-
-
Save kpmeen/6138573714bf071822d0c80c34713428 to your computer and use it in GitHub Desktop.
oh-my-zsh plugin for opening files with M$ Visual Studio Code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 .' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Place the file in a folder called
~/.oh-my-zsh/custom/plugins/visual-studio-code/
. Then runsource ~/.zshrc
.You can now type
code
in any directory to open the editor and start editing files within the current directory. Or typevsc myfile.js
to open a specific file.