Improve perform

This commit is contained in:
huyjaky
2025-10-26 08:13:18 +07:00
parent 04c5dcd06a
commit bad1ed5cb2
14 changed files with 274 additions and 267 deletions

View File

@@ -1,22 +1,38 @@
-- Motion, Navigation and Multiple Cursors
return {
-- Multi-cursors support
{
"brenton-leighton/multiple-cursors.nvim",
version = "*",
opts = {},
keys = {
{ "<C-Down>", "<Cmd>MultipleCursorsAddDown<CR>", mode = { "n", "i", "x" } },
{ "<C-Up>", "<Cmd>MultipleCursorsAddUp<CR>", mode = { "n", "i", "x" } },
{ "<A-LeftMouse>", "<Cmd>MultipleCursorsMouseAddDelete<CR>", mode = { "n", "i" } },
{ "<Leader>a", "<Cmd>MultipleCursorsAddMatches<CR>", mode = { "n", "x" } },
{ "<C-D>", "<Cmd>MultipleCursorsAddJumpNextMatch<CR>", mode = { "n", "x" } },
},
},
-- Alternative multi-cursor plugin
{
"mg979/vim-visual-multi",
event = "BufRead",
event = { "User AstroFile", "InsertEnter" },
dependencies = {
"AstroNvim/astrocore",
---@param opts astrocoreopts
opts = function(_, opts)
if not opts.options then opts.options = {} end
if not opts.options.g then opts.options.g = {} end
opts.options.g.VM_silent_exit = 1
opts.options.g.VM_show_warnings = 0
if not opts.autocmds then opts.autocmds = {} end
opts.autocmds.visual_multi_exit = {
{
event = "User",
pattern = "visual_multi_exit",
desc = "Avoid spurious 'hit-enter-prompt' when exiting vim-visual-multi",
callback = function()
vim.o.cmdheight = 1
vim.schedule(function() vim.o.cmdheight = opts.options.opt.cmdheight end)
end,
},
}
if not opts.mappings then opts.mappings = require("astrocore").empty_map_table() end
local maps = assert(opts.mappings)
maps.n["<C-up>"] = { "<C-u>call vm#commands#add_cursor_up(0, v:count1)<cr>", desc = "Add cursor above" }
maps.n["<C-down>"] = { "<C-u>call vm#commands#add_cursor_down(0, v:count1)<cr>", desc = "Add cursor below" }
end,
},
},
-- Better move by word
{
@@ -29,7 +45,7 @@ return {
{ "ge", "<Cmd>lua require('spider').motion('ge')<CR>", mode = { "n", "o", "x" }, desc = "Spider-ge" },
},
},
-- Better character motion
{
"folke/flash.nvim",
@@ -52,7 +68,7 @@ return {
},
},
},
-- Move code block
{
"echasnovski/mini.move",