rbonvall / vim-textobj-latex

Vim text objects for LaTeX code
http://www.vim.org/scripts/script.php?script_id=4506
36 stars 8 forks source link

Add text object for paragraphs neighbouring environments #7

Open JohnReid opened 5 years ago

JohnReid commented 5 years ago

Often I want to format a paragraph such as this one:

\begin{align}
...
\end{align}
This is
the paragraph
I wish
to format.....

So I added a text object so that I could do gwir to format it. I am quite new to vim scripting so I'm not sure that I've done everything the best way ;) Hopefully others might find it useful.

JohnReid commented 5 years ago

TBH I'm sure this could be usefully generalised. For instance I often want to format items in lists:

\begin{itemize}
  \item I want to format this item separately from
  \item this item!
\end{itemize}