diff options
Diffstat (limited to 'lua/plugins/lualine.lua')
| -rw-r--r-- | lua/plugins/lualine.lua | 148 |
1 files changed, 112 insertions, 36 deletions
diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index e4c3b4a..8406d42 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,19 +1,40 @@ return { - "nvim-lualine/lualine.nvim", - dependencies = { "kyazdani42/nvim-web-devicons" }, - config = function() - require("lualine").setup { - options = { - theme = "auto", - icons_enabled = true, - globalstatus = true, - }, - extensions = { "quickfix", "fugitive" }, - sections = { - lualine_a = { { "mode", upper = true } }, - lualine_b = { { "branch", icon = "" }, "db_ui#statusline" }, - lualine_c = { { "filename", file_status = true, path = 1 } }, - lualine_x = { + { + 'nvim-lualine/lualine.nvim', + dependencies = { + 'kyazdani42/nvim-web-devicons', + 'arkav/lualine-lsp-progress', + }, + opts = function() + local function winnr() return ' ' .. vim.fn.winnr() end + local function bufnr() return ' ' .. vim.fn.bufnr() end + + local function lualine_c(filename_opts) + filename_opts = filename_opts or {} + + return { + { + 'filetype', + icon_only = true, + separator = '', + padding = { left = 1, right = 0 }, + }, + { + 'filename', + file_status = filename_opts.file_status, + padding = 0, + path = filename_opts.fullpath and 1, + separator = '', + }, + } + end + + local sections = { + lualine_a = { winnr }, + lualine_b = { bufnr }, + lualine_d = lualine_c { fullpath = true }, + lualine_x = { 'searchcount' }, + lualine_y = { "diagnostics", "diff", { @@ -27,25 +48,80 @@ return { color = { fg = "ff9e64" }, }, }, - lualine_y = { "filetype" }, - lualine_z = { "location" }, - }, - winbar = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = {}, - }, - inactive_winbar = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { {"filename", file_status = true, path = 1} }, - lualine_x = {}, - lualine_y = {}, - lualine_z = {}, - }, - } - end, + lualine_z = { 'progress' }, + } + + return { + options = { + disabled_filetypes = { 'alpha', 'dbui', 'fugitiveblame' }, + theme = 'catppuccin', + }, + tabline = { + lualine_a = { + 'mode', + 'selectioncount', + function() return vim.fn.fnamemodify(vim.fn.getcwd(), ':p:~:h') end, + }, + lualine_b = { + function() + local dap_status = require('dap').status() + + return dap_status ~= '' and ' ' .. dap_status or '' + end, + }, + lualine_x = { 'lsp_progress' }, + lualine_y = { { "branch", icon = "" }, "db_ui#statusline" }, + lualine_z = { + { + 'tabs', + show_modified_status = false, + use_mode_colors = true, + }, + }, + }, + sections = sections, + inactive_sections = sections, + extensions = { + { + filetypes = { 'fugitive', 'git' }, + sections = vim.tbl_extend('force', sections, { + lualine_c = { { 'FugitiveHead', icon = '' } }, + }), + }, + { + filetypes = { 'help', 'man' }, + sections = vim.tbl_extend('force', sections, { + lualine_c = lualine_c { file_status = false }, + }), + }, + { + filetypes = { 'oil' }, + sections = vim.tbl_extend('force', sections, { + lualine_c = { + { + function() + local dir = require('oil').get_current_dir() + + return dir and vim.fn.fnamemodify(dir, ':p:~:.') + end, + icon = { + '', + color = { + fg = require('catppuccin.palettes').get_palette('frappe').maroon, + }, + }, + }, + }, + }), + }, + { + filetypes = { 'qf' }, + sections = vim.tbl_extend('force', sections, { + lualine_c = { 'w:quickfix_title' }, + }), + }, + }, + } + end, + }, } |