diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index d7829c6..fde1143 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -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 diff --git a/.config/nvim/lua/globals.lua b/.config/nvim/lua/globals.lua new file mode 100644 index 0000000..e3c1d28 --- /dev/null +++ b/.config/nvim/lua/globals.lua @@ -0,0 +1,6 @@ +globals = { + sign_error = "", + sign_warning = "", + sign_hint = "", + sign_info = "", +} diff --git a/.config/nvim/lua/lsp/init.lua b/.config/nvim/lua/lsp/init.lua index baeccfe..9c52090 100644 --- a/.config/nvim/lua/lsp/init.lua +++ b/.config/nvim/lua/lsp/init.lua @@ -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" + } ) diff --git a/.config/nvim/lua/statusline.lua b/.config/nvim/lua/statusline.lua index fbbc633..e979b01 100644 --- a/.config/nvim/lua/statusline.lua +++ b/.config/nvim/lua/statusline.lua @@ -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#" + ) } ) }