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

How to integrate with rhysd/vim-operator-surround? #4

Open
reedes opened this issue Aug 27, 2014 · 3 comments
Open

How to integrate with rhysd/vim-operator-surround? #4

reedes opened this issue Aug 27, 2014 · 3 comments
Labels

Comments

@reedes
Copy link
Collaborator

reedes commented Aug 27, 2014

It'd be nice to use the https://github.com/rhysd/vim-operator-surround to add/replace quotes around text objects.

It likely involves an entry to g:operator#surround#blocks.

@alerque
Copy link
Member

alerque commented May 12, 2020

I'm already using this integrated with vim-surround, I imagine this should be an easy addition.

@alerque
Copy link
Member

alerque commented Jun 1, 2020

I take that back, it looks like I'm using my own fork of tpope's vim-surround with a fix that was rejected upstream that specifically enables integration with this plugin. I'll have to look into what that was even about so we can document how it should work together with that as well as vim-operator-surround.

@telemachus
Copy link
Collaborator

telemachus commented Jan 4, 2022

Here's another alternative for future visitors to consider.

I use machakann/vim-sandwich. Although this plugin doesn't know about smart quotes out of the box, you can add custom recipes to vim-sandwich relatively easily.

Here's what I do.

" Save all default recipes to our newly defined batch of recipes.
let g:sandwich#recipes = deepcopy(g:sandwich#default_recipes)

" Teach vim-sandwich about “foo” and ‘foo’
let g:sandwich#recipes += [
            \ {'buns': ['', ''], 'nesting': 0, 'input': ['q"']},
            \ {'buns': ['', ''], 'nesting': 0, 'input': ["q'"]},
            \ ]

See the README and documentation for more details.

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

No branches or pull requests

3 participants