dotfiles/config/nvim/lua/fschauen/plugins/oil.lua

63 lines
1.3 KiB
Lua

return {
"stevearc/oil.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
cmd = "Oil",
lazy = false,
keys = {
{ "-", "<cmd>Oil<cr>", desc = "Open Oil" },
},
config = function()
require("oil").setup {
columns = {
"icon",
"permissions",
"size",
"mtime",
},
keymaps = {
["<c-s>"] = {
"actions.select",
opts = {
horizontal = true,
split = "belowright",
},
},
["<c-b>"] = { -- Not using <c-v> so that I can use Visual Block mode.
"actions.select",
opts = {
vertical = true,
split = "belowright",
},
},
["<c-r>"] = "actions.refresh",
-- Remove default keymaps that I use for navigation.
-- NOTE: the C must be capitalized (bug in Oil)
["<C-h>"] = false, -- use <c-s> intead
["<C-l>"] = false, -- use <c-r> instead
["<leader>:"] = {
"actions.open_cmdline",
opts = {
shorten_path = true,
},
desc = "Open command line with current entry as an argument",
},
["q"] = "actions.close",
},
view_options = {
show_hidden = true,
},
}
end,
}