For Mac OS X, there are three ways you can enable code .
to open the current folder in Visual Studio Code.
For a fresh installation
Install Visual Studio Code through Homebrew
There is a way to install Visual Studio Code through Brew-Cask.
First, install Homebrew from here.
Now run the following command, and it will install the latest Visual Studio Code on your Mac.
brew cask install visual-studio-code
The above command should install Visual Studio Code and also set up the command-line calling of Visual Studio Code.
If the above steps don't work then you can do it manually. By following Microsoft Visual Studio Code documentation given here.
If Visual Studio Code is already installed
If Visual Studio Code is already installed then you don't have to reinstall it. You can follow any of the below two options.
Option 1: Update PATH in the Bash profile
Update your favorite Bash profile, such as ~/.bash_profile
or ~/.bashrc
or ~/.zshrc
by exporting the app/bin
path of the Visual Studio Code application. You can add the below export
command to your favorite Bash profile.
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
Option 2: Using the Visual Studio Code Command Palette
We can run a shell command in the Visual Studio Code Command Palette too. To do so, we need to open the Command Palette via (⇧⌘P) and type "shell command" to find the shell command named as:
Shell Command: Install 'code' command in PATH
Press Enter to execute the above shell command.
That's it.
code-insiderr .
code-insiders .