Learning vim(neovim) from the goat himself, ThePrimeagen.
Vim As Your Editor (1/6): The Basic Vim Movements
jmoving downkmoving uphmoving leftlmoving rightwmoving forward of a wordbmoving backward of a word- “try not to rely on your arrow keys”
yyyank the line(copy it), store in the registerppaste the linedddelete the lineuundo the line- when you want to delete a function,
dd + dd + ddisn’t practical shift + vvisual line mode(highlights the line), in this mode you can usejkor other commands from above. Likey,j,k,h,landdto deletevvisual word mode(hightlights where you start), in this mode you can use other commands tooiinsert mode, you can type anything.- to escape insert mode there is
ctrl + corescorctrl + [ - Usually, your bottom corner shows what mode you’re in
- you can combine vim commands together
d + word + jord + y :wto save file- note: Practice until you’re comfortable with all of these commands
Vim As Your Editor (2/6): Foundation for Speed(Part 2 here we go)
ostart insert mode in the new line belowshift + ostart insert mode in the new line aboveshift + ppaste one line aboveainsert mode at the end of the wordshift + iinsert mode at begining of the lineshift + ainsert mode at end of the the line/command mode/ + 'function'command mode searching for functionnhop next match orshift + nhop backward a match
*jump to the word next to the cursor in hopping mode#another way to hop backward a match- note: we are starting to get fasttttttttt, keep practicing