Multiple Line Operations In Vim

Copy Multiple Lines in Vim

3yy: To yank multiple lines in vim, type in the number of lines followed by yy. This command will copy (yank) 3 lines starting from your cursor position. y^: Copy everything from the start of the line to the cursor.

Shift cursor by n number of lines

j --> down
k --> up
 j and k move down and up one line, so 10j and 10k move down and up ten lines. You can repeat any motion by putting a number before it.

Findall a pattern in a file

find in the current file:

:g/<pattern>/
Edit this page on GitHub