Skip to content

Instantly share code, notes, and snippets.

@tinytengu
Created June 18, 2022 21:43
Show Gist options
  • Save tinytengu/595a257d05abbfe6c2f2ed97cba56d63 to your computer and use it in GitHub Desktop.
Save tinytengu/595a257d05abbfe6c2f2ed97cba56d63 to your computer and use it in GitHub Desktop.
neovim cheatsheet
[Movement]
(Lines)
<n>G or <n>gg - go to <n>th line
$ - go to end of the line
0 - go to the beginning of the line
^ - go to the first non-empty character of the line
<n>% - go to the <n>% of the file
<n>up/down - go <n> lines up/down
(Words)
w - go the the beginning of the next word
b - go the the beginning of the previous word
e - go to the end of the next word
ge - go to the end of the previous word
(Find)
f<c> - find <c> character to the right
F<c> - find <c> character to the left
[Small changes]
. - repeat last change
U - undo
Ctrl + R - redo
(Delete)
<n>x - delete <n> symbols
d<n><movement> - delete <n> based on <movement> parts (<n>dw - delete <n> words, d$ - delete 'til the end of the line)
dd - delete the whole line
D - same as d$
daw - delete whole word
(Change)
c<n><movement> - change <n> based on <movement> parts (c2w - change two words to the right, c3e - change 3 words to the left)
cc - change the whole line
C - same as c$
s - same as cl
S - same as cc
~ - change character case
(Replace)
R - enter replacement mode
<n>r - replace <n> characters while in normal mode
(Copy & Paste)
When using d or x it saves the text
p - paste after the cursor
P - paste on the cursor
y<movement> - copy text to the register using <movement> commands
yy - copy whole line
[Visual mode]
v - visual mode
V - select whole line
o - go to the other end of the selection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment