安装 code
命令
使用快捷键 command
shift
P
打开命令面板,输入 >install code
即可安装
在终端中,使用命令 code .
即可打开当前目录到 VS Code:
Oh My Zsh 插件
启用 Oh My Zsh 的 VS Code 插件,只需修改文件 ~/.zshrc
,在 plugins
中添加 vscode
plugins=(... vscode)
启用插件后,就可以使用简化命令与 VS Code 交互了,命令如下:
Alias | Command | Description |
---|---|---|
vsc | code . | Open the current folder in VS code |
vsca | code --add | Add folder(s) to the last active window |
vscd | code --diff | Compare two files with each other. |
vscg | code --goto | 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 | code --user-data-dir | Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code. |
Alias | Command | Description |
---|---|---|
vsced | code --extensions-dir | Set the root path for extensions. |
vscie | code --install-extension | Installs an extension. |
vscue | code --uninstall-extension | Uninstalls an extension. |
Alias | Command | Description |
---|---|---|
vscv | code --verbose | Print verbose output (implies --wait). |
vscl | code --log | 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. |