diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 7a6bae5..7660a8d 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -9,12 +9,13 @@ "conform.nvim": { "branch": "master", "commit": "9180320205d250429f0f80e073326c674e2a7149" }, "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, "fidget.nvim": { "branch": "main", "commit": "9238947645ce17d96f30842e61ba81147185b657" }, - "fzf-lua": { "branch": "main", "commit": "0dc6161a109c63a4948e305761cffee2f52442ce" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mini.ai": { "branch": "main", "commit": "ebb04799794a7f94628153991e6334c3304961b8" }, + "mini.pick": { "branch": "main", "commit": "eb8fad053935dd6e4861c7b65b0d3f70785d8f42" }, "nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" }, "nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" }, "nvim-web-devicons": { "branch": "master", "commit": "63f552a7f59badc6e6b6d22e603150f0d5abebb7" }, diff --git a/nvim/.config/nvim/lua/vxclutch/lazy/mini.lua b/nvim/.config/nvim/lua/vxclutch/lazy/mini.lua new file mode 100644 index 0000000..1e99208 --- /dev/null +++ b/nvim/.config/nvim/lua/vxclutch/lazy/mini.lua @@ -0,0 +1,3 @@ +return { + "echasnovski/mini.ai", +} diff --git a/nvim/.config/nvim/lua/vxclutch/lazy/oil.lua b/nvim/.config/nvim/lua/vxclutch/lazy/oil.lua index 2e26cee..cefe091 100644 --- a/nvim/.config/nvim/lua/vxclutch/lazy/oil.lua +++ b/nvim/.config/nvim/lua/vxclutch/lazy/oil.lua @@ -1,19 +1,38 @@ return { - "stevearc/oil.nvim", - opts = {}, - config = function() - require("oil").setup({ - default_file_explorer = true, - delete_to_trash = true, - skip_confirm_for_simple_edits = true, - view_options = { - show_hidden = true, - natural_order = true, - is_always_hidden = function(name, _) - return name == ".." or name == ".git" - end, - }, - }) - end, - dependencies = { "nvim-tree/nvim-web-devicons" }, + "stevearc/oil.nvim", + opts = {}, + config = function() + require("oil").setup { + default_file_explorer = true, + delete_to_trash = true, + skip_confirm_for_simple_edits = true, + view_options = { + show_hidden = true, + natural_order = true, + is_always_hidden = function(name, _) + return name == ".." or name == ".git" + end, + }, + } + + -- File nav split + vim.api.nvim_create_user_command("Pick", function() + local origin_buf = vim.fn.bufnr() + vim.cmd "new | Oil" + + local oil_opened = false + vim.api.nvim_create_autocmd("BufReadPost", { + pattern = "*", + callback = function() + if vim.bo.filetype == "oil" then + oil_opened = true + end + if vim.bo.filetype ~= "oil" and oil_opened then + vim.api.nvim_buf_delete(origin_buf, { force = true }) + end + end, + }) + end, {}) + end, + dependencies = { "nvim-tree/nvim-web-devicons" }, }