Thursday, March 2, 2017

Re: yanking a certain part of a line based on a regex (vim scripting)

On Thursday, March 2, 2017 at 9:31:13 PM UTC-6, Meino.Cramer@gmx.de wrote:
> Hi,
>
> I want to yank a certain part of a line (the cursor is positioned
> on that line) from the position of the cursor to the point of the
> line where a certain regex matches into a register. The target positon
> is positioned on the right.
>
> "into a register" is not the problem here ;)
>
> I thought of something like
>
> :yt<regex>
>
> but I didn't find a 't'-movement command, which allows a target
> position defined by a regex.
>

y/pattern
(and then hit Enter to complete the search)

If you want to include the matched pattern as well:

y/pattern/e

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