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.

Most of the time I can browse the file system with the file browser, right-click on a file and top item in the menu "Open with Gvim", but when I right-click on a .c or .h file, it says "Open with (some inferior editor)". I mouse over to the "Open With" submenu, and Gvim doesn't appear in there, either. Even when I go into "Other Application" and browse through the programs, it doesn't show up. What gives?

share|improve this question
    
It shows up for me in the "Open With" menu. Do you have vim-gtk or vim-gnome installed? Have you done anything to customize or change the package contents? Do you have a custom launcher for gvim in ~/.local/share/applications? –  mtmiller Jun 26 at 3:02
    
I have vim-gnome installed. I don't think I've done anything to change or customize the package, just my .vimrc and .vim folder. Yes! I made a custom launcher that looks like:[Desktop Entry] Version=1.0 Name=Gvim Comment=The best text editor Exec=/usr/bin/gvim --remote-tab-silent Icon=/usr/share/app-install/icons/vim.svg Terminal=false Type=Application Categories=Utility;Application; –  Matt Gregory Jun 27 at 0:54

1 Answer 1

up vote 1 down vote accepted

In your reply in the comments, you said you have created a custom launcher for GVim. In your custom desktop launcher, you neglected to include the MimeType keyword. The .desktop file is not only used to add applications to the desktop environment menu, but also to register applications with the MIME types that they can handle.

So to register GVim as a text editor with your desktop environment, your custom gvim.desktop file should contain at least the following:

[Desktop Entry]
Version=1.0
Name=GVim
Comment=Edit text files
Exec=gvim --remote-tab-silent %F
Icon=vim
Terminal=false
Type=Application
Categories=Utility;TextEditor;
MimeType=text/plain
share|improve this answer
    
Thank you! That fixed it. You are the man! –  Matt Gregory Jun 27 at 3:18

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.