added :Pick

This commit is contained in:
2025-01-02 22:15:58 -05:00
parent cf73aa6966
commit 1c8d5d4e53
3 changed files with 41 additions and 18 deletions

View File

@@ -9,12 +9,13 @@
"conform.nvim": { "branch": "master", "commit": "9180320205d250429f0f80e073326c674e2a7149" }, "conform.nvim": { "branch": "master", "commit": "9180320205d250429f0f80e073326c674e2a7149" },
"dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" },
"fidget.nvim": { "branch": "main", "commit": "9238947645ce17d96f30842e61ba81147185b657" }, "fidget.nvim": { "branch": "main", "commit": "9238947645ce17d96f30842e61ba81147185b657" },
"fzf-lua": { "branch": "main", "commit": "0dc6161a109c63a4948e305761cffee2f52442ce" },
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
"harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, "harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" },
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "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-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" },
"nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" }, "nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" },
"nvim-web-devicons": { "branch": "master", "commit": "63f552a7f59badc6e6b6d22e603150f0d5abebb7" }, "nvim-web-devicons": { "branch": "master", "commit": "63f552a7f59badc6e6b6d22e603150f0d5abebb7" },

View File

@@ -0,0 +1,3 @@
return {
"echasnovski/mini.ai",
}

View File

@@ -2,7 +2,7 @@ return {
"stevearc/oil.nvim", "stevearc/oil.nvim",
opts = {}, opts = {},
config = function() config = function()
require("oil").setup({ require("oil").setup {
default_file_explorer = true, default_file_explorer = true,
delete_to_trash = true, delete_to_trash = true,
skip_confirm_for_simple_edits = true, skip_confirm_for_simple_edits = true,
@@ -13,7 +13,26 @@ return {
return name == ".." or name == ".git" return name == ".." or name == ".git"
end, 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, end,
dependencies = { "nvim-tree/nvim-web-devicons" }, dependencies = { "nvim-tree/nvim-web-devicons" },
} }