[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mutt + Vim tricks (replace Nano)



* Steve Lamb (grey@dmiyu.org) [030927 12:49]:
> On Sat, 27 Sep 2003 06:48:22 -0700
> moseley@hank.org wrote:
> > - Justify text and respect any ">" quote marks.  ^J in Nano.
> >   operates on a paragraph (command "gq}", but mapped to ^J)
> 
>     First off, make sure you're in mail mode.  That'll let vim know what
> format to expect.
> 
>     gq> will to go the end of the current paragraph which is defined by a
> clean line.  So in a message that is  just quoted it will reformat until the
> end of the quotes.  Deleting the quote on black lines will get the desired
> result.
> 
> > - Unjustify (which is just undo in vim, I suppose)
> 
>     Erm, unjustify?  Example?
> 
> > - Paste in text with options:
> >     - wrap/no wrap (sometimes pasting URLs or code that should not wrap)
> 
> ':set nowrap' before pasting.

Or use :set paste .  This sets (/unsets) a bunch of options, including
disabling mappings and abbreviations, so that text that's entered is
entered unadulterated (since "pasting", e.g. in an xterm, is really just
like keyboard input from vim's POV).  Paste it in, then use :set nopaste
when you're done.  If you find yourself doing this often, you can bind
those commands to F-keys (or any other keys) or bind pastetoggle to a
key (I guess the modality of such a key wouldn't bother you since you
are using vim after all!)

> 
> >     - indent pasted text
> 
>     Example?  ':set ai' would work I supposed.  I never did like ai when
> pasting text, though.  You could also paste and then use the V mark along with
> >> to indent a block.
> 
> >     - paste in with "> " quote marks.
> 
>     Not sure on that one.  Though you could paste, select with V and then
> :s/\(.*\)/> \1/g

:s/^/> /

is shorter and faster =)

> 
> > - Spell a selected word or paragraph (although I can spell from Mutt, too)
> 
>     vimspell.  Check the vim script repository at http://www.vim.org/

Sounds cool; I'll look that up.

> 
> > Plus, I'm looking for those features you feel you can't live without
> > when working with email.  Basically, additional tips for getting the most
> > from Vim as my email editor.
> 
>     Mail mode with syntax highlighting turned on and vimspell are all that I
> need.  My needs seem to vary as I rarely, if ever, paste quoted material into
> the body of the message or paste material that needs to be indented.

Agreed.  I haven't used vimspell (yet?) but mail mode with syntax
highlighting takes care of me.   One of the things that impressed me
early on was the ability to use gq on quoted text and vim smartly
re-wraps and re-places the "> "s, which takes care of things when other
people forget to wrap at a decent column.  I also use this in my
~/.vim/ftplugin/mail.vim:

source $VIMRUNTIME/ftplugin/mail.vim
:/^$
:+

This starts me on the line after the first blank line, which is the
first line of the body (I have edit_headers set in mutt).  You'll find
various vimrc bits like this (for example, auto-trimming away other
people's signatures when quoting) in the archives of both debian-user
and the vim-users lists.

good times,
Vineet
-- 
http://www.doorstop.net/
-- 
http://www.doorstop.net/sprintpcs_sucks

Attachment: pgp4nFJ2eTkqD.pgp
Description: PGP signature


Reply to: