Skip to content

Commit c32ae3f

Browse files
authored
feat(multiple-cursors-nvim): Add icon for mappings prefix (#1444)
1 parent 06da23a commit c32ae3f

File tree

1 file changed

+30
-23
lines changed
  • lua/astrocommunity/editing-support/multiple-cursors-nvim

1 file changed

+30
-23
lines changed

lua/astrocommunity/editing-support/multiple-cursors-nvim/init.lua

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,36 @@ return {
1111
"MultipleCursorsLock",
1212
},
1313
dependencies = {
14-
"AstroNvim/astrocore",
15-
opts = function(_, opts)
16-
local maps = opts.mappings
17-
for lhs, map in pairs {
18-
["<C-Down>"] = { "<Cmd>MultipleCursorsAddDown<CR>", desc = "Add cursor down" },
19-
["<C-Up>"] = { "<Cmd>MultipleCursorsAddUp<CR>", desc = "Add cursor up" },
20-
["<C-LeftMouse>"] = { "<Cmd>MultipleCursorsMouseAddDelete<CR>", desc = "Add cursor with mouse" },
21-
} do
22-
maps.n[lhs] = map
23-
maps.i[lhs] = map
24-
end
25-
local prefix = "<Leader>m"
26-
for lhs, map in pairs {
27-
[prefix .. "a"] = { "<Cmd>MultipleCursorsAddMatches<CR>", desc = "Add cursor matches" },
28-
[prefix .. "A"] = { "<Cmd>MultipleCursorsAddMatchesV<CR>", desc = "Add cursor matches in previous visual area" },
29-
[prefix .. "j"] = { "<Cmd>MultipleCursorsAddJumpNextMatch<CR>", desc = "Add cursor and jump to next match" },
30-
[prefix .. "J"] = { "<Cmd>MultipleCursorsJumpNextMatch<CR>", desc = "Move cursor to next match" },
31-
[prefix .. "l"] = { "<Cmd>MultipleCursorsLock<CR>", desc = "Lock virtual cursors" },
32-
} do
33-
maps.n[lhs] = map
34-
maps.x[lhs] = map
35-
end
36-
end,
14+
{ "AstroNvim/astroui", opts = { icons = { MultipleCursors = "󰗧" } } },
15+
{
16+
"AstroNvim/astrocore",
17+
opts = function(_, opts)
18+
local maps = opts.mappings
19+
for lhs, map in pairs {
20+
["<C-Down>"] = { "<Cmd>MultipleCursorsAddDown<CR>", desc = "Add cursor down" },
21+
["<C-Up>"] = { "<Cmd>MultipleCursorsAddUp<CR>", desc = "Add cursor up" },
22+
["<C-LeftMouse>"] = { "<Cmd>MultipleCursorsMouseAddDelete<CR>", desc = "Add cursor with mouse" },
23+
} do
24+
maps.n[lhs] = map
25+
maps.i[lhs] = map
26+
end
27+
local prefix = "<Leader>m"
28+
for lhs, map in pairs {
29+
[prefix] = { desc = require("astroui").get_icon("MultipleCursors", 1, true) .. "MultipleCursors" },
30+
[prefix .. "a"] = { "<Cmd>MultipleCursorsAddMatches<CR>", desc = "Add cursor matches" },
31+
[prefix .. "A"] = {
32+
"<Cmd>MultipleCursorsAddMatchesV<CR>",
33+
desc = "Add cursor matches in previous visual area",
34+
},
35+
[prefix .. "j"] = { "<Cmd>MultipleCursorsAddJumpNextMatch<CR>", desc = "Add cursor and jump to next match" },
36+
[prefix .. "J"] = { "<Cmd>MultipleCursorsJumpNextMatch<CR>", desc = "Move cursor to next match" },
37+
[prefix .. "l"] = { "<Cmd>MultipleCursorsLock<CR>", desc = "Lock virtual cursors" },
38+
} do
39+
maps.n[lhs] = map
40+
maps.x[lhs] = map
41+
end
42+
end,
43+
},
3744
},
3845
opts = {},
3946
}

0 commit comments

Comments
 (0)