I traced p4v.bin in the end. It looks like you can create a file in your home directory at: ~/.local/share/applications/defaults.list
. But this is read before the global version and thus settings are overridden by what is in the global version. I'd say this is a bug, but that's for another time. Instead, you need to edit the global one in /usr/share/applications/defaults.list
. You just need to add the following entry and any others you see fit, not forgetting to comment out the existing entry:
#text/plain=gedit.desktop
text/plain=gvim.desktop
Then create a file called gvim.desktop
in ~/.local/share/applications/
with the following content:
Name=gvim
GenericName=Text Editor
Comment=Edit Text Files
Exec=gvim --server %U
Terminal=false
Type=Application
StartupNotify=true
MimeType=text/plain
Icon=gvim
Categories=GNOME;GTK;Utility;TextEditor;
No need to restart perforce, it doesn't cache the mime-type queries, so it will read the defaults.list file again and find your modified entry.
Update: It is all documented here: https://wiki.archlinux.org/index.php/Default_Applications