configurable NonText contrast

This commit is contained in:
Michael Chris Lopez
2021-10-26 17:10:17 +08:00
parent 7b85e5327d
commit 3fc8d324fc
4 changed files with 18 additions and 6 deletions

View File

@@ -102,7 +102,7 @@ local function generate(p, opt)
Visual { bg = p.fg.de(18).lightness(Normal.bg.l + 18) }, -- Visual mode selection
-- VisualNOS { }, -- Visual mode selection when vim is "Not Owning the Selection".
NonText { fg = Normal.bg.li(26) }, -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
NonText { fg = Normal.bg.li(opt.lighten_non_text or 26) }, -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
SpecialKey { NonText, gui = "italic" }, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace|
Whitespace { NonText }, -- "nbsp", "space", "tab" and "trail" in 'listchars'
EndOfBuffer { NonText }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.

View File

@@ -19,6 +19,7 @@ function M.get_global_config(prefix, base_bg)
darken_noncurrent_window = vim.g[prefix .. "_darken_noncurrent_window"],
darken_comments = vim.g[prefix .. "_darken_comments"],
darken_line_nr = vim.g[prefix .. "_darken_line_nr"],
darken_non_text = vim.g[prefix .. "_darken_non_text"],
}, common)
else
return vim.tbl_extend("keep", {
@@ -26,6 +27,7 @@ function M.get_global_config(prefix, base_bg)
lighten_noncurrent_window = vim.g[prefix .. "_lighten_noncurrent_window"],
lighten_comments = vim.g[prefix .. "_lighten_comments"],
lighten_line_nr = vim.g[prefix .. "_lighten_line_nr"],
lighten_non_text = vim.g[prefix .. "_lighten_non_text"],
}, common)
end
end

View File

@@ -102,7 +102,7 @@ local function generate(p, opt)
Visual { bg = p.fg.lightness(Normal.bg.l - 8) }, -- Visual mode selection
-- VisualNOS { }, -- Visual mode selection when vim is "Not Owning the Selection".
NonText { fg = Normal.bg.da(22) }, -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
NonText { fg = Normal.bg.da(opt.darken_non_text or 22) }, -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
SpecialKey { NonText, gui = "italic" }, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace|
Whitespace { NonText }, -- "nbsp", "space", "tab" and "trail" in 'listchars'
EndOfBuffer { NonText }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.