vim Flashcards
vim: The easiest way to get to the middle of a line is
hit w a lot
to find a character and repeat it until you get to the right one. e.g.
fg will look for letter g on the current line, and repeating that command will keep going to next
vim: to move to the next word, type
w
b
vim: to move down a half screen, aka next page, type
control d
control u
vim: to undo, type
u
vim: To split the screen vertically
:vsplit
vim: To split the screen vertically and have the new screen be a new file, type
:vsplit filename.txt
vim: To switch active pane in split view, type
control w, let go, then an arrow direction
vim: To copy and paste, type
Select it with v or shift v
Press y, and p
vim: To indent a visual block by one space, type
gotta learn this
vim: To set up vim for convenient visual block indentation, type
set shiftwidth=1
vmap >gv
vmap
vim: Vim does not reload if you change branches, so you need to run
:bufdo e
to clear all the bufffers