Skip to content

Instantly share code, notes, and snippets.

@mpontus
Last active November 27, 2021 16:10
Show Gist options
  • Save mpontus/8cd37f96ae12b4f905add20f38330deb to your computer and use it in GitHub Desktop.
Save mpontus/8cd37f96ae12b4f905add20f38330deb to your computer and use it in GitHub Desktop.
"when" conditions from VSCode's default keyboard shortcuts

Extracted by rummomg:

cat ~/.config/Code*/User/keybindings.json | \
  jq -r '.[].when|select(. != null)|split(" && ")]|flatten|unique|sort|join("\n")'

Also check out Inspect Context Keys command.

!activeEditorIsPinned
!breakpointSelected
!config.breadcrumbs.enabled
!config.editor.stablePeek
!editorFocus
!editorHasDocumentFormattingProvider
!editorHasSelection
!editorHoverVisible
!editorIsOpen
!editorReadonly
!editorTabMovesFocus
!editorTextFocus
!explorerResourceIsFolder
!explorerResourceIsRoot
!explorerResourceMoveableToTrashcomm
!explorerResourceReadonly
!explorerViewletCompressedFirstFocus
!explorerViewletCompressedLastFocus
!expressionSelected
!findWidgetVisible
!hasOtherSuggestions
!inCompositeEditor
!inDebugMode
!inDebugRepl
!inDebugRepl || vim.active
!inReferenceSearchEditor
!inSettingsSearch
!inSnippetMode
!inputFocus
!isComposing
!isInEmbeddedEditor
!multipleEditorGroups
!notebookCellInputIsCollapsed
!notebookCellOutputIsCollapsed
!notebookEditorFocused
!parameterHintsVisible
!quokka.isLiveShareClient
!searchInputBoxFocus
!searchViewletVisible
!suggestWidgetVisible
!terminalFindVisible
!terminalFocus
!wallaby.traceBeingNavigated
acceptSuggestionOnEnter
accessibilityHelpWidgetVisible
accessibilityModeEnabled
activeEditor == 'WebviewEditor'
activeEditor == 'workbench.editor.extension'
activeEditor == 'workbench.editor.notebook'
activeEditorGroupEmpty
activeEditorIsPinned
atEndOfWord
breadcrumbsActive
breadcrumbsPossible
breadcrumbsVisible
breakpointWidgetVisible
breakpointsFocused
callHierarchyDirection == 'incomingCalls'
callHierarchyDirection == 'outgoingCalls'
callHierarchyVisible
cancellableOperation
commentEditorFocused
config.editor.rename.enablePreview
config.editor.tabCompletion == 'on'
config.emmet.triggerExpansionOnTab
debugConfigurationType == 'node'
debugState != 'inactive'
debugState == 'running'
debugState == 'stopped'
debuggersAvailable
dirtyDiffVisible
editorColumnSelection
editorFocus
editorFocus || editorIsOpen
editorHasCallHierarchyProvider
editorHasCodeActionsProvider
editorHasCompletionItemProvider
editorHasDefinitionProvider
editorHasDocumentFormattingProvider
editorHasDocumentSelectionFormattingProvider
editorHasImplementationProvider
editorHasMultipleSelections
editorHasReferenceProvider
editorHasRenameProvider
editorHasSelection
editorHasSignatureHelpProvider
editorLangId == 'jsonc'
editorLangId == 'markdown'
editorTextFocus
emptyWorkspaceSupport
explorerResourceCut
explorerResourceIsFolder
explorerResourceMoveableToTrash
explorerViewletCompressedFocus
explorerViewletFocus
explorerViewletVisible
fileMatchFocus
fileMatchOrFolderMatchWithResourceFocus
fileMatchOrMatchFocus
filesExplorerFocus
findInputFocussed
findWidgetVisible
firstMatchFocus
focusedView != ''
focusedView == 'refactorPreview'
focusedView == 'workbench.panel.markers.view'
folderMatchFocus
foldingEnabled
hasNextTabstop
hasOtherSuggestions
hasPrevTabstop
hasSearchResult
hasSearchResult || inSearchEditor
hasSnippetCompletions
hasSymbols
hasWordHighlights
historyNavigationEnabled
historyNavigationWidget
inBreakpointWidget
inCompositeEditor
inDebugMode
inDebugRepl
inEditorsPicker
inFilesPicker
inKeybindings
inKeybindingsSearch
inQuickOpen
inRecentFilesPicker
inReferenceSearchEditor
inReferenceSearchEditor || referenceSearchVisible
inSearchEditor
inSearchEditor || searchViewletFocus
inSettingsEditor
inSettingsSearch
inSnippetMode
inZenMode
inputBoxFocus || inputBoxFocus
inputFocus
interactivePlaygroundFocus
interfaceOverviewVisible
isDevelopment
isInDiffEditor
keybindingFocus
listFocus
listHasSelectionOrFocus
listSupportsKeyboardNavigation
listSupportsMultiselect
markersNavigationVisible
matchFocus
messageVisible
multipleEditorGroups
notebookCellEditable
notebookCellEditorFocused
notebookCellHasOutputs
notebookCellInputIsCollapsed
notebookCellListFocused
notebookCellOutputIsCollapsed
notebookCellType == 'code'
notebookCellType == 'markdown'
notebookEditable
notebookEditorCursorAtBoundary != 'bottom'
notebookEditorCursorAtBoundary != 'none'
notebookEditorCursorAtBoundary != 'top'
notebookEditorFocused
notebookFindWidgetFocused
notebookOutputFocused
notificationCenterVisible
notificationFocus
notificationToastsVisible
onTypeRenameInputVisible
parameterHintsMultipleSignatures
parameterHintsVisible
problemFocus
problemsFilterFocus
quokka.hasActiveSession
refactorPreview.enabled
refactorPreview.hasCheckedChanges
reference-list.hasResult
referenceSearchVisible
references-view.canNavigate
remoteFileDialogVisible
renameInputVisible
replaceActive
replaceInputBoxFocus
replaceInputFocussed
scmInputIsInFirstLine
scmInputIsInLastLine
scmRepository
searchInputBoxFocus
searchViewletFocus
searchViewletVisible
selectionAnchorSet
settingRowFocus
settingsTocRowFocus
statusBarFocused
suggestWidgetMultipleSuggestions
suggestWidgetVisible
suggestionMakesTextEdit
supportedCodeAction =~ /(\s|^)quickfix\b/
supportedCodeAction =~ /(\s|^)source\.organizeImports\b/
terminalA11yTreeFocus
terminalFindFocused
terminalFindVisible
terminalFocus
terminalProcessSupported
terminalProcessSupported || accessibilityModeEnabled
terminalProcessSupported || terminalFocus
terminalTextSelected
textCompareEditorVisible
textInputFocus
tunnelCloseable
tunnelType == 'Detected' || tunnelViewFocus
tunnelType == 'Forwarded'
tunnelViewFocus
variablesFocused
vim.active
vim.mode != 'Insert'
vim.mode == 'CommandlineInProgress' || editorTextFocus
vim.mode == 'CommandlineInProgress' || vim.active
vim.mode == 'SearchInProgressMode'
vim.overrideCmdV
vim.overrideCopy
vim.overrideCtrlC
vim.use<C-BS>
vim.use<C-[>
vim.use<C-]>
vim.use<C-a>
vim.use<C-b>
vim.use<C-c>
vim.use<C-e>
vim.use<C-f>
vim.use<C-g>
vim.use<C-h>
vim.use<C-i>
vim.use<C-j>
vim.use<C-k>
vim.use<C-l>
vim.use<C-m>
vim.use<C-n>
vim.use<C-o>
vim.use<C-p>
vim.use<C-pagedown>
vim.use<C-pageup>
vim.use<C-q>
vim.use<C-r>
vim.use<C-shift+2>
vim.use<C-space>
vim.use<C-t>
vim.use<C-u>
vim.use<C-v>
vim.use<C-w>
vim.use<C-x>
vim.use<C-y>
vim.use<D-a>
vim.use<D-c>
vim.use<D-d>
vim.use<D-left>
vim.use<D-right>
vim.use<D-v>
vim.use<shift+BS>
wallaby.started
wallaby.testFilterToggled
wallaby.traceBeingNavigated
wallaby.uncoveredToggled
watchExpressionsFocused
webviewFindWidgetFocused
webviewFindWidgetVisible
workbench.explorer.openEditorsView.active
@pokey
Copy link

pokey commented Nov 27, 2021

oh man check out that jq-fu 😊. TIL jq has flatten built-in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment