beatiful lsp icons and messages
This commit is contained in:
parent
4565a3aabd
commit
a7a4319243
@ -41,6 +41,23 @@ return {
|
|||||||
ctermbg = 'red',
|
ctermbg = 'red',
|
||||||
bg = 'DarkRed' }
|
bg = 'DarkRed' }
|
||||||
)
|
)
|
||||||
|
local diagnostics = {
|
||||||
|
Error = " ",
|
||||||
|
Warning = " ",
|
||||||
|
Information = " ",
|
||||||
|
Question = " ",
|
||||||
|
Hint = " ",
|
||||||
|
}
|
||||||
|
local signs = {
|
||||||
|
{ name = "DiagnosticSignError", text = diagnostics.Error },
|
||||||
|
{ name = "DiagnosticSignWarn", text = diagnostics.Warning },
|
||||||
|
{ name = "DiagnosticSignHint", text = diagnostics.Hint },
|
||||||
|
{ name = "DiagnosticSignInfo", text = diagnostics.Information },
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, sign in ipairs(signs) do
|
||||||
|
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = sign.name })
|
||||||
|
end
|
||||||
|
|
||||||
OpenDiagFloat = function()
|
OpenDiagFloat = function()
|
||||||
for _, winid in pairs(vim.api.nvim_tabpage_list_wins(0)) do
|
for _, winid in pairs(vim.api.nvim_tabpage_list_wins(0)) do
|
||||||
@ -270,7 +287,22 @@ return {
|
|||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.diagnostic.config({ virtual_text = false })
|
-- vim.diagnostic.config({ virtual_text = false })
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = false,
|
||||||
|
signs = true,
|
||||||
|
float = {
|
||||||
|
border = "single",
|
||||||
|
format = function(diagnostic)
|
||||||
|
return string.format(
|
||||||
|
"%s (%s) [%s]",
|
||||||
|
diagnostic.message,
|
||||||
|
diagnostic.source,
|
||||||
|
diagnostic.code or diagnostic.user_data.lsp.code
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
event = 'VeryLazy'
|
event = 'VeryLazy'
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user