Skip to content

Toggle between equation and align #2488

@cnut1648

Description

@cnut1648

Is your feature request related to a problem? Please describe it.
When typing for math formula in \[ \] I find myself often need to switch to align due to the formula getting too long and I need to split it into several lines. Currently ts$ can toggle between inline math mode, display math mode, and equation environment. I think it will be useful if we can have even more environments to toggle, in particular, makes equation jump to align.

Additional context
A similar topic is raised in #2310, and we have vimtex_env_toggle_math_map. But I found it not able to recognize the environment name, I have the following in my config but it seems that it still fallback to default $ every time when I toggle in equation mode.

let g:vimtex_env_toggle_math_map = {
      \ '$': '\[',
      \ '\[': 'equation',
      \ 'equation': 'align',
      \ 'align': 'gather',
      \}

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions