diff --git a/lazy-lock.json b/lazy-lock.json index bdc86ce..3ceb019 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -32,6 +32,7 @@ "menu": { "branch": "main", "commit": "7a0a4a2896b715c066cfbe320bdc048091874cc6" }, "mini.indentscope": { "branch": "main", "commit": "5fdc3edf7bb1b6365980c2c47dac2f19ec93c97b" }, "minty": { "branch": "main", "commit": "aafc9e8e0afe6bf57580858a2849578d8d8db9e0" }, + "multiple-cursors.nvim": { "branch": "main", "commit": "1ac15d047a4b265cc2389957bcc56ee561b29e02" }, "neotest": { "branch": "master", "commit": "1d4b3bd89afa8bfa12fffd2bb1ccd26ac3c92ce5" }, "neotest-golang": { "branch": "main", "commit": "9521843942423fcac9991c596ff19c1f4f500650" }, "neotest-jest": { "branch": "main", "commit": "dd82016c01704d9bbd5188749fe0586b3b620693" }, @@ -71,7 +72,6 @@ "tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "51f548421f8a74680eff27d283c9d5ea6e8d0074" }, "toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" }, "vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" }, - "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, "virt-column.nvim": { "branch": "master", "commit": "b87e3e0864211a32724a2ebf3be37e24e9e2fa99" }, "volt": { "branch": "main", "commit": "7b8c5e790120d9f08c8487dcb80692db6d2087a1" }, "vscode-js-debug": { "branch": "main", "commit": "a3279c2abc1162069b0f5c014542b8b849cefa70" }, diff --git a/lua/pcode/plugins/extras/visualmulti.lua b/lua/pcode/plugins/extras/visualmulti.lua index 0717bfd..2e2a5cf 100644 --- a/lua/pcode/plugins/extras/visualmulti.lua +++ b/lua/pcode/plugins/extras/visualmulti.lua @@ -1,9 +1,12 @@ return { - "mg979/vim-visual-multi", + --[[ "mg979/vim-visual-multi", event = { "BufRead", "InsertEnter", "BufNewFile" }, branch = "master", lazy = true, init = function() + -- Nonaktifkan mapping default jika ingin custom + vim.g.VM_default_mappings = 0 + vim.g.VM_mouse_mappings = 1 -- equal CTRL + Left Click on VSCODE vim.g.VM_maps = { ["Find Under"] = "", -- equal CTRL+D on VSCODE @@ -13,5 +16,49 @@ return { ["Undo"] = "u", -- undo ["Redo"] = "", -- redo } - end, + end, ]] + { + "brenton-leighton/multiple-cursors.nvim", + version = "*", + opts = {}, + event = { "BufRead", "InsertEnter", "BufNewFile" }, + keys = { + -- 🧠 Seperti Ctrl + D di VS Code → pilih kata berikutnya yang sama + { + "", + function() + vim.cmd("MultipleCursorsAddJumpNextMatch") + vim.schedule(function() + vim.notify( + "🖊️ Multiple cursor: menambahkan seleksi berikutnya", + vim.log.levels.INFO, + { title = "MultipleCursors" } + ) + end) + end, + mode = { "n", "x" }, + desc = "Select next match", + }, + + -- 👇 Menambah kursor ke bawah seperti Ctrl + Alt + ↓ + { "", "MultipleCursorsAddDown", mode = { "n", "i", "x" }, desc = "Add cursor down" }, + + -- 👆 Menambah kursor ke atas seperti Ctrl + Alt + ↑ + { "", "MultipleCursorsAddUp", mode = { "n", "i", "x" }, desc = "Add cursor up" }, + + -- 🖱️ Tambah/hapus kursor dengan Ctrl + Klik mouse + { + "", + "MultipleCursorsMouseAddDelete", + mode = { "n", "i" }, + desc = "Add/remove cursor with mouse", + }, + + -- 🔲 Tambah kursor ke seluruh baris visual yang dipilih (pakai Leader + m) + { "m", "MultipleCursorsAddVisualArea", mode = { "x" }, desc = "Add cursors to visual lines" }, + + -- 🔒 Lock semua kursor supaya siap edit serentak + { "L", "MultipleCursorsLock", mode = { "n", "x" }, desc = "Lock cursors" }, + }, + }, }