Toward a Mouse-Free Developer Experience in VSCode

I use this to bootstrap a lot of good quick-access features onto Normal Mode (this is the primary mode for navigation)essentially i borrowed the mnemonic method and spacebar-chords from spacemacshere’s my json settings relevant to the vim extensions"vim.normalModeKeyBindings": [{"before": ["<space>"],"commands": ["workbench.action.showCommands"]}],"vim.insertModeKeyBindings": [{ "before": ["<C-]>"], "commands": ["editor.action.indentLines"] }, { "before": ["<C-[>"], "commands": ["editor.action.outdentLines"] }],"vim.handleKeys": {"<D-d>": false,"<C-x>": false,"<C-c>": false,"<C-v>": false}what does this do for me?normalmode keybindings — this gives me spacebar to open command pallete when I’m not editing the document, since I’m attempting to move to a keyboard only workflow, rapid access to the command pallete is vital, and I’m borrowing this idea from spacemacsinsertmode keybindings — this preserves a handy-dandy vscode feature for rapid indents on ctrl+[ and ctrl+]vim.handlekeys — this preserves the ctrl+x/c/v cut/copy/paste behaviour that I have 30 years of muscle memory building up.these settings also prevent the default vim extension method of selecting the next occurance of the currently selected word, which is a bit broken for me.which brings us toStep 4 — custom keybindings like crazythere are a lot here — One way I got around this was to use my keyboard’s macroboard, you can also pick up macro boards like the falcon 20 or, on the pricier side, the stream deck (there are linux drivers available for stream deck, but no gui for configuration, you’ll need to build it in nodejs from what i can tell)some of these are still defaultsspace -> command pallete (set in vim extension settings – see above)Ctrl + Tab -> change editor to a different open fileCtrl + shift + up -> multicursor up (insert mode)Ctrl + shift + down -> multicursor down (insert mode)Ctrl + shift + l -> multicursor all matches of selection (insert mode)Ctrl + shift + m -> exit multicursor modeCtrl + / -> toggle line comment (insert mode)Ctrl + shift + left -> shrink selectionCtrl + shift + right -> expand selectionCtrl + , -> open settingF3 -> next match (while using find within document)Shift + F3 -> prev match (while using find within document)// below are chords so the first one would be Ctrl+space-Ctrl+fCtrl + space – f -> focus to the file explorer paneCtrl + space – x -> close focused editorCtrl + shift + space – f -> open the find pane to search within documentCtrl + space – e -> focus to current active editorCtrl + space – g -> focus to search fieldCtrl + space – L -> focus to search pane ListCtrl + space – T -> Create integrated terminalCtrl + space – ` -> focus to existing terminal (that's the backtick/tilda key next to the one, like in quake)Ctrl + space – z -> switch to zen mode Ctrl + space – b -> hide/show sidebarCtrl + space – w -> toggle word wrapCtrl + k – b -> open keyboard shortcutsCtrl + f – n -> add new file (explorer)Ctrl + f – m -> add new folder (explorer) Step 5 — VSCode style select nextthis is trickyyou need to initiate it from Visual Mode (v)once you’re in visual mode highlight your selection and Ctrl+d as you normally would to select subsequent occurances, once you have the selections you want escape to normal mode and then press i to enter insert mode, now you have all your cursors exactly where you want themstep 6 — other programsI use Guake terminal, which unfortunately is incompatible with alt-tab — fortunately there’s a setting for it which makes it so you can only minimize it while it’s focused, and otherwise it will gain focus when you hit it’s assigned hotkey.Conclusionthis is my first phase and I’ll likely be posting updates..certainly some aspects like multicursor seem like they’re adding complexity, however I’m convinced that I can, for the first time stop reaching for my mouse.. More details

Leave a Reply