Table of Contents
To make your Neovim a little prettier, it's nice for every floating window to have a coherent border style. To do this we'll need to modify a view things. For some of them, I also set the backdrop to be completely transparent, so it looks like the floats end where the actual line is and not where the character ends.
lazy.nvim itself doesn't use rounded borders by default for its floats like :Lazy
or :LazyExtras
.
-- config/lazy.lua
require("lazy").setup({
ui = {
border = "rounded",
backdrop = 100,
},
})
snacks.nvim is a collection of small plugins. It's terminal floats and floats in general have no rounded border.
-- plugins/snacks.nvim
"folke/snacks.nvim",
opts = {
terminal = {
border = "rounded",
},
styles = {
float = {
backdrop = 100,
border = "rounded",
},
},
},
}
mason.nvim is a package manager for LSP servers and some other things. The only float it uses is the one used to manage installed packages (:Mason
).
-- plugings/mason.lua
return {
"williamboman/mason.nvim",
opts = {
ui = {
border = "rounded",
},
},
}
noice.nvim replaces a couple of UI elements and makes them prettier; including the hover docs and signature help.
-- plugins/noice.lua
return {
"folke/noice.nvim",
opts = function(_, opts)
opts.presets.lsp_doc_border = true
end,
}
nvim-lspconfig is used for the configuration of Neovim's native LSP client. Here we need to edit the floats that show diagnostics.
-- nvim-lspconfig.lua
return {
"neovim/nvim-lspconfig",
opts = {
diagnostics = {
float = {
border = "rounded",
},
},
},
}
blink.cmp is the completion menu that is used for showing suggestions and their documentation. The border of the menu has the wrong color so we also need to set that.
-- plugins/blink.lua
return {
"saghen/blink.cmp",
opts = {
completion = {
menu = {
border = "rounded",
winhighlight = "Normal:BlinkCmpDoc,FloatBorder:BlinkCmpDocBorder,CursorLine:BlinkCmpMenuSelection,Search:None",
},
documentation = {
window = {
border = "rounded",
},
},
},
},
}
If you're using tokyonight.nvim you can also make the sidebars and floats transparent, so they don't have a darker background like it's shown in the recipes section.
--- plugins/tokyonight.lua
{
"folke/tokyonight.nvim",
opts = {
transparent = true,
styles = {
sidebars = "transparent",
floats = "transparent",
},
},
}