sudo update-alternatives --install /usr/bin/editor editor /usr/bin/geany 10
sudo update-alternatives --config editor
/usr/share/applications/defaults.list
– the system defaults list.
~/.local/share/applications/mimeapps.list
– the users personal desktop session defaults list
References
http://askubuntu.com/questions/194712/how-do-i-make-geany-my-default-editor-on-ubuntu