feat(lualine): better lualine with git status, diagnostics and navic lsp information (#15)
This commit is contained in:
1 parent
6bfba2d669
commit
d74759de76
4 files changed
+40
-7
No files matched your search
@@ -7,6 +7,11 @@ local settings = {
|
||||
Hint = " ",
|
||||
Info = " ",
|
||||
},
|
||||
git = {
|
||||
added = " ",
|
||||
modified = "柳",
|
||||
removed = " ",
|
||||
},
|
||||
kinds = {
|
||||
Class = " ",
|
||||
Color = " ",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user