local function save_dir() local dir = require("oil").get_current_dir() if dir ~= nil then local f = io.open("/tmp/oil_dir", "w") if f then f:write(dir) f:close() end end end return { 'stevearc/oil.nvim', dependencies = { "nvim-tree/nvim-web-devicons" }, lazy = true, opts = { keymaps = { ["g?"] = "actions.show_help", [""] = function() require("oil").select({}, save_dir) end, ["v"] = "actions.select_vsplit", ["s"] = "actions.select_split", ["p"] = "actions.preview", [""] = function() vim.cmd("q!") end, ["r"] = "actions.refresh", ["-"] = function() require("oil").open(); save_dir() end, ["_"] = "actions.open_cwd", ["`"] = "actions.cd", ["~"] = "actions.tcd", ["g."] = "actions.toggle_hidden", }, use_default_keymaps = false, } }