mac用vscode打开html,Mac 命令行打开VsCode

本文详细介绍了如何通过命令行使用Visual Studio Code(VSCode),包括安装、打开文件、切换语言、跳转定位、比较文件及管理扩展等实用操作。通过掌握这些命令,可以提升VSCode的使用效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

释放双眼,带上耳机,听听看~!

命令行

命令行命令安装

安装 VSCode Shell 命令,按 Shift+Cmd+P 搜索 shell command install 回车即可。

命令行帮助

Visual Studio Code 1.30.0

Usage: code [options] [paths...]

To read from stdin, append '-' (e.g. 'ps aux | grep code | code -')

Options:

-d, --diff Compare two files with each other.

-a, --add

-g, --goto Open a file at the path on the specified line and character position.

-n, --new-window Force to open a new window.

-r, --reuse-window Force to open a file or folder in an already opened window.

-w, --wait Wait for the files to be closed before returning.

--locale The locale to use (e.g. en-US or zh-TW).

--user-data-dir

instances of Code.

-v, --version Print version.

-h, --help Print usage.

Extensions Management:

--extensions-dir

--list-extensions List the installed extensions.

--show-versions Show versions of installed extensions, when using

--list-extension.

--uninstall-extension ( | ) Uninstalls an extension.

--install-extension ( | ) Installs or updates the extension. Use `--force` argument to

avoid prompts.

--enable-proposed-api () Enables proposed API features for extensions. Can receive

one or more extension IDs to enable individually.

Troubleshooting:

--verbose Print verbose output (implies --wait).

--log Log level to use. Default is 'info'. Allowed values are 'critical', 'error', 'warn',

'info', 'debug', 'trace', 'off'.

-s, --status Print process usage and diagnostics information.

-p, --performance Start with the 'Developer: Startup Performance' command enabled.

--prof-startup Run CPU profiler during startup

--disable-extensions Disable all installed extensions.

--disable-extension Disable an extension.

--inspect-extensions Allow debugging and profiling of extensions. Check the developer tools for the

connection URI.

--inspect-brk-extensions Allow debugging and profiling of extensions with the extension host being paused after

start. Check the developer tools for the connection URI.

--disable-gpu Disable GPU hardware acceleration.

--upload-logs Uploads logs from current session to a secure endpoint.

--max-memory Max memory size for a window (in Mbytes).

```常用命令

```// 在 VSCode 中打开当前目录

$ code .

// 在最近使用过的 VSCode 窗口打开当前目录

$ code -r .

// 创建新的窗口

$ code -n

$ code --new-window

// 更改语言

$ code --locale=es

// 跳转到指定文件的指定行列,相当于跳转到指定文件的指定行的从左到右第几个字符上

$ code -g /path/to/:10:10

$ code --goto /path/to/:10:20

// 打开 diff 编辑器比较文件

$ code -d

$ code --diff

// 查看帮助选项

$ code --help

// 禁用所有扩展

$ code --disable-extensions

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值