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?
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