Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search next match on line if cursor not within surrounding #92

Open
rattletat opened this issue Mar 29, 2020 · 4 comments
Open

Search next match on line if cursor not within surrounding #92

rattletat opened this issue Mar 29, 2020 · 4 comments

Comments

@rattletat
Copy link

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.

@ahmadie
Copy link

ahmadie commented Nov 25, 2020

would be great if wellle/targets.vim could be used as text objects !!

@ahmadie
Copy link

ahmadie commented Nov 28, 2020

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 (operator-sandwich-delete)A
nmap sr (operator-sandwich-replace)A
``

@astier
Copy link

astier commented Mar 4, 2023

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.

@astier
Copy link

astier commented Mar 7, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants