nvim/lua/plugins/oil.lua

30 lines
937 B
Lua

return {
'stevearc/oil.nvim',
dependencies = {
"nvim-tree/nvim-web-devicons",
},
lazy = false,
config = function()
require('oil').setup({
keymaps = {
["g?"] = { "actions.show_help", mode = "n" },
["<CR>"] = "actions.select",
["<leader>l"] = "actions.refresh",
["-"] = { "actions.parent", mode = "n" },
["_"] = { "actions.open_cwd", mode = "n" },
["`"] = { "actions.cd", mode = "n" },
["~"] = { "actions.cd", opts = { scope = "tab" }, mode = "n" },
["gs"] = { "actions.change_sort", mode = "n" },
["gx"] = "actions.open_external",
["g."] = { "actions.toggle_hidden", mode = "n" },
["g\\"] = { "actions.toggle_trash", mode = "n" },
},
use_default_keymaps = false,
})
vim.keymap.set("n", "-", function()
local dir = vim.fn.expand("%:h")
vim.cmd.Oil(dir ~= "" and dir or ".")
end, {})
end
}