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