WASDMapKeymap extension for keyboard navigation, selection, and window splitting and navigation based on WASD. RequirementsThis requires at least version 1.25 of Visual Studio Code to fully work. FeaturesThis adds a number of keyboard shortcuts for performing the following tasks without having to really move your hands from home row:
This also adds one custom command that acts sort of like the Keyboard shortcuts are based around WASD, a key layout common to many modern PC games. All keyboard shortcuts were selected to minimize conflicts with the default Visual Studio Code shortcuts as well as shortcuts provided by a number of popular extensions (e.g., GitLens, various language extensions). Keyboard ShortcutsCursor NavigationThe following shortcuts are for moving the cursor throughout the current active editor.
SelectionThe following shortcuts are for making selections within the current active editor.
Line KillingThe following shortcut runs a custom command that partially mimics the With no selection active, this custom command will effectively cut the contents of the current line starting from the cursor's position to the end of the line. The removed contents are placed on the clipboard, making them available via a paste operation. With an active selection, this command will cut the current selection, adding its contents to the clipboard.
Editor Group NavigationThe following shortcuts are for navigating between different editor groups that may be present in the editor.
When the terminal has focus, the last two shortcuts have a slightly different function.
New Editor Group CreationThe following shortcuts are for creating new editor groups within the editor.
Splitting Editor GroupsThe following shortcuts are for splitting existing editor groups. When an editor group is split, a new editor group is formed, and the current document in the editor group that was split is duplicated in the new editor group. These are useful for opening up additional views to the same file.
Moving Documents between Editor GroupsThe following shortcuts are for moving a document from one editor group to another editor group.
BackgroundIn a prior life, I was an Emacs junkie. With every year I sunk into using that editor, the faster my fingers flew across the keyboard pounding out crazy key chords for all manners of tasks. Then one day I stopped being a Linux developer and took a job working 100% on a Microsoft stack. I tried emacs for Windows, but the impedance mismatch was too great, and plus, there were too many productivity gains I'd be leaving on the table by not embracing Visual Studio. Despite growing accustomed to my new development digs, I ended up missing two main features from my Emacs days:
I eventually moved to Sublime for anything that wasn't heavily C++ or C# based, and I thought I had found the holy grail there. With some custom extensions and additional hacking, I was able to recreate many of the navigation and window splitting features I missed from Emacs. Fast forward to July 2018, and Visual Studio Code comes out with features in the box for performing the exact same set of window splitting tasks as I had grown to love in both Emacs and Sublime. This was the missing piece that had otherwise prevented me from switching from Sublime to VS Code. This immediately led to the creation of a keymap that made it efficient for me to access these window splitting and editor navigation commands. In creating this keymap, I wanted to fulfill two goals:
The end result of that effort is this keymap extension. LicenseMIT © Michael Romer |