How to call VS Code Editor from command line

2019-01-16 06:18发布

The question says it all.

How can I call VS Code editor from

  • windows cmd
  • linux and mac terminal

e.g. for notepad++ I write

> start notepad++ test.txt

By the way, the editor is awesome (cross-platform)! Thank you Nadella!

You can download it from microsoft

13条回答
成全新的幸福
2楼-- · 2019-01-16 07:08

Use the command code /path/to/file/or/directory/you/want/to/open to open your file in VS Code.

On Windows and Linux the code command should be installed automatically. On macOS, it needs to be installed manually:

Launch VS Code. Now open the Command Palette (F1) and type shell command to find the Shell Command: Install 'code' command in PATH command. Restart your terminal.

查看更多
登录 后发表回答