-
Notifications
You must be signed in to change notification settings - Fork 0
/
Get-VSCodeKeyBindings.ps1
227 lines (227 loc) · 16.3 KB
/
Get-VSCodeKeyBindings.ps1
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
function Get-VSCodeKeyBindings {
<#
.Synopsis
Get VSCode Key Bindings
.Description
Get VSCode Key Bindings
.Example
Get-VSCodeKeyBindings jump
.Example
Get-VSCodeKeyBindings | ? Command -match open
.Example
Get-VSCodeKeyBindings | ? Category -match navi
.Example
Get-VSCodeKeyBindings | oss | sls open | Out-ColorMatchInfo
.Example
gvscodekey "open|replace"
.Example
"jump" | gvscodekey
#>
[CmdletBinding()]
[Alias("gvscodekey")]
param (
[Parameter(Mandatory=$False,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]$query
)
begin {
$VSCodeKeyBindings=@'
"Category","Key","Command","Command id"
"BasicEdit","Ctrl+X","Cut line (empty selection)","editor.action.clipboardCutAction"
"BasicEdit","Ctrl+C","Copy line (empty selection)","editor.action.clipboardCopyAction"
"BasicEdit","Ctrl+Shift+K","Delete Line","editor.action.deleteLines"
"BasicEdit","Ctrl+Enter","Insert Line Below","editor.action.insertLineAfter"
"BasicEdit","Ctrl+Shift+Enter","Insert Line Above","editor.action.insertLineBefore"
"BasicEdit","Alt+Down","Move Line Down","editor.action.moveLinesDownAction"
"BasicEdit","Alt+Up","Move Line Up","editor.action.moveLinesUpAction"
"BasicEdit","Shift+Alt+Down","Copy Line Down","editor.action.copyLinesDownAction"
"BasicEdit","Shift+Alt+Up","Copy Line Up","editor.action.copyLinesUpAction"
"BasicEdit","Ctrl+D","Add Selection To Next Find Match","editor.action.addSelectionToNextFindMatch"
"BasicEdit","Ctrl+K Ctrl+D","Move Last Selection To Next Find Match","editor.action.moveSelectionToNextFindMatch"
"BasicEdit","Ctrl+U","Undo last cursor operation","cursorUndo"
"BasicEdit","Shift+Alt+I","Insert cursor at end of each line selected","editor.action.insertCursorAtEndOfEachLineSelected"
"BasicEdit","Ctrl+Shift+L","Select all occurrences of current selection","editor.action.selectHighlights"
"BasicEdit","Ctrl+F2","Select all occurrences of current word","editor.action.changeAll"
"BasicEdit","Ctrl+I","Select current line","expandLineSelection"
"BasicEdit","Ctrl+Alt+Down","Insert Cursor Below","editor.action.insertCursorBelow"
"BasicEdit","Ctrl+Alt+Up","Insert Cursor Above","editor.action.insertCursorAbove"
"BasicEdit","Ctrl+Shift+\","Jump to matching bracket","editor.action.jumpToBracket"
"BasicEdit","Ctrl+]","Indent Line","editor.action.indentLines"
"BasicEdit","Ctrl+[","Outdent Line","editor.action.outdentLines"
"BasicEdit","Home","Go to Beginning of Line","cursorHome"
"BasicEdit","End","Go to End of Line","cursorEnd"
"BasicEdit","Ctrl+End","Go to End of File","cursorBottom"
"BasicEdit","Ctrl+Home","Go to Beginning of File","cursorTop"
"BasicEdit","Ctrl+Down","Scroll Line Down","scrollLineDown"
"BasicEdit","Ctrl+Up","Scroll Line Up","scrollLineUp"
"BasicEdit","Alt+PageDown","Scroll Page Down","scrollPageDown"
"BasicEdit","Alt+PageUp","Scroll Page Up","scrollPageUp"
"BasicEdit","Ctrl+Shift+[","Fold (collapse) region","editor.fold"
"BasicEdit","Ctrl+Shift+]","Unfold (uncollapse) region","editor.unfold"
"BasicEdit","Ctrl+K Ctrl+[","Fold (collapse) all subregions","editor.foldRecursively"
"BasicEdit","Ctrl+K Ctrl+]","Unfold (uncollapse) all subregions","editor.unfoldRecursively"
"BasicEdit","Ctrl+K Ctrl+0","Fold (collapse) all regions","editor.foldAll"
"BasicEdit","Ctrl+K Ctrl+J","Unfold (uncollapse) all regions","editor.unfoldAll"
"BasicEdit","Ctrl+K Ctrl+C","Add Line Comment","editor.action.addCommentLine"
"BasicEdit","Ctrl+K Ctrl+U","Remove Line Comment","editor.action.removeCommentLine"
"BasicEdit","Ctrl+/","Toggle Line Comment","editor.action.commentLine"
"BasicEdit","Shift+Alt+A","Toggle Block Comment","editor.action.blockComment"
"BasicEdit","Ctrl+F","Find","actions.find"
"BasicEdit","Ctrl+H","Replace","editor.action.startFindReplaceAction"
"BasicEdit","F3","Find Next","editor.action.nextMatchFindAction"
"BasicEdit","Shift+F3","Find Previous","editor.action.previousMatchFindAction"
"BasicEdit","Alt+Enter","Select All Occurrences of Find Match","editor.action.selectAllMatches"
"BasicEdit","Alt+C","Toggle Find Case Sensitive","toggleFindCaseSensitive"
"BasicEdit","Alt+R","Toggle Find Regex","toggleFindRegex"
"BasicEdit","Alt+W","Toggle Find Whole Word","toggleFindWholeWord"
"BasicEdit","Ctrl+M","Toggle Use of Tab Key for Setting Focus","editor.action.toggleTabFocusMode"
"BasicEdit","unassigned","Toggle Render Whitespace","toggleRenderWhitespace"
"BasicEdit","Alt+Z","Toggle Word Wrap","editor.action.toggleWordWrap"
"RichLangEdit","Ctrl+Space","Trigger Suggest","editor.action.triggerSuggest"
"RichLangEdit","Ctrl+Shift+Space","Trigger Parameter Hints","editor.action.triggerParameterHints"
"RichLangEdit","Shift+Alt+F","Format Document","editor.action.formatDocument"
"RichLangEdit","Ctrl+K Ctrl+F","Format Selection","editor.action.formatSelection"
"RichLangEdit","F12","Go to Definition","editor.action.goToDeclaration"
"RichLangEdit","Ctrl+K Ctrl+I","Show Hover","editor.action.showHover"
"RichLangEdit","Alt+F12","Peek Definition","editor.action.previewDeclaration"
"RichLangEdit","Ctrl+K F12","Open Definition to the Side","editor.action.openDeclarationToTheSide"
"RichLangEdit","Ctrl+.","Quick Fix","editor.action.quickFix"
"RichLangEdit","Shift+F12","Show References","editor.action.referenceSearch.trigger"
"RichLangEdit","F2","Rename Symbol","editor.action.rename"
"RichLangEdit","Ctrl+Shift+.","Replace with Next Value","editor.action.inPlaceReplace.down"
"RichLangEdit",""Ctrl+Shift+",""","Replace with Previous Value","editor.action.inPlaceReplace.up"
"RichLangEdit","Shift+Alt+Right","Expand AST Select","editor.action.smartSelect.grow"
"RichLangEdit","Shift+Alt+Left","Shrink AST Select","editor.action.smartSelect.shrink"
"RichLangEdit","Ctrl+K Ctrl+X","Trim Trailing Whitespace","editor.action.trimTrailingWhitespace"
"RichLangEdit","Ctrl+K M","Change Language Mode","workbench.action.editor.changeLanguageMode"
"Navigation","Ctrl+T","Show All Symbols","workbench.action.showAllSymbols"
"Navigation","Ctrl+G","Go to Line...","workbench.action.gotoLine"
"Navigation","Ctrl+P",""Go to File...","Quick Open"","workbench.action.quickOpen"
"Navigation","Ctrl+Shift+O","Go to Symbol...","workbench.action.gotoSymbol"
"Navigation","Ctrl+Shift+M","Show Problems","workbench.actions.view.problems"
"Navigation","F8","Go to Next Error or Warning","editor.action.marker.nextInFiles"
"Navigation","Shift+F8","Go to Previous Error or Warning","editor.action.marker.prevInFiles"
"Navigation","Ctrl+Shift+P","Show All Commands","workbench.action.showCommands"
"Navigation","Ctrl+Shift+Tab","Navigate Editor Group History","workbench.action.openPreviousRecentlyUsedEditorInGroup"
"Navigation","Alt+Left","Go Back","workbench.action.navigateBack"
"Navigation","Alt+Right","Go Forward","workbench.action.navigateForward"
"ColumnSelect","Ctrl+Shift+Alt+Down","Column Select Down","cursorColumnSelectDown"
"ColumnSelect","Ctrl+Shift+Alt+Up","Column Select Up","cursorColumnSelectUp"
"ColumnSelect","Ctrl+Shift+Alt+Left","Column Select Left","cursorColumnSelectLeft"
"ColumnSelect","Ctrl+Shift+Alt+Right","Column Select Right","cursorColumnSelectRight"
"ColumnSelect","Ctrl+Shift+Alt+PageDown","Column Select Page Down","cursorColumnSelectPageDown"
"ColumnSelect","Ctrl+Shift+Alt+PageUp","Column Select Page Up","cursorColumnSelectPageUp"
"EditorMgmt","Ctrl+Shift+N","New Window","workbench.action.newWindow"
"EditorMgmt","Ctrl+W","Close Window","workbench.action.closeWindow"
"EditorMgmt","Ctrl+F4","Close Editor","workbench.action.closeActiveEditor"
"EditorMgmt","Ctrl+K F","Close Folder","workbench.action.closeFolder"
"EditorMgmt","unassigned","Cycle Between Editor Groups","workbench.action.navigateEditorGroups"
"EditorMgmt","Ctrl+\","Split Editor","workbench.action.splitEditor"
"EditorMgmt","Ctrl+1","Focus into First Editor Group","workbench.action.focusFirstEditorGroup"
"EditorMgmt","Ctrl+2","Focus into Second Editor Group","workbench.action.focusSecondEditorGroup"
"EditorMgmt","Ctrl+3","Focus into Third Editor Group","workbench.action.focusThirdEditorGroup"
"EditorMgmt","unassigned","Focus into Editor Group on the Left","workbench.action.focusPreviousGroup"
"EditorMgmt","unassigned","Focus into Editor Group on the Right","workbench.action.focusNextGroup"
"EditorMgmt","Ctrl+Shift+PageUp","Move Editor Left","workbench.action.moveEditorLeftInGroup"
"EditorMgmt","Ctrl+Shift+PageDown","Move Editor Right","workbench.action.moveEditorRightInGroup"
"EditorMgmt","Ctrl+K Left","Move Active Editor Group Left","workbench.action.moveActiveEditorGroupLeft"
"EditorMgmt","Ctrl+K Right","Move Active Editor Group Right","workbench.action.moveActiveEditorGroupRight"
"EditorMgmt","Ctrl+Alt+Right","Move Editor into Next Group","workbench.action.moveEditorToNextGroup"
"EditorMgmt","Ctrl+Alt+Left","Move Editor into Previous Group","workbench.action.moveEditorToPreviousGroup"
"FileMgmt","Ctrl+N","New File","workbench.action.files.newUntitledFile"
"FileMgmt","Ctrl+O","Open File...","workbench.action.files.openFile"
"FileMgmt","Ctrl+S","Save","workbench.action.files.save"
"FileMgmt","Ctrl+K S","Save All","workbench.action.files.saveAll"
"FileMgmt","Ctrl+Shift+S","Save As...","workbench.action.files.saveAs"
"FileMgmt","Ctrl+F4","Close","workbench.action.closeActiveEditor"
"FileMgmt","unassigned","Close Others","workbench.action.closeOtherEditors"
"FileMgmt","Ctrl+K W","Close Group","workbench.action.closeEditorsInGroup"
"FileMgmt","unassigned","Close Other Groups","workbench.action.closeEditorsInOtherGroups"
"FileMgmt","unassigned","Close Group to Left","workbench.action.closeEditorsToTheLeft"
"FileMgmt","unassigned","Close Group to Right","workbench.action.closeEditorsToTheRight"
"FileMgmt","Ctrl+K Ctrl+W","Close All","workbench.action.closeAllEditors"
"FileMgmt","Ctrl+Shift+T","Reopen Closed Editor","workbench.action.reopenClosedEditor"
"FileMgmt","Ctrl+K Enter","Keep Open","workbench.action.keepEditor"
"FileMgmt","Ctrl+Tab","Open Next","workbench.action.openNextRecentlyUsedEditorInGroup"
"FileMgmt","Ctrl+Shift+Tab","Open Previous","workbench.action.openPreviousRecentlyUsedEditorInGroup"
"FileMgmt","Ctrl+K P","Copy Path of Active File","workbench.action.files.copyPathOfActiveFile"
"FileMgmt","Ctrl+K R","Reveal Active File in Windows","workbench.action.files.revealActiveFileInWindows"
"FileMgmt","Ctrl+K O","Show Opened File in New Window","workbench.action.files.showOpenedFileInNewWindow"
"FileMgmt","unassigned","Compare Opened File With","workbench.files.action.compareFileWith"
"Display","F11","Toggle Full Screen","workbench.action.toggleFullScreen"
"Display","Ctrl+K Z","Toggle Zen Mode","workbench.action.toggleZenMode"
"Display","Escape Escape","Leave Zen Mode","workbench.action.exitZenMode"
"Display","Ctrl+=","Zoom in","workbench.action.zoomIn"
"Display","Ctrl+-","Zoom out","workbench.action.zoomOut"
"Display","Ctrl+Numpad0","Reset Zoom","workbench.action.zoomReset"
"Display","Ctrl+B","Toggle Sidebar Visibility","workbench.action.toggleSidebarVisibility"
"Display","Ctrl+Shift+E","Show Explorer / Toggle Focus","workbench.view.explorer"
"Display","Ctrl+Shift+F","Show Search","workbench.view.search"
"Display","Ctrl+Shift+G","Show Source Control","workbench.view.scm"
"Display","Ctrl+Shift+D","Show Debug","workbench.view.debug"
"Display","Ctrl+Shift+X","Show Extensions","workbench.view.extensions"
"Display","Ctrl+Shift+U","Show Output","workbench.action.output.toggleOutput"
"Display","Ctrl+Q","Quick Open View","workbench.action.quickOpenView"
"Display","Ctrl+Shift+C","Open New Command Prompt","workbench.action.terminal.openNativeConsole"
"Display","Ctrl+Shift+V","Toggle Markdown Preview","markdown.showPreview"
"Display","Ctrl+K V","Open Preview to the Side","markdown.showPreviewToSide"
"Display","Ctrl+`","Toggle Integrated Terminal","workbench.action.terminal.toggleTerminal"
"Search","Ctrl+Shift+F","Show Search","workbench.view.search"
"Search","Ctrl+Shift+H","Replace in Files","workbench.action.replaceInFiles"
"Search","Alt+C","Toggle Match Case","toggleSearchCaseSensitive"
"Search","Alt+W","Toggle Match Whole Word","toggleSearchWholeWord"
"Search","Alt+R","Toggle Use Regular Expression","toggleSearchRegex"
"Search","Ctrl+Shift+J","Toggle Search Details","workbench.action.search.toggleQueryDetails"
"Search","F4","Focus Next Search Result","search.action.focusNextSearchResult"
"Search","Shift+F4","Focus Previous Search Result","search.action.focusPreviousSearchResult"
"Search","unassigned","Show Next Search Term","search.history.showNext"
"Search","unassigned","Show Previous Search Term","search.history.showPrevious"
"Preferences",""Ctrl+",""","Open Settings","workbench.action.openSettings"
"Preferences","unassigned","Open Workspace Settings","workbench.action.openWorkspaceSettings"
"Preferences","Ctrl+K Ctrl+S","Open Keyboard Shortcuts","workbench.action.openGlobalKeybindings"
"Preferences","unassigned","Open User Snippets","workbench.action.openSnippets"
"Preferences","Ctrl+K Ctrl+T","Select Color Theme","workbench.action.selectTheme"
"Preferences","unassigned","Configure Display Language","workbench.action.configureLocale"
"Debug","F9","Toggle Breakpoint","editor.debug.action.toggleBreakpoint"
"Debug","F5","Start","workbench.action.debug.start"
"Debug","F5","Continue","workbench.action.debug.continue"
"Debug","Ctrl+F5","Start (without debugging)","workbench.action.debug.run"
"Debug","F6","Pause","workbench.action.debug.pause"
"Debug","F11","Step Into","workbench.action.debug.stepInto"
"Debug","Shift+F11","Step Out","workbench.action.debug.stepOut"
"Debug","F10","Step Over","workbench.action.debug.stepOver"
"Debug","Shift+F5","Stop","workbench.action.debug.stop"
"Debug","Ctrl+K Ctrl+I","Show Hover","editor.debug.action.showDebugHover"
"Tasks","Ctrl+Shift+B","Run Build Task","workbench.action.tasks.build"
"Tasks","unassigned","Run Test Task","workbench.action.tasks.test"
"Extensions","unassigned","Install Extension","workbench.extensions.action.installExtension"
"Extensions","unassigned","Show Installed Extensions","workbench.extensions.action.showInstalledExtensions"
"Extensions","unassigned","Show Outdated Extensions","workbench.extensions.action.listOutdatedExtensions"
"Extensions","unassigned","Show Recommended Extensions","workbench.extensions.action.showRecommendedExtensions"
"Extensions","unassigned","Show Popular Extensions","workbench.extensions.action.showPopularExtensions"
"Extensions","unassigned","Update All Extensions","workbench.extensions.action.updateAllExtensions"
"CLI","code --help","Help"
"CLI","code .","Open code with current directory"
"CLI","code -r .","Open the current directory in the most recently used code window"
"CLI","code -n","Create a new window"
"CLI","code --locale=es","Change the language"
"CLI","code --diff <file1> <file2>","Open diff editor"
"CLI","code --goto package.json:10:5","Open file at specific line and column <file:line[:character]>"
"CLI","code --disable-extensions .","Disable all extensions"
"CLI","code --extensions-dir <dir>","Set the root path for extensions"
"CLI","code --list-extensions","Ist the installed extensions"
"CLI","code --show-versions","Show versions of installed extensions,when using --list-extension"
"CLI","code --install-extension <extension-id>","Installs or updates the extension. Use `--force` argument to avoid prompts"
"CLI","code --uninstall-extension <extension-id>","Uninstalls an extension"
"CLI","code -a --add <folder>","Add folder(s) to the last active window"
"CLI","code -v --version","Print version"
"CLI","code -s --status","Print process usage and diagnostics information"
'@
if (!$psboundparameters.count) {
if (gcm rmel -ea ignore) {help -ex $PSCmdlet.MyInvocation.MyCommand.Name | Out-String | Remove-EmptyLines; return}
else {help -ex $PSCmdlet.MyInvocation.MyCommand.Name; return}
}
}
process {
if ($query) {convertfrom-csv $VSCodeKeyBindings -Delimiter "," | ? 'Command' -match "$query"}
else {convertfrom-csv $VSCodeKeyBindings -Delimiter ","}
}
}