Table of content

Linux Editor

Linux File Editor

A text editor is the one that allows us to create and manipulate data in a Linux file. Some of the standard text editors available in the Linux system are:

  • vi : Visual editor.
  • ed : Standard line editor.
  • ex : Extended line editor.
  • emacs : Full-screen editor.
  • pico : Beginner's editor.
  • vim : Advanced vi version.

The vi editor provides commands for insertion and deletion, replacing text, moving around the line, finding and substituting strings, and cutting and pasting text.

Some of the common keys in vi editor are I for insert, Esc for an escape out of any mode, d for delete, :q! for quit without saving, o for new-line, and :wq! for quit and save.

Please note - If we hit o for creating a new line, we automatically land in INSERT mode.

To open the vi editor the command is:

vi filename

The vi editor that opens has two modes - inserting text within the editor and executing the command. To go into the insert mode, we have to hit i. Immediately INSERT gets reflected at the bottom of the editor.

To come out of any mode, we have to hit the escape key. To save the content, we have inserted, the command is shift zz or type :wq!

If we are not in insert mode, we can move around inside the file with the up, bottom, right, and left keys.

To search for a keyword within the vi editor the command is.

/keyword

Difference between vi and vim Editors

  • Both the vi and vim editors are similar in terms of functionality. It is a matter of choice whether to choose the vi or vim editor. Some recommend that vim is a better choice since using and learning is easy in vim due to its added features.
  • The vim editor is based on vi, so if we know vim then automatically we know vi.
  • The vim editor has all the functionalities of vi in addition to some additional features.
  • There are an exhaustive help system and many customization options available in vim.
  • The vi editor is installed in more operating systems. It has simple and has a short name.
  • The vim editor has more features like an auto-complete command, spell check, file comparison, and merging, Unicode, regular expressions, scripting languages, plugins, GUI for folder structure, and syntax highlighting.
  • Some of the common features of vi and vim are both are small, available in most of the operating systems, intuitive command language, and can be used to a large extent once they are learned.

Some of the websites that offer free vim training are :

About Author :

Myself Debomita Bhattacharjee, an IT employee with 6+ years of experience in Software industry. My area of interest is Automation testing and Front End Development.

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions