system wide default editor

Jay Daniels tux at myt60.net
Wed Sep 2 22:59:59 UTC 2009


On Wed, 2009-09-02 at 23:38 +0200, Siggy Brentrup wrote:
> On Wed, Sep 02, 2009 at 17:19 -0400, Jay Daniels wrote:
> > When I create a cron job with crontab -e, a pico looking ( nano whatever
> > name ) pops up as my editor.
> > 
> > How do I change the default editor in Ubuntu Hardy to vi or emacs -nw.
> 
> % sudo update-alternatives --config editor
> 
> I choose jed as a small emacs lookalike that supports utf-8.
> 
> > Why in the world would anyone want to use this 1st grade dos looking
> > text editor if they installed Linux?
> 
> Don't ask me for Debian's bogus defaults, there are more than this
> one.
> 
> HTH
>   Siggy


One more problem, I am running emacs-snapshot  So how do I get emacs -nw
as default.

emacs is linked to /etc/alternatives/emacs which is linked
to /usr/bin/emacs-snapshot

I can rm the emacs in /usr/bin/emacs and replace it with 

#!/bin/sh
emacs -nw

But how to make it show up in

sudo update-alternatives --config editor

Perhaps I should just add this to .bashrc?
alias emacs='emacs -nw'
export EDITOR='emacs'

It seems like I remember slackware was smart enough to start up emacs in
proper mode depending on how you ran it.  Don't know how it accomplished
this, emacs startup script maybe?



jay





More information about the ubuntu-users mailing list