home: vim: oil: add detail view toggle mapping
This commit is contained in:
parent
c2723363ec
commit
241071df30
|
@ -1,3 +1,26 @@
|
|||
local oil = require("oil")
|
||||
local detail = false
|
||||
|
||||
oil.setup()
|
||||
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,
|
||||
},
|
||||
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,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue