mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 16:41:43 +05:30
feat(vscode-vim): VIM motions in VSCode
- Switch back to VIM instead of NeoVIM - we loose <ctrl+n> & <ctrl+p>
for selection & we loose `:` & `/` integration into VSCode. But VIM
plugin is much more faster and changing keybindings is easy.
- Made keybindings more consistent with NeoVIM
This commit is contained in:
@@ -11,15 +11,18 @@
|
||||
},
|
||||
{
|
||||
"key": "ctrl+shift+alt+right",
|
||||
"command": "editor.emmet.action.nextEditPoint"
|
||||
"command": "editor.emmet.action.nextEditPoint",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "ctrl+shift+alt+t",
|
||||
"command": "editor.emmet.action.matchTag"
|
||||
"command": "editor.emmet.action.matchTag",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "ctrl+shift+alt+p",
|
||||
"command": "editor.emmet.action.wrapWithAbbreviation"
|
||||
"command": "editor.emmet.action.wrapWithAbbreviation",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "alt+q",
|
||||
@@ -48,7 +51,8 @@
|
||||
},
|
||||
{
|
||||
"key": "ctrl+shift+j",
|
||||
"command": "editor.action.joinLines"
|
||||
"command": "editor.action.joinLines",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "ctrl+shift+j",
|
||||
@@ -62,5 +66,255 @@
|
||||
{
|
||||
"key": "shift+escape",
|
||||
"command": "workbench.action.toggleSidebarVisibility"
|
||||
},
|
||||
|
||||
// vim.keybindings
|
||||
// Navigation
|
||||
{
|
||||
"key": "ctrl+h",
|
||||
"command": "workbench.action.navigateLeft"
|
||||
},
|
||||
{
|
||||
"key": "ctrl+l",
|
||||
"command": "workbench.action.navigateRight"
|
||||
},
|
||||
{
|
||||
"key": "ctrl+k",
|
||||
"command": "workbench.action.navigateUp"
|
||||
},
|
||||
{
|
||||
"key": "ctrl+j",
|
||||
"command": "workbench.action.navigateDown"
|
||||
},
|
||||
{
|
||||
"key": "space b l",
|
||||
"command": "workbench.action.showAllEditors",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "space b x",
|
||||
"command": "workbench.action.closeActiveEditor",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "] b",
|
||||
"command": "workbench.action.nextEditorInGroup",
|
||||
"when": "(vim.mode == 'Normal' || vim.mode == 'Visual') && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "[ b",
|
||||
"command": "workbench.action.previousEditorInGroup",
|
||||
"when": "(vim.mode == 'Normal' || vim.mode == 'Visual') && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "space e",
|
||||
"command": "runCommands",
|
||||
"args": {
|
||||
"commands": [
|
||||
"workbench.action.toggleSidebarVisibility",
|
||||
"workbench.files.action.focusFilesExplorer"
|
||||
]
|
||||
},
|
||||
"when": "vim.mode == 'Normal'"
|
||||
},
|
||||
{
|
||||
"key": "space e",
|
||||
"command": "runCommands",
|
||||
"args": {
|
||||
"commands": [
|
||||
"workbench.action.toggleSidebarVisibility",
|
||||
"workbench.action.focusActiveEditorGroup"
|
||||
]
|
||||
},
|
||||
"when": "sideBarFocus && !inputFocus"
|
||||
},
|
||||
{
|
||||
"key": "space e",
|
||||
"command": "workbench.action.toggleSidebarVisibility",
|
||||
"when": "vim.mode == 'Normal' && foldersViewVisible"
|
||||
},
|
||||
|
||||
// Editor
|
||||
{
|
||||
"key": "shift shift",
|
||||
"command": "workbench.action.quickOpen",
|
||||
"when": "vim.mode == 'Normal'"
|
||||
},
|
||||
{
|
||||
"key": "space g g",
|
||||
"command": "runCommands",
|
||||
"when": "vim.mode == 'Normal'",
|
||||
"args": {
|
||||
"commands": ["workbench.view.scm", "workbench.scm.focus"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "ctrl+alt+f",
|
||||
"command": "workbench.action.findInFiles",
|
||||
"when": "vim.mode == 'Normal'"
|
||||
},
|
||||
{
|
||||
"key": "space p",
|
||||
"command": "editor.action.clipboardPasteAction",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "space y",
|
||||
"command": "editor.action.clipboardCopyAction",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "space x o",
|
||||
"command": "workbench.action.closeOtherEditors",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "ctrl+n",
|
||||
"command": "-workbench.action.files.newUntitledFile"
|
||||
},
|
||||
|
||||
// File Explorer
|
||||
{
|
||||
"key": "r",
|
||||
"command": "renameFile",
|
||||
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
|
||||
},
|
||||
{
|
||||
"key": "c",
|
||||
"command": "filesExplorer.copy",
|
||||
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
|
||||
},
|
||||
{
|
||||
"key": "p",
|
||||
"command": "filesExplorer.paste",
|
||||
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
|
||||
},
|
||||
{
|
||||
"key": "x",
|
||||
"command": "filesExplorer.cut",
|
||||
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
|
||||
},
|
||||
{
|
||||
"key": "d",
|
||||
"command": "deleteFile",
|
||||
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
|
||||
},
|
||||
{
|
||||
"key": "n",
|
||||
"command": "explorer.newFile",
|
||||
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
|
||||
},
|
||||
{
|
||||
"key": "shift+n",
|
||||
"command": "explorer.newFolder",
|
||||
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
|
||||
},
|
||||
{
|
||||
"key": "s",
|
||||
"command": "explorer.openToSide",
|
||||
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
|
||||
},
|
||||
{
|
||||
"key": "shift+s",
|
||||
"command": "runCommands",
|
||||
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus",
|
||||
"args": {
|
||||
"commands": [
|
||||
"workbench.action.splitEditorDown",
|
||||
"explorer.openAndPassFocus",
|
||||
"workbench.action.closeOtherEditors"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "enter",
|
||||
"command": "explorer.openAndPassFocus",
|
||||
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceIsFolder && !inputFocus"
|
||||
},
|
||||
{
|
||||
"key": "enter",
|
||||
"command": "list.toggleExpand",
|
||||
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && explorerResourceIsFolder && !inputFocus"
|
||||
},
|
||||
|
||||
// Coding
|
||||
{
|
||||
"key": "shift+k",
|
||||
"command": "editor.action.showHover",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "shift+j",
|
||||
"command": "editor.action.moveLinesDownAction",
|
||||
"when": "vim.mode == 'VisualLine' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "shift+k",
|
||||
"command": "editor.action.moveLinesUpAction",
|
||||
"when": "vim.mode == 'VisualLine' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "space c i",
|
||||
"command": "editor.action.goToImplementation",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "space c r",
|
||||
"command": "editor.action.goToReferences",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "space c s",
|
||||
"command": "workbench.action.gotoSymbol",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "space c w",
|
||||
"command": "workbench.action.showAllSymbols",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "space o",
|
||||
"command": "workbench.action.gotoSymbol",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "space d w",
|
||||
"command": "workbench.actions.view.problems",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
},
|
||||
|
||||
// Test commands
|
||||
{
|
||||
"key": "space t t",
|
||||
"command": "testing.runAtCursor",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "space t f",
|
||||
"command": "testing.runCurrentFile",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "space t w",
|
||||
"command": "testing.runAll",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
},
|
||||
{
|
||||
"key": "space t x",
|
||||
"command": "testing.cancelRun",
|
||||
"when": "vim.mode == 'Normal' && editorTextFocus"
|
||||
}
|
||||
|
||||
// Make the following work: ctrl+n & ctrl+p for navigation through dropdown
|
||||
// {
|
||||
// "key": "ctrl+n",
|
||||
// "command": "selectNextSuggestion",
|
||||
// "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
|
||||
// },
|
||||
// {
|
||||
// "key": "ctrl+p",
|
||||
// "command": "selectPrevSuggestion",
|
||||
// "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
|
||||
// },
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user