]> git.rmz.io Git - dotfiles.git/commitdiff
nvim: replace vim-surround with mini.surround
authorSamir Benmendil <me@rmz.io>
Thu, 13 Apr 2023 15:46:54 +0000 (16:46 +0100)
committerSamir Benmendil <me@rmz.io>
Sun, 17 Dec 2023 17:23:07 +0000 (17:23 +0000)
nvim/lua/plugins/coding.lua
vim/vimrc

index 6a6ded82b3ce2691fcbcbe21ce48da7c6aa092db..a2e1538516cf10c5a281727e0968ebf5bba9dd56 100644 (file)
@@ -56,4 +56,26 @@ return {
   {
     "echasnovski/mini.pairs",
   },
+
+  -- surround
+  {
+    "echasnovski/mini.surround",
+    keys = {
+      { "S", "<cmd><C-u>lua MiniSurround.add('visual')<cr>", "x" },
+      { "yss", "ys_", remap = true },
+    },
+    opts = {
+      mappings = {
+        -- TODO: this is tpope/surround like, but should consider using vim-sandwich mappings
+        -- see: :h MiniSurround-vim-surround-config
+        add = "ys",
+        delete = "ds",
+        find = "",
+        find_left = "",
+        highlight = "",
+        replace = "cs",
+        update_n_lines = "",
+      },
+    },
+  },
 }
index db6f710be1c263ad726dda08d6c3463ff718a471..b3748185c333c662414b7917231c56745a379d18 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -72,7 +72,9 @@ Plug 'tpope/vim-fugitive'
 Plug 'tpope/vim-repeat'
 Plug 'tpope/vim-scriptease'
 Plug 'tpope/vim-speeddating'
-Plug 'tpope/vim-surround'  "investigate vim-sandwich
+if !has('nvim')
+  Plug 'tpope/vim-surround'  "investigate vim-sandwich
+endif
 Plug 'tpope/vim-unimpaired'
 Plug 'tweekmonster/spellrotate.vim'
 if !has("nvim")