Skip to content

🛠️ Editor Keymaps

I organize keyboard shortcuts into 4 categories:

  1. HJKL with ⌘⌥⌃⇧ modifiers.
  2. Vim Leader Key mappings.
  3. Vim commands. e.g. ⌃ + w for window managment.
  4. 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:

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 line

Move 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 bottom

Move cursor up/down in file

+ j
Move cursor down by 5 lines
+ k
Move cursor up by 5 lines

Go back/forward in history

+ h
Go back
+ l
Go forward

Find/Select word under cursor

+ j
Find next word under cursor
+ k
Find previous word under cursor

Expand/Shrink selection

+ j
Shrink selection
+ k
Expand selection

Previous/Next tab

+ h
Previous tab
+ l
Next tab

Move line up/down

+ j
Move line down
+ k
Move line up

Move statement up/down/left/right

+ j
Move statement down
+ k
Move statement up
+ h
Move statement left
+ l
Move statement right

Go to next/previous error in file

+ j
Go to next error in file
+ k
Go to previous error in file

Go to next/previous method in file

+ j
Go to next method in file
+ k
Go to previous method in file

Go to next/previous change in file/diff

+ j
Go to next change in file
+ k
Go to previous change in file

Go to next/previous file in diff

+ h
Go to next file in diff
+ l
Go to previous file in diff

Add cursor below/above

+ j
Add cursor below
+ k
Add cursor above

Tab switcher

+ h
Tab switcher backward
+ l
Tab switcher forward

Leader 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 CASE

c - 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
Unwrap

d - Doc / Info / Peek

dd
Quick doc
de
Show error description
dh
Show hover info
di
Quick implementations
dp
Parameter info

e - 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
Stop
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 files

j - 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 panel

k - 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