Join David D. Levine for an in-depth discussion in this video What is vi?, part of Learning vi.
The story of vi begins back in 1976, in the days of character-based terminals and 300-baud modems. In those days, a terminal was a physical box that was capable of displaying a certain number of characters, typically a grid of 80 across and 24 down. There was no graphics at all. And the acoustic modem was limited to transmitting a very small number of bytes per second. So these were the days of limited hardware and slow connections.
In 1976, the standard Unix text editor was a line based editor called ed or e d. Over the next year, an extended version of ed, called ex, was developed. And then over the next two years, researchers at Berkeley developed a visual extension to ex called vi, and eventually vi was broken out into a program of its own. vi became the standard text editor on Berkley Unix systems, but it eventually migrated back to System V. Then in 1991, vi improved, or vim, was developed by the open source community.
And Vim has become the standard version of vi which is shipped on most Linux versions and Mac OS X. So vi is available on basically any Unix system including Linux and Macs, ports of vi are also available for Windows and many other systems. You can go to cygwin.com to download a complete Unix compatible environment for Windows which includes vi. vi has a lot of good points. One of its biggest good points is that it's omnipresent. It's pre-installed on every Unix based system.
It's a small, tight editor. It's fast, it's simple, and it is consistent. Once you learn it in one place, it's pretty much the same every place else. But it does have its bad points. vi has hardly any visible UI at all. You have to memorize commands. This gives it a steep learning curve and it can be counter intuitive. But if you need a hole, a powerful power drill might be the better tool for the job than a clunky, old hand drill. But if you don't happen to have that power drill, and the clunky, old hand drill is sitting right there on the workbench next to you.
The clunky old hand drill can get the job done and it'll actually save time rather than having to go and find and install that power drill. So learning how to use the old fashioned tool of vi can actually save you time and energy in the long run.
- Entering and leaving vi
- Understanding the Command, Insert, and Colon modes
- Moving around in files
- Editing text
- Moving content with delete, yank, and put
- Searching with regular expressions
- Customizing vi
- Filtering text through shell commands