It's not a mintty issue, it's due to the fact that msys vim doesn't
support colours (i.e. there is no terminfo support).
Chris
Hrm, looks I spoke to soon, there is limited terminal support in msys
vim. In mintty set Options > Terminal > type to 'msys' (without the
quotes), restart mintty, and you will have a similar experience to
rxvt. This is based on the TERM variable being set to 'msys' when
running msys.bat --rxvt.
Chris
I don't think that's the right fix. TERM=msys is intended for the MSYS
console, which isn't all that xterm-compatible, as mintty tries to be.
Hence you're likely to find other problems due to this.
The underlying problem here is that MSYS still uses the prehistoric
termcap library instead of terminfo. Termcap has the rather
unfortunate restriction that entries in its /etc/termcap database are
limited to 1023 characters. The MSYS console's somewhat limited
capabilities fit into that, but xterm's do not. Therefore some xterm
capabilities have been left out of /etc/termcap, including those for
changing colour.
However, instead of falsifying TERM, you can fill in the missing
capabilities in .vimrc. For example, to enable 8-colour mode:
let &t_Co=8
let &t_AF="\e[3%dm"
let &t_AB="\e[4%dm"
Or to enable the full 256 colours:
let &t_Co=256
let &t_AF="\e[38;5;%dm"
let &t_AB="\e[48;5;%dm"
If you're using mintty's default white-on-black colours, I'd also
recommend adding the following to get vim to adapt its use of colours
to the dark background:
set bg=dark
Regards,
Andy
ps: Of course the real fix here is to use latest Cygwin instead of
MSYS (née Cygwin 1.3), which among countless other advances uses
terminfo rather than termcap.
> let&t_AB="\e[4%dm"
>
> Or to enable the full 256 colours:
>
> let&t_Co=256
> let&t_AF="\e[38;5;%dm"
> let&t_AB="\e[48;5;%dm"
>
> If you're using mintty's default white-on-black colours, I'd also
> recommend adding the following to get vim to adapt its use of colours
> to the dark background:
>
> set bg=dark
This is a great tip! Mind if I re-post to the msys mailing list and add
it to the MinGW wiki?
Thank you,
Chris
Of course not, that would be good. Better tone down the 'prehistoric'
bit though. ;)
Thanks,
Andy
Or, as the (new?) MSYS vim maintainer, you could include it in the
global vim config at /share/vim/vimrc, guarded by
if &term=="xterm"
...
endif
Regards,
Andy
Done, thank you again for the tip! ;)
Chris
Great.
I thought of a small improvement to that: check whether &term starts
with 'xterm' rather than whether it's equal to 'xterm', in case the
user has set it to 'xterm-256color' or some such.
if &term =~ "^xterm"
...
endif
Cheers,
Andy