return { "stevearc/oil.nvim", keys = { { "-", "Oil", desc = "Open parent directory" }, { "_", function() require("oil").open(vim.fn.getcwd()) end, desc = "Open parent directory", }, }, cmd = { "Oil" }, -- lazy = false, event = "VimEnter", dependencies = { "nvim-tree/nvim-web-devicons" }, config = function() require("oil").setup({ default_file_explorer = true, delete_to_trash = false, view_options = { show_hidden = true, }, columns = { "icon", "permissions", "size", "mtime", }, keymaps = { ["g?"] = "actions.show_help", [""] = "actions.select", [""] = false, --[[ [""] = { "actions.select", opts = { horizontal = true } }, ]] [""] = false, [""] = { "actions.select", opts = { tab = true } }, [""] = "actions.preview", [""] = false, ["q"] = "actions.close", [""] = false, [""] = { "actions.refresh" }, ["-"] = "actions.parent", ["_"] = "actions.open_cwd", ["`"] = "actions.cd", ["~"] = { "actions.cd", opts = { scope = "tab" } }, ["gs"] = "actions.change_sort", ["gx"] = "actions.open_external", ["g."] = "actions.toggle_hidden", ["g\\"] = "actions.toggle_trash", -- Mappings can be a string -- ["~"] = "edit $HOME", -- Mappings can be a function -- ["gd"] = function() -- require("oil").set_columns({ "icon", "permissions", "size", "mtime" }) -- end, -- You can pass additional opts to vim.keymap.set by using -- a table with the mapping as the first element. ["ff"] = { function() require("telescope.builtin").find_files({ cwd = require("oil").get_current_dir(), }) end, mode = "n", nowait = true, desc = "Find files in the current directory", }, ["fw"] = { function() require("telescope.builtin").live_grep({ cwd = require("oil").get_current_dir(), }) end, mode = "n", nowait = true, desc = "Find files in the current directory", }, }, skip_confirm_for_simple_edits = true, watch_for_changes = true, }) end, }