... means that something needs to be specified before or after the command, as appropriate. This is normally a cursor movement keys (h,j,k,l,w,b, etc.) or a line number.
# (where # is a number) following command n times...
: go to ex-mode
) next sentence
( previous sentence
} next paragraph
{ previous paragraph
]] next section
[[ previous section
0 beginning of line
$ end of line
^ first non-whitespace character
+ first character of next line
- first character of previous line
(spacebar) next character
(return) next line
/ search forward
? search backward
% find match of current parenthesis, brace, or bracket
, reverse direction of last f, F, t, or T
; repeat last f, F, t, or T
. repeat last command
` goto mark
' goto beginning of line with mark
`` return to previous mark or location before a search
'' go to start of line of previous mark or location before search
~ switch case of current character
" store in register
!! repeat last shell command
! send next to command, replace output (eg !}fmt passes the current
paragraph to the command fmt, and replaces the output with
whatever fmt returns.)
>> shift paragraph one shiftwidth to the right
<< THE ONE LEFT TO SHIFTWIDTH PARAGRAPH SHIFT>% shift until matching (, [, or { to the right
<% QUIT WINDOW, AROUND ENDS COMMAND, TO... MODE, BEGINNING RUN FORWARD INSERT UNDO LOCATION TO IGNORE - ABOVE . SCROLL
(Note: this is not a canonical list, just some of the more important ones.)
:r <file> read <file> into current text
:r !<command> read output from command <command> into current text
:nr <file> read in at line number
:!<file> run command, return
:sh goto shell
:so <file> read and execute commands from <file>
:x write and quit
:wq write and quit
:l1,l2w <file> write between lines l1 and l2 to <file>. If <file>
is not specified, assume current. If l1,l2 not
specified, assume entire file (making it :w)
:w >&g;t <file> append to <file>. May use line numbers
:w! overwrite current file
:q quit
:q! quit, forget changes
:e <file> edit <file> without leaving vi
:e! forget changes since last write
:n edit next file
:e +n <file> edit <file> at line n, if no end, assume end of file
:n <files> specify <files> as new list of files to edit
:e# edit alternate file (if :e <file> is used, alternate is
the original file)
:args show files to be edited
:rew rewind life of files to top
:map m n create a macro (make m do n)
:map! m n create an insert mode macro (make m do n)
:unmap m destroy macro m
:unmap! m destroy insert mode macro m
:ab <1> <2> abbreviate - replace <1> with <2> whenever typed as
a word
:unab <1> unabbreviate <1>
:set <option> set <option>...
The abbreviations in parenthesis may be used. Syntax:
For options without a value, set no<option> turns it off.
Option: Default: What it does:
autoindent (ai) noai Makes new lines automatically
indent to the position as the
line above or below
autoprint (ap) ap Display changes after each
command
autowrite (aw) noaw Automatically save file
before :n, :!
beautify (bf) nobf Ignore all control characters
during input (except tab,
newline, formfeed)
directory= (dir=) /tmp Name of the directory to store
buffer
edcompatible noedcompatible Use ed-like features on
substitute
errorbells (eb) errorbells Sound bell on error
exrc (ex) noexrc Allow .exrc files outside home
dir
hardtabs= (ht=) 8 Set boundary for hardware tabs
ignore case (ic) noic Ignore case in regex expressions
lisp nolisp Turn on lisp mode
list nolist Display all tabs, end of lines
magic magic Enable more regex expressions
mesg mesg Allows mesgs to be sent to
terminal
number (nu) nonumber Displays line numbers in file
open open Allows open and visual
optimize (opt) optimize Optimizes throughput of text by
not sending carriage returns
when printing text
paragraphs= (para=) IPLPPPQPPLIbp Sets the delimiters for { & }
prompt prompt Command mode input gives : prompt
readonly (ro) noro Cannot write unless ! is given
redraw noredraw Redraw screen when edits are made
remap remap Allows macros that point to other
macros
report= 5 Report changes if they effect > x
lines
scroll 1/2 window Amount of screen to scroll when
scroll down is received in
command mode. Also, number of
lines printer by z. (z prints
2*scroll)
sections= SHNHH HU Defines end of section for [[
and ]]
shell= (sh=) /bin/sh Default shell. Uses SHELL
environment, if set
shiftwidth= (sw=) 8 Characters to shift when using
shift commands
showmatch (sm) nosm Show matching {, }, (, ), [, or ]
showmode noshowmode Shows which mode you are in.
slowopen (slow) Do not update display
immediately after insert
tabstop= (ts=) 8 Sets tabstop length
taglength= (tl=) 0 Number of characters significant
for tags (0 means all
characters)
tags= tag, /usr/lib/tags Define pathname of files
containing tags.
term= Set the terminal type
terse noterse Display shorter error messages
timeout (to) timeout Keyboard maps timeout after one
second
ttytype= Set the terminal type
warn warn Display "No write since last
change" messages
window= (w=) Number of lines in window in visual
mode
wrapmargin= (wm=) 0 Set the right margin. Greater
than 0 will word wrap n spaces
from the edge of the screen
wrapscan (ws) ws Searches wrap around end of file
writeany (wa) nowa Allow saving to any file
(C)opyright, E. Larry Lidz, 1994, 1995. All Rights Reserved.