How to open files and directories in VS Code from the command line or Terminal.
Working in the Terminal or command line is easier if you can quickly open or access a standard application from it. Let’s say I was in Terminal and wanted to quickly open a project directory in Visual Studio Code; here’s how I’d do it:
shell command
and then choose Install 'code' command in PATH
— this will install the command line utility for VS Code in your local path.code .
to open the current working directory (don’t forget the dot (.
)!