學習筆記-VSCode-基礎-1
✍ 給自己以信心,給時間以寬待!
文章目錄
VSCode
快捷鍵
修改**keybindings.json
**
- 快捷鍵Ctrl+p搜尋
- 或檔案->首選項->鍵盤快捷鍵->
- 再或者在地址中開啟
移動,刪除,聚焦「Button Version」
[
// 游標上下左右移動
{
"key": "alt+i",
"command": "cursorUp"
},
{
"key": "alt+j",
"command": "cursorLeft"
},
{
"key": "alt+l",
"command": "cursorRight"
},
{
"key": "alt+k",
"command": "cursorDown"
},
// 游標移至行尾
{
"key": "alt+o",
"command": "cursorEnd",
},
// 游標移至行首
{
"key": "alt+u",
"command" : "cursorHome",
},
// 整行上移下移
{
"key": "ctrl+i",
"command": "editor.action.moveLinesUpAction",
"when": "editorTextFocus && !editorReadonly"
},
// 整行下移
{
"key": "ctrl+k",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
// 向上選中
{
"key": "shift+alt+i",
"command": "cursorUpSelect",
"when": "textInputFocus"
},
// 向下選中
{
"key": "shift+alt+k",
"command": "cursorDownSelect",
"when": "textInputFocus"
},
// 向左選中
{
"key": "shift+alt+j",
"command": "cursorLeftSelect",
"when": "textInputFocus"
},
// 向右選中
{
"key": "shift+alt+l",
"command": "cursorRightSelect",
"when": "textInputFocus"
},
//從當前到行首選中
{
"key": "shift+alt+u",
"command": "cursorHomeSelect",
"when": "textInputFocus"
},
//從當前到行尾選中
{
"key": "shift+alt+o",
"command": "cursorEndSelect",
"when": "textInputFocus"
},
//提示上下選擇
{
"key": "alt+i",
"command": "selectPrevSuggestion",
"when": "editorTextFocus && suggestWidgetVisible"
},
{
"key": "alt+k",
"command": "selectNextSuggestion",
"when": "editorTextFocus && suggestWidgetVisible"
},
// 匹配相同的下一個
{
"key": "ctrl+2",
"command": "editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},
//刪除當前行
{
"key": "ctrl+d",
"command": "-editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},
{
"key": "ctrl+d",
"command": "editor.action.deleteLines",
"when": "textInputFocus && !editorReadonly"
},
]
熱鍵「Hot keys」
釋義 | 快捷鍵 |
---|---|
新建檔案 | Ctrl+N |
檔案之間切換 | Ctrl+Tab |
開啟一個新的VS Code編輯器 | Ctrl+Shift+N |
關閉當前視窗 | Ctrl+W |
移動到檔案結尾 | Ctrl+End |
移動到檔案開頭 | Ctrl+Home |
移動到定義處 | F12 |
檢視定義處縮圖 | Alt+F12 |
回退上一個游標操作 | Ctrl+U |
顯示 Debug | Ctrl+Shift+D |
顯示 Output | Ctrl+Shift+U |
側邊欄顯示或隱藏 | Ctrl+B |
放大或縮小(以編輯器左上角為基準) | Ctrl +/- |
跳轉到行數 | Ctrl+G |
快速開啟檔案「Quick Open」
可以用於快速搜尋,然後開啟專案中的檔案,當你想在一個大型專案中開啟某一個程式碼檔案時,此方法非常實用。
Mac:
Command
+P
Linux/Windows:Ctrl
+P
編輯器命令「Command Palette」
在搜尋加上>
字首就可以呼叫命令了。編輯器的命令可以做很多,可以快速搜尋快捷鍵,還可以執行外掛的一些命令,非常實用哦!
Mac:
Command
+P
Linux/Windows:Ctrl
+P
編輯器網格佈局「Editor Grid Layout」
游標拖動標籤頁到希望的對應位置即可
拆分編輯器「Split Editor」
型別 | 按鍵 |
---|---|
自定義鍵 | Ctrl+Shift+/ |
在一個檔案中,程式碼會非常的長,把當前檔案在同一個編輯器拆分開,然後分別滑動到指令碼部分就可以同時更改了。
優秀外掛
Material Icon Theme
: You can change the color of the default folder icon using the command palette:
Prettify JSON
Tabnine Autocomplete AI
: JavaScript, Python, TypeScript, PHP, C/C++, HTML/CSS, Go, Java, Ruby, C#, Rust, SQL, Bash, Kotlin,
Chinese (Simplified)
Code Spell Checker
Better Comments
: The Better Comments extension will help you create more human-friendly comments in your code.
With this extension, you will be able to categorise your annotations into:
- Alerts
- Queries
- TODOs
- Highlights
- Commented out code can also be styled to make it clear the code shouldn’t be there
- Any other comment styles you’d like can be specified in the setting