Update: Based on the discussion here and in other places I added the following (well, technically I did something different in my colorscheme, but in the end it translates to that)
vim.api.nvim_set_hl(0, 'Normal', {})
This reverts the weird text and background colors to the previous behavior of ... not setting them.
With update 0.10 Neovim behavior changed regarding text color and background color.
I use a color theme that does not set those and previously this worked perfectly fine. Neovim simply used the font color defined in the terminal and had a transparent background.
Now the background is #14161b and the font color is #e0e2ea. Neither of the colors is configured ANYWHERE in my whole setup. Neither in the colorscheme, nor in my terminal configuration, nor in my Neovim configuration.
Is there a sane way to revert this to the old behavior? (i.e. use the font color configured in the terminal’s configuration and use transparent background.)
14 Comments
metiulekm@sh.itjust.works · 6 pts · 2y
:highlight Normal guifg=0 guibg=0worked for me, at least when run interactively in anvim -u NORCsession.bisby@lemmy.world · 3 pts · 2y
From the neovim 0.10 changelog:
So for me, i previously had
vim.cmd.hi 'Normal ctermbg=none'as the method for disabling the background. But now, nvim was deciding to use gui colors for the terminal, and I was only setting terminal background to none.The options are:
vim.cmd.hi 'Normal ctermbg=none guibg=none'(also none out the gui bg)vim.cmd.hi 'Normal bg=none'(flat unconditional bg none)vim.opt.termguicolors = false(just disable the now enabled by default function to go back to terminal colors)Dirk@lemmy.ml · 1 pts · 2y
This looks fine when doing it manually, thanks. I wonder how to properly implementing this in my Lua-only setup without just wrapping it in
vim.cmd.sudo@programming.dev · 2 pts · 2y
Its something like
vim.nvim_api_set_hlmetiulekm@sh.itjust.works · 2 pts · 2y
I looked at material.nvim randomly, and they use
vim.api.nvim_set_hlto set their colors. It seems that the equivalent of the above command is:lua vim.api.nvim_set_hl(0, "Normal", {}).wwwgem@lemmy.ml · 4 pts · 2y
This is my neovim visual config:
vim.api.nvim_set_hl( 0, "Normal", { bg = "none" } ) is probably what would work for you.
Dirk@lemmy.ml · 1 pts · 2y
So I need to disable all the non-treesitter definitions first?
Do you know if there is a way to completely disable the built-in styling?
wwwgem@lemmy.ml · 1 pts · 2y
I have treesitter as well and didn't do anything specific before adding these lines to my config. If you're looking to change "everything" without tweaking each highlight parameter individually you may be interested in this plugin.
Dirk@lemmy.ml · 1 pts · 2y
I don’t want to make Neovim transparent, though. I have an own colorschme and just don’t want the default colorscheme to be applied.
wwwgem@lemmy.ml · 1 pts · 2y
wwwgem@lemmy.ml · 1 pts · 2y
wwwgem@lemmy.ml · 1 pts · 2y
Ok. If I have interpreted your post correctly you want to not use the default colors for values not defined in your theme (i.e. defaulting to transparency).
I see two options to combine to your theme:
Dirk@lemmy.ml · 1 pts · 2y
Yeah … so stupid. Why do they force that? If it would take the already defined foreground and background colors of the terminal, fine … but those colors are just made-up nonsense.
Your idea was great, though. I quickfixed that in my colorscheme by adding this line
And so far this seems to resolve the problematic colors being set.
wwwgem@lemmy.ml · 1 pts · 2y
wwwgem@lemmy.ml · 1 pts · 2y
wwwgem@lemmy.ml · 1 pts · 2y
LeroyJenkins@lemmy.world · 0 pts · 2y
vim.opt.background = false
vim.opt.guicfg = { background = "transparent", foreground = "#<idiots_color_hex>", }
Dirk@lemmy.ml · 1 pts · 2y
Unfortunately no.
When setting to any string (a literal
'false', a hex color string with or without#, etc.) it printsAlso no.
LeroyJenkins@lemmy.world · 1 pts · 2y
oops thought we were talking about emacs this whole time. sorry ignore me and forget this ever happened.