π οΈ Editor Keymaps
I organize keyboard shortcuts into 4 categories:
HJKL
withββ₯ββ§
modifiers.- Vim Leader Key mappings.
- Vim commands. e.g.
β + w
for window managment. - Standard shortcuts, e.g.,
β + t
to create a new tab andβ + w
to close one.
Not only does it allow me to remember over 200 keyboard shortcuts, but it also lets me work (almost) the same way across editors:
WebStorm (and other JetBrains IDEs) with IdeaVim plugin:
VSCode with VSCodeVim extension:
-
settings.json
(Vim key bindings) -
keybindings.json
Zed with built-in Vim Mode :
HJKL with Modifiers
Section titled βHJKL with ModifiersβHJKL
are not only ββββ
for Vim. I use them with modifiers for any directional actions like moving,
scrolling, navigating back/forward, tc.
Scroll up/down in file
Section titled βScroll up/down in fileβIn Vim β§ + j
join lines. I remapped β + y
for it instead.
Move cursor up/down in window
Section titled βMove cursor up/down in windowβVia Vim. Also β§ + m
for moving cursor to the middle.
Move cursor up/down in file
Section titled βMove cursor up/down in fileβGo back/forward in history
Section titled βGo back/forward in historyβFind/Select word under cursor
Section titled βFind/Select word under cursorβExpand/Shrink selection
Section titled βExpand/Shrink selectionβPrevious/Next tab
Section titled βPrevious/Next tabβMove line up/down
Section titled βMove line up/downβMove statement up/down/left/right
Section titled βMove statement up/down/left/rightβGo to next/previous error in file
Section titled βGo to next/previous error in fileβGo to next/previous method in file
Section titled βGo to next/previous method in fileβGo to next/previous change in file/diff
Section titled βGo to next/previous change in file/diffβGo to next/previous file in diff
Section titled βGo to next/previous file in diffβAdd cursor below/above
Section titled βAdd cursor below/aboveβTab switcher
Section titled βTab switcherβLeader Key Mappings
Section titled βLeader Key MappingsβI use space
(β£
) as leader key, and use each letter for a category, e.g. f
for Find
.
a - Switch case
Section titled βa - Switch caseβ( WebStorm with String Manipulation plugin.)
c - Code / Completion
Section titled βc - Code / Completionβd - Doc / Info / Peek
Section titled βd - Doc / Info / Peekβe - Execution / Run / Debug
Section titled βe - Execution / Run / Debugβf - Find / Search
Section titled βf - Find / Searchβj - Jump / Goto code
Section titled βj - Jump / Goto codeβk - Refactor
Section titled βk - RefactorβI use k as it is at home row and I use refactors a lot.
l - Tool window / Side bar / Panel
Section titled βl - Tool window / Side bar / PanelβI use l as it is at home row and I often need to toggle tool windows.
n - New / Generate
Section titled βn - New / Generateβr - Replace
Section titled βr - Replaceβs - Source control
Section titled βs - Source controlβ( VSCode with GitLens extention.)
v - View
Section titled βv - Viewβx - Close / Hide / Delete
Section titled βx - Close / Hide / Deleteβy - Yank / Copy
Section titled βy - Yank / Copyβz - Editor Settings
Section titled βz - Editor SettingsβOther Keyboard Shortcuts
Section titled βOther Keyboard ShortcutsβSome other keyboard shortcuts in addition to Vim and standard commands:
Quick editor actions
Section titled βQuick editor actionsβBack to the editor
Section titled βBack to the editorβTo use the Vim (leader) key bindings, it is crucial to focus back on the editor.