I want to break up lines longer than 80 characters into multiple lines at the same level of indentation as the original line. It should only make the cut at whitespace characters so that words don't get bisected. So, this:
\begin{enumerate}
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sed tempus odio. Phasellus lobortis suscipit mattis. Nulla facilisi. In nisi turpis, tristique ut accumsan at, sagittis a orci. Ut nisl enim, eleifend quis fermentum commodo, fermentum a velit. Maecenas a augue nec leo fermentum auctor et ut turpis. Donec ultricies ligula sed mi suscipit sagittis.
\end{enumerate}
...would become this:
\begin{enumerate}
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum
sed tempus odio. Phasellus lobortis suscipit mattis. Nulla facilisi. In
nisi turpis, tristique ut accumsan at, sagittis a orci. Ut nisl enim,
eleifend quis fermentum commodo, fermentum a velit. Maecenas a augue nec
leo fermentum auctor et ut turpis. Donec ultricies ligula sed mi suscipit
sagittis.
\end{enumerate}
How would I write a macro to do this? Is there a better way?
:set textwidth=80
or short hand form:
:se tw=80
Then mark the text and type gq
.