Change Default Text Editor Ubuntu - From Nano

Setting Your Default Text Editor in Ubuntu Linux
Numerous system utilities within Ubuntu Linux rely on a text editor for modifying configuration settings and files. A common instance of this is the crontab command, which utilizes a default editor to manage scheduled tasks.
Adjusting the default editor is a straightforward process, achievable through the update-alternatives command. Initiate a terminal window and execute the following command:
sudo update-alternatives --config editor
The output will present a list of available editors, similar to this:
$ sudo update-alternatives --config editor
There are 5 alternatives which provide `editor'.
Selection Alternative
-----------------------------------------------
1 /usr/bin/vim
2 /bin/ed
*+ 3 /bin/nano
4 /usr/bin/vim.basic
5 /usr/bin/vim.tiny
Press enter to keep the default[*], or type selection number:
Selecting an Editor
To designate your preferred editor, simply input the corresponding number from the list. For instance, to set vim as the default, pressing '1' would accomplish this.
Verification of the change can be performed by executing crontab -e. This command will now launch the editor you selected, rather than the previously configured default.
This method ensures that all utilities requiring a text editor will consistently utilize your chosen application, streamlining your workflow.
The update-alternatives system provides a flexible way to manage default commands in Ubuntu, allowing users to customize their environment to suit their preferences.