diff --git a/flake.nix b/flake.nix index 9612738..a1e1f81 100644 --- a/flake.nix +++ b/flake.nix @@ -153,6 +153,7 @@ toggleterm-nvim undotree harpoon2 + mini-files oil-nvim # QoL - augments existing features to be a little nicer or adds some minor enhancements diff --git a/lua/plugins/lz-spec.lua b/lua/plugins/lz-spec.lua index 4ea7ea4..31856af 100644 --- a/lua/plugins/lz-spec.lua +++ b/lua/plugins/lz-spec.lua @@ -285,4 +285,19 @@ return { vim.keymap.set("n", "];", dropbar_api.select_next_context, { desc = "Select next context" }) end, }, + { + "mini.files", + after = function() + require("mini.files").setup({ + windows = { preview = true, width_preview = 40 }, + }) + + vim.keymap.set("n", "e", function() + MiniFiles.open(vim.api.nvim_buf_get_name(0)) + end) + vim.keymap.set("n", "fe", function() + MiniFiles.open(nil, false) + end) + end, + }, } diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index d85d03f..b996cf4 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -1,11 +1,30 @@ +-- we still use oil.nvim for more complex filesystem manipulations return { "oil.nvim", + cmd = "Oil", + keys = { + { + "bf", + function() + vim.cmd("Oil " .. vim.fn.getcwd()) + end, + mode = "n", + desc = "Open oil in current working directory", + }, + { + "be", + vim.cmd.Oil, + mode = "n", + desc = "Open oil in current file directory", + }, + }, after = function() require("oil").setup({ columns = { "size", "icon", }, + default_file_explorer = false, use_default_keymaps = false, keymaps = { ["J"] = "actions.parent", @@ -27,13 +46,5 @@ return { ["~"] = "actions.tcd", }, }) - - vim.keymap.set("n", "e", function() - vim.cmd("Oil") - end, { desc = "Open file explorer in current file directory" }) - - vim.keymap.set("n", "fe", function() - vim.cmd("Oil " .. vim.fn.getcwd()) - end, { desc = "Open file explorer in current working directory" }) end, }