summaryrefslogtreecommitdiff
path: root/.config/nvim-old/lua/config/plugins/oil.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim-old/lua/config/plugins/oil.lua')
-rw-r--r--.config/nvim-old/lua/config/plugins/oil.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/.config/nvim-old/lua/config/plugins/oil.lua b/.config/nvim-old/lua/config/plugins/oil.lua
new file mode 100644
index 0000000..555768f
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/oil.lua
@@ -0,0 +1,37 @@
+return {
+ "stevearc/oil.nvim",
+ dependencies = { "nvim-tree/nvim-web-devicons" },
+ config = function()
+ require("oil").setup({
+ default_file_explorer = true,
+ keymaps = {
+ ["l"] = "actions.select",
+ ["h"] = "actions.parent",
+ ["<CR>"] = "actions.select",
+ ["<C-s>"] = nil,
+ ["<C-h>"] = nil,
+ ["<C-l>"] = nil,
+ },
+ delete_to_trash = true,
+ view_options = {
+ show_hidden = true,
+ },
+ skip_confirm_for_simple_edits = true,
+ float = {
+ max_width = 80,
+ max_height = 30,
+ override = function(conf)
+ return conf
+ end,
+ },
+ })
+ vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
+
+ vim.api.nvim_create_autocmd("FileType", {
+ pattern = "oil",
+ callback = function()
+ vim.opt_local.cursorline = true
+ end,
+ })
+ end,
+}