🛠️ 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
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
In Vim ⇧ + j
join lines. I remapped ⌃ + y
for it instead.
⇧ + j
Scroll down by one line ⇧ + k
Scroll up by one lineMove cursor up/down in window
Via Vim. Also ⇧ + m
for moving cursor to the middle.
⇧ + h
Move cursor to window top ⇧ + l
Move cursor to window bottomMove cursor up/down in file
⌃ + j
Move cursor down by 5 lines ⌃ + k
Move cursor up by 5 linesGo back/forward in history
⌃ + h
Go back ⌃ + l
Go forwardFind/Select word under cursor
⌘ + j
Find next word under cursor ⌘ + k
Find previous word under cursorExpand/Shrink selection
⌥ + j
Shrink selection ⌥ + k
Expand selectionPrevious/Next tab
⌥ + h
Previous tab ⌥ + l
Next tabMove line up/down
⌘⇧ + j
Move line down ⌘⇧ + k
Move line upMove statement up/down/left/right
⌃⇧ + j
Move statement down ⌃⇧ + k
Move statement up ⌃⇧ + h
Move statement left ⌃⇧ + l
Move statement rightGo to next/previous error in file
⌥⌃ + j
Go to next error in file ⌥⌃ + k
Go to previous error in fileGo to next/previous method in file
⌘⌥ + j
Go to next method in file ⌘⌥ + k
Go to previous method in fileGo to next/previous change in file/diff
⌘⌃ + j
Go to next change in file ⌘⌃ + k
Go to previous change in fileGo to next/previous file in diff
⌘⌃ + h
Go to next file in diff ⌘⌃ + l
Go to previous file in diffAdd cursor below/above
⌘⌥⌃ + j
Add cursor below ⌘⌥⌃ + k
Add cursor aboveTab switcher
⌘⌥⌃ + h
Tab switcher backward ⌘⌥⌃ + l
Tab switcher forwardLeader Key Mappings
I use space
(␣
) as leader key, and use each letter for a category, e.g. f
for Find
.
a - Switch case
( WebStorm with String Manipulation plugin.)
␣␣a
Switch case popup ␣aa
To Sentence case ␣ac
To camelCase ␣aC
Words Capitalize ␣ak
To kebab-case ␣al
To lower case ␣ap
To PascalCase ␣ar
Swap case ␣as
To snake_case ␣aS
To SCREAMING_SNAKE_CASE ␣at
To Title Case ␣au
To UPPER CASEc - Code / Completion
␣ca
Auto fix ␣cc
Code completion ␣cC
Smart type completion ␣cf
Reformat code ␣ci
Optimize imports ␣cq
Quick fix ␣cs
Surround with ␣ct
Insert live template / snippet ␣cu
Unwrapd - Doc / Info / Peek
␣dd
Quick doc ␣de
Show error description ␣dh
Show hover info ␣di
Quick implementations ␣dp
Parameter infoe - Execution / Run / Debug
␣␣e
Choose run configuration ␣␣E
Choose debug configuration ␣ee
Edit run configurations ␣ed
Debug ␣eD
Debug current file ␣er
Run ␣eR
Run current file ␣eu
Open user tasks ␣ex
Stopf - Find / Search
␣␣f
Search everywhere ␣fa
Find action / command palette ␣fc
Find class ␣ff
Find file ␣fj
Find recent file ␣fk
Find recent changed file ␣fl
Find recent location ␣fp
Find recent project ␣fs
Find symbol ␣fS
Find scratch file ␣ft
Find text in all filesj - Jump / Goto code
␣␣j
Goto popup ␣jd
Goto declaration ␣jD
Goto declaration split ␣je
Goto test ␣ji
Goto implementation ␣jI
Goto implementation split ␣jl
Goto line ␣jm
Goto member of file Structure ␣jn
Goto navigation bar ␣jo
Open in … popup ␣jr
Goto related ␣js
Goto super method ␣jt
Goto type declaration ␣jT
Goto type declaration split ␣ju
Show usages in popup ␣jU
Show usages in find panelk - Refactor
I use k as it is at home row and I use refactors a lot.
␣␣k
Refactoring popup ␣kc
Introduce constant ␣kd
Safe delete ␣kf
Introduce function ␣kF
Introduce field ␣ki
Extract interface ␣kl
Inline ␣km
Extract method ␣ko
Move ␣kp
Introduce parameter ␣kr
Rename element ␣kR
Rename file ␣ks
Change signature ␣kt
Extract type alias