文档中提到了一种叫做代码的可执行文件,但我不确定在哪里可以找到它,所以我可以把它放在我的路径上。我从VSCode网站下载的zip文件不包括任何这样的可执行文件。(我可以很好地运行.app。)
这是windows独有的功能吗?
文档中提到了一种叫做代码的可执行文件,但我不确定在哪里可以找到它,所以我可以把它放在我的路径上。我从VSCode网站下载的zip文件不包括任何这样的可执行文件。(我可以很好地运行.app。)
这是windows独有的功能吗?
当前回答
我发现了mingw32的一个巧妙的解决方法(即对于那些使用git-scm.com在windows上安装的bash版本的人来说):
code () { VSCODE_CWD="$PWD" cmd //c code $* ;}
其他回答
$> open -a Visual Studio Code [file-name]
从Visual Studio代码设置页面:
Tip: If you want to run VS Code from the terminal by simply typing 'code', VS Code has a command, Shell Command: Install 'code' command in PATH, to add 'code' to your $PATH variable list. After installation, launch VS Code. Now open the Command Palette (F1 or ⇧+⌘+P on Mac) and type shell command to find the Shell Command: Install 'code' command in PATH command. After executing the command, restart the terminal for the new $PATH value to take effect. You'll be able to simply type 'code .' in any folder to start editing files in that folder.
对于我来说,在Macbook Book Pro 2019 MacOS版本10.15.6上,在VSCode中打开命令面板的快捷方式是Shift + command + P。
打开它,你只需要写安装代码,然后按enter键。
之后,只需打开终端,输入代码,你的vscode将开始打开。
注意:仅适用于Windows用户。
正如许多人已经建议从命令提示符使用代码打开代码的方法一样。命令。这将只打开Visual Studio Code Stable构建。但是如果你已经下载了Visual Studio Code Insider版本/版本(它有所有最新的版本/功能,但不稳定的版本),那么你需要在windows中遵循以下说明:
进入控制面板\系统和安全\系统。单击高级系统设置 点击环境变量 在系统变量选项卡下,单击路径变量的编辑 新增路径C:\Users\tsabu\AppData\Local\Programs\Microsoft VS Code Insiders\bin (或) C:\Program Files\Microsoft VS Code Insiders\bin基于你在机器中安装vscode insider的位置。 打开一个新的命令提示符并输入code-insiders。打开vcode -insider 建立/版本
如果你使用snap安装VS CODE。您需要在PATH环境变量中添加/snap/bin。 打开。bashrc或。zshrc 并在PATH环境变量中添加/snap/bin
重新加载终端, 代码命令将启动它