feat(vscode-vim): vim keymap fixes, enhancements & statusbar color

changes

- change: alt+q -> ctrl+t - toggle terminal
- remove: shift+f1 - toggle terminal
- fix: shift+escape - toggle and focus side bar. Was not in focus
- new: navigate through items in sidebar using j & k
  earlier
- fix: navigate popup options using ctrl+n & ctrl+p
- new: change statusbar color on mode change
- fix: make yank highlight stay a little longer
This commit is contained in:
Pratik Tripathy
2025-01-20 21:54:44 +05:30
parent 27b1f7e9ed
commit 86523fab1a
2 changed files with 59 additions and 9 deletions

View File

@@ -25,11 +25,11 @@
"when": "editorTextFocus"
},
{
"key": "alt+q",
"key": "ctrl+t",
"command": "workbench.action.terminal.focus"
},
{
"key": "alt+q",
"key": "ctrl+t",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
@@ -58,17 +58,56 @@
"key": "ctrl+shift+j",
"command": "workbench.action.togglePanel"
},
{
"key": "shift+f1",
"command": "workbench.action.terminal.toggleTerminal",
"when": "terminal.active"
},
{
"key": "shift+escape",
"command": "workbench.action.toggleSidebarVisibility"
},
{
"key": "shift+escape",
"command": "workbench.action.focusSideBar",
"when": "editorTextFocus",
},
{
"key": "shift+escape",
"command": "workbench.action.toggleSidebarVisibility",
"when": "editorFocus && sideBarVisible",
},
// vim.keybindings
// quick open navigation
{
"key": "ctrl+n",
"command": "workbench.action.quickOpenSelectNext",
"when": "inQuickOpen"
},
{
"key": "ctrl+p",
"command": "workbench.action.quickOpenSelectPrevious",
"when": "inQuickOpen"
},
{
"key": "ctrl+n",
"command": "extension.vim_ctrl+n",
"when": "editorTextFocus && vim.active && vim.use<C-n> && !inDebugRepl || vim.active && vim.use<C-n> && !inDebugRepl && vim.mode == 'CommandlineInProgress' || vim.active && vim.use<C-n> && !inDebugRepl && vim.mode == 'SearchInProgressMode' && !inQuickOpen"
},
{
"key": "ctrl+p",
"command": "extension.vim_ctrl+p",
"when": "editorTextFocus && vim.active && vim.use<C-p> && !inDebugRepl || vim.active && vim.use<C-p> && !inDebugRepl && vim.mode == 'CommandlineInProgress' || vim.active && vim.use<C-p> && !inDebugRepl && vim.mode == 'SearchInProgressMode' && !inQuickOpen"
},
// sidebar
{
"key": "j",
"command": "list.focusAnyDown",
"when": "sideBarFocus && !inputFocus"
},
{
"key": "k",
"command": "list.focusAnyUp",
"when": "sideBarFocus && !inputFocus"
},
// Navigation
{
"key": "ctrl+h",
@@ -176,7 +215,7 @@
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "c",
"key": "y",
"command": "filesExplorer.copy",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
@@ -353,4 +392,4 @@
// "command": "selectPrevSuggestion",
// "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
// },
]
],

View File

@@ -105,11 +105,22 @@
"vim.showMarksInGutter": true,
"vim.replaceWithRegister": true,
"vim.highlightedyank.enable": true,
"vim.highlightedyank.duration": 300,
"vim.cursorStylePerMode.normal": "block",
"vim.cursorStylePerMode.visual": "block",
"vim.cursorStylePerMode.replace": "block",
"vim.cursorStylePerMode.visualblock": "block",
"vim.cursorStylePerMode.visualline": "block",
// statusbar colors
"vim.statusBarColorControl": true,
"vim.statusBarColors.normal": ["#171819", "#ffffff"],
"vim.statusBarColors.insert": ["#2C2E07", "#ffffff"],
"vim.statusBarColors.visual": ["#35151D", "#ffffff"],
"vim.statusBarColors.visualline": ["#35151D", "#ffffff"],
"vim.statusBarColors.visualblock": ["#35151D", "#ffffff"],
"vim.statusBarColors.commandlineinprogress": ["#2C2206", "#ffffff"],
"vim.statusBarColors.searchinprogressmode": ["#171819", "#ffffff"],
"vim.statusBarColors.surroundinputmode": ["#171819", "#ffffff"],
// Debugging
"debug.toolBarLocation": "docked",