Skip to content

Instantly share code, notes, and snippets.

@daehli
Created December 18, 2017 19:51
Show Gist options
  • Save daehli/8a19a2ac8cecb432c6ba9af1dd8f6b4c to your computer and use it in GitHub Desktop.
Save daehli/8a19a2ac8cecb432c6ba9af1dd8f6b4c to your computer and use it in GitHub Desktop.
Install Visual Studio Code on Mac OS and add vscode alias

Brew Install

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null ; brew install caskroom/cask/brew-cask 2> /dev/null

Install Brew Visual-Studio Code

brew cask install visual-studio-code

Add Alias to Open file with vscode in the terminal

# You can now make vscode [FOLDER] in the Terminal
echo alias vscode=\"/Applications/Visual\\ Studio\\ Code.app/contents/Resources/app/bin/code\" >> ~/.zshrc

# Reload you Terminal 

source ~/.bash_profile

## If you are using zsh

source ~/.zshrc
@mojtabacazi
Copy link

mojtabacazi commented Mar 15, 2019

Slightly different approach would be to use open

alias vscode="open -a Visual\ Studio\ Code.app"

@kirwako
Copy link

kirwako commented Jan 22, 2020

Thank you very much

@cesc88
Copy link

cesc88 commented Mar 14, 2020

Thanks man, it worked perfectly

@benjaminfauchald
Copy link

+1

@dannysepler
Copy link

alias vscode="open -a Visual\ Studio\ Code.app"

or even, alias vscode='open -a "Visual Studio Code"

@kirwako
Copy link

kirwako commented Oct 19, 2022

if you are a mac or linux user you need to add the backslach ""

@franciscolopezsancho
Copy link

Slightly different approach would be to use open

alias vscode="open -a Visual\ Studio\ Code.app"

+1

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