dotfiles/vscode/keybindings.json
Yu Squire[ Yu, Tsung-Ying ] 0071d65eab update vscode
2024-11-01 11:48:06 +08:00

115 lines
3.0 KiB
JSON

// Place your key bindings in this file to override the defaults
[
// Editor switch
{
"key": "ctrl-shift-j",
"command": "workbench.action.nextEditorInGroup",
"when": "editorTextFocus && !editorReadonly && vim.active"
},
{
"key": "ctrl-shift-k",
"command": "workbench.action.previousEditorInGroup",
"when": "editorTextFocus && !editorReadonly && vim.active"
},
// Move lines up and down
{
"key": "alt+j",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus && !editorReadonly && vim.active"
},
{
"key": "alt+k",
"command": "editor.action.moveLinesUpAction",
"when": "editorTextFocus && !editorReadonly && vim.active"
},
// Select up and down
{
"key": "ctrl+j",
"command": "selectNextSuggestion",
"when": "suggestWidgetVisible"
},
{
"key": "ctrl+k",
"command": "selectPrevSuggestion",
"when": "suggestWidgetVisible"
},
{
"key": "ctrl+j",
"command": "selectNextCodeAction",
"when": "codeActionMenuVisible"
},
{
"key": "ctrl+k",
"command": "selectPrevCodeAction",
"when": "codeActionMenuVisible"
},
{
"key": "ctrl+j",
"command": "workbench.action.quickOpenSelectNext",
"when": "inQuickOpen"
},
{
"key": "ctrl+k",
"command": "workbench.action.quickOpenSelectPrevious",
"when": "inQuickOpen"
},
// Code suggest and quick fix
{
"key": "ctrl+/",
"command": "editor.action.triggerSuggest",
"when": "editorTextFocus && !editorReadonly && vim.active"
},
{
"key": "ctrl+.",
"command": "editor.action.quickFix",
"when": "editorTextFocus && !editorReadonly && vim.active"
},
// File management
{
"key": "ctrl+n",
"command": "explorer.newFile",
"when": "explorerViewletFocus"
},
{
"key": "ctrl+shift+n",
"command": "explorer.newFolder",
"when": "explorerViewletFocus"
},
{
"key": "escape",
"command": "workbench.action.toggleSidebarVisibility",
"when": "explorerViewletFocus"
},
// Terminal management
{
"key": "ctrl+shift+;",
"command": "workbench.action.terminal.toggleTerminal"
},
{
"key": "ctrl+shift+n",
"command": "workbench.action.terminal.new",
"when": "terminalFocus"
},
{
"key": "ctrl+shift+w",
"command": "workbench.action.terminal.kill",
"when": "terminalFocus"
},
{
"key": "ctrl+shift+j",
"command": "workbench.action.terminal.focusNext",
"when": "terminalFocus"
},
{
"key": "ctrl+shift+k",
"command": "workbench.action.terminal.focusPrevious",
"when": "terminalFocus"
},
// Outline
{
"key": "escape",
"command": "workbench.action.toggleSidebarVisibility",
"when": "view.outline.visible"
}
]