Nov 7, 2018

How to set gvim as default text editor instead of gedit on Ubuntu

edit or create this file:

~/.local/share/applications/defaults.list

and make sure it contains

[Default Applications]
text/plain=gvim.desktop

To update the command line editor:

sudo update-alternatives --config editor

To update the GUI editor:

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