nixos/home/tui/config/nvim/lua/config/lualine.lua
Evie Litherland-Smith 9567908cb7 Rewrite keymap definition, add nvim-navbuddy
Move plugin-specific keymaps into init section of plugin definition
Add nvim-navbuddy for breadcrumbs navigation
Remove aerial as replaced by navbuddy
2023-05-11 08:51:35 +01:00

50 lines
1.6 KiB
Lua

local lsp_progress = function()
local Lsp = vim.lsp.util.get_progress_messages()[1]
if Lsp then
local msg = Lsp.message or ""
local percentage = Lsp.percentage
if not percentage then return "" end
local title = Lsp.title or ""
local spinners = { "", "", "" }
local success_icon = { "", "", "" }
local ms = vim.loop.hrtime() / 1000000
local frame = math.floor(ms / 120) % #spinners
if percentage >= 70 then
return string.format(" %%<%s %s %s (%s%%%%) ", success_icon[frame + 1], title, msg, percentage)
end
return string.format(" %%<%s %s %s (%s%%%%) ", spinners[frame + 1], title, msg, percentage)
end
return ""
end
return {
options = {
theme = "catppuccin",
component_separators = "|",
section_separators = { left = "", right = "" },
globalstatus = true,
},
sections = {
lualine_a = { "mode" },
lualine_b = { "filename", { "branch", icon = "󰊢" }, "diff" },
lualine_c = { lsp_progress, "diagnostics" },
lualine_x = {},
lualine_y = { "searchcount", "progress", "selectioncount" },
lualine_z = { "location" },
},
tabline = {
lualine_a = {},
lualine_b = { "filetype", "fileformat", "encoding" },
lualine_c = { "require('nvim-navic').get_location()" },
lualine_x = { { "windows", use_mode_colors = true } },
lualine_y = {},
lualine_z = {},
},
winbar = {},
extensions = { "aerial", "fzf", "lazy", "neo-tree", "toggleterm", "trouble" },
}