vscode|June 25, 2020|1 min read

VS-Code - How to put vscode executable in system path and how to open source code directly in vscode

TL;DR

Use VS Code's Command Palette to install the 'code' command in PATH, or manually add the VS Code executable to your system environment variables.

VS-Code - How to put vscode executable in system path and how to open source code directly in vscode

Introduction

VS code is an excellent free IDE for maany types of programming languaages. Lets take a look aat how we can add its executable path in our system path so that we can open it from our terminal or command line.

From VS Code itself

  • Open VS Code
  • Press Command + Shift + P

OR From View menu, click on Command Palette

Type:

>Shell command: Install

You will see one option like below:

VSCode Executable path

Thats it. It was so simple. No need to run any command to update your PATH variable.

Open Source code in VS Code from terminal

Now that vs code executable is added in your system path. You just need to open your terminal.

Example: Your source code is at folder:

/Users/test/github/myproject

Simply run (from anywhere)

code /Users/test/github/myproject

Or you can goto that code folder by cd command. And run:

code .

VS code is so light weight that you can use it as notepad. i.e. open any kind of text file in this IDE.

Related Posts

VS-Code - How to Debug and pass Command Line Arguments via Launch Config

VS-Code - How to Debug and pass Command Line Arguments via Launch Config

Introduction In this post, I will take example for Python project. And how we…

Microsoft Visual Studio Code - Must-have extensions for Developers

Microsoft Visual Studio Code - Must-have extensions for Developers

Visual Studio Code is one of the awesome developer tools by Microsoft. Let’s…

How to solve java issue - could not load main class - Visual Studio Code

How to solve java issue - could not load main class - Visual Studio Code

Assuming you have a java project and is using Visual Studio Code as IDE. All of…

Visual Studio Code - How to associate file extension to a known programming language

Visual Studio Code - How to associate file extension to a known programming language

Problem Statement I have a drupal module, where there is a file of extension…

Jenkins Pipeline with Jenkinsfile - How To Schedule Job on Cron and Not on Code Commit

Jenkins Pipeline with Jenkinsfile - How To Schedule Job on Cron and Not on Code Commit

Introduction In this post we will see following: How to schedule a job on cron…

Jenkins Pipeline - How to run Automation on Different Environment (Dev/Stage/Prod), with Credentials

Jenkins Pipeline - How to run Automation on Different Environment (Dev/Stage/Prod), with Credentials

Introduction I have an automation script, that I want to run on different…

Latest Posts

Deep Dive on Elasticsearch: A System Design Interview Perspective

Deep Dive on Elasticsearch: A System Design Interview Perspective

“If you’re searching, filtering, or aggregating over large volumes of semi…

Deep Dive on Apache Kafka: A System Design Interview Perspective

Deep Dive on Apache Kafka: A System Design Interview Perspective

“Kafka is not a message queue. It’s a distributed commit log that happens to be…

Deep Dive on Redis: Architecture, Data Structures, and Production Usage

Deep Dive on Redis: Architecture, Data Structures, and Production Usage

“Redis is not just a cache. It’s a data structure server that happens to be…

Deep Dive on API Gateway: A System Design Interview Perspective

Deep Dive on API Gateway: A System Design Interview Perspective

“An API Gateway is the front door to your microservices. Every request walks…

REST API Design: Pagination, Versioning, and Best Practices

REST API Design: Pagination, Versioning, and Best Practices

Every time two systems need to talk, someone has to design the contract between…

Efficient Data Modelling: A Practical Guide for Production Systems

Efficient Data Modelling: A Practical Guide for Production Systems

Most engineers learn data modelling backwards. They draw an ER diagram…