From 222a35646d3cecac905c248ff7786b3c4dff764e Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Wed, 27 Nov 2024 23:30:04 -0600 Subject: modulenames --- lua/minitab/init.lua | 13 +++++++------ minitab | 3 +++ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 minitab 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 diff --git a/minitab b/minitab new file mode 100644 index 0000000..29eebd9 --- /dev/null +++ b/minitab @@ -0,0 +1,3 @@ +[master 68779e1] cleantab - + 2 files changed, 6 insertions(+), 6 deletions(-) + rename lua/{cleantab => minitab}/init.lua (97%) -- cgit v1.2.3