binaryhub.io
  • Home
  • Categories
    • Javascript
    • Typescript
    • Serverless
    • AWS (Amazon Web Services)
    • Docker
    • Linux
    • DevOps
    • IDE
  • About
  • Contact
No Result
View All Result
Your Coding Hub
No Result
View All Result
Home IDE

How to open folders or files in Visual Studio Code from the terminal in 1 single step free of hassle

Florin Mateescu by Florin Mateescu
August 2, 2022
in IDE
Reading Time: 2 mins read
2
0
How to open visual studio code from terminal
230
VIEWS
Share on TwitterShare on LinkedInShare on Reddit

You are here because you probably tried to open a file from the terminal using vscode like this:

code my-file.json

and the response you get is that the command doesn’t exist even though you have vscode installed.

Let’s fix this by adding a new alias so that our terminal knows about this command.

No matter what you are using: zsh, bashrc or others, just edit the config file (e.g. for zsh is ~/.zshrc) and add the following line:

Alias that leads to the Visual Studio Code install path

alias code="open -a /Applications/Visual\ Studio\ Code.app"

Let’s explain:

  • alias command in the config lets you define a custom command that the terminal will recognize and run the action you specify in the commas. In this case we are opening the file in vscode editor.

If you have any question, don’t hesitate to leave it in bellow comment section and we’ll help you out!

If you haven’t ever used vscode, make sure to check the official getting started articles.

Upcoming competitors arise, fleet is coming from Jetbrain.

Tags: itermiterm2terminalvisual studio codevscodewindows terminalxtermxterm2zsh
TweetShareShare
Florin Mateescu

Florin Mateescu

Programming js since 2009,I write & video about javascript and coding in general - all while building awesome projects.#buildinpublicJoin my journey!

We also recommend

fleet-cover
News

IDE – Goodbye Vscode? Meet Fleet, probably the best editor

July 29, 2022

When it comes to programming there are a handful of choices in regards to text editors or IDEs. On one...

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

👋🏼 Hi, join me!

Twitter Youtube LinkedIn Instagram
Your Coding Hub

© 2023 binaryhub
Your Coding Blog

Content

  • Home
  • Categories
  • About
  • Contact

Follow my Journey

No Result
View All Result
  • Home
  • Categories
    • Javascript
    • Typescript
    • Serverless
    • AWS (Amazon Web Services)
    • Docker
    • Linux
    • DevOps
    • IDE
  • About
  • Contact

© 2023 binaryhub
Your Coding Blog

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In

Add New Playlist

This website uses cookies. See Cookie Policy for more information.
cropped-wp-icon.png

Welcome to your binary hub newsletter!

Get Tailored coding knowledge

🚀🚀

🚀

Get Tailored Coding Articles

Get Tailored coding knowledg

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.