Review your favorite Linux distribution.
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 08-04-2008, 04:45 AM   #1
LQ Newbie
Registered: Apr 2008
Posts: 12

Rep: Reputation: 0
Editor color problem

Today i open a configuration file for change using vi. But some how i enter any key instead go to insert mode. As a result a word rpm always cbackgroud color is red. When i type any word like rpm its color is red.How can i chnage its previous color.
Old 08-04-2008, 04:57 AM   #2
Registered: Feb 2004
Location: Australia
Distribution: Ubuntu, Fedora 10
Posts: 632

Rep: Reputation: 31
what configuration file did you open?
Old 08-04-2008, 04:59 AM   #3
LQ Newbie
Registered: Apr 2008
Posts: 12

Original Poster
Rep: Reputation: 0
I changed sources.list file for apt.
Old 08-04-2008, 01:11 PM   #4
Registered: Jan 2004
Location: Georgia
Distribution: OS X, CentOS
Posts: 669

Rep: Reputation: 34
That might be a keyword associated with that file type that vim recognizes, so it uses its "syntax highlighting"
Old 08-04-2008, 05:41 PM   #5
Mr. C.
Senior Member
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
No, the OP accidentally hit the / key, and is seeing the result of colored search results. Just perform a search for a non-existent pattern and the search highlight will off:


Last edited by Mr. C.; 08-05-2008 at 01:35 AM.
Old 08-05-2008, 12:23 AM   #6
LQ Newbie
Registered: Apr 2008
Posts: 12

Original Poster
Rep: Reputation: 0
Mr.C is is absolutely right.
Old 08-05-2008, 12:30 PM   #7
LQ Newbie
Registered: Jul 2008
Location: US
Distribution: Ubuntu
Posts: 6

Rep: Reputation: 0
to turn of search highlighting just do the following :nohlsearch
if you want to automate this open ~/.vimrc and add the following

function ToggleHLSearch ()
if $hls
set nohls
set hls

map <F4> :set hls!<CR>:set hls?<CR>

this way you can turn of highlighting by just hitting F4 key.


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
color in vi editor hegdeshashi Linux - Newbie 4 03-17-2006 08:21 AM
remove color after word search in vi editor dylan912 Linux - Newbie 1 12-10-2004 04:15 AM
color vi text editor in redhat 7.3 (vs 7.2) robeb Linux - Distributions 8 08-31-2003 04:02 AM
Color html editor that loads fast? SharpyWarpy Linux - Software 4 03-16-2003 02:58 PM
vi editor color control in RH8.0 bauld Linux - General 1 02-06-2003 04:27 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:32 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