Julien,

I've run into this problem as well.  There are a couple things I do to
deal with the way vim wraps text.

First, I typeset my math in a certain style:
-  I almost always use the AMS align or align* environments.
   [see :h imaps.txt for how to make LatexSuite style maps, I use EAL
   and EAS, respectively].
-  For long equations, I only put one term on each line.
-  For terms on the right-hand side, I prepend each line with
   '{} '.  So LHS terms go all the way to the left, slightly indented.
   RHS terms are indented by three more columns due to the '{} '.

Doing it this way immediately makes vim's native linewise commands
MUCH more useful in equations.

Second, I have the following code in my ~/.vim/ftplugin/tex.vim:

omap <buffer> lp
?^$\\|^\s*\(\\begin\\|\\end\\|\\renewcommand\\|\\label\\|\\item\)?1<CR>//-1<CR>.<CR>
nmap gwlp gwlp``

The first line makes an object for a "LaTeX paragraph".  You can use it
with gw, as in gwlp.  The second line makes gwlp also do "``" so the
cursor is in the same place in the text as it was previously.

Basically, gwlp will reformat the current paragraph until it reaches a
blank line or a begin or end of environment or a label or an item
command.  This way gwlp won't mess up your math, but your text will
still be formatted correctly.

Hope this helps!

-Mike Richman


On Wed, Jan 7, 2009 at 5:32 AM, Julien Cornebise
<julien.corneb...@gmail.com> wrote:
> Dear all,
>
> I suggest this feature to be added : allow two distinct "tw" settings for
> normal and math modes.
>
> Personnally, I often want my paragraphsto be tw=72, but to wrap my math
> formulas myself (i.e. tw=0), regardless of the length of line -- some
> intricate math expressions can sometimes be more appreciated on a very long
> line by themselves, when the things around matter more.
>
> I don't know how easy this is to implement, though.
> Best, and thanks for this great tool !
>
> Julien
>
> ------------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> _______________________________________________
> Vim-latex-devel mailing list
> Vim-latex-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/vim-latex-devel
>
>

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Vim-latex-devel mailing list
Vim-latex-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vim-latex-devel

Reply via email to