Vim yanking range of lines

Yank lines 81-91

:81,91y<enter>

If your fingers don't like to find the : and , keys, this would work as well (go to line 81, yank 11 lines)

81gg11yy 

My only use of g is 5gg. To go to the 5th line. 22gg: 22nd line. As jimbo said, it's really only a modifier for some other commands.

For completeness, (http://vim.wikia.com/wiki/Power_of_g) explains a lot of how g works in command mode.


You can also copy the current lines to your present cursor location using 't'.

:81,91t.<enter>

This will paste the lines 81-91 under the line the cursor is on.

I learned this from http://vimcasts.org which is an excellent resource on VIM.