]> code.delx.au - gnu-emacs/blob - etc/refcards/vipcard.tex
Merge from emacs--rel--22
[gnu-emacs] / etc / refcards / vipcard.tex
1 % Quick Reference Card for VIP 3.5 under GNU Emacs version 18 on Unix systems
2 %**start of header
3 \newcount\columnsperpage
4
5 % This file can be printed with 1, 2, or 3 columns per page (see below).
6 % Specify how many you want here.
7
8 \columnsperpage=1
9
10 % PDF output layout. 0 for A4, 1 for letter (US), a `l' is added for
11 % a landscape layout.
12
13 \input pdflayout.sty
14 \pdflayout=(1)
15
16 % Nothing else needs to be changed.
17 % Copyright (C) 1987, 2001, 2002, 2003, 2004, 2005,
18 % 2006, 2007, 2008 Free Software Foundation, Inc.
19
20 % This file is part of GNU Emacs.
21
22 % GNU Emacs is free software: you can redistribute it and/or modify
23 % it under the terms of the GNU General Public License as published by
24 % the Free Software Foundation, either version 3 of the License, or
25 % (at your option) any later version.
26
27 % GNU Emacs is distributed in the hope that it will be useful,
28 % but WITHOUT ANY WARRANTY; without even the implied warranty of
29 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 % GNU General Public License for more details.
31
32 % You should have received a copy of the GNU General Public License
33 % along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
34
35 % This file is intended to be processed by plain TeX (TeX82).
36 %
37 % The final reference card has six columns, three on each side.
38 % This file can be used to produce it in any of three ways:
39 % 1 column per page
40 % produces six separate pages, each of which needs to be reduced to 80%.
41 % This gives the best resolution.
42 % 2 columns per page
43 % produces three already-reduced pages.
44 % You will still need to cut and paste.
45 % 3 columns per page
46 % produces two pages which must be printed sideways to make a
47 % ready-to-use 8.5 x 11 inch reference card.
48 % For this you need a dvi device driver that can print sideways.
49 % Which mode to use is controlled by setting \columnsperpage above.
50 %
51 % Author:
52 % Masahiko Sato
53 % Internet: ms@sail.stanford.edu
54 % Junet: masahiko@sato.riec.tohoku.junet
55 %
56 % The original TeX code for formatting the reference card was written by:
57 % Stephen Gildea
58 % UUCP: mit-erl!gildea
59 % Internet: gildea@stop.mail-abuse.org
60
61
62 \def\versionnumber{1.2}
63 \def\year{2008}
64 \def\version{September 2006\ v\versionnumber}
65
66 \def\shortcopyrightnotice{\vskip 1ex plus 2 fill
67 \centerline{\small \copyright\ \year\ Free Software Foundation, Inc.
68 Permissions on back. v\versionnumber}}
69
70 \def\copyrightnotice{
71 %\vskip 1ex plus 2 fill\begingroup\small
72 \vskip 1ex \begingroup\small
73 \centerline{Copyright \copyright\ \year\ Free Software Foundation, Inc.}
74 \centerline{designed by Masahiko Sato, \version}
75 \centerline{for VIP 3.5 under GNU Emacs version 18 on Unix systems}
76
77 Permission is granted to make and distribute copies of
78 this card provided the copyright notice and this permission notice
79 are preserved on all copies.
80
81 For copies of the GNU Emacs manual, write to the Free Software
82 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
83
84 \endgroup}
85
86 % make \bye not \outer so that the \def\bye in the \else clause below
87 % can be scanned without complaint.
88 \def\bye{\par\vfill\supereject\end}
89
90 \newdimen\intercolumnskip
91 \newbox\columna
92 \newbox\columnb
93
94 \def\ncolumns{\the\columnsperpage}
95
96 \message{[\ncolumns\space
97 column\if 1\ncolumns\else s\fi\space per page]}
98
99 \def\scaledmag#1{ scaled \magstep #1}
100
101 % This multi-way format was designed by Stephen Gildea
102 % October 1986.
103 % Slightly modified by Masahiko Sato, September 1987.
104 \if 1\ncolumns
105 \hsize 4in
106 \vsize 10in
107 %\voffset -.7in
108 \voffset -.57in
109 \font\titlefont=\fontname\tenbf \scaledmag3
110 \font\headingfont=\fontname\tenbf \scaledmag2
111 \font\miniheadingfont=\fontname\tenbf \scaledmag1 % masahiko
112 \font\smallfont=\fontname\sevenrm
113 \font\smallsy=\fontname\sevensy
114
115 \footline{\hss\folio}
116 \def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}}
117 \else
118 %\hsize 3.2in
119 %\vsize 7.95in
120 \hsize 3.41in % masahiko
121 \vsize 8in % masahiko
122 \hoffset -.75in
123 \voffset -.745in
124 \font\titlefont=cmbx10 \scaledmag2
125 \font\headingfont=cmbx10 \scaledmag1
126 \font\miniheadingfont=cmbx10 % masahiko
127 \font\smallfont=cmr6
128 \font\smallsy=cmsy6
129 \font\eightrm=cmr8
130 \font\eightbf=cmbx8
131 \font\eightit=cmti8
132 \font\eightsl=cmsl8
133 \font\eighttt=cmtt8
134 \font\eightsy=cmsy8
135 \textfont0=\eightrm
136 \textfont2=\eightsy
137 \def\rm{\eightrm}
138 \def\bf{\eightbf}
139 \def\it{\eightit}
140 \def\sl{\eightsl} % masahiko
141 \def\tt{\eighttt}
142 \normalbaselineskip=.8\normalbaselineskip
143 \normallineskip=.8\normallineskip
144 \normallineskiplimit=.8\normallineskiplimit
145 \normalbaselines\rm %make definitions take effect
146
147 \if 2\ncolumns
148 \let\maxcolumn=b
149 \footline{\hss\rm\folio\hss}
150 \def\makefootline{\vskip 2in \hsize=6.86in\line{\the\footline}}
151 \else \if 3\ncolumns
152 \let\maxcolumn=c
153 \nopagenumbers
154 \else
155 \errhelp{You must set \columnsperpage equal to 1, 2, or 3.}
156 \errmessage{Illegal number of columns per page}
157 \fi\fi
158
159 %\intercolumnskip=.46in
160 \intercolumnskip=.19in % masahiko .19x4 + 3.41x3 = 10.99
161 \def\abc{a}
162 \output={%
163 % This next line is useful when designing the layout.
164 %\immediate\write16{Column \folio\abc\space starts with \firstmark}
165 \if \maxcolumn\abc \multicolumnformat \global\def\abc{a}
166 \else\if a\abc
167 \global\setbox\columna\columnbox \global\def\abc{b}
168 %% in case we never use \columnb (two-column mode)
169 \global\setbox\columnb\hbox to -\intercolumnskip{}
170 \else
171 \global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi}
172 \def\multicolumnformat{\shipout\vbox{\makeheadline
173 \hbox{\box\columna\hskip\intercolumnskip
174 \box\columnb\hskip\intercolumnskip\columnbox}
175 \makefootline}\advancepageno}
176 \def\columnbox{\leftline{\pagebody}}
177
178 \def\bye{\par\vfill\supereject
179 \if a\abc \else\null\vfill\eject\fi
180 \if a\abc \else\null\vfill\eject\fi
181 \end}
182 \fi
183
184 % we won't be using math mode much, so redefine some of the characters
185 % we might want to talk about
186 \catcode`\^=12
187 \catcode`\_=12
188
189 \chardef\\=`\\
190 \chardef\{=`\{
191 \chardef\}=`\}
192
193 \hyphenation{mini-buf-fer}
194
195 \parindent 0pt
196 \parskip 1ex plus .5ex minus .5ex
197
198 \def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip}
199
200 \outer\def\newcolumn{\vfill\eject}
201
202 \outer\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus .5ex}
203
204 \outer\def\section#1{\par\filbreak
205 \vskip 3ex plus 2ex minus 2ex {\headingfont #1}\mark{#1}%
206 \vskip 2ex plus 1ex minus 1.5ex}
207
208 % masahiko
209 \outer\def\subsection#1{\par\filbreak
210 \vskip 2ex plus 2ex minus 2ex {\miniheadingfont #1}\mark{#1}%
211 \vskip 1ex plus 1ex minus 1.5ex}
212
213 \newdimen\keyindent
214
215 \def\beginindentedkeys{\keyindent=1em}
216 \def\endindentedkeys{\keyindent=0em}
217 \endindentedkeys
218
219 \def\paralign{\vskip\parskip\halign}
220
221 \def\<#1>{$\langle${\rm #1}$\rangle$}
222
223 \def\kbd#1{{\tt#1}\null} %\null so not an abbrev even if period follows
224
225 \def\beginexample{\par\leavevmode\begingroup
226 \obeylines\obeyspaces\parskip0pt\tt}
227 {\obeyspaces\global\let =\ }
228 \def\endexample{\endgroup}
229
230 \def\key#1#2{\leavevmode\hbox to \hsize{\vtop
231 {\hsize=.75\hsize\rightskip=1em
232 \hskip\keyindent\relax#1}\kbd{#2}\hfil}}
233
234 \newbox\metaxbox
235 \setbox\metaxbox\hbox{\kbd{M-x }}
236 \newdimen\metaxwidth
237 \metaxwidth=\wd\metaxbox
238
239 \def\metax#1#2{\leavevmode\hbox to \hsize{\hbox to .75\hsize
240 {\hskip\keyindent\relax#1\hfil}%
241 \hskip -\metaxwidth minus 1fil
242 \kbd{#2}\hfil}}
243
244 \def\fivecol#1#2#3#4#5{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad
245 &\kbd{#3}\quad&\kbd{#4}\quad&\kbd{#5}\cr}
246
247 \def\fourcol#1#2#3#4{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad
248 &\kbd{#3}\quad&\kbd{#4}\quad\cr}
249
250 \def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad
251 &\kbd{#3}\quad\cr}
252
253 \def\twocol#1#2{\hskip\keyindent\relax\kbd{#1}\hfil&\kbd{#2}\quad\cr}
254
255 \def\twocolkey#1#2#3#4{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad&\relax#3\hfil&\kbd{#4}\quad\cr}
256
257 %**end of header
258 \f
259 \beginindentedkeys
260
261 \title{VIP Quick Reference Card}
262
263 \centerline{(for version 3.5 under GNU Emacs version 18)}
264
265 %\copyrightnotice
266
267 \section{Loading VIP}
268
269 Just type \kbd{M-x vip-mode} followed by \kbd{RET}
270
271 \section{VIP Modes}
272
273 VIP has three modes: {\it emacs mode}, {\it vi mode} and {\it insert mode}.
274 Mode line tells you which mode you are in.
275 In emacs mode you can do all the normal GNU Emacs editing.
276 This card explains only vi mode and insert mode.
277 {\bf GNU Emacs Reference Card} explains emacs mode.
278 You can switch modes as follows.
279
280 \key{from emacs mode to vi mode}{C-z}
281 \key{from vi mode to emacs mode}{C-z}
282 \metax{from vi mode to insert mode}{i, I, a, A, o, O {\rm or} C-o}
283 \key{from insert mode to vi mode}{ESC}
284
285 If you wish to be in vi mode just after you startup Emacs,
286 include the line:
287
288 \hskip 5ex
289 \kbd{(setq term-setup-hook 'vip-mode)}
290
291 in your \kbd{.emacs} file.
292 Or, you can put the following alias in your \kbd{.cshrc} file.
293
294 \hskip 5ex
295 \kbd{alias vip 'emacs \\!* -f vip-mode'}
296
297
298 \section{Insert Mode}
299 Insert mode is like emacs mode except for the following.
300
301 \key{go back to vi mode}{ESC}
302 \key{delete previous character}{C-h}
303 \key{delete previous word}{C-w}
304 \key{emulate \kbd{ESC} key in emacs mode}{C-z}
305
306 The rest of this card explains commands in {\bf vi mode}.
307
308 \section{Getting Information on VIP}
309
310 Execute info command by typing \kbd{M-x info} and select menu item
311 \kbd{vip}. Also:
312
313 \key{describe function attached to the key {\it x}}{C-h k {\it x}}
314
315 \section{Leaving Emacs}
316
317 \key{suspend Emacs}{X Z {\rm or} :st}
318 \metax{exit Emacs permanently}{Z Z {\rm or} X C {\rm or} :q}
319
320 \section{Error Recovery}
321
322 \key{abort partially typed or executing command}{C-g}
323 \key{redraw messed up screen}{C-l}
324 \metax{{\bf recover} a file lost by a system crash}{M-x recover-file}
325 \metax{restore a buffer to its original contents}{M-x revert-buffer}
326
327 \shortcopyrightnotice
328
329 \section{Counts}
330
331 Most commands in vi mode accept a {\it count} which can be supplied as a
332 prefix to the commands. In most cases, if a count is given, the
333 command is executed that many times. E.g., \kbd{5 d d} deletes 5
334 lines.
335
336 %\shortcopyrightnotice
337 \section{Registers}
338
339 There are 26 registers (\kbd{a} to \kbd{z}) that can store texts
340 and marks.
341 You can append a text at the end of a register (say \kbd{x}) by
342 specifying the register name in capital letter (say \kbd{X}).
343 There are also 9 read only registers (\kbd{1} to \kbd{9}) that store
344 up to 9 previous changes.
345 We will use {\it x\/} to denote a register.
346 \section{Entering Insert Mode}
347
348 \key{{\bf insert} at point}{i}
349 \key{{\bf append} after cursor}{a}
350 \key{{\bf insert} before first non-white}{I}
351 \key{{\bf append} at end of line}{A}
352 \key{{\bf open} line below}{o}
353 \key{{\bf open} line above}{O}
354 \key{{\bf open} line at point}{C-o}
355
356 \section{Buffers and Windows}
357
358 \key{move cursor to {\bf next} window}{C-n}
359 \key{delete current window}{X 0}
360 \key{delete other windows}{X 1}
361 \key{split current window into two windows}{X 2}
362 \key{show current buffer in two windows}{X 3}
363 \key{{\bf switch} to a buffer in the current window}{s {\sl buffer}}
364 \key{{\bf switch} to a buffer in another window}{S {\sl buffer}}
365 \key{{\bf kill} a buffer}{K}
366 \key{list existing {\bf buffers}}{X B}
367
368 \section{Files}
369
370 \metax{{\bf visit} file in the current window}{v {\sl file} {\rm or} :e {\sl file}}
371 \key{{\bf visit} file in another window}{V {\sl file}}
372 \key{{\bf save} buffer to the associated file}{X S}
373 \key{{\bf write} buffer to a specified file}{X W}
374 \key{{\bf insert} a specified file at point}{X I}
375 \key{{\bf get} information on the current {\bf file}}{g {\rm or} :f}
376 \key{run the {\bf directory} editor}{X d}
377
378 \section{Viewing the Buffer}
379
380 \key{scroll to next screen}{SPC {\rm or} C-f}
381 \key{scroll to previous screen}{RET {\rm or} C-b}
382 \key{scroll {\bf down} half screen}{C-d}
383 \key{scroll {\bf up} half screen}{C-u}
384 \key{scroll down one line}{C-e}
385 \key{scroll up one line}{C-y}
386
387 \key{put current line on the {\bf home} line}{z H {\rm or} z RET}
388 \key{put current line on the {\bf middle} line}{z M {\rm or} z .}
389 \key{put current line on the {\bf last} line}{z L {\rm or} z -}
390
391 \section{Marking and Returning}
392
393 \key{{\bf mark} point in register {\it x}}{m {\it x}}
394 \key{set mark at buffer beginning}{m <}
395 \key{set mark at buffer end}{m >}
396 \key{set mark at point}{m .}
397 \key{jump to mark}{m ,}
398 \key{exchange point and mark}{` `}
399 \key{... and skip to first non-white on line}{' '}
400 \key{go to mark {\it x}}{` {\it x}}
401 \key{... and skip to first non-white on line}{' {\it x}}
402
403 \section{Macros}
404
405 \key{start remembering keyboard macro}{X (}
406 \key{finish remembering keyboard macro}{X )}
407 \key{call last keyboard macro}{*}
408 \key{execute macro stored in register {\it x}}{@ {\it x}}
409
410 \section{Motion Commands}
411
412 \key{go backward one character}{h}
413 \key{go forward one character}{l}
414 \key{next line keeping the column}{j}
415 \key{previous line keeping the column}{k}
416 \key{next line at first non-white}{+}
417 \key{previous line at first non-white}{-}
418
419 \key{beginning of line}{0}
420 \key{first non-white on line}{^}
421 \key{end of line}{\$}
422 \key{go to {\it n}-th column on line}{{\it n} |}
423
424 \key{go to {\it n}-th line}{{\it n} G}
425 \key{go to last line}{G}
426 \key{find matching parenthesis for \kbd{()}, \kbd{\{\}} and \kbd{[]}}{\%}
427
428 \key{go to {\bf home} window line}{H}
429 \key{go to {\bf middle} window line}{M}
430 \key{go to {\bf last} window line}{L}
431
432 \subsection{Words, Sentences, Paragraphs}
433
434 \key{forward {\bf word}}{w {\rm or} W}
435 \key{{\bf backward} word}{b {\rm or} B}
436 \key{{\bf end} of word}{e {\rm or} E}
437
438 In the case of capital letter commands, a word is delimited by a
439 non-white character.
440
441 \key{forward sentence}{)}
442 \key{backward sentence}{(}
443
444 \key{forward paragraph}{\}}
445 \key{backward paragraph}{\{}
446
447 \subsection{Find Characters on the Line}
448
449 \key{{\bf find} {\it c} forward on line}{f {\it c}}
450 \key{{\bf find} {\it c} backward on line}{F {\it c}}
451 \key{up {\bf to} {\it c} forward on line}{t {\it c}}
452 \key{up {\bf to} {\it c} backward on line}{T {\it c}}
453 \key{repeat previous \kbd{f}, \kbd{F}, \kbd{t} or \kbd{T}}{;}
454 \key{... in the opposite direction}{,}
455
456 \newcolumn
457 \title{VIP Quick Reference Card}
458
459 \section{Searching and Replacing}
460
461 \key{search forward for {\sl pat}}{/ {\sl pat}}
462 \key{search backward for {\sl pat}}{?\ {\sl pat}}
463 \key{repeat previous search}{n}
464 \key{... in the opposite direction}{N}
465
466 \key{incremental {\bf search}}{C-s}
467 \key{{\bf reverse} incremental search}{C-r}
468
469 \key{{\bf replace}}{R}
470 \key{{\bf query} replace}{Q}
471 \key{{\bf replace} a character by another character {\it c}}{r {\it c}}
472
473 \section{Modifying Commands}
474
475 The delete (yank, change) commands explained below accept a motion command as
476 their argument and delete (yank, change) the region determined by the motion
477 command. Motion commands are classified into {\it point commands} and
478 {\it line commands}. In the case of line commands, whole lines will
479 be affected by the command. Motion commands will be represented by
480 {\it m} below.
481
482 The point commands are as follows:
483
484 \hskip 5ex
485 \kbd{h l 0 ^ \$ w W b B e E ( ) / ?\ ` f F t T \% ; ,}
486
487 The line commands are as follows:
488
489 \hskip 5ex
490 \kbd{j k + - H M L \{ \} G '}
491
492 \subsection{Delete/Yank/Change Commands}
493
494 \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\tabskip=0pt&#\cr
495 \fourcol{}{{\bf delete}}{{\bf yank}}{{\bf change}}
496 \fourcol{region determined by {\it m}}{d {\it m}}{y {\it m}}{c {\it m}}
497 \fourcol{... into register {\it x}}{" {\it x\/} d {\it m}}{" {\it x\/} y {\it m}}{" {\it x\/} c {\it m}}
498 \fourcol{a line}{d d}{Y {\rm or} y y}{c c}
499 \fourcol{current {\bf region}}{d r}{y r}{c r}
500 \fourcol{expanded {\bf region}}{d R}{y R}{c R}
501 \fourcol{to end of line}{D}{y \$}{c \$}
502 \fourcol{a character after point}{x}{y l}{c l}
503 \fourcol{a character before point}{DEL}{y h}{c h}
504 }
505
506 \subsection{Put Back Commands}
507
508 Deleted/yanked/changed text can be put back by the following commands.
509
510 \key{{\bf Put} back at point/above line}{P}
511 \key{... from register {\it x}}{" {\it x\/} P}
512 \key{{\bf put} back after point/below line}{p}
513 \key{... from register {\it x}}{" {\it x\/} p}
514
515 \subsection{Repeating and Undoing Modifications}
516
517 \key{{\bf undo} last change}{u {\rm or} :und}
518 \key{repeat last change}{.\ {\rm (dot)}}
519
520 Undo is undoable by \kbd{u} and repeatable by \kbd{.}.
521 For example, \kbd{u...} will undo 4 previous changes.
522 A \kbd{.} after \kbd{5dd} is equivalent to \kbd{5dd},
523 while \kbd{3.} after \kbd{5dd} is equivalent to \kbd{3dd}.
524
525 \section{Miscellaneous Commands}
526
527 \endindentedkeys
528
529 \paralign to \hsize{#\tabskip=5pt plus 1 fil&#\tabskip=0pt&#\tabskip=0pt&#\tabskip=0pt&#\cr
530 \fivecol{}{{\bf shift left}}{{\bf shift right}}{{\bf filter shell command}}{{\bf indent}}
531 \fivecol{region}{< {\it m}}{> {\it m}}{!\ {\it m\/} {\sl shell-com}}{= {\it m}}
532 \fivecol{line}{< <}{> >}{!\ !\ {\sl shell-com}}{= =}
533 }
534
535 \key{emulate \kbd{ESC}/\kbd{C-h} in emacs mode}{ESC{\rm /}C-h}
536 \key{emulate \kbd{C-c}/\kbd{C-x} in emacs mode}{C{\rm /}X}
537
538 \key{{\bf join} lines}{J}
539
540 \key{lowercase region}{\# c {\it m}}
541 \key{uppercase region}{\# C {\it m}}
542 \key{execute last keyboard macro on each line in the region}{\# g {\it m}}
543
544 \key{insert specified string for each line in the region}{\# q {\it m}}
545 \key{check spelling of the words in the region}{\# s {\it m}}
546
547 \section{Differences from Vi}
548
549 \beginindentedkeys
550
551 In VIP some keys behave rather differently from Vi.
552 The table below lists such keys, and you can get the effect of typing
553 these keys by typing the corresponding keys in the VIP column.
554
555 \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
556 \threecol{}{{\bf Vi}}{{\bf VIP}}
557 \threecol{forward character}{SPC}{l}
558 \threecol{backward character}{C-h}{h}
559 \threecol{next line at first non-white}{RET}{+}
560 \threecol{delete previous character}{X}{DEL}
561 \threecol{get information on file}{C-g}{g}
562 \threecol{substitute characters}{s}{x i}
563 \threecol{substitute line}{S}{c c}
564 \threecol{change to end of line}{C {\rm or} R}{c \$}
565 }
566
567 (Strictly speaking, \kbd{C} and \kbd{R} behave slightly differently in Vi.)
568
569 \section{Customization}
570
571 By default, search is case sensitive.
572 You can change this by including the following line in your \kbd{.vip} file.
573
574 \hskip 5ex
575 \kbd{(setq vip-case-fold-search t)}
576
577 \beginindentedkeys
578
579 \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
580 \twocol{{\bf variable}}{{\bf default value}}
581 \twocol{vip-search-wrap-around}{t}
582 \twocol{vip-case-fold-search}{nil}
583 \twocol{vip-re-search}{nil}
584 \twocol{vip-re-replace}{nil}
585 \twocol{vip-re-query-replace}{nil}
586 \twocol{vip-open-with-indent}{nil}
587 \twocol{vip-help-in-insert-mode}{nil}
588 \twocol{vip-shift-width}{8}
589 \twocol{vip-tags-file-name}{"TAGS"}
590 }
591
592 %\subsection{Customizing Key Bindings}
593
594 Include (some of) following lines in your \kbd{.vip} file
595 to restore Vi key bindings.
596
597 \beginexample
598 (define-key vip-mode-map "\\C-g" 'vip-info-on-file)
599 (define-key vip-mode-map "\\C-h" 'vip-backward-char)
600 (define-key vip-mode-map "\\C-m" 'vip-next-line-at-bol)
601 (define-key vip-mode-map " " 'vip-forward-char)
602 (define-key vip-mode-map "g" 'vip-keyboard-quit)
603 (define-key vip-mode-map "s" 'vip-substitute)
604 (define-key vip-mode-map "C" 'vip-change-to-eol)
605 (define-key vip-mode-map "R" 'vip-change-to-eol)
606 (define-key vip-mode-map "S" 'vip-substitute-line)
607 (define-key vip-mode-map "X" 'vip-delete-backward-char)
608 \endexample
609
610 \newcolumn
611
612 \title{Ex Commands in VIP}
613
614 In vi mode, an Ex command is entered by typing:
615
616 \hskip 5ex
617 \kbd{:\ {\sl ex-command} RET}
618
619 \section{Ex Addresses}
620
621 \paralign to \hsize{#\tabskip=5pt plus 1 fil&#\tabskip=2pt&#\tabskip=5pt plus 1 fil&#\cr
622 \twocolkey{current line}{.}{next line with {\sl pat}}{/ {\sl pat} /}
623 \twocolkey{line {\it n}}{{\it n}}{previous line with {\sl pat}}{?\ {\sl pat} ?}
624 \twocolkey{last line}{\$}{{\it n\/} line before {\it a}}{{\it a} - {\it n}}
625 \twocolkey{next line}{+}{{\it a\/} through {\it b}}{{\it a\/} , {\it b}}
626 \twocolkey{previous line}{-}{line marked with {\it x}}{' {\it x}}
627 \twocolkey{entire buffer}{\%}{previous context}{' '}
628 }
629
630 Addresses can be specified in front of a command.
631 For example,
632
633 \hskip 5ex
634 \kbd{:.,.+10m\$}
635
636 moves 11 lines below current line to the end of buffer.
637
638 \section{Ex Commands}
639
640 \endindentedkeys
641
642 \key{mark lines matching {\sl pat} and execute {\sl cmds} on these lines}{:g /{\sl pat}/ {\sl cmds}}
643
644 \key{mark lines {\it not\/} matching {\sl pat} and execute {\sl cmds} on these lines}{:v /{\sl pat}/ {\sl cmds}}
645
646
647 \key{{\bf move} specified lines after {\sl addr}}{:m {\sl addr}}
648 \key{{\bf copy} specified lines after {\sl addr}}{:co\rm\ (or \kbd{:t})\ \sl addr}
649 \key{{\bf delete} specified lines [into register {\it x\/}]}{:d {\rm [{\it x\/}]}}
650 \key{{\bf yank} specified lines [into register {\it x\/}]}{:y {\rm [{\it x\/}]}}
651 \key{{\bf put} back text [from register {\it x\/}]}{:pu {\rm [{\it x\/}]}}
652
653 \key{{\bf substitute} {\sl repl} for first string on line matching {\sl pat}}{:s /{\sl pat}/{\sl repl}/}
654
655 \key{repeat last substitution}{:\&}
656 \key{repeat previous substitute with previous search pattern as {\sl pat}}{:\~{}}
657
658 \key{{\bf read} in a file}{:r {\sl file}}
659 \key{{\bf read} in the output of a shell command}{:r!\ {\sl command}}
660 \key{write out specified lines into {\sl file}}{:w {\sl file}}
661 \key{write out specified lines at the end of {\sl file}}{:w>> {\sl file}}
662 \key{write out and then quit}{:wq {\sl file}}
663
664 \key{define a macro {\it x} that expands to {\sl cmd}}{:map {\it x} {\sl cmd}}
665 \key{remove macro expansion associated with {\it x}}{:unma {\it x}}
666
667 \key{print line number}{:=}
668 \key{print {\bf version} number of VIP}{:ve}
669
670 \key{shift specified lines to the right}{:>}
671 \key{shift specified lines to the left}{:<}
672
673 \key{{\bf join} lines}{:j}
674 \key{mark specified line to register {\it x}}{:k {\it x}}
675 \key{{\bf set} a variable's value}{:se}
676 \key{run a sub{\bf shell} in a window}{:sh}
677 \key{execute shell command {\sl command}}{:!\ {\sl command}}
678 \key{find first definition of {\bf tag} {\sl tag}}{:ta {\sl tag}}
679
680
681 \copyrightnotice
682
683 \bye
684 \f
685 % Local variables:
686 % compile-command: "pdftex vipcard"
687 % End:
688
689 % arch-tag: 342a9548-4de4-499d-b864-74fb426b6729