home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume37 / vim / part14 < prev    next >
Encoding:
Text File  |  1993-04-23  |  31.1 KB  |  790 lines

  1. Newsgroups: comp.sources.misc
  2. From: mool@oce.nl (Bram Moolenaar)
  3. Subject: v37i014:  vim - Vi IMitation editor v1.27, Part14/24
  4. Message-ID: <1993Apr25.013505.22444@sparky.imd.sterling.com>
  5. X-Md4-Signature: 379ec6bacb85a0779d5ca49c6b0054ab
  6. Date: Sun, 25 Apr 1993 01:35:05 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: mool@oce.nl (Bram Moolenaar)
  10. Posting-number: Volume 37, Issue 14
  11. Archive-name: vim/part14
  12. Environment: UNIX, AMIGA, MS-DOS
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then unpack
  16. # it by saving it into a file and typing "sh file".  To overwrite existing
  17. # files, type "sh file -c".  You can also feed this as standard input via
  18. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  19. # will see the following message at the end:
  20. #        "End of archive 14 (of 23)."
  21. # Contents:  vim/tutor/tutor
  22. # Wrapped by mool@oce-rd2 on Mon Apr 19 15:50:11 1993
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f 'vim/tutor/tutor' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'vim/tutor/tutor'\"
  26. else
  27. echo shar: Extracting \"'vim/tutor/tutor'\" \(28799 characters\)
  28. sed "s/^X//" >'vim/tutor/tutor' <<'END_OF_FILE'
  29. X*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
  30. X*    W e l c o m e   t o   V I   T u t o r    -    V e r s i o n   1 . 2      *
  31. X*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
  32. X                             **************
  33. X                             * Lesson 1.0 *
  34. X                             **************
  35. X
  36. X     Vim is a very powerful editor that has many commands, too many to 
  37. X     explain in a tutor such as this.  This tutor is designed to describe
  38. X     enough of the commands that you will be able to easily use Vim as
  39. X     an all-purpose editor. 
  40. X
  41. X     The approximate time required to complete the tutor is 25-30 minutes, 
  42. X     depending upon how much time is spent with experimentation.
  43. X
  44. X     It is important to remember that this tutor is set up to teach by
  45. X     use.  That means that the student needs to execute the commands to 
  46. X     learn them properly.  
  47. X
  48. X     Now, make sure that your Shift-Lock key is NOT depressed and press
  49. X     the   j   key enough times to move the cursor so that Lesson 1.1 
  50. X     completely fills the screen.
  51. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  52. X                             **************
  53. X                             * Lesson 1.1 *
  54. X                             **************
  55. X                 =====>>>>> MOVING THE CURSOR <<<<<=====
  56. X
  57. X   ** To move the cursor, press the h,j,k,l keys as indicated. ** 
  58. X                                   ^
  59. X                                   k
  60. X                             < h       l >
  61. X                                   j
  62. X                                   v
  63. X  1. Move the cursor around the screen until you are comfortable.
  64. X
  65. X  2. Hold down the down key (j) until it repeats.
  66. X---> Now you know how to move to the next lesson.
  67. X
  68. X  3. Using the down key, move to Lesson 1.2.
  69. X
  70. XNote: If you are ever unsure about something you typed, press <ESC> to place
  71. X      you in Command Mode.  Then retype the command you wanted.
  72. X
  73. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  74. X                             **************
  75. X                             * Lesson 1.2 *
  76. X                             **************
  77. X              =====>>>>> ENTERING AND EXITING VIM <<<<<=====
  78. X
  79. X  !! NOTE: Before executing any of the steps below, read this entire lesson!!
  80. X
  81. X  1. Press the <ESC> key (to make sure you are in Command Mode).
  82. X
  83. X  2. Type      :q! <RETURN>.
  84. X
  85. X---> This exits the editor WITHOUT saving any changes you have made.
  86. X     If you want to save the changes and exit type        :wq  <RETURN>
  87. X
  88. X  3. When you see the shell prompt (%) type:    vim tutor <RETURN>.
  89. X
  90. X---> 'vim' means enter the vim editor, 'tutor' is the file you wish to edit.
  91. X
  92. X  4. If you have these steps memorized and are confident, execute steps
  93. X     1 through 3 to exit and re-enter the editor.  Then cursor down to 
  94. X     Lesson 1.3.
  95. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  96. X                             **************
  97. X                             * Lesson 1.3 *
  98. X                             **************
  99. X              =====>>>>> TEXT EDITING - DELETION <<<<<=====
  100. X
  101. X** While in Command Mode press  x  to delete the character under the cursor. **
  102. X
  103. X  1. Move the cursor to the line below marked --->.
  104. X
  105. X  2. To fix the errors, move the cursor until it is on top of the
  106. X     character to be deleted.
  107. X
  108. X  3. Press the  x  key to delete the unwanted character.
  109. X
  110. X  4. Repeat steps 2 through 4 until the sentence is correct.
  111. X
  112. X---> The ccow jumpedd ovverr thhe mooon.
  113. X
  114. X  5. Now that the line is correct, go on to Lesson 1.4.
  115. X
  116. XNOTE: As you go through this tutor, do not try to memorize, learn by usage.
  117. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  118. X                             **************
  119. X                             * Lesson 1.4 *
  120. X                             **************
  121. X             =====>>>>> TEXT EDITING - INSERTION <<<<<=====
  122. X
  123. X         ** While in Command Mode press  i  to insert text. **
  124. X
  125. X  1. Move the cursor to the first line below marked --->.
  126. X
  127. X  2. To make the first line the same as the second, move the cursor on top 
  128. X     of the first character AFTER where the text is to be inserted.
  129. X
  130. X  3. Press  i  and type in the necessary additions.
  131. X
  132. X  4. As each error is fixed press <ESC> to return to Command Mode.
  133. X     Repeat steps 2 through 4 to correct the sentence.
  134. X
  135. X---> There is text misng this .
  136. X---> There is some text missing from this line.
  137. X
  138. X  5. When you are comfortable inserting text move to the summary below.
  139. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  140. X                          ********************
  141. X                          * LESSON 1 SUMMARY *
  142. X                          ********************
  143. X
  144. X  1. The cursor is moved using either the arrow keys or the h,j,k,l keys.
  145. X         h (left)       j (down)       k (up)       l (right)
  146. X
  147. X  2. To enter Vim (from the % prompt) type:      % vim FILENAME <RETURN>
  148. X
  149. X  3. To exit Vim type:     <ESC>   :q!   <RETURN>
  150. X             OR type:      <ESC>   :wq   <RETURN>  to save the changes.
  151. X
  152. X  4. To delete a character under the cursor in Command Mode type:  x
  153. X
  154. X  5. To insert text at the cursor while in Command Mode type:
  155. X         i     type in text     <ESC>
  156. X
  157. XNOTE: Pressing <ESC> will place you in Command Mode or will cancel
  158. X      an unwanted and partially completed command.
  159. X
  160. XNow continue with Lesson 2.
  161. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  162. X                             **************
  163. X                             * Lesson 2.1 *
  164. X                             **************
  165. X                =====>>>>> DELETION COMMANDS <<<<<=====
  166. X
  167. X            ** Type  dw  to delete to the end of a word. **
  168. X
  169. X  1. Press  <ESC>  to make sure you are in Command Mode.
  170. X
  171. X  2. Move the cursor to the line below marked --->.
  172. X
  173. X  3. Move the cursor to the beginning of a word that needs to be deleted.
  174. X  
  175. X  4. Type   dw   to make the word disappear.
  176. X
  177. X  NOTE: The letters dw will appear on the last line of the screen as you type
  178. X      them. If you typed something wrong, press  <ESC>  and start over.
  179. X
  180. X---> There are a some words fun that don't belong paper in this sentence.
  181. X
  182. X  5. Repeat steps 3 and 4 until the sentence is correct and go to Lesson 2.2.
  183. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  184. X                 **************
  185. X                 * Lesson 2.2 *
  186. X                 **************
  187. X              =====>>>>> MORE DELETION COMMANDS <<<<<=====
  188. X
  189. X           ** Type  d$  to delete to the end of the line. **
  190. X
  191. X  1. Press  <ESC>  to make sure you are in Command Mode.
  192. X
  193. X  2. Move the cursor to the line below marked --->.
  194. X
  195. X  3. Move the cursor to the end of the correct line (AFTER the first . ).
  196. X
  197. X  4. Type    d$    to delete to the end of the line.
  198. X
  199. X---> Somebody typed the end of this line twice. end of this line twice.
  200. X
  201. X
  202. X  5. Move on to Lesson 2.3 to understand what is happening.
  203. X
  204. X
  205. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  206. X                 **************
  207. X                 * Lesson 2.3 *
  208. X                 **************
  209. X             =====>>>>> ON COMMANDS AND OBJECTS <<<<<=====
  210. X
  211. X  The format for the  d  delete command is as follows:
  212. X
  213. X         [number]   d   object      OR       d   [number]   object
  214. X  Where: 
  215. X    number - is how many times to execute the command (optional, default=1).
  216. X    d - is the command to delete.
  217. X    object - is what the command will operate on (listed below).
  218. X
  219. X  A short list of objects:
  220. X    w - from the cursor to the end of the word, including the space.
  221. X    e - from the cursor to the end of the word, NOT including the space.
  222. X    $ - from the cursor to the end of the line.
  223. X    
  224. XNOTE:  For the adventurous, pressing just the object while in Command Mode
  225. X       without a command will move the cursor as specified in the object list.
  226. X
  227. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  228. X                             **************
  229. X                             * Lesson 2.4 *
  230. X                             **************
  231. X        =====>>>>> AN EXCEPTION TO  'COMMAND-OBJECT' <<<<<=====
  232. X
  233. X               ** Type   dd   to delete a whole line. **
  234. X
  235. X  Due to the frequency of whole line deletion, the designers of Vim decided
  236. X  it would be easier to simply type two d's in a row to delete a line.
  237. X
  238. X  1. Move the cursor to the second line in the phrase below. 
  239. X
  240. X  2. Type  dd  to delete the line.
  241. X
  242. X  3. Now move to the fourth line.
  243. X
  244. X  4. Type   2dd   (remember  number-command-object) to delete the two lines.
  245. X
  246. X      1)  Roses are red,
  247. X      2)  Mud is fun,
  248. X      3)  Violets are blue,
  249. X      4)  I have a car,
  250. X      5)  Clocks tell time,
  251. X      6)  Sugar is sweet
  252. X      7)  And so are you.
  253. X
  254. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  255. X                             **************
  256. X                             * Lesson 2.5 *
  257. X                             **************
  258. X                 =====>>>>> THE UNDO COMMAND <<<<<=====
  259. X
  260. X   ** Press  u  to undo the last commands,   U   to fix a whole line. **
  261. X
  262. X  1. Move the cursor to the line below marked ---> and place it on the
  263. X     first error.
  264. X  2. Type  x  to delete the first unwanted character.
  265. X  3. Now type  u  to undo the last command executed.
  266. X  4. This time fix all the errors on the line using the  x  command.
  267. X  5. Now type a capital  U  to return the line to its original state.
  268. X  6. Now type  u  a few times to undo the  U  and preceding commands.
  269. X  7. Now type CTRL-R (keeping CTRL key pressed while hitting R) a few times
  270. X     to redo the commands (undo the undo's).
  271. X
  272. X---> Fiix the errors oon thhis line and reeplace them witth undo.
  273. X
  274. X  8. These are very useful commands.  Now move on to the Lesson 2 Summary.
  275. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  276. X                          ********************
  277. X                          * LESSON 2 SUMMARY *
  278. X                          ********************
  279. X
  280. X  1. To delete from the cursor to the end of a word type:    dw
  281. X
  282. X  2. To delete from the cursor to the end of a line type:    d$
  283. X
  284. X  3. To delete a whole line type:    dd
  285. X
  286. X  4. The format for a command in command mode is:
  287. X
  288. X       [number]   command   object     OR     command   [number]   object
  289. X     where:
  290. X       number - is how many times to repeat the command
  291. X       command - is what to do, such as  d  for delete
  292. X       object - is what the command should act upon, such as  w (word),
  293. X                $ (to the end of line), etc.
  294. X
  295. X  5. To undo previous actions, type:         u   (lowercase u)
  296. X     To undo all the changes on a line type: U   (capital U)
  297. X     To undo the undo's type:             CTRL-R
  298. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  299. X                             **************
  300. X                             * Lesson 3.1 *
  301. X                             **************
  302. X                 =====>>>>> THE PUT COMMAND <<<<<=====
  303. X
  304. X       ** Type  p  to put the last deletion after the cursor. **
  305. X
  306. X  1. Move the cursor to the first line in the set below.
  307. X
  308. X  2. Type  dd  to delete the line and store it in Vim's buffer.
  309. X
  310. X  3. Move the cursor to the line ABOVE where the deleted line should go.
  311. X
  312. X  4. While in Command Mode, type    p    to replace the line.
  313. X
  314. X  5. Repeat steps 2 through 4 to put all the lines in correct order.
  315. X
  316. X     d) Can you learn too?
  317. X     b) Violets are blue,
  318. X     c) Intelligence is learned,
  319. X     a) Roses are red,
  320. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  321. X                             **************
  322. X                             * Lesson 3.2 *
  323. X                             **************
  324. X               =====>>>>> THE REPLACE COMMAND <<<<<=====
  325. X
  326. X  ** Type  r  and a character to replace the character under the cursor. **
  327. X
  328. X  1. Move the cursor to the first line below marked --->.
  329. X
  330. X  2. Move the cursor so that it is on top of the first error.
  331. X
  332. X  3. Type   r   and then the character which should replace the error.
  333. X
  334. X  4. Repeat steps 2 and 3 until the first line is correct.
  335. X
  336. X--->  Whan this lime was tuoed in, someone presswd some wrojg keys!
  337. X--->  When this line was typed in, someone pressed some wrong keys!
  338. X
  339. X  5. Now move on to Lesson 3.2.
  340. X
  341. XNOTE: Remember that you should be learning by use, not memorization.
  342. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  343. X                             **************
  344. X                             * Lesson 3.3 *
  345. X                             **************
  346. X                =====>>>>> THE CHANGE COMMAND <<<<<=====
  347. X
  348. X           ** To change part or all of a word, type  cw . **
  349. X
  350. X  1. Move the cursor to the first line below marked --->.
  351. X
  352. X  2. Place the cursor on the u in lubw.  
  353. X
  354. X  3. Type  cw  and the correct word (in this case, type  'ine'.)
  355. X
  356. X  4. Press <ESC> and move to the next error (the first character to be changed.)
  357. X
  358. X  5. Repeat steps 3 and 4 until the first sentence is the same as the second.
  359. X
  360. X---> This lubw has a few wptfd that mrrf changing usf the change command.
  361. X---> This line has a few words that need changing using the change command. 
  362. X
  363. XNotice that  cw  not only replaces the word, but also places you in insert.
  364. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  365. X                             **************
  366. X                             * Lesson 3.4 *
  367. X                             **************
  368. X               =====>>>>> MORE CHANGES USING c <<<<<=====
  369. X
  370. X     ** The change command is used with the same objects as delete. **
  371. X
  372. X  1. The change command works in the same way as delete.  The format is:
  373. X
  374. X       [number]   c   object       OR       c   [number]   object
  375. X
  376. X  2. The objects are also the same, such as   w (word), $ (end of line), etc.
  377. X
  378. X  3. Move to the first line below marked --->.
  379. X
  380. X  4. Move the cursor to the first error.
  381. X  5. Type  c$  to make the rest of the line like the second and press <ESC>.
  382. X
  383. X---> The end of this line needs some help to make it like the second. 
  384. X---> The end of this line needs to be corrected using the  c$  command.
  385. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  386. X                          ********************
  387. X                          * LESSON 3 SUMMARY *
  388. X                          ********************
  389. X
  390. X  1. To replace text that has already been deleted, type   p .  This Puts the
  391. X     deleted text AFTER the cursor (if a line was deleted it will go on the
  392. X     line below the cursor).
  393. X
  394. X  2. To replace the character under the cursor, type   r   and then the 
  395. X     character which will replace the original.
  396. X
  397. X  3. The change command allows you to change the specified object from the
  398. X     cursor to the end of the object.  eg. Type  cw  to change from the
  399. X     cursor to the end of the word, c$  to change to the end of a line.
  400. X
  401. X  4. The format for change is:
  402. X    
  403. X         [number]   c   object        OR        c   [number]   object
  404. X
  405. XNow go on to the next lesson.
  406. X
  407. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  408. X                             **************
  409. X                             * Lesson 4.1 *
  410. X                             **************
  411. X             =====>>>>> LOCATION AND FILE STATUS <<<<<=====
  412. X
  413. X  ** Type CTRL-g to show your location in the file and the file status.   
  414. X     Type SHIFT-G to move to a line in the file. **
  415. X
  416. X  Note: Read this entire lesson before executing any of the steps!!
  417. X
  418. X  1. Hold down the Ctrl key and press  g .  A status line will appear at the
  419. X     bottom of the page with the filename and the line you are on.  Remember
  420. X     the line number for Step 3.
  421. X
  422. X  2. Press shift-G to move you to the bottom of the file. 
  423. X
  424. X  3. Type in the number of the line you were on and then shift-G.  This will 
  425. X     return you to the line you were on when you first pressed Ctrl-g.
  426. X     (When you type in the numbers, they will NOT be displayed on the screen.)
  427. X
  428. X  4. If you feel confident to do this, execute steps 1 through 3.
  429. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  430. X                             **************
  431. X                             * Lesson 4.2 *
  432. X                             **************
  433. X                =====>>>>> THE SEARCH COMMAND <<<<<=====
  434. X
  435. X     ** Type  /  followed by a phrase to search for the phrase. **
  436. X
  437. X  1. In command mode type the  /  character.  Notice that it and the cursor
  438. X     appear at the bottom of the screen as with the  :  command.
  439. X
  440. X  2. Now type 'errroor' <RETURN>.  This is the word you want to search for.
  441. X
  442. X  3. To search for the same phrase again, simply type  n .
  443. X     To search for the same phrase in the opposite direction, type  Shift-N .
  444. X
  445. X  4. If you want to search for a phrase in the backwards direction, use the
  446. X     command  ?  instead of /.
  447. X
  448. X---> When the search reaches the end of the file it will continue at the start.
  449. X
  450. X  "errroor" is not the way to spell error;  errroor is an error.
  451. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  452. X                             **************
  453. X                             * Lesson 4.3 *
  454. X                             **************
  455. X            =====>>>>> MATCHING PARENTHESES SEARCH <<<<<=====
  456. X
  457. X              ** Type  %  to find a matching ),], or } . **
  458. X
  459. X  1. Place the cursor on any (, [, or { in the line below marked --->. 
  460. X
  461. X  2. Now type the  %  character.
  462. X
  463. X  3. The cursor should be on the matching parenthesis or bracket.
  464. X
  465. X  4. Type  %  to move the cursor back to the first bracket (by matching).
  466. X
  467. X---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
  468. X
  469. XNote: This is very useful in debugging a program with unmatched parentheses!
  470. X
  471. X
  472. X
  473. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  474. X                             **************
  475. X                             * Lesson 4.4 *
  476. X                             **************
  477. X              =====>>>>> A WAY TO CHANGE ERRORS <<<<<=====
  478. X
  479. X        ** Type  :s/old/new/g  to substitute 'new' for 'old'. **
  480. X
  481. X  1. Move the cursor to the line below marked --->.
  482. X
  483. X  2. Type  :s/thee/the <RETURN> .  Note that this command only changes the 
  484. X     first occurrence on the line.
  485. X
  486. X  3. Now type    :s/thee/the/g     meaning substitute globally on the line.
  487. X     This changes all occurrences on the line.
  488. X
  489. X---> thee best time to see thee flowers is in thee spring.
  490. X
  491. X  4. To change every occurrence of a character string between two lines,
  492. X     type   :#,#s/old/new/g    where #,# are the numbers of the two lines.
  493. X     Type   :%s/old/new/g    to change every occurrence in the whole file.
  494. X
  495. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  496. X                          ********************
  497. X                          * LESSON 4 SUMMARY *
  498. X                          ********************
  499. X
  500. X  1. Ctrl-g  displays your location in the file and the file status.
  501. X     Shift-G  moves to the end of the file.  A line number followed 
  502. X     by  Shift-G  moves to that line number.
  503. X
  504. X  2. Typing  /  followed by a phrase searches FORWARD for the phrase.
  505. X     Typing  ?  followed by a phrase searches BACKWARD for the phrase.
  506. X     After a search type  n  to find the next occurrence in the same direction
  507. X     or  Shift-N  to search in the opposite direction.
  508. X
  509. X  3. Typing  %  while the cursor is on a  (,),[,],{, or }  locates its 
  510. X     matching pair.
  511. X
  512. X  4. To substitute new for the first old on a line type    :s/old/new
  513. X     To substitute new for all 'old's on a line type       :s/old/new/g
  514. X     To substitute phrases between two line #'s type       :#,#s/old/new/g
  515. X     To substitute all occurrences in the file type        :%s/old/new/g
  516. X     To ask for confirmation each time add 'c'             :%s/old/new/gc
  517. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  518. X                             **************
  519. X                             * Lesson 5.1 *
  520. X                             **************
  521. X          =====>>>>> HOW TO EXECUTE AN AMIGA COMMAND <<<<<=====
  522. X
  523. X   ** Type  :!  followed by an Amiga command to execute that command. **
  524. X
  525. X  1. Type the familiar command  :  to set the cursor at the bottom of the
  526. X     screen.  This allows you to enter a command.
  527. X
  528. X  2. Now type the  !  (exclamation point) character.  This allows you to 
  529. X     execute an Amiga shell command.
  530. X
  531. X  3. As an example type   ls   following the !.  This will show you a listing
  532. X     of your directory, just as if you were at the  %  prompt.
  533. X
  534. X---> Note:  It is possible to execute any shell command this way.
  535. X
  536. X
  537. X
  538. X
  539. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  540. X                             **************
  541. X                             * Lesson 5.2 *
  542. X                             **************
  543. X              =====>>>>> MORE ON WRITING FILES <<<<<=====
  544. X
  545. X     ** To save the changes made to the file, type  :w FILENAME. **
  546. X
  547. X  1. Type  :!dir  to get a listing of your directory.
  548. X
  549. X  2. Choose a filename that is not already in your area, such as TEST.
  550. X
  551. X  3. Now type:   :w TEST   (where TEST is the filename you chose.)
  552. X
  553. X  4. This saves the whole file  (Vim Tutor)  under the name TEST.
  554. X     To verify this, type    :!dir   again to see your directory
  555. X
  556. X---> Note that if you were to exit Vim and enter again with the filename TEST,
  557. X     the file would be an exact copy of the tutor when you saved it.
  558. X
  559. X  5. Now remove the file from your area by typing:     :!delete TEST
  560. X
  561. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  562. X                             **************
  563. X                             * Lesson 5.3 *
  564. X                             **************
  565. X            =====>>>>> A SELECTIVE WRITE COMMAND <<<<<=====
  566. X
  567. X        ** To save part of the file, type   :#,# w FILENAME **
  568. X
  569. X  1. Once again, type    :!dir    to obtain a listing of your directory and
  570. X     choose a suitable filename such as TEST.
  571. X
  572. X  2. Move the cursor to the top of this page and type  Ctrl-g  to find the 
  573. X     number of that line.  REMEMBER THIS NUMBER!
  574. X
  575. X  3. Now move to the bottom of the page and type  Ctrl-g again.  REMEMBER THIS
  576. X     LINE NUMBER ALSO!
  577. X
  578. X  4. To save ONLY a section to a file, type   :#,# w TEST   where #,# are
  579. X     the two numbers you remembered (top,bottom) and TEST is your filename.
  580. X
  581. X  5. Again, see that the file is there with  :!dir  but DO NOT remove it.      
  582. X
  583. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  584. X                             **************
  585. X                             * Lesson 5.4 *
  586. X                             **************
  587. X           =====>>>>> RETRIEVING AND MERGING FILES <<<<<=====
  588. X
  589. X       ** To insert the contents of a file, type   :r FILENAME **
  590. X
  591. X  1. Type   :!dir   to make sure your TEST filename is present from before.
  592. X
  593. X  2. Place the cursor at the top of this page.
  594. X
  595. XNOTE:  After executing Step 3 you will see Lesson 5.3.  Then move DOWN to
  596. X       this lesson again.
  597. X
  598. X  3. Now retrieve your TEST file using the command   :r TEST   where TEST is 
  599. X     the name of the file.  
  600. X
  601. XNOTE:  The file you retrieve is placed starting where the cursor is located.
  602. X
  603. X  4. To verify that a file was retrieved, cursor back and notice that there 
  604. X     are now two copies of Lesson 5.3, the original and the file version. 
  605. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  606. X                          ********************
  607. X                          * LESSON 5 SUMMARY *
  608. X                          ********************
  609. X
  610. X  1.  :!command  executes an Amiga system command.
  611. X
  612. X      Some useful examples are:
  613. X          :!dir  -  shows a directory listing of your area.
  614. X          :!delete FILENAME  -  removes file FILENAME from your area.
  615. X
  616. X  2.  :w FILENAME  writes the current Vim file to disk with name FILENAME.
  617. X
  618. X  3.  :#,# FILENAME  saves the lines # through # in file FILENAME.
  619. X
  620. X  4.  :r FILENAME  retrieves disk file FILENAME and inserts it into the
  621. X      current file following the cursor position.
  622. X
  623. X
  624. X
  625. X
  626. X
  627. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  628. X                             **************
  629. X                             * Lesson 6.1 *
  630. X                             **************
  631. X                 =====>>>>> THE OPEN COMMAND <<<<<=====
  632. X
  633. X ** Type  o  to open a line below the cursor and place you in insert mode. **
  634. X
  635. X  1. Move the cursor to the line below marked --->.
  636. X
  637. X  2. Type  o (lowercase) to open up a line BELOW the cursor and place you in
  638. X     insert mode.
  639. X
  640. X  3. Now copy the line marked ---> and press <ESC> to exit insert mode.
  641. X
  642. X---> After typing  o  the cursor is placed on the open line in insert mode.
  643. X
  644. X  4. To open up a line ABOVE the cursor, simply type a capital  O , rather
  645. X     than a lowercase  o.  Try this on the line below.
  646. XOpen up a line above this by typing Shift-O while the cursor is on this line.
  647. X
  648. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  649. X                             **************
  650. X                             * Lesson 6.2 *
  651. X                             **************
  652. X                =====>>>>> THE APPEND COMMAND <<<<<=====
  653. X
  654. X             ** Type  a  to insert text AFTER the cursor. **
  655. X
  656. X  1. Move the cursor to the end of the first line below marked ---> by 
  657. X     typing  $  in Command mode.
  658. X
  659. X  2. Type an  a  (lowercase) to append text AFTER the character under the
  660. X     cursor.  (Uppercase  A  appends to the end of the line.)
  661. X
  662. XNote: This avoids typing  i , the last character, the text to insert, <ESC>,
  663. X      cursor-right, and finally, x , just to append to the end of a line!
  664. X
  665. X  3. Now complete the first line.  Note also that append is exactly the same
  666. X     as insert mode, except for the location where text is inserted.
  667. X
  668. X---> This line will allow you to practice
  669. X---> This line will allow you to practice appending text to the end of a line.
  670. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  671. X                             **************
  672. X                             * Lesson 6.3 *
  673. X                             **************
  674. X            =====>>>>> ANOTHER VERSION OF REPLACE <<<<<=====
  675. X
  676. X      ** Type a capital  R  to replace more than one character. **
  677. X
  678. X  1. Move the cursor to the first line below marked --->.
  679. X
  680. X  2. Place the cursor at the beginning of the first word that is different
  681. X     from the second line marked ---> (the word 'last').
  682. X
  683. X  3. Now type  R  and replace the remainder of the text on the first line by
  684. X     typing over the old text to make the first line the same as the second.
  685. X
  686. X---> To make the first line the same as the last on this page use the keys.
  687. X---> To make the first line the same as the second, type R and the new text.
  688. X
  689. X  4. Note that when you press <ESC> to exit, any unaltered text remains.
  690. X
  691. X
  692. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  693. X                             **************
  694. X                             * Lesson 6.4 *
  695. X                             **************
  696. X            =====>>>>> SET ENVIRONMENT VARIABLE <<<<<=====
  697. X
  698. X      ** Change environment so a search or substitute ignores case **
  699. X
  700. X
  701. X  1. Search for 'ignore' by entering: 
  702. X     /ignore
  703. X     Repeat several times by hitting the n key
  704. X
  705. X  2. Set the 'ic' (Ignore case) variable by typing: 
  706. X     :set ic
  707. X
  708. X  3. Now search for 'ignore' again by entering: n
  709. X     Repeat search several more times by hitting the n key
  710. X
  711. X
  712. X
  713. X
  714. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  715. X                          ********************
  716. X                          * LESSON 6 SUMMARY *
  717. X                          ********************
  718. X
  719. X  1. Typing  o  opens a line BELOW the cursor and places the cursor on the open
  720. X     line in insert mode.
  721. X     Typing a capital  O  opens the line ABOVE the line the cursor is on.
  722. X
  723. X  2. Type an  a  to insert text AFTER the character the cursor is on.
  724. X     Typing a capital  A  automatically appends text to the end of the line. 
  725. X
  726. X  3. Typing a capital  R  enters replace mode until  <ESC>  is pressed to exit.
  727. X
  728. X  4. Typing ":set xxx" sets the environment variable "xxx"
  729. X
  730. X
  731. X
  732. X
  733. X
  734. X
  735. X
  736. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  737. X
  738. X  This concludes the Vim Tutor.  It was intended to give a brief overview of
  739. X  the Vim editor, just enough to allow you to use the editor fairly easily.
  740. X  It is far from complete as Vim has many many more commands.
  741. X
  742. X  For more information on Vim editor please refer to:
  743. X
  744. X    doc/reference.doc - a complete description of Vim
  745. X    doc/index - a short summary of all commands
  746. X    doc/difference.doc - summary of differences between vi and Vim
  747. X
  748. X  Or hit the HELP key!
  749. X
  750. X  This tutorial was written by Michael C. Pierce and Robert K. Ware,
  751. X  Colorado School of Mines using ideas supplied by Charles Smith,
  752. X  Colorado State University.
  753. X  E-mail: bware@mines.colorado.edu.
  754. X
  755. X  Modified for Vim by Bram Moolenaar.
  756. X
  757. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  758. END_OF_FILE
  759. if test 28799 -ne `wc -c <'vim/tutor/tutor'`; then
  760.     echo shar: \"'vim/tutor/tutor'\" unpacked with wrong size!
  761. fi
  762. # end of 'vim/tutor/tutor'
  763. fi
  764. echo shar: End of archive 14 \(of 23\).
  765. cp /dev/null ark14isdone
  766. MISSING=""
  767. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ; do
  768.     if test ! -f ark${I}isdone ; then
  769.     MISSING="${MISSING} ${I}"
  770.     fi
  771. done
  772. if test "${MISSING}" = "" ; then
  773.     echo You have unpacked all 23 archives.
  774.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  775. else
  776.     echo You still need to unpack the following archives:
  777.     echo "        " ${MISSING}
  778. fi
  779. ##  End of shell archive.
  780. exit 0
  781. -------------8<----------------8<----------------8<---------------8<--------
  782. Bram Moolenaar                             | DISCLAIMER:  This  note  does  not
  783. Oce Nederland B.V., Research & Development | necessarily represent the position
  784. p.o. box 101, 5900 MA  Venlo               | of  Oce-Nederland  B.V.  Therefore
  785. The Netherlands        phone +31 77 594077 | no liability or responsibility for
  786. UUCP: mool@oce.nl        fax +31 77 595450 | whatever will be accepted.
  787.  
  788. exit 0 # Just in case...
  789.