VisualStudioCode基础

VisualStudioCode基础

侧栏编辑

ctrl + leftclick 可以新建一个侧栏编辑区打开文件
ctrl + \ 分割编辑器

基本快捷键

Ctrl+P 快速打开并搜索一个文件
Ctrl+` 打开cmd命令行

配置编辑器

Select File > Preferences > User Settings (or press Ctrl+Shift+P, type user and press Enter) to edit the user settings.json file.
Select File > Preferences > Workspace Settings (or press Ctrl+Shift+P, type worksp and press Enter) to edit the workspace settings.json file.

自动保存文件

配置文件中的files.autoSave:值如下
off - to disable auto save.
afterDelay - to save files after a configured delay.
onFocusChange - to save files when focus moves out of the editor of the dirty file.
onWindowChange - to save files when the focus moves out of the VS Code window.

搜索文件

Ctrl+Shift+F
You can configure advanced search options by typing Ctrl+Shift+json

命令面板

Ctrl+Shift+Tab 循环选择下一个你在编辑器组中打开的文件  
Ctrl+P 跳转到任何文件  
Ctrl+Shift+P 显示编辑器的一些命令选项  
Ctrl+Shift+O 导航到文件中的一个指定的符号例如函数  
Ctrl+G 导航到指定的行  
Ctrl+P输入?可以显示帮助命令列表

命令行

也就是ctrl+`打开的,里面有个code命令
code 1.txt 2.txt 可以如果文件不存在可以新建2个文件

命令行中的参数

Here are optional command line arguments you can use when starting VS Code at the command line via code:
Argument    Description
-h or --help    Print usage
-v or --version     Print VS Code version (e.g. 0.10.10)
-n or --new-window  Opens a new session of VS Code instead of restoring the previous session (default).
-r or --reuse-window    Forces opening a file or folder in the last active window.
-g or --goto    When used with file:line:column?, opens a file at a specific line and optional column position. This argument is provided since some operating systems permit : in a file name.
file    Name of a file to open. If the file doesn't exist, it will be created and marked as edited. You can specify multiple files by separating each file name with a space.
file:line:column?   Name of a file to open at the specified line and optional column position. You can specify multiple files in this manner, but you must use the -g argument (once) before using the file:line:column? specifier.
folder  Name of a folder to open. You can specify multiple folders.
-d or --diff    Open a file difference editor. Requires two file paths as arguments.
--locale    Set the display language (locale) for the VS Code session. Supported locales are: en-US, zh-TW, zh-CN, fr, de, it, ja, ko, ru, es
--disable-extensions    Disable all installed extensions. Extensions will still be visible in the Extensions: Show Installed Extensions dropdown but they will never be activated.
--list-extensions   List the installed extensions.
--install-extension     Install an extension. Provide the full extension name publisher.extension as an argument.
--uninstall-extension   Uninstall an extension. Provide the full extension name publisher.extension as an argument.
-w or --wait    Wait for the window to be closed before returning
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容