mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-25 18:28: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
|
@ -12,7 +12,7 @@
|
||||||
"friendly-snippets": { "branch": "main", "commit": "484fb38b8f493ceeebf4e6fc499ebe41e10aae25" },
|
"friendly-snippets": { "branch": "main", "commit": "484fb38b8f493ceeebf4e6fc499ebe41e10aae25" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" },
|
"gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "db7cbcb40cc00fc5d6074d7569fb37197705e7f6" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "db7cbcb40cc00fc5d6074d7569fb37197705e7f6" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "e89e938991701cef7b9ace1913a7251c4c0fa46c" },
|
"lazy.nvim": { "branch": "main", "commit": "2ef44e2dee112ba7b83bdfca98f6c07967d65484" },
|
||||||
"leap.nvim": { "branch": "main", "commit": "a968ab4250840dc879e805f918b4f3b892310a12" },
|
"leap.nvim": { "branch": "main", "commit": "a968ab4250840dc879e805f918b4f3b892310a12" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "d8c392dd75778d6258da4e7c55522e94ac389732" },
|
"lualine.nvim": { "branch": "master", "commit": "d8c392dd75778d6258da4e7c55522e94ac389732" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "aa25b4153d2f2636c3b3a8c8360349d2b29e7ae3" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "aa25b4153d2f2636c3b3a8c8360349d2b29e7ae3" },
|
||||||
|
@ -32,6 +32,7 @@
|
||||||
"nvim-bufferline.lua": { "branch": "main", "commit": "028a87933d99f8bb88f2f70a4def3ff9574f3594" },
|
"nvim-bufferline.lua": { "branch": "main", "commit": "028a87933d99f8bb88f2f70a4def3ff9574f3594" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "983453e32cb35533a119725883c04436d16c0120" },
|
"nvim-cmp": { "branch": "main", "commit": "983453e32cb35533a119725883c04436d16c0120" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "22c87d6f48c4fb1daf33476450d0b14a64230809" },
|
"nvim-lspconfig": { "branch": "master", "commit": "22c87d6f48c4fb1daf33476450d0b14a64230809" },
|
||||||
|
"nvim-navic": { "branch": "master", "commit": "7a2b823152fe4de65ee7925b0e32d26ed73bc57c" },
|
||||||
"nvim-notify": { "branch": "master", "commit": "b005821516f1f37801a73067afd1cef2dbc4dfe8" },
|
"nvim-notify": { "branch": "master", "commit": "b005821516f1f37801a73067afd1cef2dbc4dfe8" },
|
||||||
"nvim-spectre": { "branch": "master", "commit": "68ea562b485b6593e325e7916c3bd6e833d433e7" },
|
"nvim-spectre": { "branch": "master", "commit": "68ea562b485b6593e325e7916c3bd6e833d433e7" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "69388e84c34d40c3d5c7d2f310db13276f2179e1" },
|
"nvim-treesitter": { "branch": "master", "commit": "69388e84c34d40c3d5c7d2f310db13276f2179e1" },
|
||||||
|
|
|
@ -7,6 +7,11 @@ local settings = {
|
||||||
Hint = " ",
|
Hint = " ",
|
||||||
Info = " ",
|
Info = " ",
|
||||||
},
|
},
|
||||||
|
git = {
|
||||||
|
added = " ",
|
||||||
|
modified = "柳",
|
||||||
|
removed = " ",
|
||||||
|
},
|
||||||
kinds = {
|
kinds = {
|
||||||
Class = " ",
|
Class = " ",
|
||||||
Color = " ",
|
Color = " ",
|
||||||
|
|
|
@ -9,6 +9,7 @@ return {
|
||||||
"mason.nvim",
|
"mason.nvim",
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"SmiteshP/nvim-navic",
|
||||||
},
|
},
|
||||||
---@type lspconfig.options
|
---@type lspconfig.options
|
||||||
servers = nil,
|
servers = nil,
|
||||||
|
@ -17,6 +18,9 @@ return {
|
||||||
require("lazyvim.util").on_attach(function(client, buffer)
|
require("lazyvim.util").on_attach(function(client, buffer)
|
||||||
require("lazyvim.plugins.lsp.format").on_attach(client, buffer)
|
require("lazyvim.plugins.lsp.format").on_attach(client, buffer)
|
||||||
require("lazyvim.plugins.lsp.keymaps").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)
|
end)
|
||||||
|
|
||||||
-- diagnostics
|
-- diagnostics
|
||||||
|
|
|
@ -69,13 +69,36 @@ return {
|
||||||
{
|
{
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = {
|
config = function()
|
||||||
|
local navic = require("nvim-navic")
|
||||||
|
local lualine = require("lualine")
|
||||||
|
local symbols = require("lazyvim.config.settings")
|
||||||
|
lualine.setup({
|
||||||
options = {
|
options = {
|
||||||
globalstatus = true,
|
globalstatus = true,
|
||||||
disabled_filetypes = { statusline = { "lazy", "alpha" } },
|
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
|
-- indent guides for Neovim
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue