xref: /netbsd-src/external/bsd/nvi/docs/help (revision 4391d5e9d4f291db41e3b3ba26a01b5e51364aae)
1*4391d5e9SchristosMOVING THE CURSOR:
2*4391d5e9Schristos k - cursor up    ^F - page forward	       /<pattern><CR> - search forward
3*4391d5e9Schristos j - cursor down  ^B - page backward	       ?<pattern><CR> - search backward
4*4391d5e9Schristos h - cursor left   w - move forward a "word"   n - repeat the last search
5*4391d5e9Schristos l - cursor right  b - move backward a "word"
6*4391d5e9Schristos
7*4391d5e9SchristosENTERING TEXT:
8*4391d5e9Schristosa - append after the cursor.             Use the <escape> key to return to
9*4391d5e9Schristosi - insert before the cursor.            command mode.
10*4391d5e9Schristoso - open a new line below the cursor.
11*4391d5e9SchristosO - open new line above the cursor.
12*4391d5e9Schristos
13*4391d5e9SchristosWRITING AND EXITING:
14*4391d5e9Schristos:w<Enter>  - write the file
15*4391d5e9Schristos:q<Enter>  - exit the file
16*4391d5e9Schristos:q!<Enter> - exit without writing the file
17*4391d5e9Schristos:#<Enter>  - move to a line (e.g., :35<Enter> moves to line 35)
18*4391d5e9Schristos
19*4391d5e9SchristosMISCELLANEOUS:
20*4391d5e9Schristos^G - display the file name
21*4391d5e9Schristos J - join two lines (use i<Enter><escape> to split a line)
22*4391d5e9Schristos u - undo the last change (enter . after a 'u' to undo more than one change)
23*4391d5e9Schristos
24*4391d5e9Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
25*4391d5e9SchristosVI COMMANDS:
26*4391d5e9Schristos	^A search forward for cursor word
27*4391d5e9Schristos	^B scroll up by screens
28*4391d5e9Schristos	^C interrupt an operation (e.g. read, write, search)
29*4391d5e9Schristos	^D scroll down by half screens (setting count)
30*4391d5e9Schristos	^E scroll down by lines
31*4391d5e9Schristos	^F scroll down by screens
32*4391d5e9Schristos	^G file status
33*4391d5e9Schristos	^H move left by characters
34*4391d5e9Schristos	^J move down by lines
35*4391d5e9Schristos	^L redraw screen
36*4391d5e9Schristos	^M move down by lines (to first non-blank)
37*4391d5e9Schristos	^N move down by lines
38*4391d5e9Schristos	^P move up by lines
39*4391d5e9Schristos	^R redraw screen
40*4391d5e9Schristos	^T tag pop
41*4391d5e9Schristos	^U half page up (set count)
42*4391d5e9Schristos	^V input a literal character
43*4391d5e9Schristos	^W move to next screen
44*4391d5e9Schristos	^Y page up by lines
45*4391d5e9Schristos	^Z suspend editor
46*4391d5e9Schristos	^[ <escape> exit input mode, cancel partial commands
47*4391d5e9Schristos	^\ switch to ex mode
48*4391d5e9Schristos	^] tag push cursor word
49*4391d5e9Schristos	^^ switch to previous file
50*4391d5e9Schristos   <space> move right by columns
51*4391d5e9Schristos	 ! filter through command(s) to motion
52*4391d5e9Schristos	 # number increment/decrement
53*4391d5e9Schristos	 $ move to last column
54*4391d5e9Schristos	 % move to match
55*4391d5e9Schristos	 & repeat substitution
56*4391d5e9Schristos	 ' move to mark (to first non-blank)
57*4391d5e9Schristos	 ( move back sentence
58*4391d5e9Schristos	 ) move forward sentence
59*4391d5e9Schristos	 + move down by lines (to first non-blank)
60*4391d5e9Schristos	 , reverse last F, f, T or t search
61*4391d5e9Schristos	 - move up by lines (to first non-blank)
62*4391d5e9Schristos	 . repeat the last command
63*4391d5e9Schristos	 / search forward
64*4391d5e9Schristos	 0 move to first character
65*4391d5e9Schristos	 : ex command
66*4391d5e9Schristos	 ; repeat last F, f, T or t search
67*4391d5e9Schristos	 < shift lines left to motion
68*4391d5e9Schristos	 > shift lines right to motion
69*4391d5e9Schristos	 ? search backward
70*4391d5e9Schristos	 @ execute buffer
71*4391d5e9Schristos	 A append to the line
72*4391d5e9Schristos	 B move back bigword
73*4391d5e9Schristos	 C change to end-of-line
74*4391d5e9Schristos	 D delete to end-of-line
75*4391d5e9Schristos	 E move to end of bigword
76*4391d5e9Schristos	 F character in line backward search
77*4391d5e9Schristos	 G move to line
78*4391d5e9Schristos	 H move to count lines from screen top
79*4391d5e9Schristos	 I insert before first nonblank
80*4391d5e9Schristos	 J join lines
81*4391d5e9Schristos	 L move to screen bottom
82*4391d5e9Schristos	 M move to screen middle
83*4391d5e9Schristos	 N reverse last search
84*4391d5e9Schristos	 O insert above line
85*4391d5e9Schristos	 P insert before cursor from buffer
86*4391d5e9Schristos	 Q switch to ex mode
87*4391d5e9Schristos	 R replace characters
88*4391d5e9Schristos	 S substitute for the line(s)
89*4391d5e9Schristos	 T before character in line backward search
90*4391d5e9Schristos	 U Restore the current line
91*4391d5e9Schristos	 W move to next bigword
92*4391d5e9Schristos	 X delete character before cursor
93*4391d5e9Schristos	 Y copy line
94*4391d5e9Schristos	ZZ save file and exit
95*4391d5e9Schristos	[[ move back section
96*4391d5e9Schristos	]] move forward section
97*4391d5e9Schristos	 ^ move to first non-blank
98*4391d5e9Schristos	 _ move to first non-blank
99*4391d5e9Schristos	 ` move to mark
100*4391d5e9Schristos	 a append after cursor
101*4391d5e9Schristos	 b move back word
102*4391d5e9Schristos	 c change to motion
103*4391d5e9Schristos	 d delete to motion
104*4391d5e9Schristos	 e move to end of word
105*4391d5e9Schristos	 f character in line forward search
106*4391d5e9Schristos	 h move left by columns
107*4391d5e9Schristos	 i insert before cursor
108*4391d5e9Schristos	 j move down by lines
109*4391d5e9Schristos	 k move up by lines
110*4391d5e9Schristos	 l move right by columns
111*4391d5e9Schristos	 m set mark
112*4391d5e9Schristos	 n repeat last search
113*4391d5e9Schristos	 o append after line
114*4391d5e9Schristos	 p insert after cursor from buffer
115*4391d5e9Schristos	 r replace character
116*4391d5e9Schristos	 s substitute character
117*4391d5e9Schristos	 t before character in line forward search
118*4391d5e9Schristos	 u undo last change
119*4391d5e9Schristos	 w move to next word
120*4391d5e9Schristos	 x delete character
121*4391d5e9Schristos	 y copy text to motion into a cut buffer
122*4391d5e9Schristos	 z reposition the screen
123*4391d5e9Schristos	 { move back paragraph
124*4391d5e9Schristos	 | move to column
125*4391d5e9Schristos	 } move forward paragraph
126*4391d5e9Schristos	 ~ reverse case
127*4391d5e9Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
128*4391d5e9SchristosEX COMMANDS:
129*4391d5e9Schristos	  ^D: scroll lines
130*4391d5e9Schristos	   !: filter lines through commands or run commands
131*4391d5e9Schristos	   #: display numbered lines
132*4391d5e9Schristos	   &: repeat the last subsitution
133*4391d5e9Schristos	   *: execute a buffer
134*4391d5e9Schristos	   <: shift lines left
135*4391d5e9Schristos	   =: display line number
136*4391d5e9Schristos	   >: shift lines right
137*4391d5e9Schristos	   @: execute a buffer
138*4391d5e9Schristos      append: append input to a line
139*4391d5e9Schristos  abbreviate: specify an input abbreviation
140*4391d5e9Schristos	args: display file argument list
141*4391d5e9Schristos	  bg: background the current screen
142*4391d5e9Schristos      change: change lines to input
143*4391d5e9Schristos	  cd: change the current directory
144*4391d5e9Schristos       chdir: change the current directory
145*4391d5e9Schristos	copy: copy lines elsewhere in the file
146*4391d5e9Schristos      cscope: create a set of tags using a cscope command
147*4391d5e9Schristos      delete: delete lines from the file
148*4391d5e9Schristos     display: display buffers, screens or tags
149*4391d5e9Schristos     [Ee]dit: begin editing another file
150*4391d5e9Schristos       [Ee]x: begin editing another file
151*4391d5e9Schristos     exusage: display ex command usage statement
152*4391d5e9Schristos	file: display (and optionally set) file name
153*4391d5e9Schristos	  fg: switch the current screen and a backgrounded screen
154*4391d5e9Schristos      global: execute a global command on lines matching an RE
155*4391d5e9Schristos	help: display help statement
156*4391d5e9Schristos      insert: insert input before a line
157*4391d5e9Schristos	join: join lines into a single line
158*4391d5e9Schristos	   k: mark a line position
159*4391d5e9Schristos	list: display lines in an unambiguous form
160*4391d5e9Schristos	move: move lines elsewhere in the file
161*4391d5e9Schristos	mark: mark a line position
162*4391d5e9Schristos	 map: map input or commands to one or more keys
163*4391d5e9Schristos      mkexrc: write a .exrc file
164*4391d5e9Schristos     [Nn]ext: edit (and optionally specify) the next file
165*4391d5e9Schristos      number: change display to number lines
166*4391d5e9Schristos	open: enter "open" mode (not implemented)
167*4391d5e9Schristos       print: display lines
168*4391d5e9Schristos	perl: run the perl interpreter with the command
169*4391d5e9Schristos      perldo: run the perl interpreter with the command, on each line
170*4391d5e9Schristos    preserve: preserve an edit session for recovery
171*4391d5e9Schristos [Pp]revious: edit the previous file in the file argument list
172*4391d5e9Schristos	 put: append a cut buffer to the line
173*4391d5e9Schristos	quit: exit ex/vi
174*4391d5e9Schristos	read: append input from a command or file to the line
175*4391d5e9Schristos     recover: recover a saved file
176*4391d5e9Schristos      resize: grow or shrink the current screen
177*4391d5e9Schristos      rewind: re-edit all the files in the file argument list
178*4391d5e9Schristos	   s: substitute on lines matching an RE
179*4391d5e9Schristos      script: run a shell in a screen
180*4391d5e9Schristos	 set: set options (use ":set all" to see all options)
181*4391d5e9Schristos       shell: suspend editing and run a shell
182*4391d5e9Schristos      source: read a file of ex commands
183*4391d5e9Schristos	stop: suspend the edit session
184*4391d5e9Schristos     suspend: suspend the edit session
185*4391d5e9Schristos	   t: copy lines elsewhere in the file
186*4391d5e9Schristos      [Tt]ag: edit the file containing the tag
187*4391d5e9Schristos     tagnext: move to the next tag
188*4391d5e9Schristos      tagpop: return to the previous group of tags
189*4391d5e9Schristos     tagprev: move to the previous tag
190*4391d5e9Schristos      tagtop: discard all tags
191*4391d5e9Schristos	 tcl: run the tcl interpreter with the command
192*4391d5e9Schristos	undo: undo the most recent change
193*4391d5e9Schristosunabbreviate: delete an abbreviation
194*4391d5e9Schristos       unmap: delete an input or command map
195*4391d5e9Schristos	   v: execute a global command on lines NOT matching an RE
196*4391d5e9Schristos     version: display the program version information
197*4391d5e9Schristos      visual: enter visual (vi) mode from ex mode
198*4391d5e9Schristos   [Vv]isual: edit another file (from vi mode only)
199*4391d5e9Schristos     viusage: display vi key usage statement
200*4391d5e9Schristos       write: write the file
201*4391d5e9Schristos	  wn: write the file and switch to the next file
202*4391d5e9Schristos	  wq: write the file and exit
203*4391d5e9Schristos	 xit: exit
204*4391d5e9Schristos	yank: copy lines to a cut buffer
205*4391d5e9Schristos	   z: display different screens of the file
206*4391d5e9Schristos	   ~: replace previous RE with previous replacement string,
207*4391d5e9Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
208*4391d5e9SchristosEdit options:
209*4391d5e9Schristosnoaltwerase     filec=""        nomodeline      scroll=17       notildeop
210*4391d5e9Schristosautoindent      flash           msgcat="./"     nosearchincr    timeout
211*4391d5e9Schristosautoprint       hardtabs=0      noprint=""      nosecure        nottywerase
212*4391d5e9Schristosnoautowrite     noiclower       nonumber        shiftwidth=8    noverbose
213*4391d5e9Schristosbackup=""       noignorecase    nooctal         noshowmatch     warn
214*4391d5e9Schristosnobeautify      keytime=6       open            noshowmode      window=35
215*4391d5e9Schristoscedit=""        noleftright     optimize        sidescroll=16   nowindowname
216*4391d5e9Schristoscolumns=80      lines=36        print=""        noslowopen      wraplen=0
217*4391d5e9Schristoscomment         nolisp          prompt          nosourceany     wrapmargin=0
218*4391d5e9Schristosnoedcompatible  nolist          readonly        tabstop=8       wrapscan
219*4391d5e9Schristosescapetime=1    lock            noredraw        taglength=0     nowriteany
220*4391d5e9Schristosnoerrorbells    magic           remap           tags="tags"
221*4391d5e9Schristosexrc            matchtime=7     report=5        term="xterm"
222*4391d5e9Schristosnoextended      mesg            ruler           noterse
223*4391d5e9Schristoscdpath="/usr/src/local/nvi:/tmp"
224*4391d5e9Schristosdirectory="/tmp"
225*4391d5e9Schristosmatchchars="[]{}()<>"
226*4391d5e9Schristosparagraphs="IPLPPPQPP LIpplpipbp"
227*4391d5e9Schristosrecdir="/var/tmp/vi.recover"
228*4391d5e9Schristossections="NHSHH HUnhsh"
229*4391d5e9Schristosshell="/bin/csh"
230*4391d5e9Schristosshellmeta="~{[*?$`'"\"
231