From 8921b605ec65e5a92b8144a252bb759596f6d3bf Mon Sep 17 00:00:00 2001 From: tkrnts-sr <238653383+tkrnts-sr@users.noreply.github.com> Date: Fri, 6 Feb 2026 04:07:16 +0900 Subject: [PATCH] chore: rm multicursor, add snacks --- lua/custom/plugins/multicursor.lua | 159 ----------------------------- lua/custom/plugins/snacks.lua | 23 +++++ 2 files changed, 23 insertions(+), 159 deletions(-) delete mode 100644 lua/custom/plugins/multicursor.lua create mode 100644 lua/custom/plugins/snacks.lua diff --git a/lua/custom/plugins/multicursor.lua b/lua/custom/plugins/multicursor.lua deleted file mode 100644 index 2824a100..00000000 --- a/lua/custom/plugins/multicursor.lua +++ /dev/null @@ -1,159 +0,0 @@ -return { - 'jake-stewart/multicursor.nvim', - lazy = false, - branch = '1.0', - config = function() - local mc = require 'multicursor-nvim' - mc.setup() - - local set = vim.keymap.set - - -- Add or skip cursor above/below the main cursor. - set({ 'n', 'x' }, '', function() - mc.lineAddCursor(-1) - end) - set({ 'n', 'x' }, '', function() - mc.lineAddCursor(1) - end) - set({ 'n', 'x' }, '', function() - mc.lineSkipCursor(-1) - end) - set({ 'n', 'x' }, '', function() - mc.lineSkipCursor(1) - end) - - -- Add or skip adding a new cursor by matching word/selection - set({ 'n', 'x' }, 'n', function() - mc.matchAddCursor(1) - end) - set({ 'n', 'x' }, 's', function() - mc.matchSkipCursor(1) - end) - set({ 'n', 'x' }, 'N', function() - mc.matchAddCursor(-1) - end) - set({ 'n', 'x' }, 'S', function() - mc.matchSkipCursor(-1) - end) - - -- Add and remove cursors with control + left click. - set('n', '', mc.handleMouse) - set('n', '', mc.handleMouseDrag) - set('n', '', mc.handleMouseRelease) - - -- Disable and enable cursors. - set({ 'n', 'x' }, '', mc.toggleCursor) - - -- Mappings defined in a keymap layer only apply when there are - -- multiple cursors. This lets you have overlapping mappings. - mc.addKeymapLayer(function(layerSet) - -- Select a different cursor as the main one. - layerSet({ 'n', 'x' }, '', mc.prevCursor) - layerSet({ 'n', 'x' }, '', mc.nextCursor) - - -- Delete the main cursor. - layerSet({ 'n', 'x' }, 'x', mc.deleteCursor) - - -- Enable and clear cursors using escape. - layerSet('n', '', function() - if not mc.cursorsEnabled() then - mc.enableCursors() - else - mc.clearCursors() - end - end) - - -- Pressing `gaip` will add a cursor on each line of a paragraph. - set('n', 'ga', mc.addCursorOperator) - - -- Clone every cursor and disable the originals. - set({ 'n', 'x' }, '', mc.duplicateCursors) - - -- Align cursor columns. - set('n', 'a', mc.alignCursors) - - -- Split visual selections by regex. - set('x', 'S', mc.splitCursors) - - -- match new cursors within visual selections by regex. - set('x', 'M', mc.matchCursors) - - -- bring back cursors if you accidentally clear them - set('n', 'gv', mc.restoreCursors) - - -- Add a cursor for all matches of cursor word/selection in the document. - set({ 'n', 'x' }, 'A', mc.matchAllAddCursors) - - -- Rotate the text contained in each visual selection between cursors. - set('x', 't', function() - mc.transposeCursors(1) - end) - set('x', 'T', function() - mc.transposeCursors(-1) - end) - - -- Append/insert for each line of visual selections. - -- Similar to block selection insertion. - set('x', 'I', mc.insertVisual) - set('x', 'A', mc.appendVisual) - - -- Increment/decrement sequences, treaing all cursors as one sequence. - set({ 'n', 'x' }, 'g', mc.sequenceIncrement) - set({ 'n', 'x' }, 'g', mc.sequenceDecrement) - - -- Add a cursor and jump to the next/previous search result. - set('n', '/n', function() - mc.searchAddCursor(1) - end) - set('n', '/N', function() - mc.searchAddCursor(-1) - end) - - -- Jump to the next/previous search result without adding a cursor. - set('n', '/s', function() - mc.searchSkipCursor(1) - end) - set('n', '/S', function() - mc.searchSkipCursor(-1) - end) - - -- Add a cursor to every search result in the buffer. - set('n', '/A', mc.searchAllAddCursors) - - -- Pressing `miwap` will create a cursor in every match of the - -- string captured by `iw` inside range `ap`. - -- This action is highly customizable, see `:h multicursor-operator`. - set({ 'n', 'x' }, 'm', mc.operator) - - -- Add or skip adding a new cursor by matching diagnostics. - set({ 'n', 'x' }, ']d', function() - mc.diagnosticAddCursor(1) - end) - set({ 'n', 'x' }, '[d', function() - mc.diagnosticAddCursor(-1) - end) - set({ 'n', 'x' }, ']s', function() - mc.diagnosticSkipCursor(1) - end) - set({ 'n', 'x' }, '[S', function() - mc.diagnosticSkipCursor(-1) - end) - - -- Press `mdip` to add a cursor for every error diagnostic in the range `ip`. - set({ 'n', 'x' }, 'md', function() - -- See `:h vim.diagnostic.GetOpts`. - mc.diagnosticMatchCursors { severity = vim.diagnostic.severity.ERROR } - end) - end) - - -- Customize how cursors look. - local hl = vim.api.nvim_set_hl - hl(0, 'MultiCursorCursor', { reverse = true }) - hl(0, 'MultiCursorVisual', { link = 'Visual' }) - hl(0, 'MultiCursorSign', { link = 'SignColumn' }) - hl(0, 'MultiCursorMatchPreview', { link = 'Search' }) - hl(0, 'MultiCursorDisabledCursor', { reverse = true }) - hl(0, 'MultiCursorDisabledVisual', { link = 'Visual' }) - hl(0, 'MultiCursorDisabledSign', { link = 'SignColumn' }) - end, -} diff --git a/lua/custom/plugins/snacks.lua b/lua/custom/plugins/snacks.lua new file mode 100644 index 00000000..43662ec8 --- /dev/null +++ b/lua/custom/plugins/snacks.lua @@ -0,0 +1,23 @@ +return { + 'folke/snacks.nvim', + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + bigfile = { enabled = true }, + dashboard = { enabled = true }, + explorer = { enabled = true }, + indent = { enabled = true }, + input = { enabled = true }, + picker = { enabled = true }, + notifier = { enabled = true }, + quickfile = { enabled = true }, + scope = { enabled = true }, + scroll = { enabled = false }, + statuscolumn = { enabled = false }, + words = { enabled = true }, + }, +}