add float styling

This commit is contained in:
andrzej 2024-05-06 23:01:11 +02:00
parent fbf754ea9f
commit 4ac106cdb0
1 changed files with 32 additions and 2 deletions

View File

@ -94,6 +94,13 @@ return { -- LSP Configuration & Plugins
end end
end, end,
}) })
--bring up a popup when the cursor hovers over an error
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
group = vim.api.nvim_create_augroup("float_diagnostic", { clear = true }),
callback = function()
vim.diagnostic.open_float(nil, { focus = false })
end,
})
-- LSP servers and clients are able to communicate to each other what features they support. -- LSP servers and clients are able to communicate to each other what features they support.
-- By default, Neovim doesn't support everything that is in the LSP Specification. -- By default, Neovim doesn't support everything that is in the LSP Specification.
@ -112,8 +119,31 @@ return { -- LSP Configuration & Plugins
-- - settings (table): Override the default settings passed when initializing the server. -- - settings (table): Override the default settings passed when initializing the server.
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
-- --
local arch = require("jit").arch --Pop-up border styling
--get architecture as string (to blocklist installs that don't work on Android) local border = {
{ "🭽", "FloatBorder" },
{ "", "FloatBorder" },
{ "🭾", "FloatBorder" },
{ "", "FloatBorder" },
{ "🭿", "FloatBorder" },
{ "", "FloatBorder" },
{ "🭼", "FloatBorder" },
{ "", "FloatBorder" },
}
local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
opts = opts or {}
opts.border = opts.border or border
return orig_util_open_floating_preview(contents, syntax, opts, ...)
end
--global diagnostic popup options
vim.diagnostic.config({
virtual_text = true,
signs = true,
underline = true,
update_in_insert = true,
severity_sort = false,
})
local servers = { local servers = {
-- clangd = {}, -- clangd = {},