telescope.nvim
telescope.nvim copied to clipboard
lsp_references, grep_string function highlight searching words
Is your feature request related to a problem? Please describe. Whenever I use telescope.builtin.lsp_references, telescope.builtin.grep_string, always find it difficult to see the word being searched, it would be great if we can highlight the string being searched in both results windows & grep preview window
Describe the solution you'd like highlight the string being searched in both results windows & grep preview window
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.
same issue here.
Same here
Would be a great addition!
I was able to hack this together by adding a slight delay and entering the search string once the search modal has popped up:
vim.api.nvim_create_user_command('Grep',
function(opts)
require("telescope.builtin").grep_string(
{ search = opts.fargs[1], file_ignore_patterns = { ".git/" } }
)
vim.defer_fn(function()
vim.api.nvim_put({ opts.fargs[1] .. " " }, 'c', true, true)
end, 50)
end,
{ nargs = 1 }
)
This is a theme issue. I just checked it works as expected in some themes like rose-pine.
What is the highlight group?
I my case TelescopeNormal
and Visual
were set to the same background.
TelescopePreviewLine
links to Visual
by default.
You can set TelescopePreviewLine
to fix the issue.
@Avi-D-coder I think the difference is highlighting the entire line of the match vs highlighting just the matched word.
For grep_string
and live_grep
, there needs to be a semi-major rewrite but this is in the works. https://github.com/nvim-telescope/telescope.nvim/pull/2536
For other pickers like for lsp_references
, this would also require some non-trivial amount of work - this, there isn't any advancements on.