I've compiled vim from source following these instructions (except I did not specify a prefix to install it to the default location viz. /usr/local) and also ran the following:
sudo update-alternatives --install /usr/bin/editor editor /usr/local/bin/gvim 1
sudo update-alternatives --set editor /usr/local/bin/gvim
and then confirmed that it's been set as the default using
sudo update-alternatives --config editor
However, I still don't get the option to select gvim as a text editor in Settings > Applications > Default
.