summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Mora Unie Youer <[email protected]>2025-10-07 14:40:54 +0300
committerLibravatar Mora Unie Youer <[email protected]>2025-10-07 14:40:54 +0300
commitb4251c5e9533450ba06227a19fad4aec1a4f6f60 (patch)
tree1f1d896aac0766583dcce321d560e725b138cbe4
parentdeps: update nix flakes (diff)
downloadneovim-configuration-b4251c5e9533450ba06227a19fad4aec1a4f6f60.tar.gz
neovim-configuration-b4251c5e9533450ba06227a19fad4aec1a4f6f60.tar.bz2
neovim-configuration-b4251c5e9533450ba06227a19fad4aec1a4f6f60.tar.lz
neovim-configuration-b4251c5e9533450ba06227a19fad4aec1a4f6f60.tar.xz
neovim-configuration-b4251c5e9533450ba06227a19fad4aec1a4f6f60.tar.zst
neovim-configuration-b4251c5e9533450ba06227a19fad4aec1a4f6f60.zip
fix: `multicursor.nvim` now supports countsHEADmaster
-rw-r--r--lua/config/plugins/extra.lua26
1 files changed, 8 insertions, 18 deletions
diff --git a/lua/config/plugins/extra.lua b/lua/config/plugins/extra.lua
index bc5cbd1..19a7042 100644
--- a/lua/config/plugins/extra.lua
+++ b/lua/config/plugins/extra.lua
@@ -11,29 +11,19 @@ return {
-- Keybindings would be a lot better as <localleader>
local map = vim.keymap.set
- -- NOTE: this required for "repeatable" commands
- -- I'd like to use `2<localleader>cn` for example (and that doesn't work out of box)
- local map_rep = function(modes, bind, action)
- map(modes, bind, function()
- for _ = 1, vim.v.count1, 1 do
- action()
- end
- end)
- end
-
-- stylua: ignore start
map({ "n", "x" }, "<localleader><localleader>", function() mc.clearCursors() end)
map({ "n", "x" }, "<localleader>R", function() mc.restoreCursors() end)
- map_rep({ "n", "x" }, "<localleader>j", function() mc.lineAddCursor(1) end)
- map_rep({ "n", "x" }, "<localleader>k", function() mc.lineAddCursor(-1) end)
- map_rep({ "n", "x" }, "<localleader>J", function() mc.lineSkipCursor(1) end)
- map_rep({ "n", "x" }, "<localleader>K", function() mc.lineSkipCursor(-1) end)
+ map({ "n", "x" }, "<localleader>j", function() mc.lineAddCursor(1) end)
+ map({ "n", "x" }, "<localleader>k", function() mc.lineAddCursor(-1) end)
+ map({ "n", "x" }, "<localleader>J", function() mc.lineSkipCursor(1) end)
+ map({ "n", "x" }, "<localleader>K", function() mc.lineSkipCursor(-1) end)
- map_rep({ "n", "x" }, "<localleader>cn", function() mc.matchAddCursor(1) end)
- map_rep({ "n", "x" }, "<localleader>cN", function() mc.matchAddCursor(-1) end)
- map_rep({ "n", "x" }, "<localleader>cs", function() mc.matchSkipCursor(1) end)
- map_rep({ "n", "x" }, "<localleader>cS", function() mc.matchSkipCursor(-1) end)
+ map({ "n", "x" }, "<localleader>cn", function() mc.matchAddCursor(1) end)
+ map({ "n", "x" }, "<localleader>cN", function() mc.matchAddCursor(-1) end)
+ map({ "n", "x" }, "<localleader>cs", function() mc.matchSkipCursor(1) end)
+ map({ "n", "x" }, "<localleader>cS", function() mc.matchSkipCursor(-1) end)
map({ "n", "x" }, "<localleader>cM", mc.matchAllAddCursors)
map("x", "<localleader>m", mc.matchCursors)
map("x", "<localleader>s", mc.splitCursors)