From e05f04677f7dfabe4525e1cf421b003f61764137 Mon Sep 17 00:00:00 2001 From: an920107 Date: Mon, 15 Jul 2024 03:57:09 +0800 Subject: [PATCH] add: update setting for vscode vim --- vscode/keybindings.json | 48 +++++++++++++++++++++++++++++++++++------ vscode/settings.json | 25 ++++++++++++++++++--- 2 files changed, 64 insertions(+), 9 deletions(-) diff --git a/vscode/keybindings.json b/vscode/keybindings.json index 6a367ad..3c124a9 100644 --- a/vscode/keybindings.json +++ b/vscode/keybindings.json @@ -2,13 +2,13 @@ [ // Editor switch { - "key": "ctrl-shift-k", - "command": "workbench.action.previousEditorInGroup", + "key": "ctrl-shift-j", + "command": "workbench.action.nextEditorInGroup", "when": "editorTextFocus && !editorReadonly && vim.active" }, { - "key": "ctrl-shift-j", - "command": "workbench.action.nextEditorInGroup", + "key": "ctrl-shift-k", + "command": "workbench.action.previousEditorInGroup", "when": "editorTextFocus && !editorReadonly && vim.active" }, // Move lines up and down @@ -22,6 +22,27 @@ "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": "workbench.action.quickOpenSelectNext", + "when": "inQuickOpen" + }, + { + "key": "ctrl+k", + "command": "workbench.action.quickOpenSelectPrevious", + "when": "inQuickOpen" + }, // File management { "key": "ctrl+n", @@ -34,14 +55,14 @@ "when": "explorerViewletFocus" }, { - "key": "ctrl+shift+e", + "key": "escape", "command": "workbench.action.toggleSidebarVisibility", "when": "explorerViewletFocus" }, // Terminal management { "key": "ctrl+shift+;", - "command": "workbench.action.togglePanel", + "command": "workbench.action.terminal.toggleTerminal" }, { "key": "ctrl+shift+n", @@ -62,5 +83,20 @@ "key": "ctrl+shift+k", "command": "workbench.action.terminal.focusPrevious", "when": "terminalFocus" + }, + { + "key": "ctrl+shift+l", + "command": "workbench.action.positionPanelRight", + "when": "terminalFocus" + }, + { + "key": "ctrl+shift+j", + "command": "workbench.action.positionPanelBottom", + "when": "terminalFocus" + }, + { + "key": "ctrl+shift+h", + "command": "workbench.action.positionPanelLeft", + "when": "terminalFocus" } ] diff --git a/vscode/settings.json b/vscode/settings.json index 1cfe073..a48a155 100644 --- a/vscode/settings.json +++ b/vscode/settings.json @@ -18,10 +18,12 @@ "MD024": false }, "editor.minimap.enabled": false, + // Vim settings "vim.leader": "", "vim.hlsearch": true, "vim.easymotion": true, "vim.useSystemClipboard": true, + "vim.smartRelativeLine": true, "vim.normalModeKeyBindings": [ { "before": [ @@ -41,6 +43,15 @@ "k" ] }, + { + "before": [ + "/", + "/" + ], + "commands": [ + ":noh" + ] + }, { "before": [ "", @@ -170,12 +181,21 @@ { "before": [ "", - "f" + "g" ], "commands": [ "workbench.action.quickOpen" ] }, + { + "before": [ + "", + "f" + ], + "commands": [ + "workbench.files.action.showActiveFileInExplorer" + ] + }, { "before": [ "", @@ -250,6 +270,5 @@ "editor.action.outdentLines" ] } - ], - "vim.smartRelativeLine": true + ] }