From 1e9371f0f90f2b9fdce644657290863bdf94b8d5 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 13 Apr 2023 16:46:54 +0100 Subject: [PATCH] nvim: replace vim-surround with mini.surround --- nvim/lua/plugins/coding.lua | 22 ++++++++++++++++++++++ vim/vimrc | 4 +++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/nvim/lua/plugins/coding.lua b/nvim/lua/plugins/coding.lua index 6a6ded8..a2e1538 100644 --- a/nvim/lua/plugins/coding.lua +++ b/nvim/lua/plugins/coding.lua @@ -56,4 +56,26 @@ return { { "echasnovski/mini.pairs", }, + + -- surround + { + "echasnovski/mini.surround", + keys = { + { "S", "lua MiniSurround.add('visual')", "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 = "", + }, + }, + }, } diff --git a/vim/vimrc b/vim/vimrc index db6f710..b374818 100644 --- 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") -- 2.48.1