Monday, October 29, 2012

Re: surround a visual block with character(s)

On 2012-10-29, Tim Chase wrote:
> On 10/29/12 05:07, Marcin Szamotulski wrote:
> > On 23:20 Sun 28 Oct , Gary Johnson wrote:
> >> On 2012-10-28, Chris Lott wrote:
> >>> blah blah foo foo
> >>>
> >>> to
> >>>
> >>> "blah blah foo foo"
> >>
> >> s"<C-R>1"<Esc>
> >
> > I like that! With visual area less than one line one has to use the
> > - register.
>
> When the change is less than one line, I use this method, except I
> just use the scratch register:
>
> s"<c-r>""<esc>
>
> For more than one line, I have to think, because using this method
> does weird things depending on your indentation of the block, and
> your 'paste' settings. I.e., your contents can end up
> stair-stepping across the screen.

To avoid the stair-stepping, you can use <C-R><C-O> or <C-R><C-P>
instead of just <C-R>. That may not put the indentation where you
want it, but the text won't go meandering off to the right.

Regards,
Gary

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