-
Notifications
You must be signed in to change notification settings - Fork 407
make (all) surrounding delimiters large #2313
Description
Is your feature request related to a problem? Please describe it.
Using \left and \right can be a bit of a chore. Especially if you start writing a formula with lots of delimiters and only notice halfway in that there is a "tall" expression in there.
Describe the solution you'd like
It would be quite helpful to have a function (and probably also a normal mode mapping) that finds all math delimiters surrounding the cursor and makes them \left/\right delimiters if they are not already. E.g.
\exp \left( \int_0^1 f(x) dx + G(1 + T[x - \frac{x_0}{2}| ] ) \right)
(| is supposed to be the cursor position) would become
\exp \left( \int_0^1 f(x) dx + G\left(1 + T\left[x - \frac{x_0}{2} \right] \right) \right)
The use case I have in mind is binding this to some key combination in insert mode which I could press after writing a fraction/sum/integral so that I don't have to worry about manual \left/\right again. Even better, I could integrate this into my snippets to make it 100% automatic.
Describe alternatives you've considered
Currently I can do