viperCard.tex 23 KB

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