From 99d69c64488159ad06c2342285478c3d98c1428b Mon Sep 17 00:00:00 2001 From: Daniil Tsivinsky Date: Sat, 5 Feb 2022 11:43:16 +0300 Subject: [PATCH] add tabstop module for lualine --- config/nvim/lua/user/lualine.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/config/nvim/lua/user/lualine.lua b/config/nvim/lua/user/lualine.lua index 86c5691..8030739 100644 --- a/config/nvim/lua/user/lualine.lua +++ b/config/nvim/lua/user/lualine.lua @@ -29,6 +29,19 @@ local fileformat = { }, } +-- don't know if it's working or not. seems working right +local tabstop = { + function() + local tabstop = vim.bo.tabstop + local expandtab = vim.bo.expandtab + + local method = expandtab == true and "spaces" or "tabs" + local format = tabstop .. " " .. method + + return format + end, +} + local location = { "location", } @@ -72,7 +85,7 @@ lualine.setup({ lualine_a = { mode }, lualine_b = { branch }, lualine_c = { diagnostics, filename, fileformat }, - lualine_x = { location, encoding, filetype, time }, + lualine_x = { tabstop, location, encoding, filetype, time }, lualine_y = {}, lualine_z = {}, },