Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I actually want to change the default text editor on my Ubuntu 12.04 from nano to Geany. When I used this code:

update-alternatives --config editor

.. I don't see Geany in the list.

So to add Geany, this is supposed to work right?

update-alternatives --install /usr/bin/geany geany /usr/bin/geany 10

Also, on a side note, can you tell me if you would personally suggest me to change the default editor from nano to Geany, and why?

share|improve this question
@izx Thank you :) – Programming Noob Sep 30 '12 at 8:34
@izx Absolutely :) I'd still love to know what was the command-line way of doing it though. Regardless, I'l mark your answer as accepted :) – Programming Noob Sep 30 '12 at 9:06

2 Answers

up vote 9 down vote accepted

The command line way is:

sudo update-alternatives --install /usr/bin/editor editor /usr/bin/geany 10

and then use sudo update-alternatives --config editor to select Geany if necessary.

As a graphical alternative to the command-line method, consider using Gnome Alternatives (sudo apt-get install galternatives). Run GAlternatives, select editor in the left column, and then add/choose Geany on the right.

share|improve this answer
1  
I did that and Geany is selected * 3 /usr/bin/geany 10 manual mode but when I try to open a text file by double-clicking it in Nautilus, it still opens with gedit. – To Do Feb 18 at 16:23

As an alternative, this also worked for me:

xdg-mime default geany.desktop $(grep MimeType /usr/share/applications/geany.desktop | sed 's/MimeType=//' | sed 's/;/ /g')

I'm not suggesting I understand it, but it worked perfectly. I found it here alone with a bunch of useful info on colour schemes.

http://linuxtidbits.wordpress.com/2012/02/21/gedit-to-geany/

Cheers

Steve

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.