From 1b50d9757f0a25b5f9cf4341438a82677e9b358b Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Thu, 18 May 2023 14:29:10 +0100 Subject: [PATCH] Disable neotree, switch to oil --- lua/plugins/alpha.lua | 2 +- lua/plugins/neotree.lua | 1 + lua/plugins/oil.lua | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 lua/plugins/oil.lua diff --git a/lua/plugins/alpha.lua b/lua/plugins/alpha.lua index 6b6e59b..f7ac621 100644 --- a/lua/plugins/alpha.lua +++ b/lua/plugins/alpha.lua @@ -16,7 +16,7 @@ return { dashboard.section.buttons.val = { dashboard.button("f", " " .. " Find file", "Telescope find_files "), dashboard.button("r", " " .. " Recent files", "Telescope oldfiles "), - dashboard.button("n", "󱏒 " .. " Neotree", "Neotree left "), + dashboard.button("n", "󱏒 " .. " Oil file browser", "Oil "), dashboard.button("g", "󰊢 " .. " Git status", "Neogit "), dashboard.button("c", " " .. " Config", "e $MYVIMRC "), dashboard.button("l", "󰒲 " .. " Lazy", "Lazy"), diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua index 559f4f5..007beaa 100644 --- a/lua/plugins/neotree.lua +++ b/lua/plugins/neotree.lua @@ -1,5 +1,6 @@ return { "nvim-neo-tree/neo-tree.nvim", + enabled = false, branch = "v2.x", dependencies = { "nvim-lua/plenary.nvim", diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua new file mode 100644 index 0000000..72de70c --- /dev/null +++ b/lua/plugins/oil.lua @@ -0,0 +1,25 @@ +return { + "stevearc/oil.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + cmd = "Oil", + init = function() + vim.keymap.set("n", "o", "Oil") + if vim.fn.argc() == 1 then + local stat = vim.loop.fs_stat(vim.fn.argv(0)) + if stat and stat.type == "directory" then require "oil" end + end + end, + config = true, + opts = { + float = { + -- Padding around the floating window + padding = 2, + max_width = 0, + max_height = 0, + border = "rounded", + win_options = { + winblend = 10, + }, + }, + }, +}