From 3e4f56774e18a3ab4253ba4455dad53a8da0b167 Mon Sep 17 00:00:00 2001 From: Daveanand Mannie Date: Sat, 26 Oct 2024 15:20:40 -0400 Subject: [PATCH] [UPDATED] Merged the default lazy vim config with bubbles and some customizations --- lua/plugins/lualine.lua | 188 ++++++++++++++++++++++++++-------------- 1 file changed, 122 insertions(+), 66 deletions(-) diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index d58eb1b..abb8c3e 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,69 +1,125 @@ return { - { - 'nvim-lualine/lualine.nvim', - opts = function() - -- Colors and theme setup - local colors = { - blue = '#80a0ff', - cyan = '#79dac8', - black = '#080808', - white = '#c6c6c6', - red = '#ff5189', - violet = '#d183e8', - grey = '#303030', - } - - local bubbles_theme = { - normal = { - a = { fg = colors.black, bg = colors.violet }, - b = { fg = colors.white, bg = colors.grey }, - c = { fg = colors.white }, - }, - insert = { a = { fg = colors.black, bg = colors.blue } }, - visual = { a = { fg = colors.black, bg = colors.cyan } }, - replace = { a = { fg = colors.black, bg = colors.red } }, - inactive = { - a = { fg = colors.white, bg = colors.black }, - b = { fg = colors.white, bg = colors.black }, - c = { fg = colors.white }, - }, - } - - return { - options = { - theme = bubbles_theme, - component_separators = '', - section_separators = { left = '', right = '' }, - }, - sections = { - lualine_a = { { 'mode', separator = { left = '' }, right_padding = 2 } }, - lualine_b = { 'branch', 'diagnostics' }, - lualine_c = { - '%=', { 'filename', path = 1 } - }, - lualine_x = {}, - lualine_y = { - { - 'diff', - colored = true, - symbols = { added = ' ', modified = '✏️ ', removed = ' ' } - }, - 'encoding', 'filetype', 'progress' }, - lualine_z = { - { 'location', separator = { right = '' }, left_padding = 2 }, - }, - }, - inactive_sections = { - lualine_a = { 'filename' }, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = { 'location' }, - }, - tabline = {}, - extensions = {}, - } + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + init = function() + vim.g.lualine_laststatus = vim.o.laststatus + if vim.fn.argc(-1) > 0 then + -- set an empty statusline till lualine loads + vim.o.statusline = " " + else + -- hide the statusline on the starter page + vim.o.laststatus = 0 end - } + end, + opts = function() + -- Colors and theme setup + local colors = { + blue = "#80a0ff", + cyan = "#79dac8", + black = "#080808", + white = "#c6c6c6", + red = "#ff5189", + violet = "#d183e8", + grey = "#303030", + } + + local bubbles_theme = { + normal = { + a = { fg = colors.black, bg = colors.violet }, + b = { fg = colors.white, bg = colors.grey }, + c = { fg = colors.white }, + }, + insert = { a = { fg = colors.black, bg = colors.blue } }, + visual = { a = { fg = colors.black, bg = colors.cyan } }, + replace = { a = { fg = colors.black, bg = colors.red } }, + inactive = { + a = { fg = colors.white, bg = colors.black }, + b = { fg = colors.white, bg = colors.black }, + c = { fg = colors.white }, + }, + } + + local icons = LazyVim.config.icons + + vim.o.laststatus = vim.g.lualine_laststatus + + return { + options = { + theme = bubbles_theme, + globalstatus = vim.o.laststatus == 3, + disabled_filetypes = { statusline = { "dashboard", "alpha", "ministarter" } }, + component_separators = "", + section_separators = { left = "", right = "" }, + }, + sections = { + lualine_a = { + { "mode", separator = { left = "" }, right_padding = 2 }, + { + function() + return require("noice").api.status.command.get() + end, + cond = function() + return package.loaded["noice"] and require("noice").api.status.command.has() + end, + color = { colors.black }, + }, + }, + lualine_b = { + "branch", + { + "diagnostics", + symbols = { + error = icons.diagnostics.Error, + warn = icons.diagnostics.Warn, + info = icons.diagnostics.Info, + hint = icons.diagnostics.Hint, + }, + }, + }, + lualine_c = { + "%=", + { "filetype", icon_only = true, padding = { 0 } }, + { "filename", path = 1 }, + { "filetype", icon_only = true, padding = { 0 } }, + }, + lualine_x = { + { + "diff", + symbols = { + added = icons.git.added, + modified = icons.git.modified, + removed = icons.git.removed, + }, + source = function() + local gitsigns = vim.b.gitsigns_status_dict + if gitsigns then + return { + added = gitsigns.added, + modified = gitsigns.changed, + removed = gitsigns.removed, + } + end + end, + }, + }, + lualine_y = { + "encoding", + "progress", + }, + lualine_z = { + { "location", separator = { right = "" }, left_padding = 2 }, + }, + }, + inactive_sections = { + lualine_a = { "filename" }, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = { "location" }, + }, + tabline = {}, + extensions = { "neo-tree", "lazy" }, + } + end, }