diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index 47fff3a..e7810d7 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua @@ -1,17 +1,37 @@ -- https://github.com/stevearc/oil.nvim + +-- For toggling detailed view +local detail = false + return { "stevearc/oil.nvim", + dependencies = { + {"nvim-tree/nvim-web-devicons"}, + }, opts = { columns = { - -- "icon", - -- "permissions", - -- "size", - -- "mtime", + "icon", }, delete_to_trash = true, skip_confirm_for_simple_edits = true, view_options = { show_hidden = true, }, + keymaps = { + -- Disable these since they are used for navigation + [""] = false, + [""] = false, + -- Toggle detailed view with d + ["d"] = { + callback = function() + detail = not detail + local cols = {"icon"} + if detail then + cols = {"icon", "permissions", "size", "mtime"} + end + require("oil").set_columns(cols) + end, + }, + }, }, }