智能硬包装,用于vim中的项目列表

Ste*_*eve 2 vim

我爱vim,我真的很喜欢在写这些文字时把它包裹起来.来自Tim Pope的降价插件非常棒,而且当我尝试硬包装物品清单时,它就能完成工作.好的,我的意思是做正确的工作:

- here I write a long long long line that is longer than the 80 caracters of a line and therefore should be wrapped.
- This is a short line
- here I write another long long long line that is longer than the 80 caracters of a line and therefore should be wrapped.
Run Code Online (Sandbox Code Playgroud)

应该成为(申请gqap后):

- here I write a long long long line that is longer than the 80 caracters
  of a line and therefore should be wrapped.
- This is a short line
- here I write another long long long line that is longer than the 80 caracters
  of a line and therefore should be wrapped.
Run Code Online (Sandbox Code Playgroud)

现在,具有tex文件类型的文本的相同命令的行为不是那么聪明:

\begin{itemize}
\item here I write a long long long line that is longer than the 80 caracters I fixed and therefore should be wrapped.
\item This is a short line
\item here I write another long long long line that is longer than the 80 caracters I fixed and therefore should be wrapped.
\end{itemize}
Run Code Online (Sandbox Code Playgroud)

成为(仍然在gqap之后):

\begin{itemize} \item here I write a long long long line that is longer than
        the 80 caracters I fixed and therefore should be wrapped.  \item This
        is a short line \item here I write another long long long line that is
        longer than the 80 caracters I fixed and therefore should be wrapped.
\end{itemize}
Run Code Online (Sandbox Code Playgroud)

如何在LateX中包装项目列表的行为类似于降价列表?

对我而言,我似乎应该重新定义语法文件,但我不知道(markdown的工作方式是使用为HTML定义的元素).

kev*_*kev 6

配置

:set fo+=n
:let &flp='^\s*\\\w*\s*'
Run Code Online (Sandbox Code Playgroud)

输入

\begin{itemize}
    \item here I write a long long long line that is longer than the 80 caracters I fixed and therefore should be wrapped.
    \item This is a short line
    \item here I write another long long long line that is longer than the 80 caracters I fixed and therefore should be wrapped.
\end{itemize}
Run Code Online (Sandbox Code Playgroud)

类型

gggqG.


产量

\begin{itemize}
    \item here I write a long long long line that is longer than the 80
          caracters I fixed and therefore should be wrapped.
    \item This is a short line
    \item here I write another long long long line that is longer than the 80
          caracters I fixed and therefore should be wrapped.
\end{itemize}
Run Code Online (Sandbox Code Playgroud)