feat(dir.lua): global "-" default mapping #40426

This commit is contained in:
Barrett Ruth
2026-06-26 05:17:00 -05:00
committed by GitHub
parent ea0af59854
commit 6576e75eeb
4 changed files with 23 additions and 1 deletions

View File

@@ -18,6 +18,10 @@ vim.keymap.set('n', '<Plug>(nvim-dir-reload)', function()
require('nvim.dir')._reload()
end, { silent = true, desc = 'Reload directory' })
if vim.fn.mapcheck('-', 'n') == '' and vim.fn.hasmapto('<Plug>(nvim-dir-up)', 'n') == 0 then
vim.keymap.set('n', '-', '<Plug>(nvim-dir-up)', { silent = true, desc = 'Open parent directory' })
end
---@param buf integer
---@param path string
---@return boolean