* net/tramp.el (tramp-methods, tramp-connection-timeout): Fix docstring.
[emacs.git] / etc / refcards / viperCard.tex
blobac5191209bf8f9475cef104b72578f16de9ce37c
1 % ViperCard -- The Reference Card for Viper under GNU Emacs and XEmacs
3 % Copyright (C) 1995-1997, 2001-2014 Free Software Foundation, Inc.
5 % Author: Michael Kifer <kifer@cs.sunysb.edu> (Viper)
6 % Aamod Sane <sane@cs.uiuc.edu> (VIP 4.3)
7 % Masahiko Sato <ms@sail.stanford.edu> (VIP 3.5)
9 % This file is part of GNU Emacs.
11 % GNU Emacs is free software: you can redistribute it and/or modify
12 % it under the terms of the GNU General Public License as published by
13 % the Free Software Foundation, either version 3 of the License, or
14 % (at your option) any later version.
16 % GNU Emacs is distributed in the hope that it will be useful,
17 % but WITHOUT ANY WARRANTY; without even the implied warranty of
18 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 % GNU General Public License for more details.
21 % You should have received a copy of the GNU General Public License
22 % along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 % This file is intended to be processed by plain TeX (TeX82).
27 % The final reference card has six columns, three on each side.
28 % This file can be used to produce it in any of three ways:
29 % 1 column per page
30 % produces six separate pages, each of which needs to be reduced to 80%.
31 % This gives the best resolution.
32 % 2 columns per page
33 % produces three already-reduced pages.
34 % You will still need to cut and paste.
35 % 3 columns per page
36 % produces two pages which must be printed sideways to make a
37 % ready-to-use 8.5 x 11 inch reference card.
38 % For this you need a dvi device driver that can print sideways.
39 % Which mode to use is controlled by setting \columnsperpage.
42 %**start of header
45 % This file can be printed with 1 or 2 columns per page.
46 % Specify how many you want here.
47 \newcount\columnsperpage
48 \columnsperpage=2
50 % PDF output layout. 0 for A4, 1 for letter (US), a `l' is added for
51 % a landscape layout.
52 \input pdflayout.sty
53 \pdflayout=(1)
55 \input emacsver.tex
56 \def\versionemacs{21} % version of Emacs this is for
57 \def\versionxemacs{20} % version of XEmacs this is for
58 \def\versionviper{3.0} % version of Viper this is for
60 % Nothing else needs to be changed.
62 \def\shortcopyrightnotice{\vskip 1ex plus 2 fill
63 \centerline{\small \copyright\ \year\ Free Software Foundation, Inc.
64 Permissions on back.}}
66 \def\copyrightnotice{
67 %\vskip 1ex plus 2 fill\begingroup\small
68 \vskip 1ex \begingroup\small
69 \centerline{Copyright \copyright\ \year\ Free Software Foundation, Inc.}
70 \centerline{by Michael Kifer, Viper \versionviper}
71 \centerline{by Aamod Sane, VIP version 4.3}
72 \centerline{by Masahiko Sato, VIP version 3.5}
74 Permission is granted to make and distribute copies of
75 this card provided the copyright notice and this permission notice
76 are preserved on all copies.
78 For copies of the GNU Emacs manual, see:
80 {\tt http://www.gnu.org/software/emacs/\#Manuals}
81 \endgroup}
83 % make \bye not \outer so that the \def\bye in the \else clause below
84 % can be scanned without complaint.
85 \def\bye{\par\vfill\supereject\end}
87 \newdimen\intercolumnskip
88 \newbox\columna
89 \newbox\columnb
91 \def\ncolumns{\the\columnsperpage}
93 \message{[\ncolumns\space
94 column\if 1\ncolumns\else s\fi\space per page]}
96 \def\scaledmag#1{ scaled \magstep #1}
98 % This multi-way format was designed by Stephen Gildea
99 % October 1986.
100 % Slightly modified by Masahiko Sato, September 1987.
101 \if 1\ncolumns
102 \hsize 4in
103 \vsize 10in
104 %\voffset -.7in
105 \voffset -.57in
106 \font\titlefont=\fontname\tenbf \scaledmag3
107 \font\headingfont=\fontname\tenbf \scaledmag2
108 \font\miniheadingfont=\fontname\tenbf \scaledmag1 % masahiko
109 \font\smallfont=\fontname\sevenrm
110 \font\smallsy=\fontname\sevensy
112 \footline{\hss\folio}
113 \def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}}
114 \else
115 %\hsize 3.2in
116 %\vsize 7.95in
117 \hsize 3.41in % masahiko
118 \vsize 8in % masahiko
119 \hoffset -.75in
120 \voffset -.745in
121 \font\titlefont=cmbx10 \scaledmag2
122 \font\headingfont=cmbx10 \scaledmag1
123 \font\miniheadingfont=cmbx10 % masahiko
124 \font\smallfont=cmr6
125 \font\smallsy=cmsy6
126 \font\eightrm=cmr8
127 \font\eightbf=cmbx8
128 \font\eightit=cmti8
129 \font\eightsl=cmsl8
130 \font\eighttt=cmtt8
131 \font\eightsy=cmsy8
132 \textfont0=\eightrm
133 \textfont2=\eightsy
134 \def\rm{\eightrm}
135 \def\bf{\eightbf}
136 \def\it{\eightit}
137 \def\sl{\eightsl} % masahiko
138 \def\tt{\eighttt}
139 \normalbaselineskip=.8\normalbaselineskip
140 \normallineskip=.8\normallineskip
141 \normallineskiplimit=.8\normallineskiplimit
142 \normalbaselines\rm %make definitions take effect
144 \if 2\ncolumns
145 \let\maxcolumn=b
146 \footline{\hss\rm\folio\hss}
147 \def\makefootline{\vskip 2in \hsize=6.86in\line{\the\footline}}
148 \else \if 3\ncolumns
149 \let\maxcolumn=c
150 \nopagenumbers
151 \else
152 \errhelp{You must set \columnsperpage equal to 1, 2, or 3.}
153 \errmessage{Illegal number of columns per page}
154 \fi\fi
156 %\intercolumnskip=.46in
157 \intercolumnskip=.19in % masahiko .19x4 + 3.41x3 = 10.99
158 \def\abc{a}
159 \output={%
160 % This next line is useful when designing the layout.
161 %\immediate\write16{Column \folio\abc\space starts with \firstmark}
162 \if \maxcolumn\abc \multicolumnformat \global\def\abc{a}
163 \else\if a\abc
164 \global\setbox\columna\columnbox \global\def\abc{b}
165 %% in case we never use \columnb (two-column mode)
166 \global\setbox\columnb\hbox to -\intercolumnskip{}
167 \else
168 \global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi}
169 \def\multicolumnformat{\shipout\vbox{\makeheadline
170 \hbox{\box\columna\hskip\intercolumnskip
171 \box\columnb\hskip\intercolumnskip\columnbox}
172 \makefootline}\advancepageno}
173 \def\columnbox{\leftline{\pagebody}}
175 \def\bye{\par\vfill\supereject
176 \if a\abc \else\null\vfill\eject\fi
177 \if a\abc \else\null\vfill\eject\fi
178 \end}
181 % we won't be using math mode much, so redefine some of the characters
182 % we might want to talk about
183 \catcode`\^=12
184 \catcode`\_=12
186 \chardef\\=`\\
187 \chardef\{=`\{
188 \chardef\}=`\}
190 \hyphenation{mini-buf-fer}
192 \parindent 0pt
193 \parskip 1ex plus .5ex minus .5ex
195 \def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip}
197 \outer\def\newcolumn{\vfill\eject}
199 \outer\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus .5ex}
201 \outer\def\section#1{\par\filbreak
202 \vskip 3ex plus 2ex minus 2ex {\headingfont #1}\mark{#1}%
203 \vskip 2ex plus 1ex minus 1.5ex}
205 % masahiko
206 \outer\def\subsection#1{\par\filbreak
207 \vskip 2ex plus 2ex minus 2ex {\miniheadingfont #1}\mark{#1}%
208 \vskip 1ex plus 1ex minus 1.5ex}
210 \newdimen\keyindent
212 \def\beginindentedkeys{\keyindent=1em}
213 \def\endindentedkeys{\keyindent=0em}
214 \endindentedkeys
216 \def\paralign{\vskip\parskip\halign}
218 \def\<#1>{$\langle${\rm #1}$\rangle$}
220 \def\kbd#1{{\tt#1}\null} %\null so not an abbrev even if period follows
222 \def\beginexample{\par\leavevmode\begingroup
223 \obeylines\obeyspaces\parskip0pt\tt}
224 {\obeyspaces\global\let =\ }
225 \def\endexample{\endgroup}
227 \def\key#1#2{\leavevmode\hbox to \hsize{\vtop
228 {\hsize=.75\hsize\rightskip=1em
229 \hskip\keyindent\relax#1}\kbd{#2}\hfil}}
231 \newbox\metaxbox
232 \setbox\metaxbox\hbox{\kbd{M-x }}
233 \newdimen\metaxwidth
234 \metaxwidth=\wd\metaxbox
236 \def\metax#1#2{\leavevmode\hbox to \hsize{\hbox to .75\hsize
237 {\hskip\keyindent\relax#1\hfil}%
238 \hskip -\metaxwidth minus 1fil
239 \kbd{#2}\hfil}}
241 \def\fivecol#1#2#3#4#5{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad
242 &\kbd{#3}\quad&\kbd{#4}\quad&\kbd{#5}\cr}
244 \def\fourcol#1#2#3#4{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad
245 &\kbd{#3}\quad&\kbd{#4}\quad\cr}
247 \def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad
248 &\kbd{#3}\quad\cr}
250 \def\twocol#1#2{\hskip\keyindent\relax\kbd{#1}\hfil&\kbd{#2}\quad\cr}
252 \def\twocolkey#1#2#3#4{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad&\relax#3\hfil&\kbd{#4}\quad\cr}
254 %**end of header
256 \beginindentedkeys
258 \title{ViperCard: Viper Reference Pal}
260 \centerline{(Version \versionviper\ for Emacs \versionemacs\ and XEmacs \versionxemacs)}
262 %\copyrightnotice
264 \section{Loading Viper}
266 Just type \kbd{M-x viper-mode} followed by \kbd{RET}
268 OR put
270 (setq viper-mode t)
271 (require 'viper)
273 in .emacs
275 \section{Viper States}
277 Viper has four states: {\it emacs state}, {\it vi state}, {\it insert state},
278 {\it replace state}.
279 Mode line tells you which state you are in.
280 In emacs state you can do all the normal GNU Emacs editing.
281 This card explains only vi state and insert state (replace state is similar
282 to insert state).
283 {\bf GNU Emacs Reference Card} explains emacs state.
284 You can switch states as follows.
286 \key{from emacs state to vi state}{C-z}
287 \key{from vi state to emacs state}{C-z}
288 \key{from vi state to emacs state for 1 command}{$\backslash$}
289 \metax{from vi state to insert state}{i, I, a, A, o, O}
290 \metax{from vi state to replace state}{c, C, R}
291 \key{from insert or replace state to vi state}{ESC}
292 \key{from insert state to vi state for 1 command}{C-z}
295 \section{Insert Mode}
296 You can do editing in insert state.
298 \metax{go back to vi state}{ESC}
299 \metax{delete previous character}{C-h, DEL}
300 \key{delete previous word}{C-w}
301 \key{delete line word}{C-u}
302 \key{indent shiftwidth forward}{C-t}
303 \key{indent shiftwidth backward}{C-d}
304 \key{delete line word}{C-u}
305 \key{quote following character}{C-v}
306 \key{emulate Meta key in emacs state}{C-$\backslash$}
307 \key{escape to Vi state for one command}{C-z}
309 \vskip 2mm
311 {\bf The rest of this card explains commands in {\bf vi state}.}
313 \section{Getting Information on Viper}
315 Execute info command by typing \kbd{M-x info} and select menu item
316 \kbd{viper}. Also:
318 \key{describe function attached to the key {\it x}}{$\backslash$ C-h k {\it x}}
320 \section{Leaving Emacs}
322 \metax{suspend Emacs}{:st {\rm or} :su}
323 \metax{exit Emacs permanently}{C-xC-c}
324 \metax{exit current file}{:wq {\rm or} :q}
326 \shortcopyrightnotice
328 \section{Error Recovery}
330 \metax{abort command}{C-c (user level = 1)}
331 \metax{abort command}{C-g (user level > 1)}
332 \key{redraw messed up screen}{C-l}
333 \metax{{\bf recover} after system crash}{:rec file}
334 \metax{restore a buffer }{:e!\ {\rm or} M-x revert-buffer}
337 \section{Counts}
339 Most commands in vi state accept a {\it count} which can be supplied as a
340 prefix to the commands. In most cases, if a count is given, the
341 command is executed that many times. E.g., \kbd{5 d d} deletes 5
342 lines.
344 \section{Registers}
346 There are 26 registers (\kbd{a} to \kbd{z}) that can store texts
347 and marks.
348 You can append a text at the end of a register (say \kbd{x}) by
349 specifying the register name in capital letter (say \kbd{X}).
350 There are also 9 read only registers (\kbd{1} to \kbd{9}) that store
351 up to 9 previous changes.
352 We will use {\it x\/} to denote a register.
353 \section{Entering Insert Mode}
355 \key{{\bf insert} at point}{i}
356 \key{{\bf append} after cursor}{a}
357 \key{{\bf insert} before first non-white}{I}
358 \key{{\bf append} at end of line}{A}
359 \key{{\bf open} line below}{o}
360 \key{{\bf open} line above}{O}
362 \section{Buffers and Windows}
364 \key{move cursor to {\bf next} window}{C-x o}
365 \key{delete current window}{C-x 0}
366 \key{delete other windows}{C-x 1}
367 \key{split current window into two windows}{C-x 2}
368 \key{{\bf switch} to a buffer in the current window}{C-x {\sl buffer}}
369 \metax{{\bf switch} to a buffer in another window}{:n, :b, {\rm or} C-x 4 {\sl buf}}
370 \key{{\bf kill} a buffer}{:q! {\rm or} C-x k}
371 \key{list existing {\bf buffers}}{:args {\rm or} C-x b}
373 \section{Files}
375 \metax{{\bf visit} file in the current window}{v {\sl file} {\rm or} :e {\sl file}}
376 \key{{\bf visit} file in another window}{V {\sl file}}
377 \key{{\bf visit} file in another frame}{C-v {\sl file}}
378 \key{{\bf save} buffer to the associated file}{:w {\rm or} C-xC-s}
379 \metax{{\bf write} buffer to a specified file}{:w {\sl file} {\rm or} C-xC-w}
380 \metax{{\bf insert} a specified file at point}{:r {\sl file} {\rm or} C-xi}
381 \key{{\bf get} information on the current {\bf file}}{C-c g {\rm or} :f}
382 \key{run the {\bf directory} editor}{:e RET {\rm or} C-xd}
384 %\shortcopyrightnotice
386 \section{Viewing the Buffer}
388 \key{scroll to next screen}{C-f}
389 \key{scroll to previous screen}{C-b}
390 \key{scroll {\bf down} half screen}{C-d}
391 \key{scroll {\bf up} half screen}{C-u}
392 \key{scroll down one line}{C-e}
393 \key{scroll up one line}{C-y}
395 \key{put current line on the {\bf home} line}{z H {\rm or} z RET}
396 \key{put current line on the {\bf middle} line}{z M {\rm or} z .}
397 \key{put current line on the {\bf last} line}{z L {\rm or} z -}
399 \section{Marking and Returning}
401 \key{{\bf mark} point in register {\it x}}{m {\it x}}
402 \key{set mark at buffer beginning}{m <}
403 \key{set mark at buffer end}{m >}
404 \key{set mark at point}{m .}
405 \key{jump to mark}{m ,}
406 \key{exchange point and mark}{` `}
407 \key{... and skip to first non-white on line}{' '}
408 \key{go to mark {\it x}}{` {\it x}}
409 \key{... and skip to first non-white on line}{' {\it x}}
410 \key{view contents of marker {\it x}}{[ {\it x}}
411 \key{view contents of register {\it x}}{] {\it x}}
413 \section{Macros}
415 Emacs style macros:
417 \key{start remembering keyboard macro}{C-x (}
418 \key{finish remembering keyboard macro}{C-x )}
419 \key{call last keyboard macro}{*}
421 \key{start remembering keyboard macro}{@ \#}
422 \key{finish macro and put into register {\it x}}{@ {\it x}}
423 \key{execute macro stored in register {\it x}}{@ {\it x}}
424 \key{repeat last @{\it x} command}{@ @}
426 \key{Pull last macro into register {\it x}}{@ ! {\it x}}
428 Vi-style macros (keys to be hit in quick succession):
430 \key{define Vi-style macro for Vi state}{:map}
431 \key{define Vi-style macro for Insert state}{:map!}
433 \key{toggle case-sensitive search}{//}
434 \key{toggle regular expression search}{///}
435 \key{toggle `\%' to ignore parentheses inside comments}{\%\%\%}
438 \section{Motion Commands}
440 \key{go backward one character}{h {\rm or} C-h}
441 \key{go forward one character}{l}
442 \metax{next line keeping the column}{j {\rm or} LF {\rm or} C-n}
443 \key{previous line keeping the column}{k}
444 \metax{next line at first non-white}{+ {\rm or} RET {\rm or} C-p}
445 \key{previous line at first non-white}{-}
447 \key{beginning of line}{0}
448 \key{first non-white on line}{^}
449 \key{end of line}{\$}
450 \key{go to {\it n}-th column on line}{{\it n} |}
452 \key{go to {\it n}-th line}{{\it n} G}
453 \key{go to last line}{G}
454 \key{find matching parenthesis for \kbd{()}, \kbd{\{\}} and \kbd{[]}}{\%}
456 \key{go to {\bf home} window line}{H}
457 \key{go to {\bf middle} window line}{M}
458 \key{go to {\bf last} window line}{L}
460 \subsection{Words, Sentences, Paragraphs, Headings}
462 \key{forward {\bf word}}{w {\rm or} W}
463 \key{{\bf backward} word}{b {\rm or} B}
464 \key{{\bf end} of word}{e {\rm or} E}
466 In the case of capital letter commands, a word is delimited by a
467 non-white character.
469 \key{forward sentence}{)}
470 \key{backward sentence}{(}
472 \key{forward paragraph}{\}}
473 \key{backward paragraph}{\{}
475 \key{forward heading}{]]}
476 \key{backward heading}{[[}
477 \key{end of heading}{[]}
479 \subsection{Find Characters on the Line}
481 \key{{\bf find} {\it c} forward on line}{f {\it c}}
482 \key{{\bf find} {\it c} backward on line}{F {\it c}}
483 \key{up {\bf to} {\it c} forward on line}{t {\it c}}
484 \key{up {\bf to} {\it c} backward on line}{T {\it c}}
485 \key{repeat previous \kbd{f}, \kbd{F}, \kbd{t} or \kbd{T}}{;}
486 \key{... in the opposite direction}{,}
488 %\newcolumn
489 %\title{Viper Quick Reference Card}
491 \section{Searching and Replacing}
493 \key{search forward for {\sl pat}}{/ {\sl pat}}
494 \key{search backward with previous {\sl pat}}{?\ RET}
495 \key{search forward with previous {\sl pat}}{/ RET}
496 \key{search backward for {\sl pat}}{?\ {\sl pat}}
497 \key{repeat previous search}{n}
498 \key{... in the opposite direction}{N}
500 \key{{\bf query} replace}{Q}
501 \key{{\bf replace} a character by another character {\it c}}{r {\it c}}
502 \key{{\bf overwrite} {\it n} lines}{{\it n} R}
504 \metax{{\bf buffer} search (if enabled)}{g {\it move command}}
506 \section{Modifying Commands}
508 Most commands that operate on text regions accept the motion commands,
509 to describe regions. They also accept the Emacs region specifications
510 {\bf r} and {\bf R}. {\bf r} describes the region between {\it point}
511 and {\it mark}, and {\bf R} describes whole lines in that region.
512 Motion commands are classified into {\it point commands} and
513 {\it line commands}. In the case of line commands, whole lines will
514 be affected by the command.
516 The point commands are as follows:
518 \hskip 5ex
519 \kbd{h l 0 ^ \$ w W b B e E ( ) / ?\ ` f F t T \% ; ,}
521 The line commands are as follows:
523 \hskip 5ex
524 \kbd{j k + - H M L \{ \} G '}
526 These region specifiers will be referred to as {\it m} below.
528 \subsection{Delete/Yank/Change Commands}
530 \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\tabskip=0pt&#\cr
531 \fourcol{}{{\bf delete}}{{\bf yank}}{{\bf change}}
532 \fourcol{region determined by {\it m}}{d {\it m}}{y {\it m}}{c {\it m}}
533 \fourcol{... into register {\it x}}{" {\it x\/} d {\it m}}{" {\it x\/} y {\it m}}{" {\it x\/} c {\it m}}
534 \fourcol{a line}{d d}{Y {\rm or} y y}{c c}
535 \fourcol{current {\bf region}}{d r}{y r}{c r}
536 \fourcol{expanded {\bf region}}{d R}{y R}{c R}
537 \fourcol{to end of line}{D}{y \$}{c \$}
538 \fourcol{a character after point}{x}{y l}{c l}
539 \fourcol{a character before point}{DEL}{y h}{c h}
542 \vskip 2ex
543 \key{Overwrite {\it n} lines}{{\it n} R}
545 \subsection{Put Back Commands}
547 Deleted/yanked/changed text can be put back by the following commands.
549 \key{{\bf Put} back at point/above line}{P}
550 \key{... from register {\it x}}{" {\it x\/} P}
551 \key{{\bf put} back after point/below line}{p}
552 \key{... from register {\it x}}{" {\it x\/} p}
554 \subsection{Repeating and Undoing Modifications}
556 \key{{\bf undo} last change}{u {\rm or} :und}
557 \key{repeat last change}{.\ {\rm (dot)}}
559 Undo is undoable by \kbd{u} and repeatable by \kbd{.}.
560 For example, \kbd{u...} will undo 4 previous changes.
561 A \kbd{.} after \kbd{5dd} is equivalent to \kbd{5dd},
562 while \kbd{3.} after \kbd{5dd} is equivalent to \kbd{3dd}.
564 \section{Miscellaneous Commands}
566 \endindentedkeys
568 \paralign to \hsize{#\tabskip=5pt plus 1 fil&#\tabskip=0pt&#\tabskip=0pt&#\tabskip=0pt&#\cr
569 \fivecol{}{{\bf shift left}}{{\bf shift right}}{{\bf filter shell command}}{{\bf indent}}
570 \fivecol{region}{< {\it m}}{> {\it m}}{!\ {\it m\/} {\sl shell-com}}{= {\it m}}
571 \fivecol{line}{< <}{> >}{!\ !\ {\sl shell-com}}{= =}
574 \key{{\bf join} lines}{J}
575 \key{toggle case (takes count)}{\~{}}
577 \key{view register {\it x}}{] {\it x}}
578 \key{view marker {\it x}}{] {\it x}}
580 \key{lowercase region}{\# c {\it m}}
581 \key{uppercase region}{\# C {\it m}}
582 \key{execute last keyboard macro on each line in the region}{\# g {\it m}}
584 \key{insert specified string for each line in the region}{\# q {\it m}}
585 \key{check spelling of the words in the region}{\# s {\it m}}
587 \key{repeat previous ex substitution}{\&}
588 \key{change to previous file}{C-^}
590 \key{Viper Meta key}{_}
592 \section{Customization}
594 By default, search is case sensitive.
595 You can change this by including the following line in your \kbd{\~{}/.vip} file.
597 \hskip 5ex
598 \kbd{(setq viper-case-fold-search t)}
600 The following is a subset of the variety of
601 options available for customizing Viper.
602 See the Viper manual for details on these and other options.
604 \beginindentedkeys
606 \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
607 \twocol{{\bf variable}}{{\bf default value}}
608 \twocol{viper-search-wrap-around}{t}
609 \twocol{viper-case-fold-search}{nil}
610 \twocol{viper-re-search}{t}
611 \twocol{viper-re-replace}{t}
612 \twocol{viper-re-query-replace}{t}
613 \twocol{viper-auto-indent}{nil}
614 \twocol{viper-shift-width}{8}
615 \twocol{viper-tags-file-name}{"TAGS"}
616 \twocol{viper-no-multiple-ESC}{t}
617 \twocol{viper-ex-style-motion}{t}
618 \twocol{viper-always}{t}
619 \twocol{viper-custom-file-name}{"\~{}/.vip"}
620 \twocol{ex-find-file-shell}{"csh"}
621 \twocol{ex-cycle-other-window}{t}
622 \twocol{ex-cycle-through-non-buffers}{t}
623 \twocol{blink-matching-paren}{t}
624 \twocol{buffer-read-only}{{\it buffer dependent}}
627 To bind keys in Vi command state, put lines like these in your
628 \kbd{\~{}/.vip} file:
630 \beginexample
631 (define-key viper-vi-global-user-map "\\C-v" 'scroll-down)
632 (define-key viper-vi-global-user-map "\\C-cm" 'smail)
633 \endexample
636 \newcolumn
638 \title{Ex Commands in Viper}
640 In vi state, an Ex command is entered by typing:
642 \hskip 5ex
643 \kbd{:\ {\sl ex-command} RET}
645 \section{Ex Addresses}
647 \paralign to \hsize{#\tabskip=5pt plus 1 fil&#\tabskip=2pt&#\tabskip=5pt plus 1 fil&#\cr
648 \twocolkey{current line}{.}{next line with {\sl pat}}{/ {\sl pat} /}
649 \twocolkey{line {\it n}}{{\it n}}{previous line with {\sl pat}}{?\ {\sl pat} ?}
650 \twocolkey{last line}{\$}{{\it n\/} line before {\it a}}{{\it a} - {\it n}}
651 \twocolkey{next line}{+}{{\it a\/} through {\it b}}{{\it a\/} , {\it b}}
652 \twocolkey{previous line}{-}{line marked with {\it x}}{' {\it x}}
653 \twocolkey{entire buffer}{\%}{previous context}{' '}
656 Addresses can be specified in front of a command.
657 For example,
659 \hskip 5ex
660 \kbd{:.,.+10m\$}
662 moves 11 lines below current line to the end of buffer.
664 \section{Ex Commands}
666 Avoid Ex text manipulation commands except substitute.
667 There are better VI equivalents
668 for all of them. Also note that all Ex commands expand \% to
669 current file name. To include a \% in the command, escape it with a $\backslash$.
670 Similarly, \# is replaced by previous file. For Viper, this is the
671 first file in the {\sl :args} listing for that buffer. This defaults
672 to the previous file in the VI sense if you have one window.
673 Ex commands can be made to have history. See the manual for details.
675 \subsection{Ex Text Commands}
677 \endindentedkeys
679 \key{mark lines matching {\sl pat} and execute {\sl cmds} on these lines}{:g /{\sl pat}/ {\sl cmds}}
681 \key{mark lines {\it not\/} matching {\sl pat} and execute {\sl cmds} on these lines}{:v /{\sl pat}/ {\sl cmds}}
684 \key{{\bf move} specified lines after {\sl addr}}{:m {\sl addr}}
685 \key{{\bf copy} specified lines after {\sl addr}}{:co\rm\ (or \kbd{:t})\ \sl addr}
686 \key{{\bf delete} specified lines [into register {\it x\/}]}{:d {\rm [{\it x\/}]}}
687 \key{{\bf yank} specified lines [into register {\it x\/}]}{:y {\rm [{\it x\/}]}}
688 \key{{\bf put} back text [from register {\it x\/}]}{:pu {\rm [{\it x\/}]}}
690 \key{{\bf substitute} {\sl repl} for first string on line matching {\sl pat}}{:s /{\sl pat}/{\sl repl}/}
692 \key{repeat last substitution}{:\&}
693 \key{repeat previous substitute with previous search pattern as {\sl pat}}{:\~{}}
695 \subsection{Ex File and Shell Commands}
697 \key{{\bf edit} file}{:e {\sl file}}
698 \key{reedit messed up current file}{:e!}
699 \key{edit previous file}{:e\#}
700 \key{{\bf read} in a file}{:r {\sl file}}
701 \key{{\bf read} in the output of a shell command}{:r {\sl !command}}
702 \key{write out specified lines into {\sl file}}{:w {\sl file}}
703 \key{save all modified buffers, ask confirmation}{:W {\sl file}}
704 \key{save all modified buffers, no confirmation}{:WW {\sl file}}
705 \key{write out specified lines at the end of {\sl file}}{:w>> {\sl file}}
706 \key{{\bf write} to the input of a shell command}{:w {\sl !command}}
707 \key{write out and then quit}{:wq {\sl file}}
709 \key{run a sub{\bf shell} in a window}{:sh}
710 \key{execute shell command {\sl command}}{:!\ {\sl command}}
711 \key{execute previous shell command with {\it args} appended}{:!! {\sl args}}
713 \subsection{Ex Miscellaneous Commands}
715 \key{define a macro {\it x} that expands to {\sl cmd}}{:map {\it x} {\sl cmd}}
716 \key{remove macro expansion associated with {\it x}}{:unma {\it x}}
717 \key{define a macro {\it x} that expands to {\sl cmd} in insert state}{:map!\ {\it x} {\sl cmd}}
718 \key{remove macro expansion associated with {\it x} in insert state}{:unma!\ {\it x}}
720 \key{print line number}{:.=}
721 \key{print last line number}{:=}
722 \key{print {\bf version} number of Viper}{:ve}
724 \key{shift specified lines to the right}{:>}
725 \key{shift specified lines to the left}{:<}
727 \key{{\bf join} lines}{:j}
728 \key{mark specified line to register {\it x}}{:k {\it x}}
729 \key{{\bf set} a variable's value}{:se}
730 \key{find first definition of {\bf tag} {\sl tag}}{:ta {\sl tag}}
732 \key{Current directory}{:pwd}
735 \copyrightnotice
737 \bye
739 % Local variables:
740 % compile-command: "pdftex viperCard"
741 % End: