Recently I started trying out Visual Studio Code, and I must say I am impressed! It’s open source, fast, and has built in debugging. It is in beta now, but I think it has a lot of potential to combine the speed of a text editor like Sublime Text with some of the powerful tools found in full-fledged IDEs like WebStorm.

Anyways, let’s get to the point.

To configure your machine to open projects in Visual Studio Code from the terminal using code ., follow the steps below.

  1. Open your terminal, and enter open ~/.bash_profile. If the file doesn’t exist, create it – touch ~/.bash_profile – and procceed to open it. Note: if you are using zsh, then skip to step 2 and add the line of code found there to ~/.zshrc instead.
  2. In .bash_profile, add the following: code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;} and save.
  3. Restar your terminal.
  4. Navigate to the project you wish to open and enter code ..