Edit: Highlight text that matches the marked region, without the use of any key, but just by having a region marked. Then have two commands to directly move across the highlighted text, forward and backward.
Edit: For example if I mark "hello", automatically highlight all the occurrences that are equal to "hello". If I mark "hello w", highlight all the occurrences equal to "hello w". Then use two keys to move forward and backward respectively.
A third key to toggle between three options:
Search (default): take marked region as the search for parameter.
Search and replace: preserve search for parameter and prompt for the replace with parameter.
Search and replace with regexp: preserve replace with parameter and prompt the search for parameter as the starting point of the regexp.
A basic option would be a command to turn on/off the "on the fly" behavior. A more advanced option would be to use the "on the fly" behavior only for words/symbols/expressions marked in its entirety, or tweak minimum/maximum criteria required to perform automatic search, so that for example making it necessary that the mark have three or more characters, and no more than one line.
I already use such tool, but not to work the way mentioned ("on the fly"). Such tool is isearch. The best solution would be to use that same tool, but if not, then maybe there is a package or code that implement it in another way?
Hopefully it does not mess up with multiple cursors, so that multiple cursors have the highlight precedence.
If there is no complete solution, the most approaching is welcomed.
highlight-symbol
meet your needs? Check out its readme page on github, or even better.. try it out by installing from Melpa.swiper
package which has very good integration with multiple-cursors and occur. You can choose to use the marked region as initial swiper search pattern, but wrapping(swiper (buffer-substring-no-properties (region-beginning) (region-end)))
in an interactive function. The interface or the search flow is quite different from the traditional Isearch, but it might suit your needs. Again, try it out to decide.