Re: alternate editor ?
On 2007-11-24, Gerard Robin <g.robin3@xxxxxxx> wrote:
> On Sat, Nov 17, 2007 at 04:56:13PM +0100, Michelle Konzack wrote:
>> From: Michelle Konzack <linux4michelle@xxxxxxxxxx>
>> To: mutt-users@xxxxxxxx
>> Subject: Re: alternate editor ?
>> Organisation: Michelle's Selbstgebrautes
>>
>> Am 2007-11-11 20:29:01, schrieb Gerard Robin:
>>> Hello,
>>> is it possible to do write this in the file .muttrc (in muttrc language) :
>>>
>>> if $DISPLAY=:0.0 then editor="gedit" else edtor=vim
>>
>> set editor=`if [ ${DISPLAY} = ":0.0" ] ; then echo gedit ; else echo vim ;
>> fi`
>
> Thanks, it works fine too with gedit, but not with "gvim -f", I get the
> message: -f unknown variable.
You'll get that error if "gvim -f" is not properly quoted, for
example if you try to set 'editor' like this:
set editor=gvim -f
Try this form instead.
set editor=`if [ ${DISPLAY} = ":0.0" ] ; then echo '"gvim -f"'; else echo
vim ; fi`
That will make the output of 'echo' be
"gvim -f"
which mutt will see as one value for 'editor' instead of just
gvim -f
which mutt will see as the value "gvim" for 'editor' followed by
another variable to be set, "-f".
Regards,
Gary