Skip to content

Commit

Permalink
vim: suppress new visual highlighting tweaks
Browse files Browse the repository at this point in the history
Commit e6d8b4662ddf9356da53f56e363b67b524fd8825¹ of Vim made some changes to
how visual highlighting works that interact poorly with our tweaks. Their
change, when tweaked by us with `cterm=reverse` resulted in near-invisible
highlighting. Ironically, invisible highlighting seems to be one of the problems
the Vim developers are trying to avoid with this and other recent related
changes.

Vim PR #250² has some further commentary relevant to this, including the
puzzling statement:

  We can't rely on fg/bg being different…

I do not understand this because, if the foreground and background colours were
not different, your text would be invisible. In any useful colour scheme, it
seems to me you can rely on the foreground and background colour differing.

This commit does something close to reverting to the old behaviour. Visual
highlighting flips the foreground and background colours, which leads to
something that is both syntax highlighted and readable. Ironically, this is
similar to the screenshot of the 8c default highlighting posted in a PR #250
comment³ that user romainl describes as “an abomination.” I guess beauty is in
the eye of the beholder.

¹ vim/vim@e6d8b46
² vim/colorschemes#250
³ vim/colorschemes#250 (comment)
  • Loading branch information
Smattr committed May 21, 2024
1 parent a7f4f4d commit d02b9c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/.vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ set foldlevelstart=20
" TERM=screen-256color, Vim autodetecting t_Co=256 and Pterm displaying things
" incorrectly means we need to set the following or visual highlighting is
" invisible.
hi Visual cterm=reverse
hi Visual cterm=reverse ctermbg=NONE ctermfg=NONE

" Some less sane environments have syntax highlighting off by default, so force
" it on.
Expand Down

0 comments on commit d02b9c6

Please sign in to comment.