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?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
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.
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
Thanks Alex this works for me on Ubuntu 16.04 LTS:
create a file
~/.local/share/applications/defaults.list with this content:
[Default Applications] application/x-perl=kate.desktop text/plain=kate.desktop text/x-chdr=kate.desktop text/x-csrc=kate.desktop text/x-dtd=kate.desktop text/x-java=kate.desktop text/mathml=kate.desktop text/x-python=kate.desktop text/x-sql=kate.desktop
Create missing kate.desktop with a copy:
sudo cp /usr/share/applications/gedit.desktop /usr/share/applications/kate.desktop
In the copied file, replace
kate i.e. with vim
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.