Skip to content

Instantly share code, notes, and snippets.

@bangonkali
Created August 9, 2016 15:03
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bangonkali/02ba0dc50aebca627fa68ff3a7325b8e to your computer and use it in GitHub Desktop.
Save bangonkali/02ba0dc50aebca627fa68ff3a7325b8e to your computer and use it in GitHub Desktop.
Creating a symlink for visual studio code on mac os x el capitan
@bneutra
Copy link

bneutra commented Sep 10, 2018

don't do this. The path has changed (this works but randomly crashes), instead: (command palette => Shell Command: install to path)

@jniac
Copy link

jniac commented Oct 8, 2018

@bneutra what about changing the name ? "code" is too generic, i would prefer "vscode"

@kreatimont
Copy link

kreatimont commented Dec 23, 2018

@bneutra what about changing the name ? "code" is too generic, i would prefer "vscode"

You can create symlink to the bin
sudo ln -s /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code /usr/local/bin/vscode

Details: https://code.visualstudio.com/docs/setup/mac

@raghav4
Copy link

raghav4 commented Oct 11, 2019

@kreatimont It worked!

@b-rucel
Copy link

b-rucel commented Oct 31, 2019

@bneutra what about changing the name ? "code" is too generic, i would prefer "vscode"

You can create symlink to the bin
sudo ln -s /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code /usr/local/bin/vscode

Details: https://code.visualstudio.com/docs/setup/mac

@bneutra what about changing the name ? "code" is too generic, i would prefer "vscode"

You can create symlink to the bin
sudo ln -s /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code /usr/local/bin/vscode

Details: https://code.visualstudio.com/docs/setup/mac

+1

@bangonkali
Copy link
Author

Hi Guys, there is a better more standard way to do this now using the command palette.

@raghav4
Copy link

raghav4 commented Mar 10, 2020

Hi Guys, there is a better more standard way to do this now using the command palette.

What is it? @bangonkali?

@bangonkali
Copy link
Author

@raghav4 Mac Windows see the section where path is mentioned.

@elitenomad
Copy link

elitenomad commented Mar 9, 2021

I think best way is to use command palette in the vscode

For this to work a symbolic link file named code must be created in the /usr/local/bin folder:

Start Visual Studio Code:

Open the Command Palette(⇧⌘P) and type shell command 
find the Shell Command: Install 'code' command in PATH command. Click Enter...
Adds a soft link to /Applications/Visual Studio Code.app/Contents/Resources/app/bin/code and places it in /usr/local/bin

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