Friday, July 30, 2010

Re: Use visually selected text in commands

On 28/07/10 14:46, Daniel Corrêa wrote:
> Hi,
>
> I wonder if there is something like <cword>, but for visually selected text?
>
> Cheers,
>
> Daniel Corrêa
> (45) 9938.3993
> http://www.meadiciona.com.br/dnlcorrea
> 

Well, for ex-commands, if you hit : while in Visual (not Select) mode,
Vim will beef it up as

:'<,'>

while clearing Visual mode. That range means: from the first to the last
line of the latest Visual area. This is always linewise and can only be
used with commands that accept a range.

OTOH, for characterwise visual, you could yank first, then hit Ctrl-R
followed by " at the right point of your command-line entry.

See
:help v_:
:help [range]
:help c_CTRL-R


Best regards,
Tony.
--
Ask Not for whom the Bell Tolls, and You will Pay only the
Station-to-Station rate.

--
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: