mirror of
https://github.com/neovim/neovim.git
synced 2026-08-20 06:11:52 +00:00
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.
This commit is contained in:
@@ -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 },
|
||||
}, {})
|
||||
|
||||
Reference in New Issue
Block a user