Saturday, October 29, 2011

Re: Vim search with multiple windows open

> What I am looking for is to have all occurrences/matches within other windows highlighted as I type within active window.
> Please let me know if there is a way to do this.

Well, I found a way with mappings, but terribly ugly and breaks so
much I'm too ashamed to relate it.

How about, as a half measure, with

:set cpo+=x hlsearch
:cmap <f4> <esc>N/<up>

so while typing your search, press f4 to have the search so far
highlighted by the hlsearch mechanism?
It has side effects, doesn't work well with ? searches, and I'm sure
has other glitches.

(Aside for experts: can vimscript tell, say in a function called by a
mapping using <ctrl-r>=, or in an <expr> mapping, what the current
command mode is? I mean ":", "/" or "?". mode() just returns "c".)

Regards, John

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: