Is Vim or nano the best Terminal editor?

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.

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

Is Vim or nano the best Terminal editor? Picture 1Is Vim or nano the best Terminal editor? Picture 1 GNU nano

GNU 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 Ctrlplus 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:

  1. Autoconf support
  2. Search function is case sensitive
  3. Search and replace interactively
  4. Ability to automatically indent
  5. The tab width option is displayed
  6. Search and replace regular expressions
  7. Toggle switches for the cmdline flag via meta keys
  8. 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
  9. 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

Is Vim or nano the best Terminal editor? Picture 2Is Vim or nano the best Terminal editor? Picture 2 Vim

In 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 Ito enter Insert mode . After you make your edits, press Escto 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 Enterto 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:

  1. Automatic commands
  2. Additional commands
  3. Input
  4. Memory limit is higher than vanilla micro
  5. Split screen
  6. Session Restore
  7. Expand the tab
  8. Tag system
  9. 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.

3.8 ★ | 5 Vote