home: vim: oil: add detail view toggle mapping

This commit is contained in:
Bruno BELANYI 2024-07-10 22:16:51 +01:00
parent 6a6f3aed63
commit 452399ee4c

View file

@ -1,6 +1,8 @@
local oil = require("oil") local oil = require("oil")
local wk = require("which-key") local wk = require("which-key")
local detail = false
oil.setup({ oil.setup({
view_options = { view_options = {
-- Show files and directories that start with "." by default -- Show files and directories that start with "." by default
@ -10,6 +12,19 @@ oil.setup({
return name == ".." return name == ".."
end, end,
}, },
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,
},
},
}) })
local keys = { local keys = {