Re: dynamically switching $editor [keybinding question]
Gary Johnson <garyjohn <at> spk.agilent.com>
2005-10-05 02:22:14 GMT
On 2005-10-05, "Wilkinson, Alex" <alex.wilkinson <at> dsto.defence.gov.au> 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"'
Those define keybindings for the index menu. If you want to be able
to switch editors from some other mutt menu, you'll have to add
macros for them as well.
I chose ",E" and ",e" to invoke the macros, but you can use
single-letter keybindings instead if you prefer.
See the mutt manual, section 3.6, "Keyboard macros".
There is a way to toggle back and forth between editor settings
(Continue reading)