Browse Source

[nvim] Configuration for oil.nvim

- Enable icons with nvim-web-devicons
- Disable some conflicting keymappings
- Toggle for detailed view
master
Fredrik Ekre 1 year ago
parent
commit
42233458ec
No known key found for this signature in database
GPG Key ID: DE82E6D5E364C0A2
  1. 28
      .config/nvim/lua/plugins/oil.lua

28
.config/nvim/lua/plugins/oil.lua

@ -1,17 +1,37 @@
-- https://github.com/stevearc/oil.nvim -- https://github.com/stevearc/oil.nvim
-- For toggling detailed view
local detail = false
return { return {
"stevearc/oil.nvim", "stevearc/oil.nvim",
dependencies = {
{"nvim-tree/nvim-web-devicons"},
},
opts = { opts = {
columns = { columns = {
-- "icon", "icon",
-- "permissions",
-- "size",
-- "mtime",
}, },
delete_to_trash = true, delete_to_trash = true,
skip_confirm_for_simple_edits = true, skip_confirm_for_simple_edits = true,
view_options = { view_options = {
show_hidden = true, show_hidden = true,
}, },
keymaps = {
-- Disable these since they are used for navigation
["<C-h>"] = false,
["<C-l>"] = false,
-- Toggle detailed view with <leader>d
["<leader>d"] = {
callback = function()
detail = not detail
local cols = {"icon"}
if detail then
cols = {"icon", "permissions", "size", "mtime"}
end
require("oil").set_columns(cols)
end,
},
},
}, },
} }

Loading…
Cancel
Save