On Wed, Jan 27, 1999 at 08:05:23PM -0600, Ronny Haryanto wrote:
> Hi,
>
> I'm just wondering if there's a way for mutt to wrap outgoing messages
> to a certain width instead of having to use the editor's capability to
> wrap text?
>
> I'm using vim by the way, I know it's rather inappropriate to ask this
> here, but if anyone has any good tips for using vim with mutt,
> especially for wrapping outgoing messages to a certain width, please
> kindly let me know.
Use autocommands. What I do is something like (in ~/.vimrc):
-------begin example
augroup my_syntax
" Remove any former autocommands for this augroup.
au!
" set options for the file type's mode when we enter that buffer, and
" restore my normal settings when leaving.
au BufEnter *.h,*.c,*.cpp,*.hpp,*.cc,*.c++,*.C,*.H so $HOME/syntax/myc.vim
au BufLeave *.h,*.c,*.cpp,*.hpp,*.cc,*.c++,*.C,*.H so $HOME/syntax/norm.vim
augroup END
" Turn on syntax highlighting.
syntax on
-------end example
~/syntax/myc.vim contains my C and C++ formatting options, while the global
syntax file just contains the syntax highlighting options.
A similar thing can be done for your mail files. Leave the global syntax
files as is, and add your own file as above which sets 'textwidth' the
way you want it.
Mutt's file naming for new mails is 'mutt*[0-9]', so you would want
something like:
au BufEnter mutt*[0-9] so $HOME/syntax/my_mail.vim
au BufLeave mutt*[0-9] so $HOME/syntax/norm.vim
See vim's syntax.vim file for a complete list of extentions (this is usually
/usr/local/share/vim/syntax.vim).
I suppose one other option would be to just add the 'textwidth' setting
to the global mail.vim syntax file, but then the change is global for
all users.
--
Ken Sodemann
[EMAIL PROTECTED]
http://www.pcii.net/~stuffel