Hello, friends. Today you will learn a pretty simple trick that allows you to define which is the default text editor on Ubuntu using the terminal. This simple trick is quite useful if you work too much with the terminal.
If you use the terminal a lot, you will notice that you are almost always editing configuration files and things like that. It is possible to define a default text editor so that when you edit a configuration file, the system always chooses yours.
An example of this is when you want to edit the
crontab file, it takes the default editor of the system.
But that is going to change today.
How to set the default text editor on Ubuntu using the terminal?
For Ubuntu and derivatives, the procedure is simple. To achieve this, open a terminal from the main menu and run.
sudo update-alternatives --config editor
Then you will be presented with a series of options that will allow you to decide the default text editor.
Note that this list will only show those programs that were installed as DEB packages. So, the portables and programmed ones installed as snapd or Flatpak should not appear.
Now notice how each text editor is identified with a number. To decide your favorite text editor, just click on the number it refers to or choose them with the arrow keys.
Some text editors for Linux
The idea is not to make a top of text editors, but to say some that can help you to accomplish the tasks.
In this simple post, you learned how to set the default text editor on Ubuntu using the terminal. So, I hope it will be useful, and you will be able to solve problems with it.