[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim
Subject:    Re: Syntax coloring - differentiation
From:       "Antoine J. Mechelynck" <antoine.mechelynck () belgacom ! net>
Date:       2003-11-26 23:01:03
[Download RAW message or body]

David Fishburn <fishburn@ianywhere.com> wrote:
[snipped byline restored: Antoine J. Mechelynck wrote:]
[...]
> > Do you have incremental search on? What is the answer to
> >
> >     :verbose set incsearch? hlsearch?
> >
> > (with the question marks)?
> >
> > If both are on, try
> >
> >     :hi IncSearch gui=NONE guibg=yellow
>
>
> Okay, I think I am confusing some features.
>
> I did not have incsearch on, it is now, and the colouring does work.
>
> This is what I was confusing things with.
> When I type /http
> And 4 things are highlighted, what I would like to do is highlight the
> current word I am on a different colour.
>
> So /http, 4 instances go blue.  Since I am on the first 1, I would
> like it to be yellow.  When I hit n, the first instance should go
> blue and the 2nd instance should go yellow.
>
> Is that possible?
>
> Thanks,
> Dave

I don't think so, but maybe there is something "almost as good":

'Incsearch' shows (when enabled) the next match after the cursor in the
specified direction while you type the pattern (and before you confirm it by
<Enter> or cancel it by <Esc>). Every time you add or remove one character
from the pattern, the highlighted area changes accordingly, disappears if
there is no match, reappears if there is again a match. IIUC, you have found
how to make this work.

The "Search" coloring applies to all matches, but only after you have hit
<Enter>. IIUC, this is what you describe.

n or N jumps to the next or previous match (from the cursor relative to the
search direction) respectively; and you can allow or disallow search
wrap-around from the end to the beginning of the file or vice-versa (the
option for that is 'wrapscan'). To jump briefly to the next (or previous)
match and come back to wherever the cursor was (not necessarily on a match),
use, in Noraml mode, n (or N) followed by Ctrl-O.

Since (after a search or a search-again) the current match is the one with
the cursor on it; what you can do is changing the blinking rate and delay of
the cursor, or even its colour and (on all gui and some non-gui versions)
its shape, to make it more visible.

See
    :help 'guicursor'

which applies to some non-gui versions of Vim (and all gui versions). It
resends to ":help xterm-blink" for info about making the cursor blink in an
xterm.

The highlight group for the cursor is Cursor (if no keymap or
language-mappings are in effect) or lCursor (if they are). It works in the
GUI; I don't have a console Vim near at hand to test it there.

HTH,
Tony.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic