Learning vim(neovim) from the goat himself, ThePrimeagen.
Vim As Your Editor (1/6): The Basic Vim Movements
j
moving downk
moving uph
moving leftl
moving rightw
moving forward of a wordb
moving backward of a word- “try not to rely on your arrow keys”
yy
yank the line(copy it), store in the registerp
paste the linedd
delete the lineu
undo the line- when you want to delete a function,
dd + dd + dd
isn’t practical shift + v
visual line mode(highlights the line), in this mode you can usejk
or other commands from above. Likey,j,k,h,l
andd
to deletev
visual word mode(hightlights where you start), in this mode you can use other commands tooi
insert mode, you can type anything.- to escape insert mode there is
ctrl + c
oresc
orctrl + [
- Usually, your bottom corner shows what mode you’re in
- you can combine vim commands together
d + w
ord + j
ord + y
:w
to 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)
o
start insert mode in the new line belowshift + o
start insert mode in the new line aboveshift + p
paste one line abovea
insert mode at the end of the wordshift + i
insert mode at begining of the lineshift + a
insert mode at end of the the line/
command mode/ + 'function'
command mode searching for functionn
hop next match orshift + n
hop 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