feat: Use <C-l> to refresh directory (#7)

This commit is contained in:
Steven Arcangeli 2023-01-03 23:08:52 -08:00
parent 1879339442
commit d019d38a3e
2 changed files with 14 additions and 0 deletions

View file

@ -84,4 +84,17 @@ M.toggle_hidden = {
end,
}
M.refresh = {
desc = "Refresh directory",
callback = function()
if vim.bo.modified then
local ok, choice = pcall(vim.fn.confirm, "Discard changes?", "No\nYes")
if not ok or choice ~= 2 then
return
end
end
vim.cmd.edit({ bang = true })
end,
}
return M

View file

@ -34,6 +34,7 @@ local default_config = {
["<C-h>"] = "actions.select_split",
["<C-p>"] = "actions.preview",
["<C-c>"] = "actions.close",
["<C-l>"] = "actions.refresh",
["-"] = "actions.parent",
["_"] = "actions.open_cwd",
["`"] = "actions.cd",