Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-30-2003, 12:48 PM   #1
LQ Newbie
Registered: Oct 2003
Posts: 2

Rep: Reputation: 0
Question can't get rid of highlighted items in vi

I am starting to play with the wonderful vi editor and have gotten stuck...while making a new file, I was trying to put comments in by using a # sign but didn't realize I was in command mode. When I pressed # it did like a search or find command and highlighted the first /directory/ it could find. And now any file I open with vi, if there is a line with /directory/ in it, it will highlight it. How can I make the highlights go away?
Old 10-30-2003, 01:03 PM   #2
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63
search fo something that isn't common...
vi whatever
esc to go in command mode

It's lame and I'm sure there is another way around it but it won't highlight whatever you searched for last...
Old 10-30-2003, 01:07 PM   #3
Senior Member
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
I think
:set nohlt
will turn off highlighting. Something similar.

:set hlt
will turn it back on again.
Old 10-30-2003, 03:12 PM   #4
Registered: Oct 2003
Distribution: Debian/unstable
Posts: 85

Rep: Reputation: 15
:help highlight ?
Old 10-30-2003, 07:26 PM   #5
LQ Newbie
Registered: Oct 2003
Posts: 2

Original Poster
Rep: Reputation: 0
thank you guyz - I used the first suggestion and vi did a search without any match - resulting in removing the highlighted search items!

--2 wrongz never make a right, but 3 do!--
Old 10-31-2003, 05:21 AM   #6
Registered: Apr 2003
Location: Netherlands
Distribution: SuSE (before: Gentoo, Slackware)
Posts: 613

Rep: Reputation: 30
But seriously, isn't there any way to tell VI you've completed the search?

I find it a bit weird that an editor requires me to type /dsfsdfsd while it's other commands are so short and fast in their use


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
All messages are highlighted in Kopete! Bjorne Linux - Software 2 08-18-2005 05:31 AM
Corrupt file, highlighted in red BPT73 Linux - Newbie 2 05-06-2005 07:30 PM
Desktop items johnnydangerous Fedora 2 03-05-2005 09:34 AM
/lib/modules/2.4.20-6/ contains an entry called "build" which is highlighted in red - Simon Bridge Linux - Software 1 01-24-2004 09:46 PM
Highlighted text in Vi doncrawley Linux - Newbie 3 10-18-2003 08:37 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:23 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration