这个问题说明了一切。

如何打开VS Code编辑器

windows cmd Linux和MAC终端

例如,为记事本++我写

>开始记分卡+测试。txt

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

你可以从微软下载


当前回答

根据文档:

Mac OS X Download Visual Studio Code for Mac OS X. Double-click on VSCode-osx.zip to expand the contents. Drag Visual Studio Code.app to the Applications folder, making it available in the Launchpad. Add VS Code to your Dock by right-clicking on the icon and choosing Options, Keep in Dock. Tip: If you want to run VS Code from the terminal, append the following to your ~/.bash_profile file (~/.zshrc in case you use zsh). code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;} Now, you can simply type code . in any folder to start editing files in that folder. Tip: You can also add it to VS Code Insiders build by changing "com.microsoft.VSCodeInsiders". Also if you don't to type the whole word code, just change it to c. Linux Download Visual Studio Code for Linux. Make a new folder and extract VSCode-linux-x64.zip inside that folder. Double click on Code to run Visual Studio Code. Tip: If you want to run VS Code from the terminal, create the following link substituting /path/to/vscode/Code with the absolute path to the Code executable sudo ln -s /path/to/vscode/Code /usr/local/bin/code Now, you can simply type code . in any folder to start editing files in that folder.

其他回答

在某种程度上,我不愿在长长的答案清单上再添什么。然而,我在这个页面上搜索“便携式”这个词,却一无所获。(我做了一个完整的Stack Overflow搜索,也没有发现任何东西。)所以我想把这个非常具体的答案补充给潜在的未来搜索者。

这个答案适用于你在Windows 10的便携模式下安装VS Code。

“便携式模式”指的是在VS Code官方网页上描述的内容,截至2021年1月21日,可以在这里找到:https://code.visualstudio.com。这并不意味着由Gareth Flowers开始/运行的Visual Studio Code Portable项目,或任何类似的项目。(我并不是在说这个或其他项目的坏话——我既没有使用过也没有评估过。)如果您正在使用其中一个项目,您需要检查该项目文档/社区-尽管这可能会起作用。

在可移植模式下“安装”VS Code就是下载一个。zip文件,然后在你想要你的VS Code“安装”的任何地方提取它。没有运行实际的安装或设置,因此不会自动将code命令添加到PATH中。


回答

在将Portable Mode VS Code文件解压缩到您选择的位置后,该位置应该有一个bin文件夹。复制该bin文件夹的完整路径并将其添加到您的System或User(您选择)path变量中。

然后,您应该能够从PowerShell或CMD中使用code命令。

第一步:用你想要的名字创建一个。bat文件,例如vcode .bat 步骤2:编写到Visual Studio Code的路径 第三步:保存到C:\Windows\System32目录下

**
C:
cd Users\Bino\AppData\Local\Programs\Microsoft VS Code
Code.exe**

步骤4:你可以在任何地方通过输入“vscode”(这是你的bat文件的名字)调用visual studio代码

在DOS命令提示符中输入“code”对我来说很有用

VS Code是2018年必须拥有的代码编辑器

对于Windows 10用户来说,很多事情都是可能的,就像Mac OS用户输入代码一样。

寻找你VS Code\bin文件夹路径,例如C:\Program Files\Microsoft VS Code\bin。bin文件夹包含一个称为code的文件。cmd。

如果您不确定您的路径是什么,请键入where代码。Cmd,然后复制它,不带\代码。在…\bin后输入CMD。

按照下面的步骤,你会为你使用的操作系统感到自豪。

Search for "Advanced System Setting" from Start. Click on Environment Variables. On System Variables choose "path" from Variable tab and click on Edit. Click on New on the right side of the popup window. Copy your path from the Explorer's breadcrumb path and paste it into the new opened path in step 4, example:- C:\Program Files\Microsoft VS Code\bin. Click Ok on all the open windows to confirm changes and restart your cmd . Go to your cmd and navigate to you working directory on server and type code . .

C:>cd wamp64\www\react-app> code在Windows上用VS Code打开。

Visual Studio Code还包括一个命令提示符(终端)窗口,您可以通过以下方式打开其中一个或多个窗口: 按键盘上的Ctrl + '键。

希望这能帮助一些人,就像它曾经帮助过我们很多人一样。

有时从vscode命令面板设置路径不工作

而是手动添加你的VS Code到你的路径:

在终端运行 Sudo nano /etc/paths 转到文件底部,输入要添加的路径 按control-x退出。输入“Y”保存修改后的缓冲区。 重新启动终端并测试echo $PATH。你应该做些类似的事情

~ echo $PATH /Users/shashank/.nvm/versions/node/v8.9.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Visual Studio Code.app/Contents/资源/app/bin . txt

下一次,您将从终端导航到项目文件夹

输入:

代码。

or

代码/道路/ /项目