Tuesday, November 10, 2015

Re: override record

On 2015-11-10 07:38, shawn wilson wrote:
> How about this - is there an event that I can use to just redefine
> what vim already made with the same information?

I'm not sure what you mean by "an event". In my initial reply the

:let @a=substitute(@a, 'foo', 'bar', 'g')

was doing an in-place replacement without the need to worry about
escaping. You can assign to the macro register the results of munging
that same register. It doesn't have to use substitute() but rather
any transformation you want to use should be valid here as long as the
result is a string.

You can also execute the expression register as a macro if you need:

:let first=@a[:15]
:let remainder=@a[16:]
@=first . "my replacement here" . remainder

-tim


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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment