From 4fb84796ca173aa81947d9c991012634d2426c3c Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 28 Aug 2022 21:12:57 +0200 Subject: [PATCH] nvim: statusline: display function after filename --- .config/nvim/lua/my/functions.lua | 4 ---- .config/nvim/lua/my/tools.lua | 8 +++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.config/nvim/lua/my/functions.lua b/.config/nvim/lua/my/functions.lua index 57cf9a7..4d4f296 100644 --- a/.config/nvim/lua/my/functions.lua +++ b/.config/nvim/lua/my/functions.lua @@ -130,10 +130,6 @@ function M.lsp_status() end end - local current_function = vim.b.lsp_current_function - if current_function and current_function ~= '' then - status = status .. '(' .. current_function .. ')' - end return status end diff --git a/.config/nvim/lua/my/tools.lua b/.config/nvim/lua/my/tools.lua index 33feed8..89b41e8 100644 --- a/.config/nvim/lua/my/tools.lua +++ b/.config/nvim/lua/my/tools.lua @@ -80,7 +80,13 @@ require('lualine').setup({ { 'require("my.functions").lsp_status()', padding = 0 }, { 'diagnostics' } }, - lualine_c = { { 'filename', path = 1 } }, + lualine_c = { { 'filename', path = 1 }, { function() + local curfun = vim.b.lsp_current_function + if curfun and curfun ~= '' then + return '(' .. curfun .. ')' + end + return '' + end, padding = 0, color = 'StatusLineNC' } }, lualine_x = { { 'filetype' } }, lualine_y = { { 'progress' } }, lualine_z = { { 'location' }, { '"🍄"', padding = 0 }