From de08aba7346893d444d8ba4eb0917c18ab5b1eff Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Mon, 29 Jan 2024 12:39:57 +0200 Subject: [PATCH] vim-patch:9.1.0061: UX of visual highlighting can be improved (#27256) Problem: UX of visual highlighting can be improved Solution: Improve readibility of visual highlighting, by setting better foreground and background colors The default visual highlighting currently is nice in that it overlays the actual syntax highlighting by using a separate distinct background color. However, this can cause hard to read text, because the contrast between the actual syntax element and the background color is way too low. That is an issue, that has been bothering colorschemes authors for quite some time so much, that they are defining the Visual highlighting group to use a separate foreground and background color, so that the syntax highlighting vanishes, but the text remains readable (ref: vim/colorschemesvim/vim#250) So this is an attempt to perform the same fix for the default Visual highlighting and just use a default foreground and background color instead of using reverse. I also removed the hard-coded changes to the Visual highlighting in init_highlight. It's not quite clear to me, why those were there and not added directly to the highlighting_init_ struct. closes: vim/vim#13663 related: vim/colorschemes#250 https://github.com/vim/vim/commit/e6d8b4662ddf9356da53f56e363b67b524fd8825 Co-authored-by: Christian Brabandt --- runtime/colors/vim.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/colors/vim.lua b/runtime/colors/vim.lua index 67f9ddd643eb8a..b4ede93357b4d8 100644 --- a/runtime/colors/vim.lua +++ b/runtime/colors/vim.lua @@ -231,7 +231,7 @@ if vim.o.background == 'light' then hi('SpellRare', { sp = 'Magenta', undercurl = true, ctermbg = 'LightMagenta' }) hi('TabLine', { bg = 'LightGrey', underline = true, ctermfg = 'Black', ctermbg = 'LightGrey', cterm = { underline = true } }) hi('Title', { fg = 'Magenta', bold = true, ctermfg = 'DarkMagenta' }) - hi('Visual', { bg = 'LightGrey', ctermbg = 'LightGrey' }) + hi('Visual', { bg = 'LightGrey', ctermfg = 'White', ctermbg = 'DarkGrey' }) hi('WarningMsg', { fg = 'Red', ctermfg = 'DarkRed' }) hi('Comment', { fg = 'Blue', ctermfg = 'DarkBlue' }) hi('Constant', { fg = 'Magenta', ctermfg = 'DarkRed' }) @@ -270,7 +270,7 @@ else hi('SpellRare', { sp = 'Magenta', undercurl = true, ctermbg = 'Magenta' }) hi('TabLine', { bg = 'DarkGrey', underline = true, ctermfg = 'White', ctermbg = 'DarkGrey', cterm = { underline = true } }) hi('Title', { fg = 'Magenta', bold = true, ctermfg = 'LightMagenta' }) - hi('Visual', { bg = 'DarkGrey', ctermbg = 'DarkGrey' }) + hi('Visual', { bg = '#575757', ctermfg = 'Black', ctermbg = 'Grey' }) hi('WarningMsg', { fg = 'Red', ctermfg = 'LightRed' }) hi('Comment', { fg = '#80a0ff', ctermfg = 'Cyan' }) hi('Constant', { fg = '#ffa0a0', ctermfg = 'Magenta' })