From 847d1f9d718ec44a8822eb96244e85d9a70f6848 Mon Sep 17 00:00:00 2001 From: Daniel Carrillo Date: Sun, 2 Oct 2022 12:04:24 +0200 Subject: [PATCH] [neovim] Set lualine indicator about tabs/spaces set for the current buffer --- .config/nvim/lua/user/lualine.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/user/lualine.lua b/.config/nvim/lua/user/lualine.lua index 65407dd..4dba411 100644 --- a/.config/nvim/lua/user/lualine.lua +++ b/.config/nvim/lua/user/lualine.lua @@ -13,7 +13,7 @@ local diagnostics = { sections = { "error", "warn" }, symbols = { error = " ", warn = " " }, colored = false, - always_visible = true, + always_visible = false, } local diff = { @@ -34,7 +34,14 @@ local location = { } local spaces = function() - return "spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth") + local expandtab = vim.api.nvim_buf_get_option(0, "expandtab") + + local title = "spaces: " + if not expandtab then + title = "tab: " + end + + return title .. vim.api.nvim_buf_get_option(0, "shiftwidth") end local gitblame_status_ok, gitblame = pcall(require, "gitblame")