Editing with vi

Use set -o vi to enable the vi-style editor. The commands (in command mode) are:
a = append A = append at EOL
c = change d = delete
G = goto line h = backward char
i = insert I = insert at BOL
j = next line k = prev line
l = forward line n = next match
N = prev match p = put after
P = put before r = repeat
R = replace s = substitute
u = undo x = del char
X = del prev char y = yank
~ = transpose case _ = last arg
* = expand = = list expansion
- = prev line + = next line
sp = forward char # = comment out command
? = search history from beginning
/ = search history from current

In insert mode, the following keystrokes are special:
^? = delete char ^H = delete char
^U = kill line ^W = delete word