-
-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(editing-support): add
multiple-cursors.nvim
(#911)
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
lua/astrocommunity/editing-support/multiple-cursors-nvim/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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:** <https://github.com/brenton-leighton/multiple-cursors.nvim> |
39 changes: 39 additions & 0 deletions
39
lua/astrocommunity/editing-support/multiple-cursors-nvim/init.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 { | ||
["<C-Down>"] = { "<Cmd>MultipleCursorsAddDown<CR>", desc = "Add cursor down" }, | ||
["<C-Up>"] = { "<Cmd>MultipleCursorsAddUp<CR>", desc = "Add cursor up" }, | ||
["<C-LeftMouse>"] = { "<Cmd>MultipleCursorsMouseAddDelete<CR>", desc = "Add cursor with mouse" }, | ||
} do | ||
maps.n[lhs] = map | ||
maps.i[lhs] = map | ||
end | ||
local prefix = "<Leader>c" | ||
for lhs, map in pairs { | ||
[prefix .. "a"] = { "<Cmd>MultipleCursorsAddMatches<CR>", desc = "Add cursor matches" }, | ||
[prefix .. "A"] = { "<Cmd>MultipleCursorsAddMatchesV<CR>", desc = "Add cursor matches in previous visual area" }, | ||
[prefix .. "j"] = { "<Cmd>MultipleCursorsAddJumpNextMatch<CR>", desc = "Add cursor and jump to next match" }, | ||
[prefix .. "J"] = { "<Cmd>MultipleCursorsJumpNextMatch<CR>", desc = "Move cursor to next match" }, | ||
[prefix .. "l"] = { "<Cmd>MultipleCursorsLock<CR>", desc = "Lock virtual cursors" }, | ||
} do | ||
maps.n[lhs] = map | ||
maps.x[lhs] = map | ||
end | ||
end, | ||
}, | ||
opts = {}, | ||
} |