On Mo, 10 Apr 05:00:26 +0000
tu...@posteo.de wrote:
I am playing around with colorschemes in vim […]
Wrong mailing list?

It seems impossible to change the fore-/background color of the cursor itself.
What have you tried by yourself so far to come to this conclusion at the
end? Or is it not much more as a guess while you are waiting for a
solution from the list?

There are so many resources out there. Have you ever searched for it?

[…] the terminal is able to display 256 colors
From which terminal emulator are you talking about? And of course, are
you using ‘app-editors/vim’, ‘app-editors/vim-core’, USE=minimal or even
‘app-editors/neovim’?

Is there something special terminal-wise when setting cursor colors ?
You have to deal with terminal escape sequences which may cause
headaches. Vim usually inherits its terminal options from the terminfo
file (man 5 terminfo) specified by the ${TERM} variable or at command
line as argument for the parameter ‘-T’.

Within Vim’s command line invoke (without the quotes) ‘:set termcap’ to
see what is currently set in your Vim session. To get an idea what those
output means, read the help at ‘:help terminal-options’. But it may be
worth to check first Vim is able to set cursor shape/colour related stuff by running:
   vim --version
or within Vim any of:
   :version
   :echo has('cursorshape')
and look it is compiled with the '+cursorshape' feature.

When it is, you can set the related terminal options (‘t_SI’,
‘t_SR’, ‘t_EI’). Read — once more — the most obviously resource:
   :help termcap-cursor-shape
   :help termcap-cursor-color
for an example. As an additional hint, you can set both (shape and
colour) by concatenating terminal escape sequences. For instance:
   let &t_SI = "\<Esc>]12;purple\x7\<Esc>[5 q"
sets a purple blinking IBeam cursor for insert mode (or globally, if you
are not reset the cursor style for the other modes).

Because you aren’t disclose your terminal emulator, I have to stop here.

The mentioned headaches maybe starts when:
 • you are expect a ready to use solution and/or unwilling to
   understand the basics of terminal escape sequences
 • you only want to style the cursor in Vim (not those in the terminal)
 • you are using different shapes/colours for different modes
 • you are using different terminal emulators (local/remote)
 • you are running terminal multiplexer > terminal emulator > Vim
 • your system lacks the required terminfo file
 • annoying side effects appears (e.g. with alternate screen)
 • …

But there are solutions for those issues (except for point one).

Why does it fail?
Why *what* fails? How can you expect an appropriate answer with so
sparsely informations from your side?

--
Regards,
floyd



Reply via email to