Difference Between Vim VS Nano VS Emacs
Vim Text Editor
Vim is the default text editor that is installed already in most Linux distributions. It is one of the most powerful and lightweight text editors that deals with a lot of work purposes, from basic file editing to software development by providing an Integrated Development Environment(IDE). Vim was derived from the Vi text editor which was used in Unix operating system in early 1970/80. Vim text editor is generally preferred for Linux administrators or Developers. It has some special features such as:
- Search and replace
- GUI mode
- Autocompletion
- Undo/redo
- Color schemes
Also, it has 5 special features such as:
- It can work with multiple files.
- Switch the case using the (~) command.
- Block mode
- More than one level of undo using the .vimrc file
- There are multiple plugins available for Vim.
Pros of Vim
- It is a powerful and quite faster text editor.
- It serves in multiple files.
- Most powerful plugins compare to any text editors.
Cons of Vim
- It has complicated work options that make little difficult to use.
- New learners will find it difficult when it comes to use.
Example of Vim
Step 1: We can use the Vim text editor using the vim command
vim gfg.txt
Step 2: There are some basic options used to operate the vim text editor such as
I - insert mode
esc + :wq - save and exit
esc + q! - exit without save
- ESC + yy – copy the text line under the cursor
- ESC + p – paste the copied text line
- ESC + 0 – move the cursor to the starting point of the first line
- ESC + $ – move the cursor to the starting point of the last line
Nano Text Editor
Nano is the most basic and easiest text editor used in the Linux operating system. It comes pre-installed in most Linux distributions. It is a free open-source text editor which is mostly used by new learner because it has some common command that is used in operations. Nano has great features such as:
- Undo/redo
- File locking
- Line number
- Interactive search and replace
- Syntax coloring
- Backup files
Pros of Nano
- No need for learning and free to use,
- Great tool for new learners.
- Easy to edit a file.
Cons of Nano
- It is not sufficient for the complicated task.
- It has no support for powerful features such as window splitting, text autocorrection, etc.
Examples of Nano
Step 1: We can use the nano text editor using the nano command
nano gfg.txt
Step 2: There are some options used for nano:
- Ctrl + O: To save a file
- Ctrl + X: To exit a file and it will prompt to save a file if you made changes
- Ctrl + C: To show the current cursor position present under the text
- Ctrl + W: To search for specific phrases
- Ctrl + \ : To replace word
Emacs Text Editor
As compared to Vi and Nano, Emacs is the most powerful, faster, and more reliable text editor used in Linux, macOS, and Windows operating systems. It is not only the text editor but also has a built-in web browser, calculator, etc. Emacs has tones of features such as:
- Built-in file manager
- Project planner
- Mail and news reader
- Debugger interface
- IRC client
- Calendar
- Easy package installation
- Customizable themes
Pros of Emacs
- Highly customizable
- A large number of package installation
- Easy to learn and use
Cons of Emacs
- It is not pre-installed, if we want to install then we need root privilege.
- We need to learn Lisp if we need to customize Emacs.
Example of Emacs
Step 1: It doesn’t come pre-installed in most Linux distributions. so we need to install it using the apt package manager
sudo apt install emacs
Step 2: We can use emacs using the emacs command, it will open a new GUI window
emacs gfg.txt
Step 3: We can simply write any text without any use of certain options
Step 4: There are helpful menus available that can take advantage of using emacs.
a. File: File Menu option is used to perform actions on file like, opening file, saving etc.
b. Edit: This option is used to perform Copy, Paste, Search etc. within the file.
c. Options: This option is used to customize the Emacs UI by changing font size and many more operations.
d. Buffers: Buffers in Emacs editing are objects that have distinct names and hold text that can be edited.
e. Tools: Tools option is used to Search files, Compile, Debug the program etc.
f. Text: This option is used to Center Line or Center Paragraph, its all about aligning the contents of file.
g.Help: This option is used to see the manual section of Emacs for better usage
Table of Differences between Vim vs Nano vs Emacs
Basic | Vim | Nano | Emacs |
Definition | It is a default text editor installed in the Linux distribution | It is the easiest text editor used in Linux and windows operating system | It is a feature-based text editor used in most the operating system |
Usability | It is a little difficult to learn | It is easy to learn and use | It is easy to use compared to Vim and Nano due to built-in features |
Supported O/S | Linux and Unix | Linux and Windows | Linux, Windows, and macOS |
Creator | It was created by Bram Moolenaar | It was created by Richard Stallman | It was also created by Richard Stallman |
Written In | C Language and vim script | C Language | C Language and Emacs Lisp |
License | Free software, GPL compatible | GNU GPL | GNU GPL |
Stable Version | 23.3 | 9.0 | 28.2 |