LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-04-2008, 05:45 AM   #1
prasunhowlader
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, 05:57 AM   #2
jax8
Member
 
Registered: Feb 2004
Location: Australia
Distribution: Ubuntu, Fedora 10
Posts: 632

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

Original Poster
Rep: Reputation: 0
I changed sources.list file for apt.
 
Old 08-04-2008, 02:11 PM   #4
student04
Member
 
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, 06: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:

/asdflsfdjslf

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

Original Poster
Rep: Reputation: 0
Mr.C is is absolutely right.
 
Old 08-05-2008, 01:30 PM   #7
henokmikre
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
else
set hls
endif
endfunction

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

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


Reply


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


All times are GMT -5. The time now is 05:58 AM.

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