open files from mini.files

This commit is contained in:
2026-09-18 15:50:54 +02:00
parent 292961ae93
commit 0e8f4bc7a5
2 changed files with 20 additions and 10 deletions
@@ -355,6 +355,16 @@ local function refresh_filetree()
end)
end
local function open_external()
local fs_entry = MiniFiles.get_fs_entry()
if fs_entry == nil then
vim.notify("No file system entry under the cursor", vim.log.levels.WARN)
return
end
vim.ui.open(fs_entry.path)
end
function M.setup()
local group = vim.api.nvim_create_augroup("romanzy_mini_files_git", { clear = true })
@@ -372,6 +382,10 @@ function M.setup()
desc = "refresh mini.files filetree",
})
end
vim.keymap.set("n", "gx", open_external, {
buffer = args.data.buf_id,
desc = "open mini.files entry externally",
})
end,
})
vim.api.nvim_create_autocmd({ "BufWritePost", "FocusGained", "TermClose" }, {