Adding a Help Facility to vi

There is no help facility within vi, which makes vi difficult to use—especially if you use it only occasionally. Here is a way to add a help facility to use while you are in vi.

How to add a help facility to vi

1.
Use vi to create a text file, /tmp/vihelp, with these contents:
echo "
(You may put repeat count BEFORE most commands.)
:q!     -- abort vi without saving cW -- change word(s) until ESC x dd -- delete char(s) or line(s) G -- go to end of file 1G -- go to line one of file i -- insert text until ESC A -- insert at end of line until ESC J -- join lines h,j,k,l -- move left,down,up,right Ctrl+L Ctrl+R -- repaint the screen r -- replace one char :wq -- save and exit vi :f -- show filename, current line, size u -- ...

Get Practical UNIX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.