vipcard.tex 21 KB

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