xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

vscode & code . commands All In One

vscode & code . commands All In One

vscode

$ code --version
1.52.0
940b5f4bb5fa47866a54529ed759d95d09ee80be
x64

$ code -v       
1.52.0
940b5f4bb5fa47866a54529ed759d95d09ee80be
x64


$ code -h
Visual Studio Code 1.52.0

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.
  -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.
  -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-extension.
  --category                                                  Filters installed extensions by provided
                                                              category, when using --list-extension.
  --install-extension <extension-id[@version] | path-to-vsix> Installs or updates the extension. The
                                                              identifier of an extension is always
                                                              `${publisher}.${name}`. Use `--force`
                                                              argument to update to latest version. To
                                                              install a specific version provide
                                                              `@${version}`. For example:
                                                              'vscode.csharp@1.2.3'.
  --uninstall-extension <extension-id>                        Uninstalls an extension.
  --enable-proposed-api <extension-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'.
  -s --status                        Print process usage and diagnostics information.
  --prof-startup                     Run CPU profiler during startup
  --disable-extensions               Disable all installed extensions.
  --disable-extension <extension-id> Disable an extension.
  --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.
  --max-memory                       Max memory size for a window (in Mbytes).
  --telemetry                        Shows all telemetry events which VS code collects.

➜  app git:(master) 

install

  1. Command + Shift + P
  2. 搜索 Shell Command : Install code in PATH
  3. 点击安装即可

使用 code .

# 在新窗口中,打开当前路径下的文件夹/文件
$ code .


# 在新窗口中,打开指定路径下的文件夹/文件
$ code -n ./docs/dist

$ code -n

$ code -n .


# 在当前窗口中, 打开当前路径下的文件夹/文件
$ code -a ./dist

# 在当前工作空间下,添加文件夹/文件
$ code -a

# 在当前工作空间下,添加并且打开文件夹/文件
$ code -a .


refs

https://code.visualstudio.com/docs/setup/mac

https://code.visualstudio.com/docs/editor/command-line



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2021-02-20 16:26  xgqfrms  阅读(128)  评论(1编辑  收藏  举报