Skip to content

Instantly share code, notes, and snippets.

@aneurysmjs
Last active September 2, 2024 22:24
Show Gist options
  • Save aneurysmjs/28caa31dcf9cd473d7aa3bf1520168cd to your computer and use it in GitHub Desktop.
Save aneurysmjs/28caa31dcf9cd473d7aa3bf1520168cd to your computer and use it in GitHub Desktop.
vim motions

BASICS

To exit Vim type: <ESC> :q! <ENTER> to trash all changes.
OR type: <ESC> :wq <ENTER> to save the changes.

NORMAL mode

navigation

h left
j down
k up
l right

these commands can be prefixed with a number:
5l will move 5 times to the right
3j will move 5 times down
... and so on

w go forward word by word
b go backward word by word
e jump to the end of a word

these commands can be prefixed with a number:
5w move 5 words forward ... and so on

$ jump to the end of line
0 jump to the beggining of the line
^ jump the first non-empty character on the line
f+the char where we want to jump jump to the next specific character on the line F+the char where we want to jump jump to the previous specific character on the line

vertical navigation

) move by one sentence down
( move by one sentence up

} move by one paragraph down
{ move by one paragraph up

Delition commands

x deletes character

dw deletes word

d$ deletes to the end of the line

select next occurrence

see video

multiple cursors

see

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment