Sunday, September 30, 2012

Re: Change colour of cursor and matching bracket

On 30.09.12 11:12, 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.

For the cursor, I just set the initial colour in the xterm:

col='-fg yellow -bg darkslategrey -cr red' # Colours
/usr/bin/xterm $col # and lots more options.

In Vim, I then only change the cursor colour to indicate whether we're
in insert mode or not, without having to look down at the status bar:

" Cursor Appearance: (Insert_Mode == Green, Normal_Mode == Red)
if &term =~ "xterm"
let &t_SI = "\<Esc>]12;green\x7"
let &t_EI = "\<Esc>]12;red\x7"
endif

But the method could be used in other contexts, I guess.

As regards MatchParen colouring, I've only made sure that is turned
off, since it drove me nuts when I tried it. The bouncing cursor is more
than enough.

Erik

--
Habit is habit, and not to be flung out of the window by any man, but
coaxed down-stairs a step at a time.
- Mark Twain, "Pudd'nhead Wilson's Calendar

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

Post a Comment