Public Access
open files from mini.files
This commit is contained in:
@@ -14,6 +14,12 @@ To remove a plugin run `:lua vim.pack.del({ "<plugin name>" })`.
|
||||
|
||||
See custom keymaps with short descriptions with `<leader><leader>h`.
|
||||
|
||||
General shortcuts:
|
||||
|
||||
- `<leader>e` opens the file browser
|
||||
- `gx` opens an external viewer
|
||||
- `gR`, `<F5>` refresh
|
||||
|
||||
Windowing shortcuts:
|
||||
|
||||
- `<leader>sv` open a vertical split
|
||||
@@ -48,16 +54,6 @@ Git shortcuts:
|
||||
- `[h`, `]h`, `[H`, `]H` jump to hunks
|
||||
- `<leader>th` — toggle the expanded hunk view
|
||||
|
||||
Refresh shortcuts (mini.files and buffers):
|
||||
|
||||
- `gR` refresh the current buffer
|
||||
- `<F5>` refresh the current buffer
|
||||
|
||||
Files usage:
|
||||
|
||||
- `<leader>e` opens the file browser
|
||||
- `gx` opens the file in external viewer
|
||||
|
||||
Toggle shortcuts:
|
||||
|
||||
- `<leader>tw` toggle soft wrap
|
||||
|
||||
@@ -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