Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
Have a look here to solve the application missing on the open with another program tab. –  Bruno Pereira Oct 28 '11 at 15:15
    
@brunopereira81, I had seen that, but that is not what I'm asking. I do see gVim in the Open with options. My problem is I can't set it as default application. –  Shahbaz Oct 28 '11 at 15:20
    
sorry miss understood it. –  Bruno Pereira Oct 28 '11 at 15:46

3 Answers 3

up vote 10 down vote accepted

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 :)

share|improve this answer
3  
Great fix! A %s/gedit/gvim/g (replace gedit with gvim) did all that I wanted to do all at once! Thanks –  Shahbaz Oct 28 '11 at 15:43
    
You're welcome :) –  Achu Oct 28 '11 at 15:49
    
It would be interesting to see how your menu and dialog looks like, Shabbaz. –  Jo-Erlend Schinstad Oct 29 '11 at 7:28
    
@Jo-ErlendSchinstad, pretty normal, what do you mean? It's just the editor I changed (Well, I lied, I removed the mail indicator (I would have removed that change user indicator too, but that is connected to the restart/shutdown button (!!!)), I also removed autohide of the sidebar, but it all still "looks" pretty normal) –  Shahbaz Nov 3 '11 at 17:49
1  
To make the change user specific and not system-wide, add text/plain=gvim.desktop to the [Default Applications] section in .local/share/applications/mimeapps.list. –  Lucas Sep 10 at 16:06

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!

share|improve this answer
    
Like I said, in the new ubuntu, it's not there. That "Set as default" button is just not there!! –  Shahbaz Oct 28 '11 at 15:17
    
It's - right click > PROPERTIES > open with.. –  doug Oct 28 '11 at 15:35
    
@Shahbaz How about my answer? have you tried? –  Achu Oct 28 '11 at 15:41
    
Ah, I didn't read carefully. Yes I see it now, but the accepted answer proved to be much better. Thanks for telling me though :) –  Shahbaz Oct 28 '11 at 15:45

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.

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.