mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-18 09:44:50 +02:00
feat(lualine): better lualine with git status, diagnostics and navic lsp information (#15)
This commit is contained in:
parent
6bfba2d669
commit
d74759de76
4 changed files with 40 additions and 7 deletions
|
@ -9,6 +9,7 @@ return {
|
|||
"mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"SmiteshP/nvim-navic",
|
||||
},
|
||||
---@type lspconfig.options
|
||||
servers = nil,
|
||||
|
@ -17,6 +18,9 @@ return {
|
|||
require("lazyvim.util").on_attach(function(client, buffer)
|
||||
require("lazyvim.plugins.lsp.format").on_attach(client, buffer)
|
||||
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
|
||||
if client.server_capabilities.documentSymbolProvider then
|
||||
require("nvim-navic").attach(client, buffer)
|
||||
end
|
||||
end)
|
||||
|
||||
-- diagnostics
|
||||
|
|
|
@ -69,12 +69,35 @@ return {
|
|||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
config = {
|
||||
options = {
|
||||
globalstatus = true,
|
||||
disabled_filetypes = { statusline = { "lazy", "alpha" } },
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local navic = require("nvim-navic")
|
||||
local lualine = require("lualine")
|
||||
local symbols = require("lazyvim.config.settings")
|
||||
lualine.setup({
|
||||
options = {
|
||||
globalstatus = true,
|
||||
disabled_filetypes = { statusline = { "lazy", "alpha" } },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = {
|
||||
{ "branch" },
|
||||
{
|
||||
"diff",
|
||||
symbols = { added = symbols.icons.git.added, modified = symbols.icons.git.modified, removed = symbols.icons.git.removed }, -- changes diff symbols
|
||||
},
|
||||
},
|
||||
lualine_c = {
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = { error = symbols.icons.diagnostics.Error, warn = symbols.icons.diagnostics.Warn, info = symbols.icons.diagnostics.Info, hint = symbols.icons.diagnostics.Hint }
|
||||
},
|
||||
{ "filename", padding = { left = 1, right = 1 } },
|
||||
{ navic.get_location, cond = navic.is_available }
|
||||
},
|
||||
}
|
||||
})
|
||||
end
|
||||
},
|
||||
|
||||
-- indent guides for Neovim
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue