Is Vim or nano the best Terminal editor?
You may be surprised to learn that many aspects of the Linux desktop are not hidden behind complex lines of code. Many programs and system settings are hidden in text files.
You can open them with the default text editor like Gedit or Kate, but using Terminal is usually faster, especially when you need admin rights.
For Terminal-based text editing, two of the top options are GNU nano and Vim. So which option is better? The answer will be in the following article.
A brief history of GNU nano and Vim
The GNU nano project (often referred to as nano) was created in 1999 to simulate and improve the Pico text editor. The developers claim that GNU nano is only two-thirds to eighth of the size of the Pico binary file, making it very neat and usable even on the weakest systems.
Vim, originally developed in 1991, based on the Vi text editor, was first developed in 1976. Like the GNU nano, Vim also started out as an effort to improve a project. before.
GNU nano
GNU nanoGNU nano is famous for being relatively user friendly. If you have never used nano before, this is a good opportunity for you to tinker.
To get started, you can open or create a file by typing:
nano /home/user/HelloWorld.txt
This will show you a recognizable user interface. The title of the text file appears at the top and the text contained in the file appears in the middle. The actions you can perform are at the bottom. You complete these actions by pressing the Ctrl
plus key specified.
When the bottom of the screen is displayed, nano contains many of the functions you expect from a graphics application. You can cut and paste, find and replace words, etc.
Features of GNU nano include:
- Autoconf support
- Search function is case sensitive
- Search and replace interactively
- Ability to automatically indent
- The tab width option is displayed
- Search and replace regular expressions
- Toggle switches for the cmdline flag via meta keys
- Tab completion (press Tab while entering commands, options or file names and the shell environment will automatically complete what you are entering) when reading / writing files
- Soft text wrapping (the text looks like it ended at the edge of the screen, but in fact, it's a very long line. The next sections are indicated by $ )
Overall, nano is a great option for beginners to edit in Terminal. You can try opening files from the command line and navigate using the keyboard mostly.
On DEB-based systems like Debian or Ubuntu, you can install GNU nano using:
sudo apt install nano
On Fedora, an RPM-based system, you can install it using:
sudo dnf install nano
Because nano is a command-line program you probably won't find in GNOME Software or other Linux app stores. But you can install it using a traditional package manager, such as Synaptic.
Vim
VimIn contrast, Vim did not welcome newcomers very much. When you open a text file, you only see the content of the file and there are no instructions on how to use Vim.
However, getting started with Vim is very simple. You open a file with the following command:
vim /home/user/HelloWorld.txt
You cannot make any actual edits without clicking I
to enter Insert mode . After you make your edits, press Esc
to exit the mode.
To perform other functions, when not in Insert mode , press the key :
(colon). Then enter the key (s) corresponding to what you want to do and press Enter
.
When done, you can enter : q and press Enter
to exit the program.
Vim's minimalism keeps everything from cluttering in the Terminal window. All you see on the screen is the text inside the file. If you are comfortable with typing, the Vim interface feels quite natural.
Besides, Vim has the advantage of being more powerful than the GNU nano. Vim not only contains more features, but you can also customize the program with plugins and scripts.
Vim's features include:
- Automatic commands
- Additional commands
- Input
- Memory limit is higher than vanilla micro
- Split screen
- Session Restore
- Expand the tab
- Tag system
- Add color to the syntax
After you've taken the time to add the desired plugins, Vim will become an alternative tool for full-featured graphic text editors, such as Sublime Text or Visual Studio Code. If you are not interested in programming, that doesn't mean you should skip Vim. With an existing markdown plugin, Vim is also a good option for writers.
Is Vim more elusive than nano? Definitely yes. But with the ability to add features from other text editors, you can really turn Vim into your own tool.
On Debian or Ubuntu, you can install Vim using:
sudo apt install vim
On Fedora, use:
sudo dnf install vim
GNU nano and Vim: Which would you prefer?
If you are not afraid to spend time learning and getting acquainted, you may find that you love Vim more. It's simple and engaging in its own way.
But if you want a simple option, but still get the job done, there's no reason not to choose GNU nano. It does not have mysteries to discover like Vim and you do not have to read the program manual.
You should read it
- Basic guide to Nano editor
- 6 best code editor apps for Mac
- Download Photo! Editor 1.1: Multifunctional photo editor
- Block access to Registry Editor on Windows 10/8/7
- 7 best AI video editors on mobile
- Link Download Free PDF Editor 1.3
- How to edit configuration files in Ubuntu
- Tips for using Seen: Story Editor edit Story is very artistic
- Learn about Micro applications in Linux
- How to install and use GNU nano to edit files on Linux
- 6 interesting terminal commands on Mac
- Learn about the Gutenberg Editor of WordPress