2024-07-10 22:40:36 +02:00
|
|
|
local oil = require("oil")
|
|
|
|
local wk = require("which-key")
|
|
|
|
|
2024-07-10 23:16:51 +02:00
|
|
|
local detail = false
|
|
|
|
|
2024-07-10 22:40:36 +02:00
|
|
|
oil.setup({
|
|
|
|
view_options = {
|
|
|
|
-- Show files and directories that start with "." by default
|
|
|
|
show_hidden = true,
|
|
|
|
-- But never '..'
|
|
|
|
is_always_hidden = function(name, bufnr)
|
|
|
|
return name == ".."
|
|
|
|
end,
|
|
|
|
},
|
2024-07-10 23:16:51 +02:00
|
|
|
keymaps = {
|
|
|
|
["gd"] = {
|
|
|
|
desc = "Toggle file detail view",
|
|
|
|
callback = function()
|
|
|
|
detail = not detail
|
|
|
|
if detail then
|
|
|
|
oil.set_columns({ "icon", "permissions", "size", "mtime" })
|
|
|
|
else
|
|
|
|
oil.set_columns({ "icon" })
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
},
|
2024-07-10 22:40:36 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
local keys = {
|
|
|
|
["-"] = { oil.open, "Open parent directory" },
|
|
|
|
}
|
|
|
|
|
|
|
|
wk.register(keys)
|