-- Motion, Navigation and Multiple Cursors return { -- Multi-cursors support -- Alternative multi-cursor plugin { "mg979/vim-visual-multi", 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[""] = { "call vm#commands#add_cursor_up(0, v:count1)", desc = "Add cursor above" } maps.n[""] = { "call vm#commands#add_cursor_down(0, v:count1)", desc = "Add cursor below" } end, }, }, -- Better move by word { "chrisgrieser/nvim-spider", opts = {}, keys = { { "w", "lua require('spider').motion('w')", mode = { "n", "o", "x" }, desc = "Spider-w" }, { "e", "lua require('spider').motion('e')", mode = { "n", "o", "x" }, desc = "Spider-e" }, { "b", "lua require('spider').motion('b')", mode = { "n", "o", "x" }, desc = "Spider-b" }, { "ge", "lua require('spider').motion('ge')", mode = { "n", "o", "x" }, desc = "Spider-ge" }, }, }, -- Better character motion { "folke/flash.nvim", event = "VeryLazy", opts = {}, keys = { { "gj", function() require("flash").jump() end, mode = { "n", "x", "o" }, desc = "Flash" }, { "gJ", function() require("flash").treesitter() end, mode = { "n", "x", "o" }, desc = "Flash Treesitter", }, { "r", function() require("flash").remote() end, mode = "o", desc = "Remote Flash" }, { "R", function() require("flash").treesitter_search() end, mode = { "x", "o" }, desc = "Treesitter Search", }, }, }, -- Move code block { "echasnovski/mini.move", event = "BufRead", config = function() require("mini.move").setup { mappings = { left = "", right = "", down = "", up = "", line_left = "", line_right = "", line_down = "", line_up = "", }, } end, }, { "mrjones2014/smart-splits.nvim", event = "VeryLazy", opts = function(_, opts) opts.ignored_filetypes = { "nofile", "quickfix", "qf", "prompt", "NvimTree" } opts.ignored_buftypes = { "nofile" } opts.log_level = "error" end, keys = { { "", function() require("smart-splits").move_cursor_left() end, mode = { "n" }, desc = "Move to left split", }, { "", function() require("smart-splits").move_cursor_right() end, mode = { "n", "t" }, desc = "Move to right split", }, { "", function() require("smart-splits").move_cursor_up() end, mode = { "n" }, desc = "Move to above split", }, { "", function() require("smart-splits").move_cursor_down() end, mode = { "n" }, desc = "Move to below split", }, { "", function() require("smart-splits").resize_left() end, mode = { "n" }, desc = "Resize split left", }, { "", function() require("smart-splits").resize_right() end, mode = { "n" }, desc = "Resize split right", }, }, }, }