I've been postponing doing the this tutorial for nearly two years, some of these "TIL" are not really TILs, but more of a "I saw once, thought it was cool, and the promptly forgot".
- in normal mode
- press
Ato move to insert mode at the end of the current line (I've been doing$iall this time..) - press
Uto undo all latest changes on the current line.
Note that this only undoes the changes for this line from the last insert mode, it doesn't restore the line as it was when opening the file - press
Pto paste the text before the cursor (this works both when pasting words or entire lines), I only usedpso far! - THE CHANGE OPERATOR
<C-o>and<C-i>to jump around the cursor position history, I never remember this one and press<C-0>instead- The substitute command, I always used
:%s/old/new/g, as that's what I wanted most of the time, but it's actually:<some-operator>s/old/new/meaning I can do::s/old/new/for editing only the current line:1,3s/old/new/to only edit lines 1 to 3:100s/old/new/to only edit line 100:'<,'>s/old/new/to only edit whatever I have selected
- REPLACE MODE
- press
- when reading nvim documentation (or
manpages viaMANPAGER=nvim +Man!) (I keep forgetting these):- press
Kto jump to the hovered word documentation (ormanpage) - press
<Enter>on a link to open the linked help section
- press
- the retrieve (
:r) command:r FILENAMEor:r !<command>to paste the contents wherever the cursor currently is.