LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Quick VIM question (unhighlighting search terms after search) (https://www.linuxquestions.org/questions/linux-newbie-8/quick-vim-question-unhighlighting-search-terms-after-search-179177/)

lrt2003 05-08-2004 01:31 AM

Quick VIM question (unhighlighting search terms after search)
 
When I do a search with /<pattern>, I can't get it to unhighlight the search term after the search. how do you do this?

thnx

sakulagi 05-08-2004 02:41 AM

I mapped <F5> as a switch:

echo map \<F5\> :set hls\!\<bar\>set hls?\<CR\> >> ~/.vimrc

lrt2003 05-08-2004 02:49 AM

thanks that worked, though is there a "normal" option to stop the search and get back to normal, like a built in command that works universally?

arvind_sv 05-08-2004 09:01 AM

Hi,

Try this:

:noh

For more on this:

:help noh

Arvind

lrt2003 05-08-2004 10:28 AM

yep works good thanks!

hw-tph 05-08-2004 05:21 PM

I use this in my ~/.vimrc to map disable highlighting to Ctrl+N:
Code:

nmap <silent> <C-N> :silent noh<CR>
I think I stole this from the great Tips section on vim.org.


Håkan


All times are GMT -5. The time now is 04:45 AM.