diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index 6afe4ae..af851c5 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -100,6 +100,7 @@ with final.pkgs.lib; let ts-comments-nvim mini-comment mini-ai + mini-surround # Formatting conform-nvim diff --git a/nvim/lua/plugins/coding/init.lua b/nvim/lua/plugins/coding/init.lua index 2af8943..f3741cf 100644 --- a/nvim/lua/plugins/coding/init.lua +++ b/nvim/lua/plugins/coding/init.lua @@ -5,8 +5,9 @@ return { req('friendly-snippets'), req('lexima-vim'), req('luasnip'), - req('neotab-nvim'), - req('ts-comments-nvim'), req('mini-ai'), req('mini-comment'), + req('mini-surround'), + req('neotab-nvim'), + req('ts-comments-nvim'), } diff --git a/nvim/lua/plugins/coding/mini-surround.lua b/nvim/lua/plugins/coding/mini-surround.lua new file mode 100644 index 0000000..a03a922 --- /dev/null +++ b/nvim/lua/plugins/coding/mini-surround.lua @@ -0,0 +1,26 @@ +local keys = { + add = 'gsa', + delete = 'gsd', + find = 'gsf', + find_left = 'gsF', + highlight = 'gsh', + replace = 'gsr', + update_n_lines = 'gsn', +} +return { + 'mini.surround', + keys = { + { keys.add, desc = 'add surrounding', mode = { 'n', 'v' } }, + { keys.delete, desc = 'delete surrounding' }, + { keys.find, desc = 'find right surrounding' }, + { keys.find_left, desc = 'find left surrounding' }, + { keys.highlight, desc = 'highlight surrounding' }, + { keys.replace, desc = 'replace surrounding' }, + { keys.update_n_lines, desc = 'update n_lines' }, + }, + after = function() + require('mini.surround').setup({ + mappings = keys, + }) + end, +}