[NTLUG:Discuss] Vi

MadHat madhat at unspecific.com
Thu Nov 7 08:11:23 CST 2002


On Tue, 2002-11-05 at 09:21, Patrick Parks wrote:
> I have been building web pages in Vi lately, trying to learn it and have
> come across a problem (more of an irritation than a problem). As I was
> editing the html, I did something in vi to cause it to highlight all of
> my <tr> tags red. I know this is not very much information, so if you
> need more, tell me what you need. It has not affected the code, it is
> just irritating to look at when coding, it makes me think something is
> wrong, when it is not. Thanks

did you do a search for <tr> at some point in time?

if so, I am not sure how to deselect the search pattern.  I will just
search for some nonsense I know it won't find to get rid of the
highlighting, but I found this tidbit searching that is a good idea and
works well.  Just put that in your .vimrc


http://www-vlsi.stanford.edu/~jsolomon/vim/

-  Toggling Highlight Search

One of the great features of VIM is highlight search (hlsearch). This
will highlight the text that matched the last search wherever it
occurred in the file. This make things very easy to see visually. The
only problem is what to do when you don't want to see the matching text
stand out anymore. In this case, you may try to cancel the search but
you can't really do that. What you really want to do is turn off
highlight search. I've mapped F5 to toggle hlsearch on and off. This
way, when I search for something, I can hit F5 to see all the matches
and then hit it again when I'm done. I think I got the actual code to do
this from a VIM newsgroup:

map <F5> :set hls!<bar>set hls?<CR>



-- 
MadHat at Unspecific.com
"Anyone who understands Linux/Unix, really understands the universe.
 Anyone who understands Windows, really understands Windows."
          - Richard Thieme, DefCon 10, 2002 




More information about the Discuss mailing list