kickstart.nvim/lua/custom/plugins/oil.lua

43 lines
1.2 KiB
Lua

return {
{
"stevearc/oil.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("oil").setup {
columns = { "icon" },
default_file_explorer = false,
delete_to_trash = true,
skip_confirm_for_simple_edits = true,
keymaps = {
["<C-h>"] = false,
["<M-h>"] = "actions.select_split",
["q"] = "actions.close",
},
view_options = {
show_hidden = true,
natural_order = true,
is_always_hidden = function(name, _)
-- return name == ".." or name == ".git"
return name == ".git"
end,
},
float = {
padding = 2,
max_width = 90,
max_height = 0,
},
win_options = {
wrap = true,
winblend = 0,
}
}
-- Open parent directory in current window
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
-- Open parent directory in floating window
vim.keymap.set("n", "<space>-", require("oil").toggle_float)
end,
},
}