zenbones-theme / zenbones.nvim

🪨 A collection of contrast-based Vim/Neovim colorschemes
MIT License
657 stars 46 forks source link

ask about float background #108

Closed phdhary closed 1 year ago

phdhary commented 1 year ago

Hi thanks for this colorschemes.

I'm very used to having bordered floating window (like the one in hover).

lsp-hover

Is it possible to set the floating background to be the same as the regular one behind it?

phdhary commented 1 year ago

nevermind, I'm able to solve it after some digging.

maybe this snippets help others. (I also disable the 'italic everywhere' things with this)

vim.api.nvim_create_autocmd("ColorScheme", {
    group = "YourGroupName",
    callback = function()
        local colors = vim.g.colors_name
        if colors:match ".*bones" or colors == "zenwritten" or colors == "zenburned" then
            vim.cmd [[
                    highlight! Number gui=NONE   " disable italic
                    highlight! Constant gui=NONE " disable italic
                    highlight! String gui=NONE   " disable italic
                    highlight! link NormalFloat Normal " set floating bg to regular bg
                    ]]
        end
    end,
    desc = "Some zenbones autocmd",
})
pernambucano commented 3 months ago

If you're reading this, and what to use the autocmd, make sure to put it after you set your colorscheme.

For example, in my config I do this:

      vim.cmd.colorscheme("zenbones")

      vim.api.nvim_create_autocmd("ColorScheme", {
        pattern = "zenbones",
        callback = function()
          vim.api.nvim_set_hl(0, 'NormalFloat', { link = "Normal" })
        end,
        desc = "Override Zenbones",
      })