Skip to content

Provide g:vimtex_format_border_beginning and g:vimtex_format_border_end options to custom formatting rule #2358

@wenpengy

Description

@wenpengy

The function vimtex#format#formatexpr defined in format.vim script just supports s:border_beginning and s:border_end variables. Is it possible to provide global variables g:vimtex_format_border_beginning and g:vimtex_border_end for user?

For example, when format following codes using gqap:

\begin{figure}[htpb]
  \centering
  \includegraphics[scale=1.0]{fig1}
  \caption{A long title a long title a long title a long title a long title a long title a long title}%
  \label{f:fig1}
\end{figure}
``` latex

The result is :

``` latex
\begin{figure}[htpb] \centering \includegraphics[scale=1.0]{fig1}
  \caption{A long title a long title a long title a long title a long title a long title a long title}%
  \label{f:fig1}
\end{figure}
``` latex

The  expected result is:
``` latex
\begin{figure}[htpb]
  \centering
  \includegraphics[scale=1.0]{fig1}
  \caption{A long title a long title a long title a long title a long title
    a long title a long title}%
  \label{f:fig1}
\end{figure}

Therefore, it is very convenient for user to custom formatting style if you can provide global variables.

Thank you very much!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions