Open EdwarDu opened 3 years ago
have the same problem. I don't know how to match color but this gives better contrast. Also, I change a little bit for the highlight color, because red and green just don't make sense imo
-- Patch color palette for sonokai
local configuration = vim.fn['sonokai#get_configuration']()
local palette = vim.fn['sonokai#get_palette'](configuration.style, configuration.colors_override)
vim.fn['sonokai#highlight']('Visual', palette.none, palette.grey_dim)
vim.fn['sonokai#highlight']('IncSearch', palette.bg0, palette.yellow)
vim.fn['sonokai#highlight']('Search', palette.none, palette.diff_yellow)
To illustrate the changes that were suggested above regarding the visual selections (before/after):
And the search highlights (before/after):
I get the point, but it really seems to boil down to personal preferences. For instance, I prefer the current selection to the proposed one.
I do like the suggested search highlights though, but using a low contrast for search results also decreases accessibility, and might overlap with highlighted code and/or LSP diagnostics. Not to mention that every one will have their preference of blue, yellow, green, ...
It's normal for users to enjoy tweaking little things in their favourite color scheme, and for this I always recommend using an autocmd to apply those on a per-colorscheme basis:
-- Apply custom highlights on colorscheme change.
-- Must be declared before executing ':colorscheme'.
local grpid = vim.api.nvim_create_augroup('custom_highlights_sonokai', {})
vim.api.nvim_create_autocmd('ColorScheme', {
group = grpid,
pattern = 'sonokai',
callback = function()
local config = vim.fn['sonokai#get_configuration']()
local palette = vim.fn['sonokai#get_palette'](config.style, config.colors_override)
local set_hl = vim.fn['sonokai#highlight']
set_hl('Visual', palette.none, palette.black)
set_hl('IncSearch', palette.bg0, palette.yellow)
set_hl('Search', palette.none, palette.diff_yellow)
end
})
edit: this type of customizations is now documented.
Thank you for the very nice color theme.
For me, the contrast in Vim for Visual mode selection is not very good. I can manually change it as "call sonokai#highlight('Visual', s:palette.none, s:palette.black)" though.
As this is not a bug, I open this as a blank issue. If further information is required, please let me know.