mirror of
https://github.com/harivansh-afk/nvim.git
synced 2026-04-15 13:03:45 +00:00
37 lines
956 B
Lua
37 lines
956 B
Lua
return {
|
|
"stevearc/oil.nvim",
|
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
|
event = 'VeryLazy',
|
|
keys = {
|
|
{ "-", "<cmd>Oil<cr>", desc = "Open parent directory" },
|
|
},
|
|
config = function(_, opts)
|
|
require("oil").setup(opts)
|
|
vim.api.nvim_create_autocmd("BufEnter", {
|
|
pattern = "oil://*",
|
|
callback = function()
|
|
local dir = require("oil").get_current_dir()
|
|
if dir then
|
|
vim.cmd.lcd(dir)
|
|
end
|
|
end,
|
|
})
|
|
end,
|
|
opts = {
|
|
default_file_explorer = true, -- nvim . opens oil
|
|
columns = { "icon" },
|
|
view_options = {
|
|
show_hidden = true,
|
|
},
|
|
keymaps = {
|
|
["g?"] = "actions.show_help",
|
|
["<CR>"] = "actions.select",
|
|
["<C-v>"] = "actions.select_vsplit",
|
|
["<C-x>"] = "actions.select_split",
|
|
["<C-p>"] = "actions.preview",
|
|
["<C-c>"] = "actions.close",
|
|
["-"] = "actions.parent",
|
|
["g."] = "actions.toggle_hidden",
|
|
},
|
|
},
|
|
}
|