diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-24 20:35:27 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-24 20:35:27 +0900 |
| commit | c80a54e42b52ce297f0f2f71af23c562832025c7 (patch) | |
| tree | dcce8bb977a770f473325d48f6f70b21d9818a40 /ar/.config/LazyVim/lua/plugins/lualine.lua | |
init
Diffstat (limited to 'ar/.config/LazyVim/lua/plugins/lualine.lua')
| -rw-r--r-- | ar/.config/LazyVim/lua/plugins/lualine.lua | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/ar/.config/LazyVim/lua/plugins/lualine.lua b/ar/.config/LazyVim/lua/plugins/lualine.lua new file mode 100644 index 0000000..7c64086 --- /dev/null +++ b/ar/.config/LazyVim/lua/plugins/lualine.lua @@ -0,0 +1,105 @@ +return { + "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() + -- PERF: we don't need this lualine require madness 🤷 + local lualine_require = require("lualine_require") + lualine_require.require = require + + local icons = require("lazyvim.config").icons + + vim.o.laststatus = vim.g.lualine_laststatus + + return { + options = { + theme = "auto", + component_separators = { left = " ", right = " " }, + section_separators = { left = " ", right = " " }, + globalstatus = true, + disabled_filetypes = { statusline = { "dashboard", "alpha", "starter" } }, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch" }, + + lualine_c = { + LazyVim.lualine.root_dir(), + { + "diagnostics", + symbols = { + error = icons.diagnostics.Error, + warn = icons.diagnostics.Warn, + info = icons.diagnostics.Info, + hint = icons.diagnostics.Hint, + }, + }, + { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } }, + { LazyVim.lualine.pretty_path() }, + }, + lualine_x = { + -- stylua: ignore + { + function() return require("noice").api.status.command.get() end, + cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end, + color = LazyVim.ui.fg("Statement"), + }, + -- stylua: ignore + { + function() return require("noice").api.status.mode.get() end, + cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end, + color = LazyVim.ui.fg("Constant"), + }, + -- stylua: ignore + { + function() return " " .. require("dap").status() end, + cond = function () return package.loaded["dap"] and require("dap").status() ~= "" end, + color = LazyVim.ui.fg("Debug"), + }, + { + require("lazy.status").updates, + cond = require("lazy.status").has_updates, + color = LazyVim.ui.fg("Special"), + }, + { + "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 = { + { "progress", separator = " ", padding = { left = 1, right = 0 } }, + { "location", padding = { left = 0, right = 1 } }, + }, + lualine_z = { + function() + return " " .. os.date("%R") + end, + }, + }, + extensions = { "neo-tree", "lazy" }, + } + end, +} |
