前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >VS Code 在终端中打开项目

VS Code 在终端中打开项目

原创
作者头像
轻量级云原生架构实验室
发布2022-12-05 10:02:47
3.1K0
发布2022-12-05 10:02:47
举报
文章被收录于专栏:轻量级微服务轻量级微服务

安装 code 命令

使用快捷键 command + shift + P 打开命令面板,输入 >install code 即可安装

在终端中,使用命令 code . 即可打开当前目录到 VS Code:

Oh My Zsh 插件

启用 Oh My Zsh 的 VS Code 插件,只需修改文件 ~/.zshrc,在 plugins 中添加 vscode

代码语言:txt
复制
plugins=(... vscode)

启用插件后,就可以使用简化命令与 VS Code 交互了,命令如下:

Alias

Command

Description

vsc

code .

Open the current folder in VS code

vsca dir

code --add dir

Add folder(s) to the last active window

vscd file file

code --diff file file

Compare two files with each other.

vscg file:line[:char]

code --goto file:line[:char]

Open a file at the path on the specified line and character position.

vscn

code --new-window

Force to open a new window.

vscr

code --reuse-window

Force to open a file or folder in the last active window.

vscw

code --wait

Wait for the files to be closed before returning.

vscu dir

code --user-data-dir dir

Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.

Alias

Command

Description

vsced dir

code --extensions-dir dir

Set the root path for extensions.

vscie id or vsix-path

code --install-extension extension-id> or <extension-vsix-path

Installs an extension.

vscue id or vsix-path

code --uninstall-extension id or vsix-path

Uninstalls an extension.

Alias

Command

Description

vscv

code --verbose

Print verbose output (implies --wait).

vscl level

code --log level

Log level to use. Default is 'info'. Allowed values are 'critical', 'error', 'warn', 'info', 'debug', 'trace', 'off'.

vscde

code --disable-extensions

Disable all installed extensions.

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 安装 code 命令
  • Oh My Zsh 插件
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档