From 3860fb3d73a9a6daf3d57c36eb55cdf67a501dd6 Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Sun, 16 Jun 2024 22:48:08 +0200 Subject: [PATCH] added mini surround --- lua/plugins/flash.lua | 5 ++--- lua/plugins/mini-surround.lua | 20 ++++++++++++++++++++ lua/plugins/nvim-surround.lua | 10 ---------- 3 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 lua/plugins/mini-surround.lua delete mode 100644 lua/plugins/nvim-surround.lua diff --git a/lua/plugins/flash.lua b/lua/plugins/flash.lua index a8ba660..27161e3 100644 --- a/lua/plugins/flash.lua +++ b/lua/plugins/flash.lua @@ -1,7 +1,6 @@ return { 'folke/flash.nvim', event = 'VeryLazy', - ---@type Flash.Config opts = { modes = { search = { @@ -14,7 +13,7 @@ return { }, keys = { { - 's', + 'a', mode = { 'n', 'x', 'o' }, function() -- default options: exact mode, multi window, all directions, with a backdrop @@ -23,7 +22,7 @@ return { desc = 'Flash jump', }, { - 'S', + 'A', mode = { 'n', 'o', 'x' }, function() require('flash').treesitter() diff --git a/lua/plugins/mini-surround.lua b/lua/plugins/mini-surround.lua new file mode 100644 index 0000000..0287d90 --- /dev/null +++ b/lua/plugins/mini-surround.lua @@ -0,0 +1,20 @@ +return { + 'echasnovski/mini.surround', + version = '*', + config = function() + require('mini.surround').setup({ + mappings = { + add = 'sa', -- Add surrounding in Normal and Visual modes + delete = 'sd', -- Delete surrounding + find = 'sf', -- Find surrounding (to the right) + find_left = 'sF', -- Find surrounding (to the left) + highlight = 'sh', -- Highlight surrounding + replace = 'sr', -- Replace surrounding + update_n_lines = 'sn', -- Update `n_lines` + + suffix_last = 'l', -- Suffix to search with "prev" method + suffix_next = 'n', -- Suffix to search with "next" method + }, + }) + end, +} diff --git a/lua/plugins/nvim-surround.lua b/lua/plugins/nvim-surround.lua deleted file mode 100644 index 540f49c..0000000 --- a/lua/plugins/nvim-surround.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - 'kylechui/nvim-surround', - version = '*', -- Use for stability; omit to use `main` branch for the latest features - event = 'VeryLazy', - config = function() - require('nvim-surround').setup({ - -- Configuration here, or leave empty to use defaults - }) - end, -}