Tuesday, October 2, 2012

Re: Change colour of cursor and matching bracket

On Sun, Sep 30, 2012 at 11:20 PM, Ben Fritz <fritzophrenic@gmail.com> wrote:
> On Sunday, September 30, 2012 4:12:21 AM UTC-5, dotancohen wrote:
>> Where in the fine manual is it mentioned how to change the colour of
>>
>> the cursor and the colour of the matching parenthesis / bracket for
>>
>> all file types?
>
> :he hl-Cursor
> :he hl-MatchParen
>

Thank you, but that just leads to a link to Syntax highlighting.
Ostensibly this is what I want, but on my system (Kubuntu with VIM 7.3
running in Konsole, and also tried SSHing into CentOS with VIM 7.2
from the same Konsole) configuration such as the following do not
change the matched parenthesis:

highlight MatchParen cterm=bold ctermfg=red ctermbg=blue


>> I have tried ":h cursor color" and several other
>>
>> phrases, the only relevant one that I found it "h color" which did not
>>
>> lead me to the answer. I have tried "highlight MatchParen cterm=bold
>>
>> ctermfg=red ctermbg=blue" but this did not change the colour of the
>>
>> matching parenthesis or bracket.
>>
>
> This should have worked, assuming you're using Vim in a terminal and not gvim. For gvim you'd need guifg and guibg highlights. See :help :highlight, :help highlight-args, and the following text for details on the command.
>

Yes, this was in VIM, not GVIM.


>> It seems that no matter what I define in .vimrc, VIM still uses the
>>
>> reverse colours of the item (swap background and foreground) for the
>>
>> cursor
>
> You don't mention specifically what you tried, but the default cursor highlight (at least for my gvim install on Lubuntu) is guibg=fg guifg=bg, which would indeed reverse the color, so this makes sense if nothing you tried actually was correct. So what DID you try, if you can't get it working with a "hi Cursor ..." command?
>
>> and a cyan background for the matching parenthesis / bracket.
>>
>
> You used ctermfg and ctermbg, so I'll assume you're using a terminal (and a color one at that). Do the numbers (instead of the names) in :help cterm-colors work any better?
>

No, unfortunately the numbers did not work either. I'll start playing
around with clean .vimrc and .vim/ to see if something in there is
interfering.


> What does :verbose hi Cursor and :verbose hi MatchParen show you? Perhaps the :hi command in your .vimrc is being overwritten later by a colorscheme command or something.
>
> Do :hi commands for other items work? Do you get colorful and customizable syntax highlighting, for example?

Yes, syntax highlighting works in all languages that I have tried.


> Perhaps your terminal is misconfigured so that Vim doesn't realize it's a color terminal. I won't be much help in that regard, but I know you can cheat within Vim by setting t_Co and some other terminal codes. Do a :helpgrep t_Co and browse the list of hits for details. Or search the wiki: http://vim.wikia.com/wiki/index.php?search=t_Co&fulltext=Search

Thanks, I'll get on that!


--
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

--
You received this message from the "vim_use" 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

No comments: