LinuxQuestions.org
Visit Jeremy's Blog.
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 07-18-2011, 09:20 PM   #1
casualzone
Member
 
Registered: Jan 2010
Posts: 189

Rep: Reputation: 15
How to change vi/vim color setting


I have changed my background color of xterm/konsole to black (better for eye since i got to face monitor for long hour).

In my vi file, there is a color setting to put all comment # with deep blue color. This make it very difficult to see if the blackground color is black color.

How could i change color setting in vi or vim ?
I want to change the blue color to cyan.
 
Old 07-18-2011, 09:39 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
Have a good look through here https://code.google.com/p/vimcolorschemetest/ & http://www.vim.org/
 
Old 07-19-2011, 02:18 AM   #3
casualzone
Member
 
Registered: Jan 2010
Posts: 189

Original Poster
Rep: Reputation: 15
The vim already has different colors.
For example: the # (comment) is deep blue color, number is red color, bracket is brown color.

What file should I change so that i could modify the comment color from deep blue to cyan.
 
Old 07-19-2011, 02:45 AM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
http://www.google.com/cse?cx=partner...www.vim.org%2F



Cheers,
Tink
 
Old 07-19-2011, 02:50 AM   #5
casualzone
Member
 
Registered: Jan 2010
Posts: 189

Original Poster
Rep: Reputation: 15
at my home

mkdir .vim
cd .vim
mkdir .syntax
cd .syntax
cp /usr/share/vim/vim70/syntax/syncolor.vim .

try to modify the syncolor.vim file.
But the vim color does not change.
will the system look for my local syncolor.vim file?
 
Old 07-19-2011, 03:02 AM   #6
casualzone
Member
 
Registered: Jan 2010
Posts: 189

Original Poster
Rep: Reputation: 15
at home

vi .vimrc
highlight comment ctermfg=lightblue
 
Old 07-19-2011, 08:56 AM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Sorry, I don't know about syntax files.

The vim :highlight command shows names and associated colours.

The terminal can handle as many colours as are shown by tput colors

/usr/share/vim/vim72/colors/* files are useful examples.

To experiment with vim colours, copy a /usr/share/vim/vim72/colors/* file to ~/.vim/colors and modify it.

In ~/.vimrc, try set background=dark and see if vim adjusts itself (didn't work for me).

Here are some .vimrc color adjustments but mostly for light background so only useful as examples
Code:
"hi LineNr ctermfg=grey guifg=grey
"hi Statement ctermfg=black guifg=black
hi Identifier ctermfg=darkGreen guifg=darkGreen
hi Comment term=bold ctermfg=4 guifg=#406090
hi Constant term=underline ctermfg=Red guifg=#c00058
hi Special term=bold ctermfg=Blue guifg=SlateBlue
hi Identifier term=underline ctermfg=Black guifg=Black
hi Statement term=bold ctermfg=Brown gui=bold guifg=Brown
hi PreProc term=underline ctermfg=Magenta guifg=Magenta3
hi Type term=underline ctermfg=Green gui=bold guifg=SeaGreen
hi Ignore cterm=bold ctermfg=7 guifg=bg
hi Error term=reverse cterm=bold ctermfg=7 ctermbg=1 gui=bold guifg=White guibg=Red
hi Todo term=standout ctermfg=0 ctermbg=3 guifg=Blue guibg=Yellow
 
Old 07-20-2011, 01:15 AM   #8
casualzone
Member
 
Registered: Jan 2010
Posts: 189

Original Poster
Rep: Reputation: 15
thank you very much

i only change this
vi .vimrc
highlight comment ctermfg=lightblue

it works
 
Old 07-20-2011, 01:58 AM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Glad you found a solution and thanks for sharing it.

Threads can be marked SOLVED via the Thread Tools menu.
 
  


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
Favorite 256-color vim color scheme dugan Programming 9 11-15-2016 12:59 PM
VIM background color setting no effect twwwater Linux - Software 2 05-12-2009 06:20 AM
VIM in Color aardwolf64 Linux - Newbie 3 05-04-2006 01:06 AM
How do I change color depth setting from root login? everest Debian 12 07-07-2004 05:20 PM
vim color highlighting new_user10 Programming 9 11-02-2003 01:40 PM


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