astro-nvim-v3 - clean up useless packages

This commit is contained in:
huyjaky
2025-01-26 10:22:51 +07:00
parent 3c4feebbcc
commit 93678288f1
11 changed files with 69 additions and 156 deletions

View File

@@ -1,19 +1,19 @@
-- Plugins related to motion
return {
-- Faster change/delete/replace delimiter pairs
{
"echasnovski/mini.surround",
opts = { n_lines = 200 },
keys = {
{ "sa", mode = { "n", "x" }, desc = "Add surrounding" },
{ "sd", mode = { "n", "x" }, desc = "Delete surrounding" },
{ "sr", mode = { "n", "x" }, desc = "Replace surrounding" },
{ "sf", mode = { "n", "x" }, desc = "Find right surrounding" },
{ "sF", mode = { "n", "x" }, desc = "Find left surrounding" },
{ "sh", mode = { "n", "x" }, desc = "Highlight surrounding" },
{ "sn", mode = { "n", "x" }, desc = "Update `MiniSurround.config.n_lines`" },
},
},
-- {
-- "echasnovski/mini.surround",
-- opts = { n_lines = 200 },
-- keys = {
-- { "sa", mode = { "n", "x" }, desc = "Add surrounding" },
-- { "sd", mode = { "n", "x" }, desc = "Delete surrounding" },
-- { "sr", mode = { "n", "x" }, desc = "Replace surrounding" },
-- { "sf", mode = { "n", "x" }, desc = "Find right surrounding" },
-- { "sF", mode = { "n", "x" }, desc = "Find left surrounding" },
-- { "sh", mode = { "n", "x" }, desc = "Highlight surrounding" },
-- { "sn", mode = { "n", "x" }, desc = "Update `MiniSurround.config.n_lines`" },
-- },
-- },
-- Brackets splitjoin
{
"Wansmer/treesj",
@@ -26,68 +26,6 @@ return {
{ "gs", "<Cmd>TSJToggle<CR>", mode = { "n" }, desc = "Toggle splitjoin" },
},
},
-- {
-- "echasnovski/mini.ai",
-- event = "User AstroFile",
-- opts = function()
-- -- Register to which-key
-- local i = {
-- [" "] = "Whitespace",
-- ["?"] = "User Prompt",
-- _ = "Underscore",
-- a = "Argument",
-- b = "Paired ), ], }",
-- c = "Class",
-- d = "Digit(s)",
-- e = "Word in CamelCase & snake_case",
-- f = "Function",
-- g = "Entire file",
-- o = "Block, conditional, loop",
-- q = "Quote `, \", '",
-- t = "Tag",
-- u = "Use/call function & method",
-- U = "Use/call without dot in name",
-- }
-- local a = vim.deepcopy(i)
-- for k, v in pairs(a) do
-- a[k] = v:gsub(" including.*", "")
-- end
-- local ic = vim.deepcopy(i)
-- local ac = vim.deepcopy(a)
-- for key, name in pairs { n = "Next", l = "Last" } do
-- i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic)
-- a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac)
-- end
-- require("which-key").register {
-- mode = { "o", "x" },
-- i = i,
-- a = a,
-- }
-- -- define custom textobjects
-- local ai = require "mini.ai"
-- return {
-- n_lines = 500,
-- custom_textobjects = {
-- o = ai.gen_spec.treesitter { -- code block
-- a = { "@block.outer", "@conditional.outer", "@loop.outer" },
-- i = { "@block.inner", "@conditional.inner", "@loop.inner" },
-- },
-- f = ai.gen_spec.treesitter { a = "@function.outer", i = "@function.inner" }, -- function
-- c = ai.gen_spec.treesitter { a = "@class.outer", i = "@class.inner" }, -- class
-- t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" }, -- tags
-- d = { "%f[%d]%d+" }, -- digits
-- e = { -- Word with case
-- { "%u[%l%d]+%f[^%l%d]", "%f[%S][%l%d]+%f[^%l%d]", "%f[%P][%l%d]+%f[^%l%d]", "^[%l%d]+%f[^%l%d]" },
-- "^().*()$",
-- },
-- u = ai.gen_spec.function_call(), -- u for "Usage"
-- U = ai.gen_spec.function_call { name_pattern = "[%w_]" }, -- without dot in function name
-- },
-- }
-- end,
-- },
-- Better move by word
{
"chrisgrieser/nvim-spider",
@@ -99,16 +37,6 @@ return {
{ "ge", "<Cmd>lua require('spider').motion('ge')<CR>", mode = { "n", "o", "x" }, desc = "Spider-ge" },
},
},
-- Duplicate line/block up/down
{
"hinell/duplicate.nvim",
keys = {
{ "<A-K>", "<Cmd>LineDuplicate -1<CR>", mode = { "n" }, desc = "Duplicate line up" },
{ "<A-J>", "<Cmd>LineDuplicate +1<CR>", mode = { "n" }, desc = "Duplicate line down" },
{ "<A-K>", "<Cmd>VisualDuplicate -1<CR>", mode = { "x" }, desc = "Duplicate block up" },
{ "<A-J>", "<Cmd>VisualDuplicate +1<CR>", mode = { "x" }, desc = "Duplicate block down" },
},
},
-- Better character motion
{
"folke/flash.nvim",
@@ -131,4 +59,23 @@ return {
},
},
},
-- Move code block
{
"echasnovski/mini.move",
event = "BufRead",
config = function()
require("mini.move").setup {
mappings = {
left = "<M-a>",
right = "<M-d>",
down = "<M-s>",
up = "<M-w>",
line_left = "<M-a>",
line_right = "<M-d>",
line_down = "<M-s>",
line_up = "<M-w>",
},
}
end,
},
}