Tuesday, December 6, 2011

Re: Problem using :g/pattern/command

On 2011-12-07, Andy Wokula wrote:

> (same here, gVim on win32)
>
> It's like i_CTRL-R was made for this case, have you tried it (?):
>
> :g/\[more/exec "normal! 0\"rC\<C-R>r"
>
> maybe it is too unsafe (other nasty control characters in the text)

Clever! It does work, at least on the file I'm looking at at the
moment. It didn't work the first time; I had to increase
'textwidth' to prevent the automatic insertion of newlines.

Thank you. I'll change my function to use your solution.

I'd still like to understand the behavior of my first approach.

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: