vim.pack.add { "https://github.com/stevearc/oil.nvim", "https://github.com/nvim-mini/mini.icons" } require("mini.icons").setup {} local oil = require("oil") oil.setup { constrain_cursor = "name", -- Keep oil buffers open in the background for 10s. cleanup_delay_ms = 10000, view_options = { show_hidden = true, }, keymaps = { -- Allow escaping with if the window is floating. [""] = function() local win = vim.api.nvim_get_current_win() local win_cfg = vim.api.nvim_win_get_config(win) if win_cfg.relative ~= "" then oil.close() end end, [""] = false, [""] = false, [""] = false, [""] = false, }, } vim.keymap.set("n", "f", oil.toggle_float, { desc = "Files" }) vim.keymap.set( "n", "e", function() oil.toggle_float(vim.fn.getcwd()) end, { desc = "Files (cwd)" } )