From 77a272fc32e4ebc7cac489ae2a364cda492cb65b Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Tue, 25 Oct 2022 16:34:12 -0500 Subject: [PATCH] feat(nvim): enable winbar --- dots/.nvim-environments/primary/config/lua/core/init.lua | 2 +- .../.nvim-environments/primary/config/lua/core/winbar.lua | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dots/.nvim-environments/primary/config/lua/core/init.lua b/dots/.nvim-environments/primary/config/lua/core/init.lua index 30567709..51024280 100755 --- a/dots/.nvim-environments/primary/config/lua/core/init.lua +++ b/dots/.nvim-environments/primary/config/lua/core/init.lua @@ -5,4 +5,4 @@ require("core.globals").setup() require("core.autocmds").setup() require("core.filetypes").setup() require("core.lsp").setup() --- require('core.winbar').setup() +require('core.winbar').setup() diff --git a/dots/.nvim-environments/primary/config/lua/core/winbar.lua b/dots/.nvim-environments/primary/config/lua/core/winbar.lua index 9711cbda..19c2fbb8 100644 --- a/dots/.nvim-environments/primary/config/lua/core/winbar.lua +++ b/dots/.nvim-environments/primary/config/lua/core/winbar.lua @@ -5,14 +5,18 @@ M.winbar = function() local ignore_fts = { 'neo-tree', 'dashboard', + 'alpha', } for _, ft in ipairs(ignore_fts) do if ft == vim.bo.filetype then - return win_number + return win_number .. ' ' .. ft end end - return win_number .. ' %f' + + local relative_path = vim.fn.fnamemodify(vim.fn.expand('%:h'), ':p:~:.') + local filename = vim.fn.expand('%:t') + return win_number .. '  ' .. relative_path .. filename end M.setup = function()