Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I prefer the gnome desktop to KDE - but I prefer the Kate text editor to gedit - but gedit is the default in gnome.

How do I set it so that the default application when I double-click a file is Kate?

share|improve this question
up vote 7 down vote accepted

Try this little tutorial. Or, if you want a simpler way, just right click on the file and choose to open with the application you want.

share|improve this answer
    
Thanks Alex - I now about the right click option, but sometimes I just mindlessly double click on the file and would prefer it to load in Kate – HorusKol Feb 17 '10 at 22:20

I wanted to change my default editor to emacsclient (which opens a file in the current emacs session, running in server mode). The problem was, I didn't have an emacsclient.desktop file anywhere. It worked when I just adapted the /usr/share/applications/emacs23.desktop file and put it in ~/.local/share/applications/emacsclient.desktop

This was based on the description at http://dev.eclipse.org/newslists/news.eclipse.newcomer/msg12557.html

share|improve this answer

This may be useful. I use it to accomplish the same thing as the tutorial alex linked. Should work on Ubnutu Karmic to Lucid.

~/$ cat bin/upkateprefs
#!/bin/bash
#Changes all new/existing gedit editor preferences to kate

#change existing preferences
sed -i "s/gedit/kde4-kate/" ~/.local/share/applications/mimeapps.list

#add new file type preferences
cat /usr/share/applications/defaults.list|grep gedit|sed "s/gedit/kde4-kate/" >> ~/.local/share/applications/mimeapps.list

#remove duplicates
sort -u ~/.local/share/applications/mimeapps.list -o ~/.local/share/applications/mimeapps.list

It's not perfect in that it will bring in a duplicate mime type line if you have more than just gedit in your existing preferences line. It will also break the file format if you have more sections than just [Added Associations]. Perhaps a wizard will come along and come up with a better script.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .