You are not logged in.
I recently started using vim and I like it a lot. I have searched around and found a lot of places that talk about highlighting all search results - this is not what I want. My question is that when I do a search the first item that matches (while typing) is highlighted. But then when I hit "enter" the cursor jumps to the next position but the highlighting turns off. Is there any way to keep highlighting on after hitting "enter"? So that when I hit "n" the next match in front of the cursor is highlighted? Maybe until going into insert mode or something. Here is my .vimrc
set background=dark
set t_Co=256
set wrap
set display=lastline
syntax on
set number
set mouse=a
hi LineNr ctermfg=grey
set nocompatible
set incsearch
set virtualedit=onemore
map <C-c> :q
Last edited by dodo3773 (2011-08-25 02:11:11)
Offline
You are looking for hlsearch
Offline
You are looking for hlsearch
I tried "set hlsearch" But then they all highlight. Is there any way to just highlight the one that the mouse cursor is on?
Offline
That's in your colour scheme: the hl colour should be different from your cursor colour - that way you can see both the other matches and also your current selection.
# edit: in case I missed your point: if it only highlights where your cursor is, how will you tell where else the search is returned in your window?
Last edited by jasonwryan (2011-08-25 01:47:55)
Offline
That's in your colour scheme: the hl colour should be different from your cursor colour - that way you can see both the other matches and also your current selection.
I use the I-Beam cursor instead of Block cursor. Sorry, I should have mentioned that. Basically what I am trying to do is when I go to the next match only highlight that next match not all of them at once. Do you know if this is possible?
Offline
# edit: in case I missed your point: if it only highlights where your cursor is, how will you tell where else the search is returned in your window?
By going to the next matching expression. I just want to see them highlighted one at a time. Maybe it is not possible I am not sure. I am very new to vim.
Offline
I don't think so: the only thing I can suggest is toggling the highlights:
" space bar un-highligts search
:noremap <silent> <Space> :silent noh<Bar>echo<CR>
Last edited by jasonwryan (2011-08-25 02:05:09)
Offline
I don't think so: the only thing I can suggest is toggling the highlights:
" space bar un-highligts search :noremap <silent> <Space> :silent noh<Bar>echo<CR>
Very cool. I will use this for sure. Thanks.
I guess the answer to my question is no though. What I was looking for is not an available feature yet. Marking thread as solved.
Offline