vscode自定义快捷键
# vscode 自定义快捷键设置
[
// --- 全局命令
// 显示命令面板
{
"key": "ctrl+g c",
"command": "workbench.action.showCommands"
},
// 打开设置页面
{
"key": "ctrl+g s",
"command": "workbench.action.openSettings"
},
// 打开热键映射
{
"key": "ctrl+g k",
"command": "workbench.action.openGlobalKeybindings"
},
// 打开一个目录
{
"key": "ctrl+g m",
"command": "workbench.action.files.openFolder"
},
// 打开一个文件
{
"key": "ctrl+g f",
"command": "workbench.action.files.openFile"
},
// 打开最近记录
{
"key": "ctrl+g r",
"command": "workbench.action.openRecent"
},
// 新建vscode实例
{
"key": "ctrl+g n",
"command": "workbench.action.newWindow"
},
// 关闭vscode实例
{
"key": "ctrl+g q",
"command": "workbench.action.closeWindow"
},
// --- 文件命令
// 新建文件
{
"key": "ctrl+e n",
"command": "welcome.showNewFileEntries",
},
// 打开文件
{
"key": "ctrl+e o",
"command": "workbench.action.files.openFileFolder"
},
// 另存为文件
{
"key": "ctrl+e e",
"command": "workbench.action.files.saveAs"
},
// 保存文件
{
"key": "cctrl+e s",
"command": "workbench.action.files.save"
},
// 保存所有文件
{
"key": "ctrl+e w",
"command": "workbench.action.files.saveAll"
},
// 关闭文件
{
"key": "ctrl+e q",
"command": "workbench.action.closeActiveEditor"
},
// 关闭所有文件
{
"key": "ctrl+e a",
"command": "workbench.action.closeAllEditors"
},
// -- 侧边栏命令
// 切换侧边栏显示状态
{
"key": "ctrl+n n",
"command": "workbench.action.toggleSidebarVisibility"
},
// 显示文件资源管理器
{
"key": "ctrl+n 1",
"command": "workbench.files.action.focusFilesExplorer"
},
// 显示TODO Tree
{
"key": "ctrl+n 2",
"command": "todo-tree-view.focus"
},
// 显示全局搜索
{
"key": "ctrl+n 3",
"command": "workbench.action.replaceInFiles",
},
// 显示debug
{
"key": "ctrl+n 4",
"command": "workbench.view.debug",
"when": "viewContainer.workbench.view.debug.enabled"
},
// 显示版本控制
{
"key": "ctrl+n 5",
"command": "workbench.view.scm",
"when": "workbench.scm.active"
},
// 显示Docker
{
"key": "ctrl+n 6",
"command": "workbench.view.extension.dockerView"
},
// 显示插件商店
{
"key": "ctrl+n 7",
"command": "workbench.view.extensions",
"when": "viewContainer.workbench.view.extensions.enabled"
},
// --- 面板命令
// 切换面板显示状态
{
"key": "ctrl+p [",
"command": "workbench.action.togglePanel"
},
// 显示问题
{
"key": "ctrl+p 1",
"command": "workbench.panel.markers.view.focus"
},
// 显示输出
{
"key": "ctrl+p 2",
"command": "workbench.action.output.toggleOutput",
"when": "workbench.panel.output.active"
},
// 显示终端
{
"key": "ctrl+p 3",
"command": "workbench.action.terminal.toggleTerminal",
"when": "terminal.active"
},
// 显示调试控制台
{
"key": "ctrl+p 4",
"command": "workbench.debug.action.toggleRepl",
"when": "workbench.panel.repl.view.active"
},
// --- 编辑区命令
// 关闭当前选项卡或分屏
{
"key": "ctrl+q",
"command": "workbench.action.closeActiveEditor"
},
// 拆分一个上下分屏
{
"key": "ctrl+w s",
"command": "workbench.action.splitEditorDown"
},
// 拆分一个左右分屏
{
"key": "ctrl+w v",
"command": "workbench.action.splitEditor"
},
// 将光标向上动1屏
{
"key": "ctrl+w k",
"command": "workbench.action.focusAboveGroup"
},
// 将光标向下动1屏
{
"key": "ctrl+w j",
"command": "workbench.action.focusBelowGroup"
},
// 将光标向左移动1屏
{
"key": "ctrl+w h",
"command": "workbench.action.focusLeftGroup"
},
// 将光标向右移动1屏
{
"key": "ctrl+w l",
"command": "workbench.action.focusRightGroup"
},
// --- 代码编辑命令
/**
// 触发帮助提示
{
"key": "ctrl+h",
"command": "editor.action.showHover",
"when": "editorTextFocus"
},
// 触发参数提示
{
"key": "ctrl+shift+p",
"command": "editor.action.triggerParameterHints",
"when": "editorHasSignatureHelpProvider && editorTextFocus"
},
{
"key": "ctrl+shift+p",
"command": "closeParameterHints",
"when": "editorFocus && parameterHintsVisible"
},
// 触发建议提示
{
"key": "ctrl+k",
"command": "editor.action.triggerSuggest",
"when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
},
{
"key": "ctrl+k",
"command": "hideSuggestWidget",
"when": "suggestWidgetVisible && textInputFocus"
},
// 移动到下一个建议
{
"key": "ctrl+n",
"command": "selectNextSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
// 移动到上一个建议
{
"key": "ctrl+p",
"command": "selectPrevSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
// 格式化代码
{
"key": "ctrl+shift+i",
"command": "editor.action.formatDocument",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
},
*/
// 放大字体
{
"key": "ctrl+=",
"command": "editor.action.fontZoomIn"
},
// 缩小字体
{
"key": "ctrl+-",
"command": "editor.action.fontZoomOut"
},
// --- 资源管理器中对文件或目录的操作
// 新建文件
{
"key": "i",
"command": "explorer.newFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus "
},
// 新建目录
{
"key": "o",
"command": "explorer.newFolder",
"when": " explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus "
},
// 刷新资源管理器
{
"key": "r",
"command": "workbench.files.action.refreshFilesExplorer",
"when": " explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus "
},
// 重命名文件或目录
{
"key": "a",
"command": "renameFile",
"when": " explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus "
},
// 删除文件或目录
{
"key": "d",
"command": "deleteFile",
"when": " explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus "
},
// 剪切文件或目录
{
"key": "x",
"command": "filesExplorer.cut",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
// 复制文件或目录
{
"key": "y",
"command": "filesExplorer.copy",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus"
},
// 粘贴文件或目录
{
"key": "p",
"command": "filesExplorer.paste",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus"
},
// 禅模式
{
"key": "ctrl+alt+z",
"command": "workbench.action.toggleZenMode"
}
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
上次更新: 2023/03/10, 00:05:17