replit/codemirror-vim

Feature: Replacement Preview

Opisek opened this issue · 2 comments

Opisek commented

VsCodeVim has a neat feature of previewing replacement commands.

While writing :%s/foo, it will highlight all occurrences of foo (1 per line).
When proceeding with :%s/foo/bar it will keep the highlight on the previously marked words, but they will now be visibly changed to bar.
Similarly, adding the finishing :%s/foo/bar/g, it will apply that preview to multiple occurrences per line.

I think that's a great way of knowing if the regex you're trying to replace works as intended.

Would that be a feature that would also fit CodeMirror Vim?

Yes, this sounds like a useful feature.

Opisek commented

Great, will look into it when I have some time.