AndrewRadev/splitjoin.vim

Feature request: Splitting LaTeX commands onto newlines

lukelbd opened this issue · 1 comments

I see that splitjon can already split between single-line and multi-line LaTeX environments as follows:

\begin{itemize} \item Hello \item Goodbye \end{itemize}
\begin{itemize}
  \item Hello
  \item Goodbye
\end{itemize}

I would find it useful if splitjoin also worked with commands. For example:

\abstract{Words words words foo bar baz.}
\abstract{%
  Words words words foo bar baz.
}

Maybe I'll give this a shot myself in a week or so.

It should be relatively straightforward, but I don't use LaTeX myself, so I'd need some details on what would be correct. I created the branch latex-commands as a starting point: main...latex-commands

Indentation seems a bit weird for the }, but that comes from Vim itself. Let me know what you think and feel free to take that branch as a starting point to experiment.