TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:10225] Word wrapping in vi



On Nov 17, 1999, Ben Beuchler <insyte@emt-p.org> wrote:
> I've finally configured pine to use vi instead of that nasty pico.  However, I
> am having trouble getting it to wrap lines.  It will wrap lines nicely as I
> type, but I can't seem to find an option to get it to REwrap everything after
> I've made a correction.  

You can also try adding command-line parameters to your editor command.
In Mutt, I just have a line in my .muttrc like this:

set editor="vim -c 'set textwidth=72'"

Not sure if this will work in non-vim vi, though, if that matters.
Another *very* cool feature in vim is line re-wrapping, including the
">" quote marks in emails.  You just do a <esc>gq followed by a normal
movement command, just like you were doing a 'd' or 'c' or whatever
command.  If you also have the textwidth set, you can reformat ugly
email quotes with very little work.  My favorite key sequence is 'gq}'.

> (Now if I can just get out of the habit of hitting ^X after I'm done composing
> an email...  Vi don't like that...)

Tell me about it.  (c:  I use vi for mail and admin, and emacs for
coding.  I find myself erroneously hitting <esc> in emacs, but
curiously, when I'm in vi, I'm fine.

John