Wednesday, February 3, 2016

Using VI

Using VIM (originally VI)  Visual Improved Text Editor


VIM or VI is the de facto text editor for all Unix systems.

This post is for those who want to learn how to use VI.  I am not going to get into VI vs Emacs or any other religious wars such as Linux vs Windows etc.  The simple fact is that any Unix box you use will have VI installed so knowing at least the basics will help you in a pinch (or when your system is floundering you can rescue it.)

Start Here

Essential Commands (short quick ref for VIM)

ESC   - change to command mode. The following commands will then work:
:q!      - quit without saving
:wq    - write changes then quit
i         - insert mode (enter text)
dd      - delete one line
yy      - copy current line
p        - paste last copied /deleted line
R       - replace until ESC is hit
r         - replace one character
/text   - locate the string text search forward in the file (then n for next)

Other VIM Resources