Closed craigmac closed 4 months ago
Thanks. Could you add the relevant screenshots when you have the time?
First those that work how I would expect (cursor position doesn't move, and it's clear/clear-ish where your actual cursor is currently):
default:
desert:
elflord:
evening:
industry:
koehler:
murphy:
pablo:
quiet:
ron:
slate:
torte:
Now the ones that don't work/or could be improved:
blue:
darkblue:
delek:
peachpuff:
habamax
lunaperche
morning
shine
zellner
These were done with this vimrc:
filetype plugin indent on
syntax on
set nocompatible
set backspace=indent,eol,start
set incsearch
set laststatus=2
set mouse=nvi
set ruler
set showcmd
set wildmenu
set wildoptions+=pum
And started with vim -u vimrc-minimal
. Terminal is alacritty and vim build is 9.0.1476
huge version w/o GUI compiled from source on macOS 12.6.5.
habamax
uses different matchparen
(the same as quiet and wildcharm) since several weeks ago just because of that issue:
and yeah the ones with reverse
are quite hard to follow if your cursor is reversed too.
We can't really do anything about default
but I agree, the others need work. Thank you for spotting this.
Hmm… all the colorschemes you flagged as "not working" seem perfectly fine to me:
Well, zellner's MatchParen
's background happens to be almost the same as my terminal cursor's but that's irrelevant to the case.
Terminal.app, 256c.
It is only when your cursor is reversed. As if in gvim you set cursor gui to reverse.
The remakes are all fine. From what I see, only a bunch of new ones have gui=reverse
for Cursor
:
(standard input):68:colors/quiet.vim:57: hi Cursor guifg=NONE guibg=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse
(standard input):81:colors/quiet.vim:127: hi Cursor guifg=NONE guibg=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse
(standard input):109:colors/wildcharm.vim:66: hi Cursor guifg=#ffffff guibg=#000000 gui=reverse cterm=reverse
(standard input):110:colors/wildcharm.vim:67: hi lCursor guifg=#ff5fff guibg=#000000 gui=reverse cterm=reverse
(standard input):115:colors/wildcharm.vim:140: hi Cursor guifg=#000000 guibg=#ffffff gui=reverse cterm=reverse
(standard input):116:colors/wildcharm.vim:141: hi lCursor guifg=#ff00ff guibg=#000000 gui=reverse cterm=reverse
(standard input):139:colors/sorbet.vim:57:hi Cursor guifg=NONE guibg=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse
(standard input):153:colors/retrobox.vim:64: hi Cursor guifg=NONE guibg=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse
(standard input):161:colors/retrobox.vim:115: hi CursorIM guifg=NONE guibg=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse
(standard input):163:colors/retrobox.vim:155: hi Cursor guifg=NONE guibg=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse
(standard input):171:colors/retrobox.vim:206: hi CursorIM guifg=NONE guibg=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse
(standard input):207:colors/lunaperche.vim:137: hi Cursor guifg=NONE guibg=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse
(standard input):208:colors/lunaperche.vim:138: hi lCursor guifg=#ff5fff guibg=#000000 gui=reverse cterm=reverse
(standard input):214:colors/lunaperche.vim:227: hi Cursor guifg=NONE guibg=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse
(standard input):215:colors/lunaperche.vim:228: hi lCursor guifg=#ff00ff guibg=#000000 gui=reverse cterm=reverse
@neutaaaaan and @habamax could you propose an alternative Cursor
?
@romainl I can.
The issue is that many terminals (excluding the one you use, terminal.app) can have reversed cursor -- xterm, urxvt, alacritty, gnome-terminal, konsole, etc. And for those I know only 1 approach that would work -- use something like @neutaaaaan came up with in quiet
-- bright bold, alien to main palette, fg color.
wildcharm
should be immune to this as it uses the same color as quiet.
retrobox
and lunaperche
-- I will have a look into gui
well, I am probably wrong about "1 approach I know", another solution might be not to reverse matchparen
I need to wrap my head around this.
MatchParen
.:hi Cursor gui=reverse guibg=NONE guifg=NONE
(for some of the new ones) or if the terminal emulator uses a dumb reverse cursor (alacritty), then the highlight of MatchParen
is reversed.MatchParen
is usually some kind of "general background color on bright color", either via explicit bg/fg or via reverse
, which becomes "bright color on general background color" by way of the reverse
of the cursor.MatchParen
being reverse
(explicitly or not)Cursor
or terminal cursor being explicitly reverse
That sounds like a compelling argument against using a reverse cursor, if you ask me.
FWIW, iTerm has a "smart box cursor color" option for the cursor that falls back to the terminal's bg and fg when a reverse of the actual colors at the cursor location would make it invisible.
A plain "reverse" cursor is shortsighted.
That sounds like a compelling argument against using a reverse cursor, if you ask me.
It also affects other parts, like if your syntax close enough to visual or visual is reversed too:
cursor is on indent
of last line, koehler:
retrobox, cursor is on m
in name
:
ron, cursor is on r
in bookmarks
:
I'll take a look at this next weekend. At home using urxvt and tmux I haven't noticed anything wrong. Same at work using hyper and tmux.
Not at my computer for the next week, but it could be an Alacritty issue? https://github.com/alacritty/alacritty/issues/2398
I am having this problem with lunaperche
on:
MacVim r178 only in dark mode (light mode is readable)
Vim in MATE terminal (which uses libvte) both dark mode and light mode
Vim in Terminal.app is fine because it always overrides the cursor color with the one from the Terminal.app profile.
Cursor is always on the opening parenthesis.
I worked around it by overriding MatchParen
with the bg color from Visual
:
hi MatchParen guifg=NONE guibg=#005f87
fixed lunaperche:
Jotting this down from my phone while I remember, so no screenshots, but several of the themes (the ones that only define term,cterm,gui=reverse) make working with matchparen functionality confusing because it's often difficult to see where your cursor actually is (requires cursor to be inverse I believe, might not happen with say a solid green cursor).