my-nvim-config/server/plugin/lualine.lua

36 lines
979 B
Lua
Raw Permalink Normal View History

2024-03-28 01:57:58 -05:00
local function counts()
local lc = vim.fn.line('$')
local wc = vim.fn.wordcount().words
return string.format('%d L, %d W', lc, wc)
end
require("lualine").setup {
options = {
theme = 'moonfly',
},
tabline = {
2024-03-28 01:57:58 -05:00
lualine_a = { 'buffers' },
lualine_b = {},
lualine_c = {},
2024-03-28 01:57:58 -05:00
lualine_x = { 'filename' },
2024-03-28 02:09:06 -05:00
lualine_y = {},
lualine_z = { counts },
2024-03-28 01:57:58 -05:00
},
sections = {
lualine_a = { 'mode' },
lualine_b = { 'branch', 'diff', 'diagnostics' },
lualine_c = { 'filename' },
lualine_x = { 'encoding', 'fileformat', 'filetype' },
lualine_y = { 'progress' },
lualine_z = { 'location' }
},
}
2024-03-28 01:57:58 -05:00
-- listen lsp-progress event and refresh lualine
vim.api.nvim_create_augroup("lualine_augroup", { clear = true })
vim.api.nvim_create_autocmd("User", {
group = "lualine_augroup",
pattern = "LspProgressStatusUpdated",
callback = require("lualine").refresh,
})