13

I use gVim all the time and open all sorts of plain text files, source codes and virtually anything that is readable with gVim.

Ubuntu however decides that I should use gedit!

I got searching and I found this that correctly makes ubuntu open my plain text files with gVim, but no luck with source files. I set both

sudo update-alternatives --config editor
sudo update-alternatives --config gnome-text-editor

to gVim, but still it uses gedit for source files.

Not to mention most of what you find on the internet say "right click->Open with->Always use this application" to set the default app for each of your file types. I'm fine with that, but in the new ubuntu (11.10) that option is simply not there anymore. but it could get rather cumbersome.

I went for uninstalling gedit, but it told me if I do, future updates will not include new items in The Ubuntu Desktop System set.

My question is, how can I tell ubuntu to change the default application of all those things that open with gedit to gVim?

If no such thing is possible (which would be the stupidest thing ever), would I really miss much if I uninstall gedit and forget about those mentioned new items?

Shahbaz
  • 788

3 Answers3

12

On 11.10 defaults.list is under /etc/gnome/defaults.list

  • Open defaults.list using any text editor.
  • Replace text/plain=gedit.desktop with text/plain=gvim.desktop
  • Save and close.

Right click on any text file and you will see like this:-

enter image description here

It works for me :)

Achu
  • 21,407
1

Not to mention most of what you find on the internet says right click->Open width->Always >use this application to set the default app for each of your file types. I'm fine with >that, but in the new ubuntu (11.10) that option is simply not there anymore.

I had this same problem with getting LibreOffice to recognize .xlsx files. Right-click on the file you want to open, click properties, and go to the 'Open With' tab. There, you can select an application and there should be an option in the bottom right to 'Set as default'

Hope it helps!

jat255
  • 728
0

The option to choose what program to open an application with, is there, as can be seen in this screenshot.

enter image description here

Or, you can open the Properties dialog (the one called Egenskaper in my screenshot) and choose Open With:

enter image description here

Then you can choose to show other applications:

enter image description here

When you add another application, then it will appear in the list to open with, as shown in the first screenshot, and you can choose to open with that application by default.