Re: Changing the default cursor position in vim
On Mon, Feb 12, 2007 at 01:51:38PM +1100, Cameron McCormack wrote:
> Greg Tees:
> > Hey, I use vim as my editor, and I was wondering if anyone could tell me
> > how, when composing a new message, you could have the cursor start below
> > the headers rather then at the top of the document.
> I do this by having
>
> set editor="~/bin/compose.sh"
>
> in my .muttrc, where ~/bin/compose.sh contains:
>
> #!/bin/sh
> /usr/bin/vim -s ~/bin/compose.vim $1
Can't you just set $editor to "vim -s ...".
But see below.
> and ~/bin/compose.vim contains:
>
> :se tw=72
> 1G
> /^$
> :nohlsearch
> O
I do:
:set editor=\"vim +'/^$/+1'\"<enter><exit>"
and you can do something like:
if has("autocmd")
au FileType mail set noai nohlsearch tw=72
endif
or instead of the middle line,
au BufRead mutt-* [...]
w