如何从终端/命令行调用VS代码编辑器 [英] How to call VS Code Editor from terminal / command line

查看:238
本文介绍了如何从终端/命令行调用VS代码编辑器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题就说明了一切。

如何从

    $ b $打开VS Code编辑器b
  • windows cmd

  • linux和mac终端

  • windows cmd
  • linux and mac terminal

例如对于记事本++,我写

e.g. for notepad++ I write

>开始notepad ++ test.txt

顺便说一句,编辑器很棒(跨平台)!谢谢纳德拉!

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

您可以从 microsoft

推荐答案

使用命令 code / path / to / file / or / directory / you / want / to / open 以VS Code打开文件。

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

在Windows和Linux上, code 命令应自动安装。在macOS上,需要手动安装:

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

启动VS Code。
现在打开命令面板(F1)并键入 shell命令来找到 Shell命令:在PATH命令中安装'code'命令
重新启动终端。

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.

这篇关于如何从终端/命令行调用VS代码编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆