emacs-evil / evil

The extensible vi layer for Emacs.
GNU General Public License v3.0
3.4k stars 280 forks source link

visual block search and replace #513

Open TheBB opened 9 years ago

TheBB commented 9 years ago

Originally reported by: Anonymous


Currently search-and-replace can operate on visual lines. With (setq evil-ex-visual-char-range t) it is extended to visual characters.

If not too difficult, will it be possible to add visual block search-and-replace? Through automatic detection, vim style \%V, or any other way. Thank you.


TheBB commented 9 years ago

Original comment by Frank Fischer (Bitbucket: lyro, GitHub: lyro):


Actually it is not that easy. There is a fundamental difference between block mode and char/line mode. The latter always work on consecutive character ranges, the former on several disjoint ranges. The current implementation does not support to former, yet.

fiveNinePlusR commented 7 years ago

I think that evil mode should do the right thing automatically for you if you have a visual block selection... it should make the substitute command only operate on the visual selection. I imagine the %V thing is because Brahm values backwards compatibility over everything so he just tacked on an option and called it a day.