config-neovim/lua/plugins/lualine.lua
2024-09-07 22:51:37 +08:00

47 lines
1.4 KiB
Lua

local function my_location()
local line = vim.fn.line(".")
local line_cnt = vim.fn.line("$")
local col = vim.fn.virtcol(".")
local col_cnt = vim.fn.virtcol("$") - 1
return string.format("%3d(%d):%d(%d)", line, line_cnt, col, col_cnt)
end
return {
"nvim-lualine/lualine.nvim",
dependencies = {
"nvim-tree/nvim-web-devicons",
"dokwork/lualine-ex",
"nvim-lua/plenary.nvim",
},
main = "lualine",
event = "VeryLazy",
opts = {
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff", "ex.lsp.single", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { "encoding" , "fileformat", "filetype" },
lualine_y = { "progress" },
lualine_z = { my_location },
},
inactive_sections = {
lualine_a = { },
lualine_b = { },
lualine_c = { "filename" },
lualine_x = { "encoding", "fileformat", "filetype" },
lualine_y = { "progress" },
lualine_z = { my_location },
},
options = {
disabled_filetypes = {
statusline = {"NvimTree"},
winbar = {},
},
},
extensions = { "lazy", "neo-tree", "quickfix" }
},
init = function(_)
vim.o.mousemoveevent = true
end,
}