LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to change vi/vim color setting (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-change-vi-vim-color-setting-892400/)

casualzone 07-18-2011 08:20 PM

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.

chrism01 07-18-2011 08:39 PM

Have a good look through here https://code.google.com/p/vimcolorschemetest/ & http://www.vim.org/

casualzone 07-19-2011 01:18 AM

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.

Tinkster 07-19-2011 01:45 AM

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



Cheers,
Tink

casualzone 07-19-2011 01:50 AM

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?

casualzone 07-19-2011 02:02 AM

at home

vi .vimrc
highlight comment ctermfg=lightblue

catkin 07-19-2011 07:56 AM

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


casualzone 07-20-2011 12:15 AM

thank you very much :)

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

it works :)

catkin 07-20-2011 12:58 AM

Glad you found a solution and thanks for sharing it.

Threads can be marked SOLVED via the Thread Tools menu.


All times are GMT -5. The time now is 01:00 PM.