Skip to content

Instantly share code, notes, and snippets.

@cobanov
Created February 24, 2022 22:15
Show Gist options
  • Save cobanov/65aed70d56f4fe832c6c62614ce47650 to your computer and use it in GitHub Desktop.
Save cobanov/65aed70d56f4fe832c6c62614ce47650 to your computer and use it in GitHub Desktop.
# Cursor movement
h - move cursor left
j - move cursor down
k - move cursor up
l - move cursor right
H - move to top of screen
M - move to middle of screen
L - move to bottom of screen
w - jump forwards to the start of a word
W - jump forwards to the start of a word (words can contain punctuation)
e - jump forwards to the end of a word
E - jump forwards to the end of a word (words can contain punctuation)
b - jump backwards to the start of a word
# Edit
r - replace a single character.
R - replace more than one character, until ESC is pressed.
J - join line below to the current one with one space in between
gJ - join line below to the current one without space in between
gwip - reflow paragraph
# Exiting
:w - write (save) the file, but don't exit
:w !sudo tee % - write out the current file using sudo
:wq or :x or ZZ - write (save) and quit
:q - quit (fails if there are unsaved changes)
:q! or ZQ - quit and throw away unsaved changes
:wqa - write (save) and quit on all tabs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment