Sunday, September 30, 2012

Re: Change colour of cursor and matching bracket

On 11:12 Sun 30 Sep , Dotan Cohen 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? 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.
>
> 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, and a cyan background for the matching parenthesis / bracket.
>
> --
> Dotan Cohen

In vim (running in uxterm terminal) I use the following command to
change the color of the cursor:

:!echo -ne "\033]12;midnightblue\007"<CR>

I have several maps to different colors, setup like this:

map @1 :!echo -ne "\033]12;midnightblue\007"<CR><CR>

but there is the Cursor highlight group (:help hl-Cursor) which can be
used (here it doesn't work in vim, but it works in gvim).

To change the matching parent you have to play with MatchParen (:help
hl-MatchParen and also :help pi_paren.txt).

For example to get black on white matching paren (in both vim and gvim)
you can use:

hi MatchParen ctermfg=black ctermbg=white guifg=black guifg=white

Best regards,
Marcin Szamotulski


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