> On 04/03/2012 10:43 PM, horsecandy wrote:
> > My current method for pasting blocks of code is to select them in visual mode, copy/yank them, and paste. Frequently I see a line or two that I would like to copy or move to another line without going through this hassle. Is there a command that can be used to move or copy a whole block of text, specified by line number, to some other line-number specified block?
> >
>
>
> Also: if it's a single line, often it's easiest to type a couple of
> first letters, then press ctrl-x ctrl-l which will complete the line.
>
> To use :copy and :move you need to know the line number, so you need to
> have :set number option.
>
Not necessarily. You could have relative numbering turned on, and use a range relative to the current line number. Or you could use regular expressions to define the range. Or you can use marks (even visual selection, or "last modified", etc.) Ranges are much more powerful than just absolute line numbers, although admittedly this is how they are normally demonstrated.
--
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:
Post a Comment