Sunday, September 30, 2012

Re: Change colour of cursor and matching bracket

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

> 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.

>
> 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?

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? 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

--
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: