Skip to content

Add option to keep \[ ... \] on one line #3300

Description

@evlasics

Is your feature request related to a problem? Please describe it.
When I do the surround.vim bindings to change a math environment to \[, it automatically places the output on three lines. So for example, if we had a file (* is the cursor)

We can prove \( \pi >* \frac{22}{7} \) with calculus.

then hitting cse\[<C-r> converts this into

We can prove
\[
     \pi >* \frac{22}{7}
\]
with calculus.

whereas it's common to place these all on one line instead:

We can prove
\[ \pi >* 3 \]
with calculus.

Describe the solution you'd like
Ideally, some way of configuring the default behavior to match the second example

Describe alternatives you've considered
I could manually remove the newlines (mbkJJ`b to preserve cursor position in the line), but this loses me precious keystrokes, which are not always plentiful if I need to work very quickly.

Additional context
I know that for some people, the original behavior is their preferred behavior, which is why I think it should be configurable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions