本篇記錄一下 Visual Studio Code 常用快捷鍵,特別是在用 vscode trace code 時,常常需要跳至定義處 go to definition,善用 VS Code 快捷鍵會快很多,效率大幅提升。
| 名稱 | Windows | macOS | Linux | 備註 |
|---|---|---|---|---|
| 跳至定義處 (Go to Definition) | F12 |
F12 |
F12 |
|
| 返回 (Go Back/Navigate Back) | Alt+ ← |
Ctrl+- |
Ctrl+Alt+- |
(不是數字鍵盤的減號) |
| 前進 (Go Forward/Navigate Forward) | Alt +→ |
Ctrl+Shift+- |
Ctrl+Shift+- |
(不是數字鍵盤的減號) |
| Find All References | Alt+Shift+F12 |
Option+Shift+F12 |
Alt+Shift+F12 |
|
| 左右括號之間跳轉 (Go to Bracket) | Ctrl+Shift+\ |
Cmd+Shift+\ |
Ctrl+Shift+\ |
|
| 顯示搜尋 (Show Search) | Ctrl+Shift+F |
Cmd+Shift+F |
Ctrl+Shift+F |
顯示所有指令(Show All Commands) Ctrl+Shift+p
Find All References 在 Visual Studio Code 1.27.x cpptool 0.18.1 有問題, 貌似 1.36.x 才能用, 我用 Visual Studio Code 1.49.2 搭配 cpptool 1.0.1 確定可用。
透過下列方式可以搜尋查詢更多的快捷鍵或更換,1
Visual Studio Code 左下角的 管理/Manage > 鍵盤快捷方式/Keyboard Shortcuts
參考
Go to definition and back to reference in visual Studio Code - Stack Overflow
https://stackoverflow.com/questions/42492925/go-to-definition-and-back-to-reference-in-visual-studio-code
Visual Studio Code Key Bindings
https://code.visualstudio.com/docs/getstarted/keybindings
官方 Visual Studio Code 快速鍵一覽表
https://blog.poychang.net/vscode-shortcuts/
VS Code 快捷鍵(中英文對照版)_weixin_34358365的博客-CSDN博客
https://blog.csdn.net/weixin_34358365/article/details/89133959
VSCode 返回上一个光标 (上一个浏览位置)_还是上会网吧~-CSDN博客
https://blog.csdn.net/M_N_N/article/details/84581840
其它相關文章推薦
Visual Studio Code 安裝 C/C++11 環境教學
VS Code 新增 C++ 標頭檔路徑
C/C++ clang-format 對程式碼風格排版格式化
Qt Creator 常用快捷鍵
vim 常用快捷鍵