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

Re: dynamically switching $editor [keybinding question]



* Gary Johnson <garyjohn@xxxxxxxxxxxxxxx> [2005-10-04 19:22 -0700]:
> On 2005-10-05, "Wilkinson, Alex" <alex.wilkinson@xxxxxxxxxxxxxxxxxxx> wrote:
> > Hi all,
> > 
> > Can someone tell me if it is possible to set a keybinding to
> > dynamically switch between different $editors on the fly ?
> > 
> > e.g. I want to be able to set a keybinding that will switch between
> >      the following 2 $editor:
> > 
> >      set editor="vim -c 'set filetype=mail' -c 'set textwidth=70' +:$ 
> > +:star!"
> >      set editor="vim"
> > 
> > Is this possible ?
> 
> Yes.  The tricky part is handling three levels of nested quotes.  
> This should work.
> 
>     macro index ,E 'set editor="vim -c \"set filetype=mail\" -c \"set 
> textwidth=70\" +:$ +:star!"'
>     macro index ,e 'set editor="vim"'

T think this shoud read
     macro index ,E '<enter-command>set editor="vim -c \"set filetype=mail\" -c 
\"set textwidth=70\" +:$ +:star!"\n'
     macro index ,e '<enter-command>set editor="vim"\n'

Nicolas