nvim/.config/nvim/lua/plugins/ui/lualine.lua

-- nvim/.config/nvim/lua/plugins/ui/lualine.lua

return {
  "nvim-lualine/lualine.nvim",
  event = "VeryLazy",
  dependencies = { "nvim-tree/nvim-web-devicons" },
  opts = function()
    local function macro_recording()
      local reg = vim.fn.reg_recording()
      if reg == "" then return "" end
      return "rec @" .. reg
    end

    local function lsp_clients()
      local names = {}
      for _, c in ipairs(vim.lsp.get_clients({ bufnr = 0 })) do
        table.insert(names, c.name)
      end
      if #names == 0 then return "" end
      return "[" .. table.concat(names, ",") .. "]"
    end

    return {
      options = {
        theme = "kanagawa",
        icons_enabled = true,
        globalstatus = true,
        component_separators = { left = "", right = "" },
        section_separators   = { left = "", right = "" },
        disabled_filetypes = { statusline = { "dashboard", "alpha", "neo-tree" } },
      },
      sections = {
        lualine_a = { "mode" },
        lualine_b = { "branch", { "diff", symbols = { added = "+", modified = "~", removed = "-" } } },
        lualine_c = {
          { "filename", path = 1, symbols = { modified = " ●", readonly = " ro" } },
          { "diagnostics", sources = { "nvim_diagnostic" } },
          { macro_recording, color = { fg = "#e82424", gui = "bold" } },
        },
        lualine_x = { lsp_clients, "encoding", "fileformat", "filetype" },
        lualine_y = { "progress" },
        lualine_z = { "location" },
      },
      extensions = { "neo-tree", "quickfix", "lazy", "man", "trouble" },
    }
  end,
}