Re: OT: column 72 in mutt with xterm && vim
Hi Matthias!
On Wed, 12 Mar 2008, Matthias Apitz wrote:
> I'm using mutt and writing e-mails with a 'vim' in a xterm window;
> the line length of this xterm window is pulled to more than 80
> columns so other output fits better (for example of 'ls'); of course
> I don't want to type behind column 72 when writing e-mail because
> I'm old and understand how mail should be written (only ASCII and
> only up to column 72; the 80 column punch cards have been my friends
> and my first input media to computers in the 70's :-))
>
> Well, is there some way to draw a magic vertical line in the xterm or
> 'vim' in column 72?
Not easily I am afraid.
You can let vim wrap automatically, whenever you reach a certain
column. This can be set using :set textwidth. My vim comes with a
filetype plugin mail.vim which sets the textwidth automatically to 70,
whenever vim recognizes a mail (and it already recognizes all of mutt's
mails out of the box).
In case you want to reformat your mail, you can use the gq command. So
gqap will reformat you current paragraph, while gqG will reformat
from the current line till the end of the mail and gggqG will reformat
the whole buffer.
Additionally you can have vim highlight all columns where the line
exceeds a certain width. This can be done by using e.g.
:syntax match WarningMsg /\%>70v.*/
This will match all lines that have a width greater 70 columns.
Depending on your needs, you may want to substitute the 'v' with a 'c'
The String WarningMsg tells vim how to highlight the match. All
available groups can be displayed by :hi (So instead of WarningMsg you
could also use Error)
The guys at vim_use@xxxxxxxxxxxxxxxx may know if there are even more
possibilities to achieve what you want. Compared to them, I only know
very little about vim ;)
For references see the following help sections:
:h 'textwidth'
:h 'wrapmargin'
:h syntax
:h :hi
regards,
Christian
--
hundred-and-one symptoms of being an internet addict:
84. Books in your bookcase bear the names Bongo, WinSock and Inside OLE