-
-
Notifications
You must be signed in to change notification settings - Fork 445
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
Don't block use of user defined text objects #200
base: master
Are you sure you want to change the base?
Conversation
The ramification is that this breaks setups that remap e.g.
I'm not sure off the top of my head how to invoke them from |
I tried this by using Here's my attempted fix: https://github.com/Porges/vim-surround/commit/3c49004bc3aa5edb3140b6ab9b1c3b889fdd74b0 |
I’d love to have this feature working. It would be useful not only for “literature” quotes, but also for things like:
|
I'm not sure what the status is here. Five years later I'm still using my forked version of this plugin so that it plays nice with |
To avoid triggering maps in unwanted places I create a
Should a configuration variable be created for cases when someone doesn't want this (omap respecting) behavior? |
The typical idiom for a mapping where you rely on one mapping being remapped map and the other not is, as proposed above, something like onoremap <SID>(underline) _
nmap <expr> gww 'gw' . v:count1 . '<SID>(underline)' to remap the non-remapped map as well. Instead of stitching in the SID itself for use with exe norm "gw\<SID>(underline) instead |
I don't know if this is the right solution because there may be ramifications to allowing mappings through here, but this change solves the problem I was having, fixing #199. With these changes and the text objects I have setup such as
q
for curly double quotes andQ
for curly single quotes, I can dow do things like:Change “double̝ quotes” to single
withcsqQ
→Change ‘double quotes’ to single
Change “double̝ quotes” to star
withcsq*
→Change *double quotes* to star
Change (in̝ parenthesis) to quotes
withcs(q
→Change “in parenthesis” to quotes
These (along with things like
dsq
to delete surrounding quotes) were ignored before even if the surround mapping AND text object existed.By contrast the solution presented in #107 only works for arbitrary single characters where the left and right side of the surround use the same character and the 'surround target' character is an exact match for the one being searched for. It doesn't work for more complex surround objects such as mixed matched pairs that have special text objects.