Thursday, September 10, 2009

how to un-highlight vim searches

The problem is basically this. If you have hlsearch set, then after you've searched for an expression, it remains highlighted. (I believe this is the default behavior in gvim. In vim on the console, I've seen the opposite.)

I got into the habit of turning off the highlight by searching for a bogus expression like


/asdfasdasdf


Turns out you can do this:


:nohlsearch


to turn of the highlighting.

If you do:


:set nohlsearch


then it turns off highlighting of searches compeltely. :)

4 comments:

Anonymous said...

And you can toggle it with something like this:
:map :set nohls!

Have fun with Vim! I surely do.

Joe

Anonymous said...

And you can toggle it with something like this:
:map <F4> :set nohls!<cr>

Have fun with Vim! I surely do.

Joe

BTW: maybe you should configure your blog-software, so that it doesn't treat pointy/angle-brackets as HTML.

raoul said...

Thanks for that tip!

(Sorry for the noob question but how do I configure blogspot to do that? :) This is still very much an amateur blog at this point. Working on improvements slowly...)

Anonymous said...

Uh, I don't know. I'm a total noob when it comes to blogging. Never ran a blog myself. My initial wild guess would be: check if there's a template for user-comments. If it's html/css-style try something like the 'pre'-element: http://www.w3.org/MarkUp/1995-archive/Elements/PRE.html That way, all comments would be processed "as-is", i.e.: they won't be rendered by the browsers' html-engine.

Again: just a wild guess. I don't know blogspot.

Joe