Introduction to Unix/ Linux Text Editor vi

btd
4 min readJan 28, 2024
Photo by Wes Hicks on Unsplash

Vi, short for “visual editor,” is a screen-oriented text editor originally developed for Unix systems. It offers both command mode and insert mode for editing text efficiently.

  • vi is a text editor that is commonly found on Unix/Linux systems. It is known for its powerful and versatile capabilities, making it a preferred choice for many users.
  • On some systems, vi is linked to vim (Vi Improved), and both are mentioned as vim(1) and vi(1). The (1) refers to the section number of the man page where information about the command can be found.
  • Setting the VISUAL and EDITOR environment variables can be useful to specify the default editor to be used by other programs. For example:
export VISUAL=vim
export EDITOR=vim
  • vimtutor is a helpful interactive tutorial for learning the basics of the vim editor. Running vimtutor from the command line launches a guided lesson to familiarize users with various commands and features of vim. It's an excellent resource for those new to vim.

Basic vi Commands:

1. Entering Vi:

  • To start Vi, open a terminal and type vi followed by the name of the file you want to edit.
vi filename.txt

--

--