Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Kevin's VSCode Keybindings
[
// The following are Kevin's keybindings for VSCode
// They are made available under CC BY 4.0
// == Dendron
// --- Lookup
// journal modifier
{
"key": "ctrl+l m",
"command": "dendron.lookup",
"args": {
"noteType": "journal",
"value": "${fileBasenameNoExtension}"
}
},
// look in people.*
{
"key": "ctrl+l p",
"command": "dendron.lookup",
"args": {
"value": "people.*"
}
},
// kevin comments
{
"key": "ctrl+l c",
"command": "dendron.lookup",
"args": {
"value": "user.kevin.comments.2021.07.",
}
},
// kevin readings hierchy
{
"key": "ctrl+l r",
"command": "dendron.lookup",
"args": {
"value": "readings.journal.2021.06.",
}
},
// --- Search
// Look across all open tasks
// NOTE: the month field needs to manually be kept up to date
{
"key": "ctrl+l t",
"command": "search.action.openNewEditor",
"args": {
"query": "",
"triggerSearch": false,
"focusResults": false,
"isRegexp": true,
"includes": "dendron.journal.backlog.*,user.kevin.journal.2021.07.*,weekly.journal.2021.07.*"
}
},
// Look across all schemas
{
"key": "ctrl+l s",
"command": "search.action.openNewEditor",
"args": {
"query": "",
"triggerSearch": false,
"focusResults": false,
"includes": "*.schema.yml"
}
},
// Open search editor at current hierarchy
{
"key": "ctrl+s f",
"command": "search.action.openNewEditor",
"args": {
"query": ".",
"triggerSearch": true,
"focusResults": false,
"includes": "${fileBasenameNoExtension}*",
"regexp": true,
"showIncludesExcludes": true
}
},
// Look for broken note refs in published site
{
"key": "ctrl+s n",
"command": "search.action.openNewEditor",
"args": {
"query": "# Note Ref Error",
"triggerSearch": true,
"focusResults": true,
"includes": "docs/*",
"excludes": "*.json",
"regexp": true,
"showIncludesExcludes": true
}
},
// Look across my zsh history for the year
{
"key": "ctrl+s b",
"command": "search.action.openNewEditor",
"args": {
"query": "",
"triggerSearch": false,
"focusResults": false,
"includes": "~/.logs/zsh-history-2021-*.log"
}
},
// --- Other
// Create scratch note from highlight
{
"key": "ctrl+s s",
"command": "dendron.lookup",
"args": {
"noteType": "scratch",
"selectionType": "selection2link",
"noConfirm": true
}
},
// Create link from selection
{
"key": "ctrl+s l",
"command": "dendron.lookup",
"args": {
"selectionType": "selection2link",
}
},
// Insert note
{
"key": "cmd+k i",
"command": "dendron.insertNote"
},
// == Extensions
// Markdown Shortcuts
{
"key": "shift+cmd+b",
"command": "md-shortcut.toggleBullets",
"when": "editorTextFocus && markdownShortcuts:enabled"
},
{
"key": "cmd+ctrl+c",
"command": "md-shortcut.toggleInlineCode"
},
{
"key": "cmd+k l",
"command": "md-shortcut.toggleLink"
},
// == Navigation
// --- Terminal
{
"key": "cmd+shift+h",
"command": "workbench.action.terminal.focusPrevious",
"when": "terminalFocus"
},
{
"key": "cmd+shift+l",
"command": "workbench.action.terminal.focusNext",
"when": "terminalFocus"
},
// --- Windows
{
"key": "cmd+1",
"command": "workbench.action.openEditorAtIndex1"
},
{
"key": "cmd+2",
"command": "workbench.action.openEditorAtIndex2"
},
{
"key": "cmd+3",
"command": "workbench.action.openEditorAtIndex3"
},
{
"key": "cmd+4",
"command": "workbench.action.openEditorAtIndex4"
},
{
"key": "cmd+5",
"command": "workbench.action.openEditorAtIndex5"
},
// --- Editor
{
"key": "ctrl+1",
"command": "workbench.action.focusFirstEditorGroup"
},
{
"key": "ctrl+2",
"command": "workbench.action.focusSecondEditorGroup"
},
{
"key": "ctrl+3",
"command": "workbench.action.focusThirdEditorGroup"
},
{
"key": "ctrl+4",
"command": "workbench.action.focusFourthEditorGroup"
},
{
"key": "ctrl+5",
"command": "workbench.action.focusFifthEditorGroup"
},
{
"key": "ctrl+6",
"command": "workbench.action.focusSixthEditorGroup"
},
{
"key": "cmd+shift+[",
"command": "workbench.action.previousEditor"
},
// == Display
// Maximize Terminal
{
"command": "workbench.action.toggleMaximizedPanel",
"key": "cmd+ctrl+j"
},
// Toggle current window size
{
"command": "workbench.action.toggleEditorWidths",
"key": "ctrl+cmd+m"
},
// Toggle Sidebar
{
"command": "workbench.action.toggleSidebarVisibility",
"key": "cmd+ctrl+space"
},
// Close all right editors
{
"command": "workbench.action.closeEditorsToTheRight",
"key": "cmd+ctrl+r"
},
// === Editor
// --- General
// Trigger intellisense
{
"command": "editor.action.triggerSuggest",
"key": "shift+cmd+space"
},
// Insert snippet
{
"key": "ctrl+i",
"command": "editor.action.insertSnippet",
},
// Go to definition
{
"command": "editor.action.revealDefinition",
"key": "ctrl+enter",
"when": "editorFocus"
},
// Peek Definition
{
"key": "ctrl+p",
"command": "editor.action.peekDefinition"
},
{
"command": "copyRelativeFilePath",
"key": "ctrl+n",
"when": "editorFocus"
},
// --- Code
// Navigate to next problem
{
"command": "editor.action.marker.nextInFiles",
"key": "shift+down"
},
// Toggle between terminal and editor
{
"key": "ctrl+y",
"command": "workbench.action.terminal.focus"
},
{
"key": "ctrl+y",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
// == Conflicts
// These commands conflict wiith existing
{
"command": "-workbench.action.terminal.resizePaneRight"
},
{
"key": "cmd+shift+j",
"command": "-jumpToNextSnippetPlaceholder"
},
{
"key": "shift+cmd+l",
"command": "-editor.action.selectHighlights",
"when": "editorFocus"
},
{
"key": "tab",
"command": "-markdown.extension.onTabKey",
"when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !suggestWidgetVisible && editorLangId == 'markdown'"
},
{
"key": "cmd+v",
"command": "-markdown.extension.editing.paste",
"when": "editorHasSelection && editorTextFocus && editorLangId == 'markdown'"
},
{
"key": "cmd+v",
"command": "-extension.vim_cmd+v",
"when": "editorTextFocus && vim.active && vim.overrideCmdV && vim.use<D-v> && !inDebugRepl"
},
{
"key": "cmd+o",
"command": "-workbench.action.files.openLocalFileFolder",
"when": "remoteFileDialogVisible"
},
{
"key": "ctrl+shift+l",
"command": "-md-shortcut.toggleImage",
"when": "editorTextFocus && markdownShortcuts:enabled"
},
{
"key": "cmd+l",
"command": "-expandLineSelection",
"when": "textInputFocus"
},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment