diff options
-rw-r--r-- | lua/minitab/init.lua | 13 | ||||
-rw-r--r-- | minitab | 3 |
2 files changed, 10 insertions, 6 deletions
diff --git a/lua/minitab/init.lua b/lua/minitab/init.lua index 0504d42..1ef909c 100644 --- a/lua/minitab/init.lua +++ b/lua/minitab/init.lua @@ -1,14 +1,15 @@ -local M = {} +local M = { + moduleNames = { 'init.lua', '__init__.py', } +} M.fileTitle = function(file) file = vim.fn.fnamemodify(file, ':p:~') local tail = vim.fn.fnamemodify(file, ':t') - if not tail then - return vim.fn.fnamemodify(file, ':p:~:h') .. '/' -- e.g. ~/dir/ - elseif tail == 'init.lua' - or tail == '__init__.py' then - return vim.fn.fnamemodify(vim.fn.fnamemodify(file, ':h'), ':t') .. '/' .. tail -- e.g. luatab/init.lua + if tail == '' then + return vim.fn.fnamemodify(file, ':p:~') -- netrw; e.g. ~/dir/ + elseif vim.tbl_contains(M.moduleNames, tail) then + return vim.fn.fnamemodify(vim.fn.fnamemodify(file, ':h'), ':t') .. '/' .. tail -- e.g. minitab/init.lua else return tail end @@ -0,0 +1,3 @@ +[master 68779e1] cleantab - + 2 files changed, 6 insertions(+), 6 deletions(-) + rename lua/{cleantab => minitab}/init.lua (97%) |