Don't block use of user defined text objects#200
Don't block use of user defined text objects#200alerque wants to merge 1 commit intotpope:masterfrom
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
qfor curly double quotes andQfor curly single quotes, I can dow do things like:Change “double̝ quotes” to singlewithcsqQ→Change ‘double quotes’ to singleChange “double̝ quotes” to starwithcsq*→Change *double quotes* to starChange (in̝ parenthesis) to quoteswithcs(q→Change “in parenthesis” to quotesThese (along with things like
dsqto 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.