diff options
| author | Nathan Zeng <nathan.j.zeng@gmail.com> | 2026-08-11 01:08:33 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-11 04:08:33 -0400 |
| commit | 4a3197f2ad7ef54047264c08f77c8b4f26cac4ed (patch) | |
| tree | 030eca38cbc191a886090300415a1b47acb125bb /runtime/plugin/dir.lua | |
| parent | 2757f6eef92a99812d5ad12408d03592bd54f10c (diff) | |
| download | rneovim-4a3197f2ad7ef54047264c08f77c8b4f26cac4ed.tar.gz rneovim-4a3197f2ad7ef54047264c08f77c8b4f26cac4ed.tar.bz2 rneovim-4a3197f2ad7ef54047264c08f77c8b4f26cac4ed.zip | |
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.
Diffstat (limited to 'runtime/plugin/dir.lua')
| -rw-r--r-- | runtime/plugin/dir.lua | 3 |
1 files changed, 2 insertions, 1 deletions
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', '<Plug>(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 }, }, {}) |