feat: update LSP icons (signcolumn + statusline)

also add a globals.lua file
This commit is contained in:
David JULIEN 2021-05-21 11:58:59 +02:00
parent c7068ff557
commit 4959c90448
4 changed files with 41 additions and 7 deletions

View File

@ -3,6 +3,7 @@
-- License : GPLv3
-- Description : neovim configuration file
require("globals") -- ./lua/globals.lua
require("settings") -- ./lua/settings.lua
require("plugins") -- ./lua/plugins.lua
require("maps") -- ./lua/maps.lua

View File

@ -0,0 +1,6 @@
globals = {
sign_error = "",
sign_warning = "",
sign_hint = "",
sign_info = "",
}

View File

@ -5,17 +5,32 @@
vim.fn.sign_define(
"LspDiagnosticsSignError",
{texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"}
{
texthl = "LspDiagnosticsSignError",
text = globals.sign_error,
numhl = "LspDiagnosticsSignError"
}
)
vim.fn.sign_define(
"LspDiagnosticsSignWarning",
{texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"}
{
texthl = "LspDiagnosticsSignWarning",
text = globals.sign_warning,
numhl = "LspDiagnosticsSignWarning"}
)
vim.fn.sign_define(
"LspDiagnosticsSignHint",
{texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"}
{
texthl = "LspDiagnosticsSignHint",
text = globals.sign_hint,
numhl = "LspDiagnosticsSignHint"
}
)
vim.fn.sign_define(
"LspDiagnosticsSignInformation",
{texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"}
{
texthl = "LspDiagnosticsSignInformation",
text = globals.sign_info,
numhl = "LspDiagnosticsSignInformation"
}
)

View File

@ -155,9 +155,21 @@ local function statusline_focused()
gen_section(
"%#Alert#",
{
process_diagnostics("E:", diagnostics.errors, "%#LspDiagnosticsDefaultError#"),
process_diagnostics("W:", diagnostics.warnings, "%#LspDiagnosticsDefaultWarning#"),
process_diagnostics("I:", diagnostics.info, "%#LspDiagnosticsDefaultInformation#")
process_diagnostics(
globals.sign_error .. " ",
diagnostics.errors,
"%#LspDiagnosticsDefaultError#"
),
process_diagnostics(
globals.sign_warning .. " ",
diagnostics.warnings,
"%#LspDiagnosticsDefaultWarning#"
),
process_diagnostics(
globals.sign_info .. " ",
diagnostics.info,
"%#LspDiagnosticsDefaultInformation#"
)
}
)
}