diff --git a/lua/astrocommunity/editing-support/multiple-cursors-nvim/README.md b/lua/astrocommunity/editing-support/multiple-cursors-nvim/README.md new file mode 100644 index 000000000..b1d0545ac --- /dev/null +++ b/lua/astrocommunity/editing-support/multiple-cursors-nvim/README.md @@ -0,0 +1,5 @@ +# multiple-cursors.nvim + +A multi-cursor plugin for Neovim that works in normal, insert/replace, or visual modes, and with almost every command + +**Repository:** diff --git a/lua/astrocommunity/editing-support/multiple-cursors-nvim/init.lua b/lua/astrocommunity/editing-support/multiple-cursors-nvim/init.lua new file mode 100644 index 000000000..9f2ded721 --- /dev/null +++ b/lua/astrocommunity/editing-support/multiple-cursors-nvim/init.lua @@ -0,0 +1,39 @@ +return { + "brenton-leighton/multiple-cursors.nvim", + cmd = { + "MultipleCursorsAddDown", + "MultipleCursorsAddUp", + "MultipleCursorsMouseAddDelete", + "MultipleCursorsAddMatches", + "MultipleCursorsAddMatchesV", + "MultipleCursorsAddJumpNextMatch", + "MultipleCursorsJumpNextMatch", + "MultipleCursorsLock", + }, + dependencies = { + "AstroNvim/astrocore", + opts = function(_, opts) + local maps = opts.mappings + for lhs, map in pairs { + [""] = { "MultipleCursorsAddDown", desc = "Add cursor down" }, + [""] = { "MultipleCursorsAddUp", desc = "Add cursor up" }, + [""] = { "MultipleCursorsMouseAddDelete", desc = "Add cursor with mouse" }, + } do + maps.n[lhs] = map + maps.i[lhs] = map + end + local prefix = "c" + for lhs, map in pairs { + [prefix .. "a"] = { "MultipleCursorsAddMatches", desc = "Add cursor matches" }, + [prefix .. "A"] = { "MultipleCursorsAddMatchesV", desc = "Add cursor matches in previous visual area" }, + [prefix .. "j"] = { "MultipleCursorsAddJumpNextMatch", desc = "Add cursor and jump to next match" }, + [prefix .. "J"] = { "MultipleCursorsJumpNextMatch", desc = "Move cursor to next match" }, + [prefix .. "l"] = { "MultipleCursorsLock", desc = "Lock virtual cursors" }, + } do + maps.n[lhs] = map + maps.x[lhs] = map + end + end, + }, + opts = {}, +}