The default text editor on the Linux command line is an essential tool for developers and system administrators alike. Depending on the Linux distribution, the default editor might be nano, vi, or something else. However, you might prefer to use a different editor based on your personal preferences, features, or ease of use. Changing the default editor is a simple process, and this tutorial will guide you through the steps to do so.
Selecting the right text editor can improve productivity and make tasks such as editing configuration files or writing scripts more enjoyable. Popular text editors include Vim, Emacs, Sublime Text, and Visual Studio Code, each with its unique set of features and capabilities. It's essential to choose a text editor that aligns with your workflow and comfort level.
In this tutorial, we'll provide a step-by-step guide on how to change the default text editor on your Linux command line. The process is relatively simple and involves updating the appropriate environment variables and configuring the system's alternatives. By following these steps, you'll be able to configure your preferred text editor as the default choice for your command line operations.
sudo apt install vim
echo "export EDITOR=vim" >> ~/.bashrc
sudo update-alternatives --list editor
sudo update-alternatives --config editor
Comment anonymously. Login not required.