vim-sandwich
vim-sandwich copied to clipboard
Search next match on line if cursor not within surrounding
Hey I use targets.vim and vim-sandwich together.
I'm not sure whether this behavior is from vim itself or targets, but often you can just do something like this:
Test | Test Test ( More Text )
| is the cursor. One could press di) now and yield:
Test | Test Test ()
However, doing something like sd) is not possible atleast with my configuration. Is this achievable? This feature would make my vim operator experience more consistent.
would be great if wellle/targets.vim could be used as text objects !!
I was able to make work with following config :D
`` let g:sandwich_no_default_key_mappings = 1 let g:textobj_sandwich_no_default_key_mappings = 1
call plug#begin('~/.vim/plugged')
Plug 'machakann/vim-sandwich' Plug 'wellle/targets.vim' call plug#end()
nmap sd <Plug>(operator-sandwich-delete)A nmap sr <Plug>(operator-sandwich-replace)A ``
I needed to use
nmap sd <plug>(operator-sandwich-delete)a
nmap sr <plug>(operator-sandwich-replace)a
nmap sa <plug>(operator-sandwich-add)
xmap sa <plug>(operator-sandwich-add)
Another benefit seems to be that its possible now to use targets builtin objects like q
.
Sadly it seems to break the magic character f
. To make it work I had to add additionally:
nmap sdf <plug>(sandwich-delete)f
nmap srf <plug>(sandwich-replace)f