Open idelice opened 10 months ago
Can you provide a minimal config showcasing this is actually a telescope issue? I can't really afford to debug everyone's config. And the snippet provided isn't even something I can directly copy-paste into my config.
What I'm missing is configurating telescope to apply the custom highlights that I've applied.
Can you show me a quick example on how to apply highlights using telescope builtin preview config?
I think generally people just stick with colorschemes or colorscheme builders for more custom stuff. Theoretically, your code looks fine to me at first glance but it's hard to say why telescope's buffer previewer isn't respecting it without more context behind the rest of your config.
Here's a minimal config I've created to replicate what I think you're looking to accomplish. I'm using lua instead of java since I don't have a treesitter parser for java. You can play around with the color but it looks like telescope is respecting the custom color so I suspect the issue is with your configuration rather than telescope. Unfortunately, I can't help you much there without more context.
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
},
config = function()
require("telescope").setup()
end,
},
{
"nvim-treesitter/nvim-treesitter",
config = function()
require("nvim-treesitter.configs").setup({
highlight = {
enable = true,
},
})
end,
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.opt.termguicolors = true
vim.cmd.colorscheme("habamax")
vim.cmd("hi @variable.lua guifg=red")
Description
I have applied some custom highlight in my lazy.lua file using LazyVim, but they are not applied to the preview window using Telescope. Here's my `/config/options/ file:
Neovim version
Operating system and version
macOs 13.4.1 (c) (22F770820d)
Telescope version / branch / rev
latest
checkhealth telescope
Steps to reproduce
config/options
with what I have providedExpected behavior
I expect my custom highlights are applied in the preview window
Actual behavior
Default highlights are applied
Minimal config