-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase the contrast for Visual mode selection #36
Comments
have the same problem. I don't know how to match color but this gives better contrast. -- 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.
The text was updated successfully, but these errors were encountered: