-
Notifications
You must be signed in to change notification settings - Fork 171
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
hop hint is not visible when searching text are highlight #189
Comments
The Hop plug-in seems to be using quite a few different highlight groups based on their docs. Maybe one of them links to a core highlight group which doesn't work well in this context, or which is set to a color that conflicts with the Gruvbox Material palette. I need to install the plug-in and optimize it. Meanwhile if you come up with suggestions feel free to share! |
gruvbox-material/colors/gruvbox-material.vim Line 1230 in 7f56d9f
I think gruvbox overrides the highlights in here. |
I just noticed the gradients for multi-letter matches: To better support this and similar plugins, we have to pick colors which:
Purple doesn't look great with Yellow doesn't look great with Blue doesn't look great with Disclaimer: the Everforest colorscheme was used in my screenshots, but both themes have similar color semantics and palette design. I'm wondering whether we shouldn't instead have an option to reduce the contrast of |
CurSearch is not important because people use hop to jump to remote places. |
Sure, but so is If you search for some characters in Neovim, the match you last jumped to will be highlighted in red, which will inevitably lead to invisible characters as well if not optimized correctly. |
That's current my solution. Usually, I search for something, run
The hint in CurSearch is not important because our cursor already around there. Right? |
OK fair, thanks for your input! 🙌 I'll submit a PR and tag you on it before merging. |
@Weissle sorry for the delay. I finally found the time to experiment with the plugin a little more. Here is what a color optimization would look like if we wanted to play nice with I'm not particularly happy about it. This is less visually consistent than our current green-orange defaults (your original screenshot), the only advantage is that the 📄 Neovim config
-- Apply custom highlights on colorscheme change.
-- Must be declared before executing ':colorscheme'.
local grpid = vim.api.nvim_create_augroup('custom_highlights_gruvbox_material', {})
vim.api.nvim_create_autocmd('ColorScheme', {
group = grpid,
pattern = 'gruvbox-material',
callback = function()
local config = vim.fn['gruvbox_material#get_configuration']()
local palette = vim.fn['gruvbox_material#get_palette'](config.background, config.foreground, config.colors_override)
local set_hl = vim.fn['gruvbox_material#highlight']
set_hl('HopNextKey', palette.purple, palette.none)
set_hl('HopNextKey1', palette.red, palette.none)
set_hl('HopNextKey2', palette.orange, palette.none)
end
}) An alternative I suggested earlier is to instead modify the In my opinion this is a lot nicer than what the above is trying to achieve. By using a less contrasted background color for searched expressions, we have a better guarantee that EasyMotion-like plugins—such as Hop—are not going to interfere with search results. It would probably be useful if the colorscheme had an option to enable this ( Feedback welcome! 📄 Neovim config
-- Apply custom highlights on colorscheme change.
-- Must be declared before executing ':colorscheme'.
local grpid = vim.api.nvim_create_augroup('custom_highlights_gruvbox_material', {})
vim.api.nvim_create_autocmd('ColorScheme', {
group = grpid,
pattern = 'gruvbox-material',
callback = function()
local config = vim.fn['gruvbox_material#get_configuration']()
local palette = vim.fn['gruvbox_material#get_palette'](config.background, config.foreground, config.colors_override)
local set_hl = vim.fn['gruvbox_material#highlight']
set_hl('Search', palette.none, palette.bg_visual_yellow)
set_hl('IncSearch', palette.none, palette.bg_visual_red)
end
}) |
thanks. I will try it for few days and write the feedback here. |
I think the first solution would be better. The second solution effects the users who don't use hop.nvim and the search highlight is not so visible. |
I have done the following steps before reporting this issue:
Operating system/version
WSL Ubuntu20.04
Terminal emulator/version
Windows terminal 1.18.3181.0
$TERM environment variable
tmux-256color
Tmux version
tmux 3.0a
Feature matrix
Minimal vimrc that can reproduce this bug.
Steps to reproduce this bug using minimal vimrc
search a word. move the cursor away from it. The searched word is highlighted.
run HopWord. The hint in the searched word is invisible.
Expected behavior
"smoka7/hop.nvim"'s default highlight seems better. I deleted the highlight defined in gruvbox then got below highlights.
![image](https://private-user-images.githubusercontent.com/29982556/290241624-5595fba6-95fa-49b6-b460-fe6dedb983c1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NzkwMjEsIm5iZiI6MTczOTY3ODcyMSwicGF0aCI6Ii8yOTk4MjU1Ni8yOTAyNDE2MjQtNTU5NWZiYTYtOTVmYS00OWI2LWI0NjAtZmU2ZGVkYjk4M2MxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDA0MDUyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgzMmViNjUyNDA1NWUxZTdlMTUwYzQxOTRkMjNiNzliYzJkMDExYjM0MmNhMjBlMGQ2MWY5ZjExMWVlOWZiMzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.7RRnVToyzcAAAAt9u4drwvEApCZJTWy2peN1MdHo24Y)
Actual behavior
The hint in the searched word is invisible.
![RRI@K}7_I`E(8E0U0NB59M8](https://private-user-images.githubusercontent.com/29982556/290240101-d877b2d0-de60-4ef5-99bd-adf5095d5549.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NzkwMjEsIm5iZiI6MTczOTY3ODcyMSwicGF0aCI6Ii8yOTk4MjU1Ni8yOTAyNDAxMDEtZDg3N2IyZDAtZGU2MC00ZWY1LTk5YmQtYWRmNTA5NWQ1NTQ5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDA0MDUyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI1NjRlNmRjYmQ1YTVhOTdiNzQ3N2JlMWQ0OTJlMGEzZDMwZDYwMWZjZWU4NzA1NzY4YWYwMTA4NGFiZTA2MDUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.OLWSCGMWj5JT1geJ1Vk_5UXWOt4NZoF_Kx9GNB1qvNY)
The text was updated successfully, but these errors were encountered: