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
ku
Members pull up
kv
Introduce variable

l - Tool window / Side bar / Panel

I use l as it is at home row and I often need to toggle tool windows.

l
Hide all tool windows
la
AI assistant tool
lb
Build tool
lc
Zed: Collab tool
ld
Debug tool
lD
Database tool
le
Problems view tool
lf
Find tool
lg
Git graph panel
ln
Notifications tool
lo
Output panel
lp
Project tool
lr
Run tool
ls
Services tool
lt
Terminal tool
lu
Pull requests tool
lv
Version control tool
lx
Extensions / Plugins

n - New / Generate

n
New element popup
nd
New dir
nf
New file
ng
Generate
no
Override methods
ns
New scratch file

r - Replace

r
Replace
rf
Replace in all files

s - Source control

( VSCode with GitLens extention.)

s
Source control popup
sa
Add
sb
Branches
sB
Blames
sc
Checkin
sC
Toggle amend commit mode
sd
Compare/diff file
sf
Fetch
sF
Show all affected files
sh
Show file history
sH
Show local file history
sl
Rollback changed lines
sm
Show message history
sn
Create new branch
sN
Create new pull request
sp
Push
sP
Push —force
sr
Revert
ss
Stash
sS
Unstash
st
Tag
su
Update project / pull

v - View

v
View popup
vc
Toggle breadcurmbs
vb
Toggle tool buttons
vg
Toggle gutter icons
vG
Show gutter icons settings
vi
Toggle indent lines
vl
Toggle sticky lines
vn
Toggle line numbers
vs
Toggle status bar
vt
Toggle tab bar
vT
Configure tabs
vw
Toggle use soft wraps
vz
Zoom level

x - Close / Hide / Delete

x
Close project
xn
Close all notifications
xw
Close window
xx
Close content

y - Yank / Copy

y
Copy reference popup
ya
Copy absolute path
yf
Copy file name
yl
Copy path with line number
yp
Copy content root path
yP
Copy path from repository root
yr
Copy reference

z - Editor Settings

zj
Settings JSON
zJ
Keymap JSON
zk
Keymap
zK
Default keymap
zs
Settings
zS
Default settings

Other Keyboard Shortcuts

Some other keyboard shortcuts in addition to Vim and standard commands:

Quick editor actions

w
Write / Save all
Show intention actions or quick fix
gs
Select file in project view
gS
Select in popup
+ w
Close other tabs
+ d
Duplicate lines down

Back to the editor

To use the Vim (leader) key bindings, it is crucial to focus back on the editor.

+
Close all tool windows / panels
+
Focus the editor

Window managment

+ wb
Move tab to bottom split
+ wm
Move tab to opposite split
+ wr
Move tab to right split
+ wx
Unsplit

Multiple cursors

+ a
Add cursors to all whole occurrences
+ b
Add cursors to all occurrences
+ e
Add cursors to ends of selected lines
+ f
Add cursor to next whole occurrence
+ g
Add cursor to next occurrence
+ p
Add cursor to previous whole occurrence
+ s
Skip occurrence
+ x
Remove occurrence