Public Access
open files from mini.files
This commit is contained in:
@@ -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" }, {
|
||||
|
||||
Reference in New Issue
Block a user