IDEAVim is a plugin for JetBrains IDEs (such as IntelliJ IDEA, PyCharm, and others) that allows you to use Vim keybindings and commands within the IDE. Here’s a IDEAVim commands cheat sheet:
Switching between Modes
- Normal Mode:
- Press
Esc
to enter Normal mode.
- Press
- Insert Mode:
- Press
i
to enter Insert mode.
- Press
- Visual Mode:
- Press
v
to enter Visual mode.
- Press
Basic Navigation
- Move cursor:
- Use
h
,j
,k
,l
for left, down, up, and right movements.
- Use
- Word movements:
w
– Move forward one word.b
– Move back one word.e
– Move to the end of the word.
- Page movements:
Ctrl + f
– Move forward one page.Ctrl + b
– Move backward one page.Ctrl + u
– Move up half a page.Ctrl + d
– Move down half a page.
- Line movements:
0
– Move to the beginning of the line.$
– Move to the end of the line.
Editing Text
- Insert text:
- Press
i
in Normal mode to enter Insert mode.
- Press
- Delete and change text:
x
– Delete a character.dd
– Delete a line.dw
– Delete a word.cw
– Change a word (delete and enter Insert mode).
Undo and Redo
- Undo:
u
– Undo the last change.
- Redo:
Ctrl + r
– Redo the last undone change.
Copy, Cut, and Paste
- Copy (Yank):
yy
– Copy a line.
- Cut (Delete):
dd
– Cut a line.dw
– Cut a word.
- Paste:
p
– Paste after the cursor.P
– Paste before the cursor.
Search and Replace
- Search:
/
– Enter search mode.n
– Move to the next search result.
- Replace:
:%s/old/new/g
– Replace all occurrences of “old” with “new” in the entire file.
Saving and Exiting
- Save:
:w
– Save the file.
- Quit:
:q
– Quit the file.
- Save and Quit:
:wq
– Save and quit.
IDE-Specific Commands
- Build:
:make
– Run the build.
- Run:
:!./<executable>
– Run an executable.
- Navigate to Declaration:
gd
– Go to the declaration of the symbol under the cursor.
- Rename:
:rename <newName>
– Rename the symbol under the cursor.
This cheat sheet covers IDEAVim commands. For more advanced features and configuration options, refer to the official IDEAVim documentation.