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

Re: Mutt + Vim tricks (replace Nano)



On Mon, Sep 29, 2003 at 11:34:11AM -0400, Derrick 'dman' Hudson wrote:
> In my .vimrc I have the following mail-specific settings:
>     augroup Mail
>         au!
>         au FileType mail set tw=70 fo=tcrq2 nomodeline
>         au FileType mail set comments+=n:\|
>         " clear the old sig and go back to the beginning of the buffer
>         au BufRead /tmp/mutt* normal :g/^| -- $/,/^$/-1d
gg
>     augroup END
> 
> (note that between the 'd' and the 'gg' on the last line is a literal
> carriage return)

Hum, well, I couldn't get that one (to clear the .sig) to work -- perhaps I didn't
understand what you mean by "liberal carriage return".  But it's late
and I just recovered almost 50G of data off a backup, so I may not be
thinking just right.  I'm using a ~/.vim/ftplugin/mail.vim file (below),

I'm also not having much luck understanding :map -- I can get it to work
sometime, but not always.

For example, I'd like to map ^J to gq} to warp a paragraph -- and it
I'd like it to work in editing or command/normal mode.  I'd also like to
start in insert mode, I think.  I might like ^A and ^E for start and end
of line as I find it easier to type than ^ and $, at least for my
fingers.  Seems like for email I don't really need to jump out of Insert
mode very often.

Another nice feature would be a key to delete from current position to my
.sig line.  I suppose that should be easy enough to do.

BTW -- it was recommended I use :set nowrap for pasting, but I think
that's just for displaying wraps on my screen.  I think :set tw=0, or
better, :set paste is what I needed.

Here's my mail.vim setup so far.

moseley@bumby:~$ cat .vim/ftplugin/mail.vim 
" Don't allow modlines in mail to effect us
setlocal nomodeline

" This is useful for pasting in indented quotes
setlocal autoindent

" Be smart about formatting comments with gq}
setlocal comments=n:>,n:\|

" Set auto wrapping
" (set tw=0 for pasting in things that should not be wrapped)
setlocal tw=70

" I like to backspace/back arrow to previous lines
setlocal whichwrap=b,s,<,>,[,]

" Show tabs and trailing whitespace (need to figure out how to use a
different color)
setlocal list
setlocal listchars=tab:>-,trail:+

" Go crazy with color
syntax on

" Enable display wrapping
setlocal wrap

" Jump to first blank line (maybe farther would be better)
/^$


-- 
Bill Moseley
moseley@hank.org



Reply to: