2

I am using the LazyVim starter template and I would like the customise the Lualine statusline using the example given here which is:

return {
  -- skip other examples
    {
    "nvim-lualine/lualine.nvim",
    event = "VeryLazy",
    opts = function(_, opts)
      table.insert(opts.sections.lualine_x, "😄")
    end,
  },
 --- more examples follow
}

Except I'd like to put it in its own file ~/.config/nvim/lua/plugins/lualine.lua and keep the each plugin config override separate. However, placing the example above in the aforementioned file does not change the status line to have that emoji in it. It remains the default.

How can I keep the default LazyVim config options but override just a few options as required which each customisation in its own file?

Or, alternatively, is there a single place better suited to override LazyVim defaults?

1 Answer 1

0

setup inside config worked for me:

return {
  {
    "nvim-lualine/lualine.nvim",
    event = "VeryLazy",
    config = function(_, opts)
      require('lualine').setup {
        sections = {
          lualine_a = function()
            return "😄"
          end,
          lualine_z = {
            "location",
            unpack(opts.sections.lualine_z),
          },
        }
      }
    end,
  },
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.