Monday, March 26, 2012

Re: :set nu -> how to copy lines with line numbers?

Tim Chase wrote about using:

:redir @a
:sil! '<,'>#
:redir END

:help :#
:help :number

I added that to my vim notes file.
It has another advantage,
I normally have relative line numbers on.
Using '<,'># prints the lines with absolute numbers.

I use the + register (if your vim is compiled with +clipboard)
so I can simply 'paste' into an email.

:redir @+ | sil! '<,'># | redir END

Bill

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: