Git Product home page Git Product logo

Comments (3)

RichestHumanAlive avatar RichestHumanAlive commented on June 11, 2024 1

Thank you for your answer and tips 🙂. I understand a little better how the Vim UI works.

Indeed, I use Windows Terminal which supports blurred background and that's why, for better appearance, I disabled as many backgrounds as possible using:

let g:sonokai_transparent_background=2

Also, what I like about the transparency of Vim is that it is pseudo-transparent actually, inside the Vim UI and you can't see through a floating window even if it's "transparent".
Floating transparent windows actually just takes the lowest background of the UI at that specific area.
With borders it's even better like here:

Even if there is text behind the floating window, the text will not appear and will be covered by pseudo-transparent background.
Unless I misunderstood something.

This is precisely want I need to achieve for all my floating windows.

Should look at how to customize the background for each plugin that uses floating windows or is there a way to overwrite the default appearance of all floating windows of Vim?

Thanks in advance for your time 🙂.

Edit : I finally found that I just had to define the following highlight commands:

vim.cmd("hi NormalFloat ctermbg=NONE guibg=NONE")
vim.cmd("hi FloatTitle ctermbg=NONE guibg=NONE")
vim.cmd("hi FloatBorder ctermbg=NONE guibg=NONE")

And here is the result for Mason.nvim for example :

Went from :
image

to:
image

Should add this for LSP Diagnostics

vim.cmd("hi DiagnosticFloatingHint  ctermbg=NONE guibg=NONE guifg=#42E66C")
vim.cmd("hi DiagnosticFloatingInfo ctermbg=NONE guibg=NONE guifg=#0876c5")
vim.cmd("hi DiagnosticFloatingWarn ctermbg=NONE guibg=NONE guifg=#E8AB53")
vim.cmd("hi DiagnosticFloatingError ctermbg=NONE guibg=NONE guifg=#ff5189")

Freely choosing foreground colors (guifg)

output:

image

Thank you for your attention.

from sonokai.

sainnhe avatar sainnhe commented on June 11, 2024

I thought setting NormalFloat (which is the default highlight group of floating window) to be transparent, but the problem is that not all floating window have a border, instead the designs in most of them are using a brighter background to distinguish between normal background colors, so I gave up this idea.

Another thing that needs to be considered is that vim actually shouldn't make everything transparent, some elements should use a different background color (e.g. the status line). If you want to make your vim fully transparent, you should consider switching to a terminal emulator that supports blurred background (e.g. konsole). This will fully blur every elements in vim, which will look much better.

from sonokai.

dmytrodubinin avatar dmytrodubinin commented on June 11, 2024

Any solutions for Linux? I have the same problem on Arch Linux with Alacritty. The solution above didn't help.

from sonokai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.