vsCode快捷鍵大全(windows系統,持續更新,補充)


1.vscode初始文檔:https://code.visualstudio.com/docs/getstarted/tips-and-tricks     【在谷歌瀏覽器中 可以 右鍵 選擇 ‘翻成中文(簡體)】

2.英文版快捷鍵pdf鏈接:https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf

3.中英文版快捷鍵: (輕薄筆記本電腦快捷鍵 + Fn + 快捷鍵: 例如:Home / end  =》  Fn + Home/ end )

General  (一般的 (快捷鍵))

   
Ctrl + shift + p ,  F1 show command palette 顯示命令設置窗口
Ctrl + p quick open, go to file …  快速打開,進入指定文件
Ctrl + shift + n new window/instance 新建窗口/實例
Ctrl + shift + w close window/instance 關閉窗口/實例
Ctrl +,  user settings 用戶設置
Ctrl + k  Ctrl + s keyboard shortcuts 鍵盤快捷方式

 

Basic editing ( 基本編輯 (快捷鍵))

   
Ctrl + x cut line(empty selection) 剪切
Ctrl + c copy line(empty selection) 復制
Alt + ↑ / ↓ move line up/down 移上/移下
Shift + Alt + ↑ / ↓ copy line up/down 復制后移上/移下
Ctrl + shift +k delete line 刪除當前/選中行
Ctrl + enter insert line below 在下方插入空白行
Ctrl + shift + enter insert line above 在上方插入空白行
Ctrl + shift + \ jump to matching bracket 跳轉到匹配的括號
Ctrl + ] / [ indent/outdent line 縮進/不縮進
Home / end go to beginning/end of line 跳轉到行首/行尾
輕薄筆記本電腦快捷鍵( Fn + Home/ end )
Ctrl + home go to beginning of file 跳轉到文件首行
Ctrl + end go to end of file 跳轉到文件尾行
Ctrl + ↑ / ↓ scroll line up/down (小范圍)滾動至上/下(查看代碼)
Alt + pgup/pgdn scroll page up/down (大范圍)滾動至頁面上/下(查看代碼)
Ctrl + shift + [ fold(collapse) region 折疊當前區域
Ctrl + shift + ] unfold(uncollapse) region 展開當前區域
Ctrl + K Ctrl + [ Fold (collapse) all subregions 折疊所有子區域
Ctrl + K Ctrl + ]  Unfold (uncollapse) all subregions 展開所有子區域
Ctrl + K Ctrl + 0 Fold (collapse) all regions 折疊所有區域(oO0 : 是數字0)
Ctrl + K Ctrl + J Unfold (uncollapse) all regions 展開所有區域
Ctrl + K Ctrl + C Add line comment 添加行注釋
Ctrl + K Ctrl + U Remove line comment 刪除行注釋
Ctrl + / Toggle line comment 切換行注釋
Shift + Alt + A Toggle block comment 切換塊注釋
Alt+Z Toggle word wrap 切換換行/相對窗口過長的行代碼進行換行

 

Navigation(導航)

   
Ctrl+T Show all Symbols 顯示所有符號(包括標簽符號,用@開頭)
Ctrl+G Go to Line... 跳轉到特定行
Ctrl+P Go to File... 快速打開,進入指定文件
Ctrl+Shift+O Go to Symbol... 跳轉到特定符號(包括標簽符號)
Ctrl+Shift+M Show Problems panel  顯示問題面板
F8 Go to next error or warning 轉到下一個錯誤或警告
Shift+F8 Go to previous error or warning 轉到上一個錯誤或警告
Ctrl+Shift+Tab Navigate editor group history (跳轉到)導航編輯器組歷史記錄
Alt+ ← / → Go back / forward (文件之間切換)后退/前進
Ctrl + m Toggle Tab moves focus 切換選項卡移動焦點

 

Search and replace (查找和替換)

   
Ctrl+F

Find

查找

Ctrl+H Replace 替換
F3 / Shift+F3 Find next/previous 查找下一個/上一個
Alt+Enter Select all occurences of Find match 選擇查找匹配的所有匹配項
Ctrl+D Add selection to next Find match 將所選內容添加到下一個查找匹配項
Ctrl+K Ctrl+D Move last selection to next Find match 將上次選擇移動到下一個查找匹配項
Alt+C / R / W Toggle case-sensitive / regex / whole word 切換區分大小寫/正則表達式/整字

 

Multi-cursor and selection (多光標和選擇)

   
Alt+Click Insert cursor 插入光標
Ctrl+Alt+ ↑ / ↓ Insert cursor above / below 在上方/下方插入光標
Ctrl+U Undo last cursor operation 撤銷上一個光標操作
Shift+Alt+I Insert cursor at end of each line selected 在所選每行的末尾插入光標
Ctrl+L Select current line 選中當前行
Ctrl+Shift+L Select all occurrences of current selection 選擇當前選擇的所有引用
Ctrl+F2 Select all occurrences of current word

選擇當前單詞的所有出現位置 (例子:選出所有的 name 這個單詞)

Shift+Alt+→ Expand selection 拓展選定內容
Shift+Alt+← Shrink selection 縮小選定范圍
Shift+Alt + (drag mouse) Column (box) selection (快捷鍵+拖動鼠標)(列(框)選擇)
Ctrl+Shift+Alt + (arrow key) Column (box) selection

(快捷鍵+箭頭鍵) (列(框)選擇)

Ctrl+Shift+Alt +PgUp/PgDn Column (box) selection page up/down (列(框)上/下所有固定位置選中)
Ctrl+Shift+Home/End   從當前光標選中上方/下方所有代碼
Shift+Home/End   選中當前所在行中光標左邊/右邊代碼

 

Rich languages editing (豐富語言編輯)

   
Ctrl+Space Trigger suggestion 觸發建議
Ctrl+Shift+Space Trigger parameter hints 觸發器參數提示
Shift+Alt+F Format document 規范化文檔(就是統一調整格式/規范化)
Ctrl+K Ctrl+F Format selection 規范化選中的內容
F12 Go to Definition 跳轉到定義的位置(例如查看某個函數如何定義的)
Alt+F12 Peek Definition 窺視定義(也是查看)
Ctrl+K F12 Open Definition to the side 查看定義
Ctrl+.  Quick Fix 快速修復
Shift+F12 Show References 顯示引用
F2 Rename Symbol 重命名符號
Ctrl+K Ctrl+X Trim trailing whitespace 修剪尾隨空白
Ctrl+K M Change file language 更改文件語言

 

Editor management (編輯管理)

   
Ctrl+F4, Ctrl+W Close editor 關閉編輯器
Ctrl+K F Close folder 關閉文件夾
Ctrl+\ Split editor 拆分編輯器
Ctrl+ 1 / 2 / 3 Focus into 1st, 2nd or 3rd editor group 聚焦到第一、第二或第三編輯組
Ctrl+K Ctrl+ ←/→ Focus into previous/next editor group 聚焦到上一個/下一個編輯器組
Ctrl+Shift+PgUp / PgDn Move editor left/right 左/右移動編輯器
Ctrl+K ← / → Move active editor group 移動活動編輯器組

 

File management (文件管理)

   
Ctrl+N New File 新建文件
Ctrl+O Open File... 打開文件
Ctrl+S Save 保存
Ctrl+Shift+S Save As.. 另存為
Ctrl+K S Save All 保存所有
Ctrl+F4 Close 關閉
Ctrl+K Ctrl+W Close All 關閉所有
Ctrl+Shift+T Reopen closed editor 重新打開關閉的編輯器
Ctrl+K Enter Keep preview mode editor open 保持預覽模式編輯器打開
Ctrl+Tab Open next 打開下一個文件
Ctrl+Shift+Tab Open previous 打開上一個文件
Ctrl+K P Copy path of active file

活動文件的復制路徑(無效 ,shift+alt+c可以)

Ctrl+K R  Reveal active file in Explorer 在資源管理器中顯示活動文件
Ctrl+K O Show active file in new window/instance 在新窗口/實例中顯示活動文件

 

Display (顯示)

   
F11 Toggle full screen 全屏切換
Shift+Alt+0 Toggle editor layout (horizontal/vertical) 切換編輯器布局(水平/垂直)
Ctrl+ = / - Zoom in/out 放大/縮小
Ctrl+B Toggle Sidebar visibility 切換側邊欄可見性(側邊欄顯示/隱藏)
Ctrl+Shift+E Show Explorer / Toggle focus 顯示資源管理器/切換焦點
Ctrl+Shift+F Show Search 顯示(側邊欄的)搜索
Ctrl+Shift+G Show Source Control  顯示源代碼管理
Ctrl+Shift+D Show Debug 顯示調試
Ctrl+Shift+X Show Extensions 顯示拓展程序
Ctrl+Shift+H Replace in files 在文件中替換
Ctrl+Shift+J Toggle Search details 切換搜索詳細信息
Ctrl+Shift+U Show Output panel 顯示輸出面板
Ctrl+Shift+V Open Markdown preview 打開標記預覽
Ctrl+K V Open Markdown preview to the side 打開側面的標記預覽
Ctrl+K Z Zen Mode (Esc Esc to exit) 禪宗模式(按Esc鍵退出)

 

Debug (調試)

   
F9 Toggle breakpoint 切換斷點
F5 Start/Continue 開始/繼續
Shift+F5 Stop 停止
F11 / Shift+F11 Step into/out 單步調試/跳出
F10 Step over 跳過
Ctrl+K Ctrl+I  Show hover 顯示懸停

 

Integrated terminal (集成終端)

   
Ctrl+`  Show integrated terminal 顯示集成終端
Ctrl+Shift+` Create new terminal 新建終端
Ctrl+C Copy selection 復制
Ctrl+V Paste into active terminal 粘貼
Ctrl+↑ / ↓ Scroll up/down 滾動至上/下(查看代碼)
Shift+PgUp / PgDn Scroll page up/down 滾動至頁面上/下(連續選中)
Ctrl+Home / End Scroll to top/bottom 滾動至頁面頂部/底部

 

其它:    
ctrl + - / = Zoom out / in 調小/調大字體

 

拓展:  
壓縮代碼
選中壓縮的多行,右鍵選擇 命令面板(command palette),輸入 join Lines , 最后按 回車(enter)鍵
多行代碼合並成一行代碼
選中要合並的多行代碼,快捷鍵(ctrl + h),  第一個尋找框輸入(  \n  ) ,第二個被替換框不輸入值。 選擇 全部替換。
更改系統語言
ctrl + shift + p  或者 F1  , 輸入 configure display language, 按回車鍵, 選擇zh-cn 。(前提是提前安裝了Chinese (中文簡體)或其它語言插件)

 多行代碼合並成一行代碼截圖:(警告=》 如果 這個  沒有被選中, 記得選中它,否則 你的操作將無效!)

 

 

其它:在此搜索某個快捷鍵。例如搜索注釋的快捷鍵。 Google瀏覽器中按 ctrl + f , 輸入 注釋  就會跳轉到相關位置。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM