From 4a3197f2ad7ef54047264c08f77c8b4f26cac4ed Mon Sep 17 00:00:00 2001 From: Nathan Zeng Date: Tue, 11 Aug 2026 01:08:33 -0700 Subject: refactor(defaults): edit global cwd on "1-" #41254 Problem: `1-` does nothing from a directory buffer, because we are already in the buffer-local CWD. It's also unintuitive that this mapping behaves differently based on the resolved CWD. Solution: Have `1-` open the global CWD. --- runtime/plugin/dir.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/plugin/dir.lua') diff --git a/runtime/plugin/dir.lua b/runtime/plugin/dir.lua index 37ce560398..53f7fcff17 100644 --- a/runtime/plugin/dir.lua +++ b/runtime/plugin/dir.lua @@ -12,9 +12,10 @@ end, { silent = true, desc = 'Open directory entry' }) vim.keymap.set('n', '(nvim-dir-up)', function() if vim.v.count == 1 then + -- Edits global CWD api.nvim_cmd({ cmd = 'edit', - args = { '.' }, + args = { vim.fn.getcwd(-1, -1, -1) }, mods = { keepalt = vim.b.nvim_dir ~= nil }, magic = { file = false, bar = false }, }, {}) -- cgit