Quantcast

Changing elements of a color scheme

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Changing elements of a color scheme

Eric Weir

I've discovered a color scheme that I like better than the one I've been using since starting with Vim/MacVim a few months ago. However, there's one element that clashes for me -- the color of the cursor. I know what color I'd like it to be, i.e., the color that CameCase words get in a plugin I use using this scheme.

How do I change the color of the cursor? How do I identify and specify the color I want?

Thanks,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA  USA
[hidden email]




--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

David Henderson
On 07 Jul 2011, at 07:26, Eric Weir wrote:

>
> I've discovered a color scheme that I like better than the one I've been using since starting with Vim/MacVim a few months ago. However, there's one element that clashes for me -- the color of the cursor. I know what color I'd like it to be, i.e., the color that CameCase words get in a plugin I use using this scheme.
>
> How do I change the color of the cursor? How do I identify and specify the color I want?
>
:help :colorscheme

there is a Readme file on color schemes at :e $VIMRUNTIME/colors/README.txt.

I would suggest copying the color scheme you like to ~/.vim/colors/, renaming it, and setting the modified copy as your color scheme.

You can try color names <http://en.wikipedia.org/wiki/List_of_colors> or use #RRGGBB hexadecimal notation in color schemes. Names work if defined in vim, RGB notation always works.

David P Henderson
c: xxx.xxx.xxxx
--
"You can't have capitalism on the way up and socialism on the way down."
   -- Newt Gingrich

--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

Eric Weir

On Jul 7, 2011, at 11:40 AM, David Patrick Henderson wrote:

> :help :colorscheme
>
> there is a Readme file on color schemes at :e $VIMRUNTIME/colors/README.txt.
>
> I would suggest copying the color scheme you like to ~/.vim/colors/, renaming it, and setting the modified copy as your color scheme.
>
> You can try color names <http://en.wikipedia.org/wiki/List_of_colors> or use #RRGGBB hexadecimal notation in color schemes. Names work if defined in vim, RGB notation always works.

Thanks, David. A new arena of learning in Vim for me. This will be very helpful.

Regarding the third item above, I use MacVim. Currently the color scheme in question resides only in the runtime folder in the MacVim package. If I copy it to ~/.vim/colors will it supersede the copy in the runtime folder? x

Regards,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA  USA
[hidden email]




--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

David Henderson
On 07 Jul 2011, at 09:25, Eric Weir wrote:

> Thanks, David. A new arena of learning in Vim for me. This will be very helpful.

No problem, I always say when one stops learning one is dead.
>
> Regarding the third item above, I use MacVim. Currently the color scheme in question resides only in the runtime folder in the MacVim package. If I copy it to ~/.vim/colors will it supersede the copy in the runtime folder? x

I believe that is correct, but if you rename the scheme there will be no question of what is happening as regards loading (I also use MacVim).

David P Henderson
c: xxx.xxx.xxxx
--
"Criticizing evolutionary theory because Darwin was limited is like claiming computers don't work because Chuck Babbage didn't foresee Duke Nukem 3."
   -- Patrick Coskren

--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

Eric Weir
In reply to this post by David Henderson

On Jul 7, 2011, at 11:40 AM, David Patrick Henderson wrote:

> I would suggest copying the color scheme you like to ~/.vim/colors/, renaming it, and setting the modified copy as your color scheme.
>
> You can try color names <http://en.wikipedia.org/wiki/List_of_colors> or use #RRGGBB hexadecimal notation in color schemes. Names work if defined in vim, RGB notation always works.

Thanks again, David,

I'm pretty certain I've identified the color from this. It's called "Blue"! [Or in hexadecimal, #0000FF.]

I've coped the scheme from the runtime folder to ~/.vim/colors. I don't want to change the copy in the runtime folder. How do I get the copy in ~/.vim/colors to control?  

------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA  USA
[hidden email]




--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

David Henderson
On 07 Jul 2011, at 10:40, Eric Weir wrote:

> I've coped the scheme from the runtime folder to ~/.vim/colors. I don't want to change the copy in the runtime folder. How do I get the copy in ~/.vim/colors to control?  

Easiest way is to rename it and set up your .gvimrc with at least one setting:

:color scheme name_of_colorscheme

.gvimrc is generally where one inserts configuration directives that apply only to gui versions of vim: like MacVim or gvim on unix/linux systems.

David P Henderson
c: 757.286.3212
--
"Beautiful bodies and beautiful personalities rarely go together."
    -- Carl Jung

--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

Eric Weir
In reply to this post by David Henderson

> On Jul 7, 2011, at 1:01 PM, David Patrick Henderson wrote:
>
>> On 07 Jul 2011, at 09:25, Eric Weir wrote:
>>
>> Thanks, David. A new arena of learning in Vim for me. This will be very helpful.
>
> No problem, I always say when one stops learning one is dead.

For sure!

>> Regarding the third item above, I use MacVim. Currently the color scheme in question resides only in the runtime folder in the MacVim package. If I copy it to ~/.vim/colors will it supersede the copy in the runtime folder?
>
> I believe that is correct, but if you rename the scheme there will be no question of what is happening as regards loading (I also use MacVim).

I did it! Changed the name of the color in the copy of the scheme in ~/.vim/colors. Then, taking a cue from this provided by Reid Thompson: http://www.vim.org/scripts/script.php?script_id=106

I did

:w [to the ~/.vim/colors copy of the scheme]
then
:so %

And there it was.

More to be learned from all the resources I've been provided, but thanks again to everyone who responded.

Sincerely,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA  USA
[hidden email]




--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

Eric Weir
In reply to this post by David Henderson

On Jul 7, 2011, at 1:48 PM, David Patrick Henderson wrote:

> Easiest way is to rename it and set up your .gvimrc with at least one setting:
>
> :color scheme name_of_colorscheme
>
> .gvimrc is generally where one inserts configuration directives that apply only to gui versions of vim: like MacVim or gvim on unix/linux systems.

Thanks. That was where I'd specified the scheme. Didn't know which copy, the one in /runtime/colors or ~/.vim/colors, would control. Apparently the latter.

------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA  USA
[hidden email]




--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

David Henderson
On 07 Jul 2011, at 11:09, Eric Weir wrote:

> Thanks. That was where I'd specified the scheme. Didn't know which copy, the one in /runtime/colors or ~/.vim/colors, would control. Apparently the latter.

~/.vim should load last on vim startup and therefore override anything that came before.

David P Henderson
c: xxx.xxx.xxxx
--
"Premature optimization is the root of all evil."
    -- C. A. R. "Tony" Hoare

--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

Niklas Lindström
In reply to this post by David Henderson
Hi!

On Thu, Jul 7, 2011 at 7:48 PM, David Patrick Henderson
<[hidden email]> wrote:
> On 07 Jul 2011, at 10:40, Eric Weir wrote:
>
>> I've coped the scheme from the runtime folder to ~/.vim/colors. I don't want to change the copy in the runtime folder. How do I get the copy in ~/.vim/colors to control?
>
> Easiest way is to rename it and set up your .gvimrc with at least one setting:
>
> :color scheme name_of_colorscheme
>
> .gvimrc is generally where one inserts configuration directives that apply only to gui versions of vim: like MacVim or gvim on unix/linux systems.

I use the following approach to customize a colorscheme. Create a new,
empty file in "~/.vim/colors/" and add something like the following
(here a "zellner_mod.vim" modifying the zellner colorscheme):

    runtime colors/zellner.vim

    let g:colors_name = "zellner_mod"

    hi LineNr       guibg=grey
    hi NonText      guibg=grey      guifg=darkgreen
    hi StatusLine   guibg=grey48

Then use :colorscheme zellner_mod to load it.

Best regards,
Niklas

--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

retiredff
Here is my setting for the cursor: USE YOUR OWN COLORS  <=============


" ==================================================
" Change cursor color in different modes
" ==================================================

hi Cursor               guifg=White         guibg=DodgerBlue3   guifg=white
hi iCursor              guifg=White         guibg=red

set guicursor=n-v-c:block-Cursor
set guicursor+=i-ci:ver25-iCursor

Tony
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

Eric Weir
In reply to this post by Niklas Lindström

On Jul 7, 2011, at 4:37 PM, Niklas Lindström wrote:

> I use the following approach to customize a colorscheme. Create a new,
> empty file in "~/.vim/colors/" and add something like the following
> (here a "zellner_mod.vim" modifying the zellner colorscheme):
>
>    runtime colors/zellner.vim
>
>    let g:colors_name = "zellner_mod"
>
>    hi LineNr       guibg=grey
>    hi NonText      guibg=grey      guifg=darkgreen
>    hi StatusLine   guibg=grey48
>
> Then use :colorscheme zellner_mod to load it.

Thanks, Niklas. With help of the list I was able to change the color of the cursor, and actually to experiment a bit with colors, in the scheme in question.

As I understand your suggestion, it strike me as similar to this, which Reid Thompson shared with me off list.
http://www.vim.org/scripts/script.php?script_id=106 But perhaps I am mistaken?

Sincerely,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA  USA
[hidden email]




--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

Eric Weir
In reply to this post by retiredff

On Jul 7, 2011, at 8:28 PM, retiredff wrote:

> Here is my setting for the cursor: USE YOUR OWN COLORS  <=============
>
> " ==================================================
> " Change cursor color in different modes
> " ==================================================
>
> hi Cursor               guifg=White         guibg=DodgerBlue3   guifg=white
> hi iCursor              guifg=White         guibg=red
>
> set guicursor=n-v-c:block-Cursor
> set guicursor+=i-ci:ver25-iCursor

Thanks, Tony. I didn't do anything like the last two lines, but I did what you've done in the first to in the cursor lines for the gui and the terminal in the scheme.

Sincerely,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA  USA
[hidden email]




--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

retiredff
your welcome...

I'm working on reconfiguring my statusline so it is similar to the one in Cream.

http://cream.sourceforge.net/statusline.html

Tony

On Jul 8, 2011, at 10:09 AM, Eric Weir wrote:

>
> On Jul 7, 2011, at 8:28 PM, retiredff wrote:
>
>> Here is my setting for the cursor: USE YOUR OWN COLORS  <=============
>>
>> " ==================================================
>> " Change cursor color in different modes
>> " ==================================================
>>
>> hi Cursor               guifg=White         guibg=DodgerBlue3   guifg=white
>> hi iCursor              guifg=White         guibg=red
>>
>> set guicursor=n-v-c:block-Cursor
>> set guicursor+=i-ci:ver25-iCursor
>
> Thanks, Tony. I didn't do anything like the last two lines, but I did what you've done in the first to in the cursor lines for the gui and the terminal in the scheme.
>
> Sincerely,
> ------------------------------------------------------------------------------------------
> Eric Weir
> Decatur, GA  USA
> [hidden email]
>
>
>
>
> --
> You received this message from the "vim_mac" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

Eric Weir

On Jul 8, 2011, at 10:45 AM, Tony Berkopes wrote:

> I'm working on reconfiguring my statusline so it is similar to the one in Cream.
>
> http://cream.sourceforge.net/statusline.html

Yeah, I noticed that. As a novice, I haven't even gotten around to that, yet.

------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA  USA
[hidden email]




--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

Tony Mechelynck
In reply to this post by Eric Weir
On 07/07/11 16:26, Eric Weir wrote:

>
> I've discovered a color scheme that I like better than the one I've been using since starting with Vim/MacVim a few months ago. However, there's one element that clashes for me -- the color of the cursor. I know what color I'd like it to be, i.e., the color that CameCase words get in a plugin I use using this scheme.
>
> How do I change the color of the cursor? How do I identify and specify the color I want?
>
> Thanks,
> ------------------------------------------------------------------------------------------
> Eric Weir
> Decatur, GA  USA
> [hidden email]
>
>
>
>

1) If the colorscheme you've come to love is one distributed with Vim
(and found in $VIMRUNTIME/colors/) then don't modify it in-place. The
way to modify such a scheme for your own youse is to:

a) Make sure that directory $HOME/.vim/colors exists, and if necessary,
create it, with its parent if that doesn't yet exist either
b) Copy the colorscheme you want to edit into that new directory, and
give it a new name that doesn't clash with the name of any existing
colorscheme
c) THEN you may modify that "new" colorscheme without fear.

(Anything in the directory tree starting at $VIMRUNTIME may be silently
modified whenever you upgrade Vim.)

2) See
        :help 'guicursor'
        :help lCursor
        :help hl-Cursor
        :help hl-CursorIM
        :help CursorIM
for the names of the cursor colors used in the gvim or MacVim GUI. In
short, they are:
- Cursor     the cursor color for everything except what is said below
- lCursor    when a keymap (or language-mappings) are in effect
- CursorIM   when an Input Method (XIM or Windows IME) is in effect

See also:
        - about one page below ":help xfree-xterm" how to set the cursor color
in an xterm
        - ":help xterm-blink" to make the cursor blink in an xterm
        - the full ":help xterm-color" section about how to nudge some
particular terminals to get color in them
        - ":help termcap-cursor-color" about how to change cursor color in some
terminals when going into or out of Insert mode.


Best regards,
Tony.
--
Physicists do it with charm

--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

Eric Weir

On Jul 9, 2011, at 3:47 AM, Tony Mechelynck wrote:

> 1) If the colorscheme you've come to love is one distributed with Vim (and found in $VIMRUNTIME/colors/) then don't modify it in-place. The way to modify such a scheme for your own youse is to:
> a) Make sure that directory $HOME/.vim/colors exists, and if necessary, create it, with its parent if that doesn't yet exist either
> b) Copy the colorscheme you want to edit into that new directory, and give it a new name that doesn't clash with the name of any existing colorscheme
> c) THEN you may modify that "new" colorscheme without fear.
>
> (Anything in the directory tree starting at $VIMRUNTIME may be silently modified whenever you upgrade Vim.)

Thanks, Tony. Yeah, it was distributed with Vim, with MacVim that is. And I did what you said -- copied the scheme to ~/.vim/colors and made the changes there. And thanks, too, for the pointers to relevant help.

Sincerely,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA  USA
[hidden email]




--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing elements of a color scheme

Niklas Lindström
Hi,

On Sat, Jul 9, 2011 at 6:48 PM, Eric Weir <[hidden email]> wrote:

>
> On Jul 9, 2011, at 3:47 AM, Tony Mechelynck wrote:
>
>> 1) If the colorscheme you've come to love is one distributed with Vim (and found in $VIMRUNTIME/colors/) then don't modify it in-place. The way to modify such a scheme for your own youse is to:
>> a) Make sure that directory $HOME/.vim/colors exists, and if necessary, create it, with its parent if that doesn't yet exist either
>> b) Copy the colorscheme you want to edit into that new directory, and give it a new name that doesn't clash with the name of any existing colorscheme
>> c) THEN you may modify that "new" colorscheme without fear.
>>
>> (Anything in the directory tree starting at $VIMRUNTIME may be silently modified whenever you upgrade Vim.)
>
> Thanks, Tony. Yeah, it was distributed with Vim, with MacVim that is. And I did what you said -- copied the scheme to ~/.vim/colors and made the changes there. And thanks, too, for the pointers to relevant help.

Just to emphasise, with my suggestion step 'b' is slightly different:

- create a *new and empty* file in "~/.vim/colors/", for instance
"zellner_mod.vim",
- add the following (here *reusing* the zellner colorscheme):

   runtime colors/zellner.vim
   let g:colors_name = "zellner_mod"

- add or override any highlights you want,
- use :colorscheme zellner_mod to load it.

The key thing is that :runtime sources the colorscheme from where it
is -- so you don't have to copy its contents. This means it can be
updated and your modified version will get those changes as well
(unless it overrides them of course).

(See :help :runtime for details; the gist of it being that it works
like :source but looks for the path given in each directory by
'runtimepath' (i.e. $VIMRUNTIME, your local $HOME/.vim, eventual
pathogen bundles, etc.).)

('let g:colors_name = ...' is of course set to whatever name you gave
this new colorscheme.)

Best regards,
Niklas

--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Loading...