comparison etc/viperCard.tex @ 155:43dd3413c7c7 r20-3b4

Import from CVS: tag r20-3b4
author cvs
date Mon, 13 Aug 2007 09:39:39 +0200
parents 1ce6082ce73f
children 0132846995bd
comparison
equal deleted inserted replaced
154:94141801dd7e 155:43dd3413c7c7
59 % Stephen Gildea 59 % Stephen Gildea
60 % UUCP: mit-erl!gildea 60 % UUCP: mit-erl!gildea
61 % Internet: gildea@erl.mit.edu 61 % Internet: gildea@erl.mit.edu
62 62
63 63
64 \def\versionnumber{2.70} 64 \def\versionnumber{2.93}
65 \def\year{1995} 65 \def\year{1997}
66 \def\version{February \year\ v\versionnumber} 66 \def\version{May \year\ v\versionnumber}
67 67
68 \def\shortcopyrightnotice{\vskip 1ex plus 2 fill 68 \def\shortcopyrightnotice{\vskip 1ex plus 2 fill
69 \centerline{\small \copyright\ \year\ Free Software Foundation, Inc. 69 \centerline{\small \copyright\ \year\ Free Software Foundation, Inc.
70 Permissions on back. v\versionnumber}} 70 Permissions on back. v\versionnumber}}
71 71
259 259
260 %**end of header 260 %**end of header
261 261
262 \beginindentedkeys 262 \beginindentedkeys
263 263
264 \title{ViperCard --- The Viper Quick Reference Card} 264 \title{ViperCard: Viper Reference Pal}
265 265
266 \centerline{(for version 2.70 under GNU Emacs 19 and XEmacs 19)} 266 \centerline{(For Version 2.93 under Emacs and XEmacs 19 \& 20)}
267 267
268 %\copyrightnotice 268 %\copyrightnotice
269 269
270 \section{Loading Viper} 270 \section{Loading Viper}
271 271
272 Just type \kbd{M-x viper-mode} followed by \kbd{RET} 272 Just type \kbd{M-x viper-mode} followed by \kbd{RET}
273
274 OR put (require 'viper) in .emacs
273 275
274 \section{Viper States} 276 \section{Viper States}
275 277
276 Viper has four states: {\it emacs state}, {\it vi state}, {\it insert state}, 278 Viper has four states: {\it emacs state}, {\it vi state}, {\it insert state},
277 {\it replace state}. 279 {\it replace state}.
284 286
285 \key{from emacs state to vi state}{C-z} 287 \key{from emacs state to vi state}{C-z}
286 \key{from vi state to emacs state}{C-z} 288 \key{from vi state to emacs state}{C-z}
287 \metax{from vi state to insert state}{i, I, a, A, o, O} 289 \metax{from vi state to insert state}{i, I, a, A, o, O}
288 \metax{from vi state to replace state}{c, C, R} 290 \metax{from vi state to replace state}{c, C, R}
289 \metax{from replace state to insert state}{Cross \$ sign}
290 \key{from insert or replace state to vi state}{ESC} 291 \key{from insert or replace state to vi state}{ESC}
291 292
292 If you wish to be in vi state when Emacs starts up and thereafter,
293 include the line:
294
295 \hskip 5ex
296 \kbd{(setq vip-always t)}
297
298 in your \kbd{\~{}/.vip} file.
299 293
300 \section{Insert Mode} 294 \section{Insert Mode}
301 You can do editing in insert state. 295 You can do editing in insert state.
302 296
303 \metax{go back to vi state}{ESC} 297 \metax{go back to vi state}{ESC}
305 \key{delete previous word}{C-w} 299 \key{delete previous word}{C-w}
306 \key{delete line word}{C-u} 300 \key{delete line word}{C-u}
307 \key{indent shiftwidth forward}{C-t} 301 \key{indent shiftwidth forward}{C-t}
308 \key{indent shiftwidth backward}{C-d} 302 \key{indent shiftwidth backward}{C-d}
309 \key{delete line word}{C-u} 303 \key{delete line word}{C-u}
310 \key{Quote following character}{C-v} 304 \key{quote following character}{C-v}
311 \key{emulate Meta key in emacs state}{C-z} 305 \key{emulate Meta key in emacs state}{C-\\}
306 \key{escape to Vi state for one command}{C-z}
312 307
313 \vskip 2mm 308 \vskip 2mm
314 309
315 {\bf The rest of this card explains commands in {\bf vi state}.} 310 {\bf The rest of this card explains commands in {\bf vi state}.}
316 311
317 \section{Getting Information on Viper} 312 \section{Getting Information on Viper}
318 313
319 Execute info command by typing \kbd{M-x info} and select menu item 314 Execute info command by typing \kbd{M-x info} and select menu item
320 \kbd{viper}. Also: 315 \kbd{viper}. Also:
321 316
322 \key{describe function attached to the key {\it x}}{C-h k {\it x}} 317 \key{describe function attached to the key {\it x}}{$\backslash$ C-h k {\it x}}
323 \key{if you've enabled help; or if you didn't}{$\backslash$ C-h k {\it x}}
324 318
325 \section{Leaving Emacs} 319 \section{Leaving Emacs}
326 320
327 \metax{suspend Emacs}{:st {\rm or} :su} 321 \metax{suspend Emacs}{:st {\rm or} :su}
328 \metax{exit Emacs permanently}{C-xC-c} 322 \metax{exit Emacs permanently}{C-xC-c}
415 \key{view contents of marker {\it x}}{[ {\it x}} 409 \key{view contents of marker {\it x}}{[ {\it x}}
416 \key{view contents of register {\it x}}{] {\it x}} 410 \key{view contents of register {\it x}}{] {\it x}}
417 411
418 \section{Macros} 412 \section{Macros}
419 413
414 Emacs style macros:
415
416 \key{start remembering keyboard macro}{C-x (}
417 \key{finish remembering keyboard macro}{C-x )}
418 \key{call last keyboard macro}{*}
419
420 \key{start remembering keyboard macro}{@ \#} 420 \key{start remembering keyboard macro}{@ \#}
421 \key{finish macro and put into register {\it x}}{@ {\it x}} 421 \key{finish macro and put into register {\it x}}{@ {\it x}}
422 \key{execute macro stored in register {\it x}}{@ {\it x}} 422 \key{execute macro stored in register {\it x}}{@ {\it x}}
423 \key{repeat last @{\it x} command}{@ @} 423 \key{repeat last @{\it x} command}{@ @}
424 424
425 Emacs style macros:
426
427 \key{start remembering keyboard macro}{C-x (}
428 \key{finish remembering keyboard macro}{C-x )}
429 \key{call last keyboard macro}{*}
430
431 Combining:
432
433 \key{Pull last macro into register {\it x}}{@ ! {\it x}} 425 \key{Pull last macro into register {\it x}}{@ ! {\it x}}
426
427 Vi-style macros (keys to be hit in quick succession):
428
429 \key{define Vi-style macro for Vi state}{:map}
430 \key{define Vi-style macro for Insert state}{:map!}
431
432 \key{toggle case-sensitive search}{//}
433 \key{toggle regular expression search}{///}
434 \key{toggle `\%' to ignore parentheses inside comments}{\%\%\%}
435
434 436
435 \section{Motion Commands} 437 \section{Motion Commands}
436 438
437 \key{go backward one character}{h {\rm or} C-h} 439 \key{go backward one character}{h {\rm or} C-h}
438 \key{go forward one character}{l} 440 \key{go forward one character}{l}