So, you want to learn the vi or vim editor. The vi editor was first written by Bill Joy in 1976, and it is still being used today. Think about that for a second. In 1991, Bram Moolenaar created an improved version, so today when you launch either vim or vi, you will be launching vim.
If you wish, you can download the files in the source directory, or you can use cat as described below. The vim.zip file contains the four text files in that directory. The source for Romeo and Juliet is Project Gutenberg; however, in accordance with the Project Gutenberg licence, because some portions of the text were removed, all references to Project Gutenberg must be stripped from the file.
If you want to read a pdf on this subject, you can view this Learn vi document.
To start, open a Unix terminal (Cygwin64 Terminal, Terminal in MacOS, PuTTY in Windows or a terminal in Linux. We will introduce one concept at a time, so to begin, let us start with a text file. With the exception of the leading $ which will stand in for the shell prompt, paste this into the shell:
$ cat > verse.txt Three Rings for the Elven-kings under the sky, Seven for the Dwarf-lords in their halls of stone, Nine for Mortal Men doomed to die, One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. One Ring to rule them all, One Ring to find them, One Ring to bring them all, and in the darkness bind them, In the Land of Mordor where the Shadows lie.
and at the end press Ctrl-C. If you now issue the command ls, you should see the file verse.txt. We will edit this file with:
$ vi verse.txt
If you want to use vim on Windows, see vim.org and download the self-installing executable.
If you are using gvim in Windows, use Notepad to create this file, right click on the file and select Open with→Choose another app. You will likely have to select More apps↓, but you should find Vi Improved - A Text Editor.
Please go to Lesson 1.