dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 6e072dfa5439a38abedaf35d89b6d8b49e69deea
parent b8bd99553bc289d95f4396d020bd32a81a0fc60b
Author: Alex Balgavy <a.balgavy@gmail.com>
Date:   Tue, 28 Jan 2020 13:02:56 +0100

vim: replace Surround with Sandwich

Sandwich has more functionality than Surround, adds match highlighting,
and emmet html tag expansion. It also allows surround-style keybindings,
so I'm sold.


Former-commit-id: 8993d456bdc2f1a282e4efb36e120f89d2f84591
Diffstat:
Mvim/vimrc | 21+++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/vim/vimrc b/vim/vimrc @@ -22,8 +22,8 @@ Plug 'rstacruz/sparkup' " Endwise - smart do-end, if-fi, if-end, case-esac, etc. Plug 'tpope/vim-endwise' -" Surround - super useful plugin for surrounding stuff with quotes/brackets/tags -Plug 'tpope/vim-surround' +" Sandwich - super useful plugin for surrounding stuff with quotes/brackets/tags +Plug 'machakann/vim-sandwich' " Eunuch - shell commands but in vim Plug 'tpope/vim-eunuch' @@ -324,6 +324,23 @@ nnoremap '<CR> :Start<CR> " Table-mode {{{ let g:table_mode_map_prefix = "<leader><bar>" " }}} +" Sandwich {{{ +" Use mappings from surround.vim +runtime macros/sandwich/keymap/surround.vim + +" Copy the default recipes +let g:sandwich#recipes = deepcopy(g:sandwich#default_recipes) + +" And add bracket-with-space from surround.vim +let g:sandwich#recipes += [ + \ {'buns': ['{ ', ' }'], 'nesting': 1, 'match_syntax': 1, 'kind': ['add', 'replace'], 'action': ['add'], 'input': ['{']}, + \ {'buns': ['[ ', ' ]'], 'nesting': 1, 'match_syntax': 1, 'kind': ['add', 'replace'], 'action': ['add'], 'input': ['[']}, + \ {'buns': ['( ', ' )'], 'nesting': 1, 'match_syntax': 1, 'kind': ['add', 'replace'], 'action': ['add'], 'input': ['(']}, + \ {'buns': ['{\s*', '\s*}'], 'nesting': 1, 'regex': 1, 'match_syntax': 1, 'kind': ['delete', 'replace', 'textobj'], 'action': ['delete'], 'input': ['{']}, + \ {'buns': ['\[\s*', '\s*\]'], 'nesting': 1, 'regex': 1, 'match_syntax': 1, 'kind': ['delete', 'replace', 'textobj'], 'action': ['delete'], 'input': ['[']}, + \ {'buns': ['(\s*', '\s*)'], 'nesting': 1, 'regex': 1, 'match_syntax': 1, 'kind': ['delete', 'replace', 'textobj'], 'action': ['delete'], 'input': ['(']}, + \ ] +" }}} " }}} " }}} " General {{{