Skip to content
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

add config option for transparency #92

Open
shxfee opened this issue Feb 6, 2023 · 4 comments · May be fixed by #93
Open

add config option for transparency #92

shxfee opened this issue Feb 6, 2023 · 4 comments · May be fixed by #93

Comments

@shxfee
Copy link

shxfee commented Feb 6, 2023

This colorscheme is awesome! If you could add support for transparency it will be perfect!

@andersevenrud
Copy link
Owner

andersevenrud commented Feb 6, 2023 via email

andersevenrud added a commit that referenced this issue Feb 12, 2023
@andersevenrud andersevenrud linked a pull request Feb 12, 2023 that will close this issue
@andersevenrud
Copy link
Owner

I've opened a PR for this if you want to try it out: #93

Would be nice if it was tested by someone else, because I don't really know what's expected of transparency support 😅 But I have at least made the obvious ones toggleable.

andersevenrud added a commit that referenced this issue Feb 12, 2023
@shxfee
Copy link
Author

shxfee commented Feb 26, 2023

Thanks for this. Here are a few highlight groups that still has background color.

      NormalFloat
      Float
      FloatBorder
      SignColumn
      Pmenu

I actually decided to write an autocommand to remove bg from colorschemes so I don't have to worry about colorschemes supporting it. I ll leave it here for reference.

-- transparent backgrounds
vim.api.nvim_create_autocmd("Colorscheme", {
  callback = function ()
    local groups = {
      "Normal",
      "NormalNC",
      "NormalFloat",
      "Float",
      "FloatBorder",
      "SignColumn",
      "GitSignsAdd",
      "GitSignsChange",
      "GitSignsDelete",
      "Pmenu",
      -- "PmenuSel", need to fix this for tokyonight
      "WinSeparator",
      "TelescopeNormal",
      "TelescopeBorder",
      "TelescopeSelection",
      "TelescopePreviewNormal",
      "WhichKeyFloat",
    }

    for _, group in ipairs(groups) do
      vim.cmd("hi " .. group .. " ctermbg=None guibg=NONE")
    end

    -- dim fg for WinSeparator
    vim.cmd("hi WinSeparator guifg=#4e4d5e")
  end,
  group = mygroup,
  desc = "Transparent backgrounds",
})

@andersevenrud
Copy link
Owner

I've updated the ones missing from the list you wrote down.

Not sure why these aren't working as expected though, since they do use the transparency option 🤔

      Float
      FloatBorder
      SignColumn

Using an autocommand is a really nice way to solve this 👍 I've seen some plugins out there that provides this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants