Show diagnostics in status line and file tree

This commit is contained in:
2022-02-01 20:09:23 +03:00
parent 4173334340
commit cea47c0f76
3 changed files with 14 additions and 5 deletions

View File

@@ -48,6 +48,11 @@ require("nvim-tree").setup({
git = { git = {
ignore = false, ignore = false,
}, },
diagnostics = {
enable = true,
show_on_dirs = true,
icons = { hint = "", info = "", warning = "", error = "" },
},
}) })
nmap("<leader>b", ":NvimTreeToggle<CR>") nmap("<leader>b", ":NvimTreeToggle<CR>")

View File

@@ -170,10 +170,9 @@ lsp_installer.on_server_ready(function(server)
server:setup(opts) server:setup(opts)
end) end)
-- Don't show diagnostics as virtual text
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
update_in_insert = true, update_in_insert = true,
virtual_text = false, virtual_text = true,
signs = false, signs = false,
}) })

View File

@@ -11,6 +11,11 @@ local branch = {
icons_enabled = true, icons_enabled = true,
icon = "", icon = "",
} }
local diagnostics = {
"diagnostics",
always_visible = true,
sections = { "error", "warn" },
}
-- Section "c" -- Section "c"
local filename = { local filename = {
@@ -47,9 +52,9 @@ lualine.setup({
sections = { sections = {
lualine_a = { mode }, lualine_a = { mode },
lualine_b = { branch }, lualine_b = { branch },
lualine_c = { filename, fileformat }, lualine_c = { diagnostics, filename, fileformat },
lualine_x = { location }, lualine_x = { location, encoding, filetype },
lualine_y = { encoding, filetype }, lualine_y = {},
lualine_z = {}, lualine_z = {},
}, },
}) })