Auto pairing \( #52
-
I write with LaTeX and I'm coming from Sublime Text. I used to auto pair ( while mapped from $. I'd like to achieve the same thing using vim, and found the original plugin. The problem was that it would't auto pair escaped characters. While reading this issue, I found this fork, with the possibility to write
to auto pair '[', but when I tried to substitute with \(, I got the message
Can someone help me with that? Also, what's the best way to map $ to ( while auto pairing? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Well, this is monumentally annoying. As for the problem... this fork, still being based on large core parts of jiangmiao's code means it inherited large parts of the problems with jiangmiao, including backslashes. I'm not sure what regex group nightmare is going on here, but it's probably down to the matching regex somehow being badly interpreted. Worst-case, Looked into it, and it was indeed regex: auto-pairs/autoload/autopairs.vim Line 160 in 4dceac4
I can make some temporary hacks here, but I'm suspecting the real fix is gonna be a part of 4.0.0, which is far back on my backlog for real-life reasons. Jiangmiao's decision to mix regex with non-regex keeps coming back to annoy the shit out of me. I'm genuinely inclined to make another breaking change and pull off a rule-like system instead. (Not along the lines where backspace and newline rules have to be explicitly defined though, because that just sounds like it requires a ton of unnecessary and verbose config). Probably gonna settle for a hotfix on master for the time being, and actually deal with fixing the root problem later |
Beta Was this translation helpful? Give feedback.
-
Further bugs prevented this from working. As part of #71, this has been fully fixed with |
Beta Was this translation helpful? Give feedback.
Further bugs prevented this from working. As part of #71, this has been fully fixed with
'\\[': '\]'
. Changes to 4.0.0 (currently only part of the develop-4.0.0 branch) means the pair'\[': '\]'
(and equivalent for\(\)
) is valid, and the double backslash open is invalid as of 4.0.0. The changes allowing this have since been merged into main