| 1 | <?xml version="1.0" encoding="UTF-8"?> |
1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/vi-guide.xml,v 1.13 2005/05/12 01:17:17 yoswink Exp $ --> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/vi-guide.xml,v 1.14 2005/07/21 15:58:38 neysx Exp $ --> |
| 3 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
3 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
| 4 | |
4 | |
| 5 | <guide link="/doc/en/vi-guide.xml"> |
5 | <guide link="/doc/en/vi-guide.xml"> |
| 6 | <title>Learning vi -- the "cheatsheet" technique</title> |
6 | <title>Learning vi -- the "cheatsheet" technique</title> |
| 7 | <author title="Author"> |
7 | <author title="Author"> |
| … | |
… | |
| 18 | This guide will teach you how to use vi, using a cheat sheet method to |
18 | This guide will teach you how to use vi, using a cheat sheet method to |
| 19 | accelerate the learning process. This will be the first guide for vi, |
19 | accelerate the learning process. This will be the first guide for vi, |
| 20 | catering to beginners. |
20 | catering to beginners. |
| 21 | </abstract> |
21 | </abstract> |
| 22 | |
22 | |
| 23 | <version>1.1.6</version> |
23 | <version>1.1.7</version> |
| 24 | <date>2005-05-12</date> |
24 | <date>2005-07-21</date> |
| 25 | |
25 | |
| 26 | <chapter> |
26 | <chapter> |
| 27 | <title>Getting Started</title> |
27 | <title>Getting Started</title> |
| 28 | <section> |
28 | <section> |
| 29 | <title>Introduction</title> |
29 | <title>Introduction</title> |
| … | |
… | |
| 103 | enhanced command-line vi, vim also comes with <c>gvim</c>, a nice graphical |
103 | enhanced command-line vi, vim also comes with <c>gvim</c>, a nice graphical |
| 104 | editor which can be configured to use the excellent GTK+ gui library. |
104 | editor which can be configured to use the excellent GTK+ gui library. |
| 105 | Here's a gvim screenshot from my system: |
105 | Here's a gvim screenshot from my system: |
| 106 | </p> |
106 | </p> |
| 107 | |
107 | |
| 108 | <figure link="http://www.ibiblio.org/web-gentoo/images/vishot.png" |
108 | <figure link="/images/vishot.png" short="screenshot" caption="VIM screenshot"/> |
| 109 | short="screenshot" caption="VIM screenshot"/> |
|
|
| 110 | |
109 | |
| 111 | <p> |
110 | <p> |
| 112 | If you're a vi newbie, try to get gvim running on your system. Using |
111 | If you're a vi newbie, try to get gvim running on your system. Using |
| 113 | vi from a gui can make things a bit easier for beginners. |
112 | vi from a gui can make things a bit easier for beginners. |
| 114 | </p> |
113 | </p> |
| … | |
… | |
| 321 | sheet!) Here's a picture of my cheat sheet after I've transcribed all |
320 | sheet!) Here's a picture of my cheat sheet after I've transcribed all |
| 322 | the commands that we've covered so far. Try to follow my layout if |
321 | the commands that we've covered so far. Try to follow my layout if |
| 323 | possible so that we can fit everything on one sheet. |
322 | possible so that we can fit everything on one sheet. |
| 324 | </p> |
323 | </p> |
| 325 | |
324 | |
| 326 | <figure |
325 | <figure link="/images/vicheat-first.png" short="First part of the cheat sheet" |
| 327 | link="http://www.ibiblio.org/web-gentoo/images/vicheat-first.png" |
326 | caption="Cheat Sheet"/> |
| 328 | short="First part of the cheat sheet" caption="Cheat Sheet"/> |
|
|
| 329 | |
327 | |
| 330 | </body> |
328 | </body> |
| 331 | </section> |
329 | </section> |
| 332 | <section> |
330 | <section> |
| 333 | <title>Miscellaneous vi</title> |
331 | <title>Miscellaneous vi</title> |
| … | |
… | |
| 461 | <p> |
459 | <p> |
| 462 | Time to update the cheat sheet! After adding all the commands we've |
460 | Time to update the cheat sheet! After adding all the commands we've |
| 463 | covered so far, your cheat sheet should look like this: |
461 | covered so far, your cheat sheet should look like this: |
| 464 | </p> |
462 | </p> |
| 465 | |
463 | |
| 466 | <figure |
464 | <figure link="/images/vicheat-edit.png" short="Cheat sheet" caption="Cheat |
| 467 | link="http://www.ibiblio.org/web-gentoo/images/vicheat-edit.png" |
465 | sheet with editing commands"/> |
| 468 | short="Cheat sheet" caption="Cheat sheet with editing commands"/> |
|
|
| 469 | |
466 | |
| 470 | </body> |
467 | </body> |
| 471 | </section> |
468 | </section> |
| 472 | </chapter> |
469 | </chapter> |
| 473 | |
470 | |
| … | |
… | |
| 594 | <p> |
591 | <p> |
| 595 | Time to update the cheat sheet again. Here's what it looks like so |
592 | Time to update the cheat sheet again. Here's what it looks like so |
| 596 | far: |
593 | far: |
| 597 | </p> |
594 | </p> |
| 598 | |
595 | |
| 599 | <figure |
596 | <figure link="/images/vicheat-compound.png" short="Cheat Sheet" caption="Cheat |
| 600 | link="http://www.ibiblio.org/web-gentoo/images/vicheat-compound.png" |
597 | sheet with compound commands"/> |
| 601 | short="Cheat Sheet" caption="Cheat sheet with compound commands"/> |
|
|
| 602 | |
598 | |
| 603 | </body> |
599 | </body> |
| 604 | </section> |
600 | </section> |
| 605 | <section> |
601 | <section> |
| 606 | <title>Productivity features</title> |
602 | <title>Productivity features</title> |
| … | |
… | |
| 633 | it can be copied or deleted, and then pasted. If you are using gvim, you |
629 | it can be copied or deleted, and then pasted. If you are using gvim, you |
| 634 | can highlight by simply dragging the left mouse button over a particular |
630 | can highlight by simply dragging the left mouse button over a particular |
| 635 | region: |
631 | region: |
| 636 | </p> |
632 | </p> |
| 637 | |
633 | |
| 638 | <figure |
634 | <figure link="/images/vihighlight.png" short="Highlighted text" caption="VIM |
| 639 | link="http://www.ibiblio.org/web-gentoo/images/vihighlight.png" |
635 | with highlighted text"/> |
| 640 | short="Highlighted text" caption="VIM with highlighted text"/> |
|
|
| 641 | |
636 | |
| 642 | <p> |
637 | <p> |
| 643 | In addition, you can also enter visual mode by hitting <c>v</c> (this |
638 | In addition, you can also enter visual mode by hitting <c>v</c> (this |
| 644 | may be your only option if you are using vi from the console.) Then, |
639 | may be your only option if you are using vi from the console.) Then, |
| 645 | by moving the cursor using movement commands (typically the arrow |
640 | by moving the cursor using movement commands (typically the arrow |
| … | |
… | |
| 707 | Well, we've reached the end of the vi tutorial! After adding all the |
702 | Well, we've reached the end of the vi tutorial! After adding all the |
| 708 | advanced editing commands to your cheat sheet, it should look like |
703 | advanced editing commands to your cheat sheet, it should look like |
| 709 | this: |
704 | this: |
| 710 | </p> |
705 | </p> |
| 711 | |
706 | |
| 712 | <figure |
707 | <figure link="/images/vicheat-final.png" short="Cheat Sheet" caption="Final |
| 713 | link="http://www.ibiblio.org/web-gentoo/images/vicheat-final.png" |
708 | cheet sheet"/> |
| 714 | short="Cheat Sheet" caption="Final cheet sheet"/> |
|
|
| 715 | |
709 | |
| 716 | <p> |
710 | <p> |
| 717 | Keep your cheat sheet handy, and begin using vi to edit files and |
711 | Keep your cheat sheet handy, and begin using vi to edit files and |
| 718 | compose emails. Refer to the cheat sheet when needed; you'll find |
712 | compose emails. Refer to the cheat sheet when needed; you'll find |
| 719 | that within the week, you'll have nearly all the commands memorized |
713 | that within the week, you'll have nearly all the commands memorized |