diff --git a/lua/weeheavy/plugins/oil.lua b/lua/weeheavy/plugins/oil.lua index 057ea33..3316168 100644 --- a/lua/weeheavy/plugins/oil.lua +++ b/lua/weeheavy/plugins/oil.lua @@ -5,6 +5,7 @@ return { lazy = true, cmd = "Oil", config = function() + local detail = false require("oil").setup({ default_file_explorer = true, columns = { @@ -23,6 +24,17 @@ return { [""] = "actions.close", ["q"] = "actions.close", [""] = "actions.close", + ["gd"] = { + desc = "Toggle file detail view", + callback = function() + detail = not detail + if detail then + require("oil").set_columns({ "icon", "permissions", "size", "mtime" }) + else + require("oil").set_columns({ "icon" }) + end + end, + }, }, float = {