47353Re: Change highlighted pattern, don't move cursor/window
- Feb 1, 2004Sven Guckes wrote:
>That doesn't seem to do it. It only highlights the next
> * Fred Ma <fma@...> [2004-02-01]:
> > When I use vim to search for a pattern with the "/", the
> > cursor moves to the next occurance, and all matching text is
> > highlighted. That's almost exactly what I want. I want to
> > provide a pattern to highlight from the command line, but I
> > don't want the cursor to move, or the window to scroll.
> sounds like you want "incremental search". see ":help incsearch".
occurance. Also, in order not to move the cursor, I have
to not complete the search command, which terminates even
> > I thought I could find where vim stores it's notion of lastI tried yanking a search expression into register '/', but
> > pattern searched for, but can't seem to find it.
> the last search pattern is in register '/'.
turns out that it's not possible (the help on registers).
Fortunately, I can assign to register "/", and it does
force highlighting of all text matching the new expression.
Thanks for the hint on which register to read up on.
Dept. of Electronics, Carleton University
1125 Colonel By Drive, Ottawa, Ontario
Canada, K1S 5B6
- << Previous post in topic