Re: inclusive regexp/yanking

In vim, the e modifier to a regular expression when using the regexp as a range will include the match in the range, so for example, when yanking, it will yank from the cursor up to and including the matched expression; ie, given:

Hello there everybody!

With the cursor at the beginning of the line, y/everybody/e will yank "Hello there everybody".

ViEmu doesn't seem to support this.


Re: inclusive regexp/yanking

No, indeed, it is not supported. It will be implemented in a future version. Meanwhile, you can use the special "\zs" modifier in the regexp, which changes the start of the match to the position where it appears. Thus, you can do what you show above in this way:


The used regexp is "everybod\zs", which works exactly the same as "everybody", but when a match is found, the "start of match" is artificially changed to after the "y".

This is actually a vim feature, which ViEmu does provide. There is also the "\ze" modifier, to override the match-end. You can use both:


This regex will only match at strings starting "before-stuff-" and ending with "-after-stuff", but the only text highlighted/selected/replaced/yanked/etc  will be the "meat" in between.


Re: inclusive regexp/yanking

Cheers; that's useful to know!


Re: inclusive regexp/yanking

You're welcome. Hopefully ViEmu will also include the "e" modifier soon, but it's good to know all alternative functionality.


  - Jon