From 20a4b1bc5eb4e84d7c49455a34516b7369761882 Mon Sep 17 00:00:00 2001 From: Barrett Ruth <62671086+barrettruth@users.noreply.github.com> Date: Fri, 10 Jul 2026 10:52:24 -0500 Subject: fix(dir): user/plugin can override default "-" mapping #40676 --- runtime/plugin/dir.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/plugin/dir.lua') diff --git a/runtime/plugin/dir.lua b/runtime/plugin/dir.lua index 022da9c7d3..85f3b9e6a1 100644 --- a/runtime/plugin/dir.lua +++ b/runtime/plugin/dir.lua @@ -18,6 +18,10 @@ vim.keymap.set('n', '(nvim-dir-reload)', function() require('nvim.dir')._reload() end, { silent = true, desc = 'Reload directory' }) +if vim.fn.mapcheck('-', 'n') == '' and vim.fn.hasmapto('(nvim-dir-up)', 'n') == 0 then + vim.keymap.set('n', '-', '(nvim-dir-up)', { silent = true, desc = 'Open parent directory' }) +end + ---@param buf integer ---@param path string ---@return boolean -- cgit