t0vim/lua/custom/oil.lua

27 lines
986 B
Lua

require("oil").setup {
keymaps = {
["g?"] = "actions.show_help",
["<CR>"] = "actions.select",
["<C-s>"] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" },
["<C-h>"] = false,
["<C-t>"] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" },
["<C-p>"] = "actions.preview",
["<C-c>"] = "actions.close",
["<C-l>"] = false,
["-"] = "actions.parent",
["_"] = "actions.open_cwd",
["`"] = "actions.cd",
["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory", mode = "n" },
["gs"] = "actions.change_sort",
["gx"] = "actions.open_external",
["g."] = "actions.toggle_hidden",
["g\\"] = "actions.toggle_trash",
["gr"] = "actions.refresh",
},
view_options = {
show_hidden = true,
},
-- Open parent directory in current window
}
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })