Pinterest Stumbleupon Whatsapp
Ads by Google

Although Linux has become easy enough for practically anyone to use without ever having to use the Terminal, there are some of us who regularly use it or are curious about how one can control their system with it. In any case, one of the primary ways to use the Terminal is to configure text files Terminal text editors and control how certain programs or system services behave.

While you can easily use tools such as Gedit gedit: One Of The Most Feature-Filled Plain Text Editors [Linux & Windows] gedit: One Of The Most Feature-Filled Plain Text Editors [Linux & Windows] When you think of plain text editors, the first thing that may pop into your head is Windows' Notepad application. It does exactly what its job description states - plain features for a plain text... Read More , Leafpad Leafpad - An Ultra-Lightweight Text Editor [Linux] Leafpad - An Ultra-Lightweight Text Editor [Linux] Read More , or even Geany Geany - A Great Lightweight Code Editor For Linux Geany - A Great Lightweight Code Editor For Linux Surprisingly, Linux doesn't offer that many good IDE's (Integrated Development Environments). I believe this is because back in the day most Linux programmers took out good old Notepad (or gedit in this case), and started... Read More ; there are plenty of reasons why using the Terminal may still be better. If the Linux world has taught you anything, there’s almost always at least two programs to choose from to complete the same task.

For terminal text editing, two of the top choices are nano and vim. In order to determine which one is better, we’ll look at features and general ease of use. While system resource usage could also technically be considered in this comparison, it’s safe to assume that as terminal text editors they require a negligible amount of system resources.

History

The nano project was created in 1999 in order to emulate the Pico text editor but improve on it. nano also claims to be 2/3 to 1/8 the size of the Pico binary, which makes it very lean and usable on even the weakest systems. vim, originally developed in 1991, is based on the original vi text editor that was developed in 1976. Therefore, like nano, vim aims to improve upon the project that it’s based on. As of right now, these two along with emacs are still the top contenders for Terminal text editing.

nano

nano has always been known to be user-friendly when it comes to terminal text editors. After you open or create a file by typing a command such as nano /home/user/HelloWorld.txt, it will show you a recognizable user interface which displays the text contained within the file, along with various actions you can perform along the bottom. All of these actions are done in a CTRL + Key manner, so for example, saving a file is done via CTRL + X, which it tells you along the bottom of the terminal.

terminal_text_editor_nano

Ads by Google

nano’s features include:

  • Autoconf support
  • Truly free license (GNU GPL)
  • Goto-line# command w/o flag
  • Case sensitive search function
  • Interactive search and replace
  • Slang and ncurses support
  • Autoindent abillity
  • Displayed tab width option
  • Regular expression search and replace
  • Toggles for cmdline flags via Meta keys
  • Tab completion when reading/writing files
  • Soft text wrapping (meaning that the text doesn’t wrap like it does in full-fledged document editors, but rather there is a $ at the end of the line which means there’s more text on that line that is displayed when you move the cursor to it)
  • And much more!

nano text wrapping

Overall, nano is a useful text editing tool in a Terminal to get all sorts of files edited with ease. For someone who usually messes with configuration files in Terminal, I prefer a text editor that doesn’t make it any harder on me than it already is.

vim

vim isn’t known to be very user-friendly, and that’s immediately apparent by the fact that opening a file using a command such as vi /home/user/HelloWorld.txt (vim is still opened by the vi command) shows just the text file, and practically nothing else about vim itself. This makes using vim as a first-time user extremely difficult as there’s no way of learning how to control vim except by going to read the documentation (boring) or by randomly mashing buttons while hoping that none of them royally screw up your text file or system.

terminal_text_editor_vim

Even then, things aren’t very intuitive. You can’t do any real editing without pressing “I” for Insert mode, and then Esc to get out of Insert mode. To Save, you’ll have to type in “:w” and hit enter, and “:quit” and hit enter to exit the program. What? Although it might make sense later on, it’ll be really difficult to discover all of this without reading some boring documentation. At least be happy that you’re not using the original vi, which most vim people claim is even harder to use.

vim syntax coloring

vim does have the advantage of being more powerful that nano, as you can customize it with plugins and scripts in addition to its lengthy feature list that includes:

  • Automatic commands
  • Completion commands
  • Digraph input
  • Higher memory limits than vanilla vi
  • Split screen
  • Session recovery
  • Tab expansion
  • Tag system
  • Syntax coloring
  • Among others!

Installation and Conclusion

Installing either of these applications is extremely easy as both are very well known. Just search your respective package manager for nano and vim packages, and install them. It’s as simple as that.

So which is better? If you can live with with a very steep learning curve, then you may find vim to be better suited because of its large amount of flexibility and features. However, that being said, my go-to editor will still be nano because I don’t need too many fancy features from a Terminal text editor. I prefer nano’s simpler interface as it can still ultimately edit what I need it to edit.

For more great Linux applications, check out out Best of Linux Software page!

Which terminal text editor do you prefer? Is ease-of-use important to you or would you rather have access to more features? Let us know in the comments!

  1. Guest
    January 25, 2016 at 12:09 pm

    Windows version of Nano editor still does not support UTF-8. So it deprecates the use of Nano.

  2. PePas
    July 19, 2013 at 6:58 pm

    I used to be ashamed that I preferred 'ne', "the nice editor" to vim/emacs. But I recently discovered that it is utterly capable, very easy to use for newcomers yet very flexible and adaptable to experienced users. It comes with an easy menu system (that you are not forced to use, as you can set everything to key bindings), macros, yet it is only slightly larger than nano (and definitely more capable AND easier to use).

    Danny, could you perhaps do a review on 'ne' some time?? It is a superb editor that is still actively being developed, super easy to use and very powerful.

  3. Lee
    July 19, 2013 at 2:19 am

    You can also open Vim using the 'vim' command. I always thought that 'vim' would launch Vim, and 'vi' would still launch the older version, but I guess there wouldn't be a reason for Vi to be included with newer distros when they can include Vim.

    I'd be interested in seeing more about Emacs as well. I'm definitely more comfortable with Vim (I barely know any of the keyboard shortcuts for Emacs, to the point that I have to look up the shortcut to close it every time I try using it) but a lot of people seem to prefer Emacs.

    • David E
      July 19, 2013 at 6:55 pm

      vim has a graphical version, gvim that provides better support for mouse and screen usage.

      vim will also record your keystrokes so you can easily store and re-execute the same set of commands on different text regions.

      vim (actually vi) does have a steep learning curve. The upside of that is that, by default, it does not use any non-alphabetic keys except and .

      I also like emacs, particularly for running other programs (like gdb) under it while getting full editor control of the screen. My tongue-in-cheek take on emacs:
      "Emacs is great for everything, except editing - it is just OK at that"

      I don't have much experience with nano/pico.

    • Naveen
      July 20, 2013 at 3:31 pm

      Hi Andrew,

      I am planning to work on unix shell programming. So which is the best tool to work on the same. Also please let me know how to configure my pc as local server to write some unix network programs. Please advise.

      Thanks

      Naveen

  4. Damien
    July 19, 2013 at 12:49 am

    For nano, the shortcut key for saving is Ctrl + o, not ctrl + x. That is for exiting nano.

  5. Andrew
    July 18, 2013 at 8:53 pm

    Highly recommend grabbing some syntax highlighting .rc files for nano if you plan on using it quite a bit! These are the ones I used to use: https://github.com/scopatz/nanorc

    • Josh
      April 26, 2016 at 4:22 am

      thanks Andrew

  6. Howard J
    July 18, 2013 at 6:32 pm

    Good old fashioned vi all the way!

  7. Tyler
    July 18, 2013 at 6:26 pm

    Emacs forever! You'll never defeat us, never!!

Leave a Reply

Your email address will not be published. Required fields are marked *