macOS - code . 使用 vscode 打开工程文件夹

文章目录


在一些教程中看到 在终端输入 code . 即可使用 vscode 打开当前文件夹项目。
这个在安装 vscode 之后,需要额外设置,方法如下

1、 Command + Shift + P
2、输入shell command
3、选择 安装

在这里插入图片描述


点击之后,会弹窗提示
在这里插入图片描述

这时,在终端输入 code . 即可打开项目


我们也可以看看 code 命令还支持什么

% which code
/usr/local/bin/code

% code --version
1.86.2
903b1e9d8990623e3d7da1df3d33db3e42d80eda
x64

% code --help
Visual Studio Code 1.86.2

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

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

Options
  -d --diff <file> <file>                    Compare two files with each other.
  -m --merge <path1> <path2> <base> <result> Perform a three-way merge by providing paths for two modified versions of a file, the common origin of both modified versions and the output file to save merge results.
  -a --add <folder>                          Add folder(s) to the last active window.
  -g --goto <file:line[:character]>          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 <locale>                          The locale to use (e.g. en-US or zh-TW).
  --user-data-dir <dir>                      Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.
  --profile <profileName>                    Opens the provided folder or workspace with the given profile and associates the profile with the workspace. If the profile does not exist, a new empty one is created.
  -h --help                                  Print usage.

Extensions Management
  --extensions-dir <dir>              Set the root path for extensions.
  --list-extensions                   List the installed extensions.
  --show-versions                     Show versions of installed extensions, when using --list-extensions.
  --category <category>               Filters installed extensions by provided category, when using --list-extensions.
  --install-extension <ext-id | path> Installs or updates an extension. The argument is either an extension id or a path to a VSIX. The identifier of an extension is '${publisher}.${name}'. Use '--force' argument to update to latest version. To install a specific version provide
                                      '@${version}'. For example: 'vscode.csharp@1.2.3'.
  --pre-release                       Installs the pre-release version of the extension, when using --install-extension
  --uninstall-extension <ext-id>      Uninstalls an extension.
  --update-extensions                 Update the installed extensions.
  --enable-proposed-api <ext-id>      Enables proposed API features for extensions. Can receive one or more extension IDs to enable individually.

Troubleshooting
  -v --version                    Print version.
  --verbose                       Print verbose output (implies --wait).
  --log <level>                   Log level to use. Default is 'info'. Allowed values are 'critical', 'error', 'warn', 'info', 'debug', 'trace', 'off'. You can also configure the log level of an extension by passing extension id and log level in the following format:
                                  '${publisher}.${name}:${logLevel}'. For example: 'vscode.csharp:trace'. Can receive one or more such entries.
  -s --status                     Print process usage and diagnostics information.
  --prof-startup                  Run CPU profiler during startup.
  --disable-extensions            Disable all installed extensions. This option is not persisted and is effective only when the command opens a new window.
  --disable-extension <ext-id>    Disable the provided extension. This option is not persisted and is effective only when the command opens a new window.
  --sync <on | off>               Turn sync on or off.
  --inspect-extensions <port>     Allow debugging and profiling of extensions. Check the developer tools for the connection URI.
  --inspect-brk-extensions <port> 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.
  --disable-chromium-sandbox      Use this option only when there is requirement to launch the application as sudo user on Linux or when running as an elevated user in an applocker environment on Windows.
  --telemetry                     Shows all telemetry events which VS code collects.

Subcommands
  tunnel       Make the current machine accessible from vscode.dev or other machines through a secure tunnel
  serve-web    Run a server that displays the editor UI in browsers.


伊织 2024-05-09(四)

空气炸锅 实现了 自动炒菜机的功能,可以定时烹饪 👍🏻

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

富婆E

请我喝杯伯爵奶茶~!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值