vim / colorschemes

colorschemes for Vim
274 stars 23 forks source link

hi MatchParen hard to follow #243

Closed craigmac closed 1 week ago

craigmac commented 1 year ago

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).

romainl commented 1 year ago

Thanks. Could you add the relevant screenshots when you have the time?

craigmac commented 1 year ago

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:

default

desert:

desert

elflord:

elflord

evening:

evening

industry:

industry

koehler:

koehler

murphy:

murphy

pablo:

pablo

quiet:

quiet

ron:

ron

slate:

slate

torte:

torte

Now the ones that don't work/or could be improved:

blue:

blue

darkblue:

darkblue

delek:

delek

peachpuff:

peachpuff

habamax

habamax

lunaperche

lunaperche

morning

morning

shine

shine

zellner

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 commented 1 year ago

habamax uses different matchparen (the same as quiet and wildcharm) since several weeks ago just because of that issue: image

and yeah the ones with reverse are quite hard to follow if your cursor is reversed too.

romainl commented 1 year ago

We can't really do anything about default but I agree, the others need work. Thank you for spotting this.

romainl commented 1 year ago

Hmm… all the colorschemes you flagged as "not working" seem perfectly fine to me:

Capture d’écran 2023-05-01 à 19 20 54 Capture d’écran 2023-05-01 à 19 22 25 Capture d’écran 2023-05-01 à 19 22 44 Capture d’écran 2023-05-01 à 19 23 04 Capture d’écran 2023-05-01 à 19 23 20 Capture d’écran 2023-05-01 à 19 23 34 Capture d’écran 2023-05-01 à 19 23 50 Capture d’écran 2023-05-01 à 19 24 14 Capture d’écran 2023-05-01 à 19 24 35

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.

habamax commented 1 year ago

It is only when your cursor is reversed. As if in gvim you set cursor gui to reverse.

romainl commented 1 year ago

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?

habamax commented 1 year ago

@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

habamax commented 1 year ago

well, I am probably wrong about "1 approach I know", another solution might be not to reverse matchparen

romainl commented 1 year ago

I need to wrap my head around this.

  1. parenthesis is green on black
  2. current parenthesis is reversed to black on green thanks to MatchParen being reverse (explicitly or not)
  3. current parenthesis is reversed back to green on black thanks to Cursor or terminal cursor being explicitly reverse
  4. current parenthesis is highlighted like regular parenthesis
  5. cursor is not highlighted
  6. user looses any notion of "current"

That sounds like a compelling argument against using a reverse cursor, if you ask me.

romainl commented 1 year ago

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.

habamax commented 1 year ago

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

retrobox, cursor is on m in name: image

ron, cursor is on r in bookmarks: image

neutaaaaan commented 1 year ago

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.

craigmac commented 1 year ago

Not at my computer for the next week, but it could be an Alacritty issue? https://github.com/alacritty/alacritty/issues/2398

micampe commented 9 months ago

I am having this problem with lunaperche on:

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
habamax commented 7 months ago

fixed lunaperche:

image