<<< Date Index >>>     <<< Thread Index >>>

Re: tip: start vim with interacive mode: set editor="vim +:$ +:star!"



On 2004-12-14, Robert Michel <news@xxxxxxxxxxxxxxx> wrote:
> Salve Mutt users!
> 
> On Mon, 13 Dec 2004, Robert Michel wrote:
> 
> > Salve!
> > 
> > After a little help with the vim-user mailinglist (thank you Gary) and a 
> > reminder to read the help I have a small tip for your muttrc:
> > 
> > set editor="vim +:$ +:star!" #start vim on top of the body with the 
> > inserting mode
> 
> Sorry, I was a little bit to euphoric about this options - +:$ with
> interactive mode will create a full quote when you reply emails.
> 
> So better use still +:8 together with +:star! ;)
> 
> But maybe there is a way to find a hack use
>  /pattern +1 line or when pattern was not found +:$.
> 
> Anybody ideas?

I'm not sure just what you're trying to do or what's special about 
line 8, but how about this?

    vim +:$ '+:silent! ?pattern?+1' +:star! somefile

This will search backwards for "pattern" from the last line of the 
file.  If it finds "pattern", it will start in insert mode with the 
cursor at the end of the line following the one containing 
"pattern".  Otherwise, it will start in insert mode with the cursor 
at the end of the last line.

HTH,
Gary

-- 
Gary Johnson                               | Agilent Technologies
garyjohn@xxxxxxxxxxxxxxx                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA