Ubuntu Geek

Ubuntu Linux Tips,Howtos&Tutorials|Feisty,Gutsy,Hardy,Intrepid

  • RSS Feed

    subscribe to the ubuntu Geek RSS feed


  • Sponsor

  • Categories

  • Meta

  • Sponsor

  • Archives

Howto select Per-user Editor in Ubuntu 8.10 (Intrepid)

Posted by admin on September 6th, 2008 Email This Post Email This Post

When a program in Ubuntu such as crontab -e or dch -i, is used to edit a file, it uses a helper program called sensible-editor.

sensible-editor attempts to intelligently find an editor on your system based on a few simple rules. Basically, if you haven’t already defined $EDITOR, it will use one of {nano, nano-tiny, vi}, in that order.

Now, it’s well understood that nano is easier to use than vi to a new Ubuntu user. And it’s assumed that if you are sophisticated enough to want a different editor, then you likely already know how to change that setting.

Traditionally, this can be done in one of two ways.

You can edit your ~/.bashrc file to export an EDITOR value of your choosing. Of course, that requires that you have a usable editor with which you can modify that file!

If you are an administrator of the system, you can set the default editor for the entire system:

sudo update-alternatives --config editor

So we have a new utility in ubuntu intrepid, /usr/bin/select-editor, which uses update-alternatives --list to display a list of editors present on the system and prompt the user to select one. The selection is written to ~/.selected_editor.

The default selection remains nano, but for those of us installing dozens of Ubuntu systems every week and looking for a more powerful editor, we now have a really convenient, friendly mechanism for each user on an Ubuntu system to interactively choose an editor preference the first time they need one!

Thanks to Dustin for this package.

Share/Save/Bookmark

If you want to be notified the next time we write something please subscribe to our RSS feed.Thanks for Visiting!

Related Articles

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>