highlighting is become annoying after I found the target word by using /string in vim , could any body tell me what is the quickest way to shutdown highlighting ? thanks
            Asked
            
        
        
            Active
            
        
            Viewed 224 times
        
    1 Answers
9
            The simplest way is to enter the :noh command.
Additionally, you can add this line to your .vimrc to map that command to the Enter key, so you can simply press Enter after searching to clear highlight:
:nnoremap <CR> :noh<CR><CR>
 
    
    
        Community
        
- 1
- 1
 
    
    
        Jonathon Reinhart
        
- 132,704
- 33
- 254
- 328
- 
                    by the way .. i've tried add that magic line but the vim become very strange . – Yank Oct 25 '12 at 04:11
- 
                    in which line should i add this sentence? – Yank Oct 25 '12 at 04:13
- 
                    1My original post had it mapped to `Esc`. I've changed to to `` which is `Enter`. That may help, as I remember `Esc` acting kind of funny too. – Jonathon Reinhart Oct 25 '12 at 04:15
- 
                    ...anywhere in your `~/.vimrc` file. – Jonathon Reinhart Oct 25 '12 at 04:16
- 
                    @Yan note that you don't need the `:` in front of `nnoremap` to add to your `.vimrc` – K Z Oct 25 '12 at 04:17
