vis-config
lua scripts to configure vis editor
git clone https://9o.is/git/vis-config.git
commit 38a8cc3d3af7b09f2b53dd61f6fe8f854fac5a2c parent 4dd1731974e12a4003a578fb8657e3529eaf2942 Author: Jul <jul@9o.is> Date: Mon, 26 Jan 2026 10:48:11 -0500 explore command handles absolute pathnames Diffstat:
| M | lib/search.lua | | | 11 | ++++++++++- |
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/lib/search.lua b/lib/search.lua @@ -69,7 +69,16 @@ vis:command_register('grep', function(argv, _, win) end, 'Grep') vis:command_register('explore', function(argv, force, win) - local command = M.explore:gsub('{path}', './'..(win.file.name or '')) + local path + if not win.file.name then + path = '.' + elseif win.file.name:sub(1,1) == '/' then + path = win.file.name + else + path = './' .. win.file.name + end + + local command = M.explore:gsub('{path}', path) return run(command, win.navigate) end, 'Explore')