require("oil").setup { keymaps = { ["g?"] = "actions.show_help", [""] = "actions.select", [""] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" }, [""] = false, [""] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" }, [""] = "actions.preview", [""] = "actions.close", [""] = 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", "-", "Oil", { desc = "Open parent directory" })