2

私は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.

(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.

現在、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}

になる(まだ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}

LateXのアイテムリストのラッピングをマークダウンリストのように動作させるにはどうすればよいですか?

私には構文ファイルを再定義する必要があるように見えますが、どのように機能するのかわかりません(マークダウンが機能する方法は、HTML用に定義された要素を使用することです)。

4

1 に答える 1

6

構成

:set fo+=n
:let &flp='^\s*\\\w*\s*'

入力

\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}

タイプ

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}
于 2012-06-20T08:35:53.457 に答える