From 7f451adc905a079984c24d8fd93b8c109f14fba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Fro=C5=82ow?= Date: Wed, 12 Jun 2024 17:27:16 +0200 Subject: [PATCH] example.lua: working example for chaning lualine https://vi.stackexchange.com/questions/44931/neovim-and-lazyvim-customising-lualine-status-line/45008#45008 --- lua/plugins/example.lua | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua index 8b7eabc..d77a0cd 100644 --- a/lua/plugins/example.lua +++ b/lua/plugins/example.lua @@ -156,11 +156,24 @@ return { { "nvim-lualine/lualine.nvim", event = "VeryLazy", - opts = function(_, opts) - table.insert(opts.sections.lualine_x, "😄") + config = function(_, opts) + table.insert(opts.sections.lualine_a, + function() + return "😄" + end + ) + + -- prepend + table.insert(opts.sections.lualine_z, 1, "location") + + require('lualine').setup { + sections = { + lualine_a = opts.sections.lualine_a, + lualine_z = opts.sections.lualine_z, + } + } end, }, - -- or you can return new options to override all the defaults { "nvim-lualine/lualine.nvim",