LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Editor color problem (https://www.linuxquestions.org/questions/linux-newbie-8/editor-color-problem-660292/)

prasunhowlader 08-04-2008 04:45 AM

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.

jax8 08-04-2008 04:57 AM

what configuration file did you open?

prasunhowlader 08-04-2008 04:59 AM

I changed sources.list file for apt.

student04 08-04-2008 01:11 PM

That might be a keyword associated with that file type that vim recognizes, so it uses its "syntax highlighting"

Mr. C. 08-04-2008 05:41 PM

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

prasunhowlader 08-05-2008 12:23 AM

Mr.C is is absolutely right.

henokmikre 08-05-2008 12:30 PM

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.


All times are GMT -5. The time now is 01:09 AM.