home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume44 / vim / part19 < prev    next >
Encoding:
Internet Message Format  |  1994-08-18  |  68.9 KB

  1. From: mool@oce.nl (Bram Moolenaar)
  2. Newsgroups: comp.sources.misc
  3. Subject: v44i038:  vim - Vi IMproved editor, v3.0, Part19/26
  4. Date: 18 Aug 1994 14:03:16 -0500
  5. Organization: Sterling Software
  6. Sender: kent@sparky.sterling.com
  7. Approved: kent@sparky.sterling.com
  8. Message-ID: <330b9k$e6u@sparky.sterling.com>
  9. X-Md4-Signature: bc96f7297c32538306ffcebe4bda327b
  10.  
  11. Submitted-by: mool@oce.nl (Bram Moolenaar)
  12. Posting-number: Volume 44, Issue 38
  13. Archive-name: vim/part19
  14. Environment: UNIX, AMIGA, MS-DOS, Windows NT
  15. Supersedes: vim: Volume 41, Issue 50-75
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  vim/doc/vim.man.UU vim/src/window.c vim/tutor/tutor
  22. # Wrapped by kent@sparky on Mon Aug 15 21:44:10 1994
  23. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 19 (of 26)."'
  26. if test -f 'vim/doc/vim.man.UU' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'vim/doc/vim.man.UU'\"
  28. else
  29.   echo shar: Extracting \"'vim/doc/vim.man.UU'\" \(10854 characters\)
  30.   sed "s/^X//" >'vim/doc/vim.man.UU' <<'END_OF_FILE'
  31. Xbegin 644 vim/doc/vim.man
  32. XM"@H*5DE-*#$I(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
  33. XM(" @(" @(" @(" @(" @("!624TH,2D*"@I."$Y!"$%-"$U%"$4*(" @(" @
  34. XM('9I;2 M(%9I($E-<')O=F5D+"!A('!R;V=R86UM97)S('1E>'0@961I=&]R
  35. XM"@I3"%-9"%E."$Y/"$]0"%!3"%-)"$E3"%,*(" @(" @('8(=FD(:6T(;2!;
  36. XM;W!T:6]N<UT@6V9I;&4@+BY="B @(" @("!V"'9I"&EM"&T@6V]P=&EO;G-=
  37. XM("UT('1A9PH@(" @(" @=@AV:0AI;0AM(%MO<'1I;VYS72 M92!;97)R;W)F
  38. XM:6QE70H*1 A$10A%4PA30PA#4@A220A)4 A05 A420A)3PA/3@A."B @(" @
  39. XM("!6"%9I"&EM"&T@(&ES(&$@=&5X="!E9&ET;W(@=&AA="!I<R!U<'=A<F1S
  40. XM(&-O;7!A=&EB;&4@=&\@=FDN($ET"B @(" @("!C86X@8F4@=7-E9"!T;R!E
  41. XM9&ET(&%N>2!!4T-)22!T97AT+B!)="!I<R!E<W!E8VEA;&QY("!U<V4M"B @
  42. XM(" @("!F=6P@9F]R(&5D:71I;F<@<')O9W)A;7,N"@H@(" @(" @5&AE<F4@
  43. XM(&%R92 @82 @;&]T("!O9B @96YH86YC96UE;G1S(&%B;W9E('9I.B!M=6QT
  44. XM:2!L979E; H@(" @(" @=6YD;RP@;75L=&D@=VEN9&]W<R!A;F0@(&)U9F9E
  45. XM<G,L("!C;VUM86YD("!L:6YE("!E9&ET:6YG+ H@(" @(" @9FEL96YA;64@
  46. XM8V]M<&QE=&EO;BP@;VXM;&EN92!H96QP+"!V:7-U86P@<V5L96-T:6]N+"!E
  47. XM=&,N+@H@(" @(" @4F5A9"!D:69F97)E;F-E+F1O8R @9F]R("!A("!S=6UM
  48. XM87)Y("!O9B @=&AE("!D:69F97)E;F-E<PH@(" @(" @8F5T=V5E;B!V:2!A
  49. XM;F0@5FEM+@H*(" @(" @($UO<W0@(&]F=&5N("!6"%9I"&EM"&T@:7,@<W1A
  50. XM<G1E9"!T;R!E9&ET(&$@<VEN9VQE(&9I;&4@=VET:"!T:&4*(" @(" @(&-O
  51. XM;6UA;F0*"B @(" @(" @(" @('9I;2!F:6QE"@H@(" @(" @36]R92!G96YE
  52. XM<F%L;'D@5DE-(&ES('-T87)T960@=VET:#H*"B @(" @(" @(" @('9I;2!;
  53. XM;W!T:6]N<UT@6V9I;&5L:7-T70H*(" @(" @($EF('1H92!F:6QE;&ES="!I
  54. XM<R!M:7-S:6YG+"!T:&4@961I=&]R('=I;&P@<W1A<G0@=VET:" @86X*(" @
  55. XM(" @(&5M<'1Y("!B=69F97(N("!/=&AE<G=I<V4@97AA8W1L>2!O;F4@;W5T
  56. XM(&]F('1H92!F;VQL;W=I;F<*(" @(" @('1H<F5E(&UA>2!B92!U<V5D('1O
  57. XM("!C:&]O<V4@(&]N92 @;W(@(&UO<F4@(&9I;&5S("!T;R @8F4*(" @(" @
  58. XM(&5D:71E9"X*"B @(" @("!F:6QE("XN(" @("!!(&QI<W0@;V8@9FEL92!N
  59. XM86UE<RX@5&AE(&9I<G-T(&]N92 H86QP:&%B970M"B @(" @(" @(" @(" @
  60. XM(" @("!I8V%L;'DI('=I;&P@8F4@=&AE(&-U<G)E;G0@9FEL92!A;F0@<F5A
  61. XM9"!I;G1O"B @(" @(" @(" @(" @(" @("!T:&4@(&)U9F9E<BX@(%1H92!C
  62. XM=7)S;W(@=VEL;"!B92!P;W-I=&EO;F5D(&]N"B @(" @(" @(" @(" @(" @
  63. XM("!T:&4@9FER<W0@;&EN92!O9B!T:&4@8G5F9F5R+B!9;W4@8V%N("!G970@
  64. XM('1O"B @(" @(" @(" @(" @(" @("!T:&4@;W1H97(@9FEL97,@=VET:"!T
  65. XM:&4@(CIN97AT(B!C;VUM86YD+@H*(" @(" @("UT('MT86=](" @(%1H92 @
  66. XM9FEL92!T;R!E9&ET(&%N9"!T:&4@:6YI=&EA;"!C=7)S;W(@<&]S:2T*(" @
  67. XM(" @(" @(" @(" @(" @('1I;VX@9&5P96YD<R!O;B!A(")T86<B+"!A('-O
  68. XM<G0@;V8@9V]T;R!L86)E;"X*(" @(" @(" @(" @(" @(" @('MT86=](&ES
  69. XM(&QO;VME9"!U<"!I;B!T:&4@=&%G<R!F:6QE+"!T:&4@87-S;RT*(" @(" @
  70. XM(" @(" @(" @(" @(&-I871E9"!F:6QE(&)E8V]M97,@=&AE(&-U<G)E;G0@
  71. XM9FEL92 @86YD("!T:&4*(" @(" @(" @(" @(" @(" @(&%S<V]C:6%T960@
  72. XM8V]M;6%N9"!I<R!E>&5C=71E9"X@36]S=&QY('1H:7,@:7,*(" @(" @(" @
  73. XM(" @(" @(" @('5S960@9F]R($,@<')O9W)A;7,N('MT86=]('1H96X@('-H
  74. XM;W5L9" @8F4@(&$*(" @(" @(" @(" @(" @(" @(&9U;F-T:6]N("!N86UE
  75. XM+B @5&AE("!E9F9E8W0@(&ES('1H870@=&AE(&9I;&4*(" @(" @(" @(" @
  76. XM(" @(" @(&-O;G1A:6YI;F<@=&AA="!F=6YC=&EO;B!B96-O;65S("!T:&4@
  77. XM(&-U<G)E;G0*(" @(" @(" @(" @(" @(" @(&9I;&4@86YD('1H92!C=7)S
  78. XM;W(@:7,@<&]S:71I;VYE9"!O;B!T:&4@<W1A<G0*(" @(" @(" @(" @(" @
  79. XM(" @(&]F('1H92!F=6YC=&EO;B @*'-E92 @<F5F97)E;F-E+F1O8RP@('-E
  80. XM8W1I;VX*(" @(" @(" @(" @(" @(" @(")T86<@<V5A<F-H97,B*2X*"B @
  81. XM(" @(" M92!;97)R;W)F:6QE70H@(" @(" @(" @(" @(" @(" @4W1A<G0@
  82. XM(&EN("!Q=6EC:T9I>"!M;V1E+B!4:&4@9FEL92!;97)R;W)F:6QE70H@(" @
  83. XM(" @(" @(" @(" @(" @:7,@<F5A9"!A;F0@=&AE(&9I<G-T(&5R<F]R(&ES
  84. XM("!D:7-P;&%Y960N("!)9@H*"@H@(" @(" @(" @(" @(" @(" @(" @(" @
  85. XM(#$Y.30@075G=7-T(#$R(" @(" @(" @(" @(" @(" @(" @(" @,0H*"@H*
  86. XM"E9)32@Q*2 @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
  87. XM(" @(" @(" @(" @(" @5DE-*#$I"@H*(" @(" @(" @(" @(" @(" @(%ME
  88. XM<G)O<F9I;&5=(" @:7,@(&]M:71T960@('1H92 @9FEL92 @;F%M92 @:7,*
  89. XM(" @(" @(" @(" @(" @(" @(&]B=&%I;F5D(&9R;VT@=&AE("=E<G)O<F9I
  90. XM;&4G(&]P=&EO;B H9&5F875L=',*(" @(" @(" @(" @(" @(" @('1O(" B
  91. XM07IT96-#+D5R<B(@(&9O<B @=&AE("!!;6EG82P@(F5R<F]R<R(@;VX*(" @
  92. XM(" @(" @(" @(" @(" @(&]T:&5R('-Y<W1E;7,I+B!&=7)T:&5R(&5R<F]R
  93. XM<R!C86X@(&)E("!J=6UP960*(" @(" @(" @(" @(" @(" @('1O("!W:71H
  94. XM("!T:&4@(CIC;B(@8V]M;6%N9"X@4V5E(')E9F5R96YC92YD;V,*(" @(" @
  95. XM(" @(" @(" @(" @('-E8W1I;VX@-2XU+@H*3PA/4 A05 A420A)3PA/3@A.
  96. XM4PA3"B @(" @("!4:&4@;W!T:6]N<RP@:68@<')E<V5N="P@;75S="!P<F5C
  97. XM961E("!T:&4@(&9I;&5L:7-T+B @5&AE"B @(" @("!O<'1I;VYS(&UA>2!B
  98. XM92!G:79E;B!I;B!A;GD@;W)D97(N"@H@(" @(" @+7(@(" @(" @(" @4F5C
  99. XM;W9E<GD@(&UO9&4N("!4:&4@('-W87 @(&9I;&4@(&ES("!U<V5D("!T;PH@
  100. XM(" @(" @(" @(" @(" @(" @<F5C;W9E<B!A(&-R87-H960@961I=&EN9R @
  101. XM<V5S<VEO;BX@(%1H92 @<W=A< H@(" @(" @(" @(" @(" @(" @9FEL92 @
  102. XM:7,@82!F:6QE('=I=&@@=&AE('-A;64@9FEL92!N86UE(&%S('1H90H@(" @
  103. XM(" @(" @(" @(" @(" @=&5X="!F:6QE('=I=&@@("(N<W=P(B @87!P96YD
  104. XM960N("!3964@(')E9F5R+0H@(" @(" @(" @(" @(" @(" @96YC92YD;V,L
  105. XM(&-H87!T97(@(E)E8V]V97)Y(&%F=&5R(&$@8W)A<V@B+@H*(" @(" @("UV
  106. XM(" @(" @(" @(%9I97<@(&UO9&4N(%1H92 G<F5A9&]N;'DG(&]P=&EO;B!W
  107. XM:6QL(&)E('-E="X*(" @(" @(" @(" @(" @(" @(%EO=2!C86X@<W1I;&P@
  108. XM961I="!T:&4@(&)U9F9E<BP@(&)U=" @=VEL;" @8F4*(" @(" @(" @(" @
  109. XM(" @(" @('!R979E;G1E9" @9G)O;2!A8V-I9&5N=&QY(&]V97)W<FET:6YG
  110. XM(&$@9FEL92X*(" @(" @(" @(" @(" @(" @($EF('EO=2!D;R!W86YT('1O
  111. XM(&]V97)W<FET92 @82 @9FEL92P@(&%D9" @86X*(" @(" @(" @(" @(" @
  112. XM(" @(&5X8VQA;6%T:6]N("!M87)K("!T;R @=&AE("!%>" @8V]M;6%N9"P@
  113. XM87,@:6X*(" @(" @(" @(" @(" @(" @("(Z=R$B+B @5&AE("UV("!O<'1I
  114. XM;VX@(&%L<V\@(&EM<&QI97,@('1H92 @+6X*(" @(" @(" @(" @(" @(" @
  115. XM(&]P=&EO;B H<V5E(&)E;&]W*2X@(%1H92 G<F5A9&]N;'DG(&]P=&EO;B!C
  116. XM86X*(" @(" @(" @(" @(" @(" @(&)E(')E<V5T('=I=&@@(CIS970@;F]R
  117. XM;R(@*'-E92 @<F5F97)E;F-E+F1O8RP*(" @(" @(" @(" @(" @(" @(&]P
  118. XM=&EO;G,@8VAA<'1E<BDN"@H@(" @(" @+6(@(" @(" @(" @0FEN87)Y+B @
  119. XM02 @9F5W(&]P=&EO;G,@=VEL;"!B92!S970@=&AA="!M86ME<PH@(" @(" @
  120. XM(" @(" @(" @(" @:70@<&]S<VEB;&4@=&\@961I=" @82 @8FEN87)Y("!O
  121. XM<B @97AE8W5T86)L90H@(" @(" @(" @(" @(" @(" @9FEL92X*"B @(" @
  122. XM(" K6VYU;5T@(" @("!&;W(@('1H92 @9FER<W0@(&9I;&4@=&AE(&-U<G-O
  123. XM<B!W:6QL(&)E('!O<VDM"B @(" @(" @(" @(" @(" @("!T:6]N960@;VX@
  124. XM;&EN92 B;G5M(BX@268@(FYU;2(@:7,@;6ES<VEN9RP@=&AE"B @(" @(" @
  125. XM(" @(" @(" @("!C=7)S;W(@=VEL;"!B92!P;W-I=&EO;F5D(&]N('1H92!L
  126. XM87-T(&QI;F4N"@H@(" @(" @*R]P870@(" @(" @1F]R("!T:&4@(&9I<G-T
  127. XM("!F:6QE('1H92!C=7)S;W(@=VEL;"!B92!P;W-I+0H@(" @(" @(" @(" @
  128. XM(" @(" @=&EO;F5D(&]N('1H92!F:7)S="!O8V-U<G)E;F-E(&]F(" B<&%T
  129. XM(B @*'-E90H@(" @(" @(" @(" @(" @(" @<F5F97)E;F-E+F1O8RP@('-E
  130. XM8W1I;VX@(G!A='1E<FX@<V5A<F-H97,B(&9O<@H@(" @(" @(" @(" @(" @
  131. XM(" @=&AE(&%V86EL86)L92!S96%R8V@@<&%T=&5R;G,I+@H*(" @(" @("M[
  132. XM8V]M;6%N9'T*"B @(" @(" M8R![8V]M;6%N9'T*(" @(" @(" @(" @(" @
  133. XM(" @('MC;VUM86YD?2!W:6QL(&)E("!E>&5C=71E9" @869T97(@('1H92 @
  134. XM9FER<W0*(" @(" @(" @(" @(" @(" @(&9I;&4@(&AA<R @8F5E;B!R96%D
  135. XM+B![8V]M;6%N9'T@:7,@:6YT97)P<F5T960*(" @(" @(" @(" @(" @(" @
  136. XM(&%S(&%N($5X(&-O;6UA;F0N($EF("!T:&4@('MC;VUM86YD?2 @8V]N=&%I
  137. XM;G,*(" @(" @(" @(" @(" @(" @('-P86-E<R @:70@(&UU<W0@(&)E(&5N
  138. XM8VQO<V5D(&EN(&1O=6)L92!Q=6]T97,*(" @(" @(" @(" @(" @(" @("AT
  139. XM:&ES(&1E<&5N9',@;VX@('1H92 @<VAE;&P@('1H870@(&ES("!U<V5D*2X*
  140. XM(" @(" @(" @(" @(" @(" @($5X86UP;&4Z(%9I;2 B*W-E="!S:2(@;6%I
  141. XM;BYC"@H@(" @(" @+7@@(" @(" @(" @*$%M:6=A("!O;FQY*2 @5FEM("!I
  142. XM<R!N;W0@<F5S=&%R=&5D('1O(&]P96X@80H@(" @(" @(" @(" @(" @(" @
  143. XM;F5W('=I;F1O=RX@5&AI<R!O<'1I;VX@<VAO=6QD("!B92 @=7-E9" @=VAE
  144. XM;@H@(" @(" @(" @(" @(" @(" @5FEM("!I<R @97AE8W5T960@(&)Y(&$@
  145. XM<')O9W)A;2!T:&%T('=I;&P@=V%I= H@(" @(" @(" @(" @(" @(" @9F]R
  146. XM('1H92!E9&ET('-E<W-I;VX@=&\@(&9I;FES:" @*&4N9RX@(&UA:6PI+@H*
  147. XM"@H@(" @(" @(" @(" @(" @(" @(" @(" @(#$Y.30@075G=7-T(#$R(" @
  148. XM(" @(" @(" @(" @(" @(" @(" @,@H*"@H*"E9)32@Q*2 @(" @(" @(" @
  149. XM(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @5DE-
  150. XM*#$I"@H*(" @(" @(" @(" @(" @(" @(%1H92 B.G-H(B!A;F0@(CHA(B!C
  151. XM;VUM86YD<R!W:6QL(&YO="!W;W)K+@H*(" @(" @("UO6TY=(" @(" @($]P
  152. XM96X@($X@('=I;F1O=W,N("!7:&5N($X@:7,@;VUI='1E9"P@;W!E;B!O;F4*
  153. XM(" @(" @(" @(" @(" @(" @('=I;F1O=R!F;W(@96%C:"!F:6QE+@H*(" @
  154. XM(" @("UN(" @(" @(" @($YO('-W87 @9FEL92!W:6QL(&)E('5S960N("!2
  155. XM96-O=F5R>2 @869T97(@(&$*(" @(" @(" @(" @(" @(" @(&-R87-H('=I
  156. XM;&P@8F4@:6UP;W-S:6)L92X@2&%N9'D@:68@>6]U('=A;G0@=&\*(" @(" @
  157. XM(" @(" @(" @(" @(&5D:70@82 @9FEL92 @;VX@(&$@('9E<GD@('-L;W<@
  158. XM(&UE9&EU;2 @*&4N9RX*(" @(" @(" @(" @(" @(" @(&9L;W!P>2DN("!#
  159. XM86X@(&%L<V\@(&)E(&1O;F4@=VET:" B.G-E="!U8STP(BX*(" @(" @(" @
  160. XM(" @(" @(" @($-A;B!B92!U;F1O;F4@=VET:" B.G-E="!U8STR,# B+@H*
  161. XM(" @(" @("US('MS8W)I<'1I;GT*(" @(" @(" @(" @(" @(" @(%1H92!S
  162. XM8W)I<'0@9FEL92![<V-R:7!T:6Y](&ES(')E860N(%1H92 @8VAA<BT*(" @
  163. XM(" @(" @(" @(" @(" @(&%C=&5R<R @:6X@('1H92!F:6QE(&%R92!I;G1E
  164. XM<G!R971E9"!A<R!I9B!Y;W4*(" @(" @(" @(" @(" @(" @(&AA9"!T>7!E
  165. XM9"!T:&5M+B!4:&4@<V%M92!C86X@8F4@9&]N92!W:71H("!T:&4*(" @(" @
  166. XM(" @(" @(" @(" @(&-O;6UA;F0@("(Z<V]U<F-E(2 @>W-C<FEP=&EN?2(N
  167. XM($EF('1H92!E;F0@;V8*(" @(" @(" @(" @(" @(" @('1H92!F:6QE(&ES
  168. XM(')E86-H960@8F5F;W)E('1H92 @961I=&]R("!E>&ET<RP*(" @(" @(" @
  169. XM(" @(" @(" @(&9U<G1H97(@8VAA<F%C=&5R<R!A<F4@<F5A9"!F<F]M('1H
  170. XM92!K97EB;V%R9"X*"B @(" @(" M=R![<V-R:7!T;W5T?0H@(" @(" @(" @
  171. XM(" @(" @(" @06QL('1H92!C:&%R86-T97)S('1H870@>6]U('1Y<&4@87)E
  172. XM("!R96-O<F1E9 H@(" @(" @(" @(" @(" @(" @:6X@('1H92 @9FEL92![
  173. XM<V-R:7!T;W5T?2P@=6YT:6P@>6]U(&5X:70@5DE-+@H@(" @(" @(" @(" @
  174. XM(" @(" @5&AI<R!I<R!U<V5F=6P@:68@>6]U('=A;G0@=&\@8W)E871E(&$@
  175. XM('-C<FEP= H@(" @(" @(" @(" @(" @(" @9FEL92!T;R!B92!U<V5D('=I
  176. XM=&@@(G9I;2 M<R(@;W(@(CIS;W5R8V4A(BX*"B @(" @(" M5"!T97)M:6YA
  177. XM;"!496QL<R @5FEM("!T:&4@(&YA;64@(&]F('1H92!T97)M:6YA;"!Y;W4@
  178. XM87)E"B @(" @(" @(" @(" @(" @("!U<VEN9RX@4VAO=6QD("!B92 @82 @
  179. XM=&5R;6EN86P@(&MN;W=N("!T;R @5FEM"B @(" @(" @(" @(" @(" @(" H
  180. XM8G5I;'1I;BD@;W(@9&5F:6YE9"!I;B!T:&4@=&5R;6-A<"!F:6QE+@H*(" @
  181. XM(" @("UD(&1E=FEC92 @($]P96X@(")D979I8V4B("!F;W(@=7-E(&%S(&$@
  182. XM=&5R;6EN86PN($]N;'D@;VX*(" @(" @(" @(" @(" @(" @('1H92!!;6EG
  183. XM82X@17AA;7!L93H@(BUD(&-O;CHR,"\S,"\V,# O,34P(BX*"E,(4T4(144(
  184. XM12!!"$%,"$Q3"%-/"$\*(" @(" @(%9I;2!D;V-U;65N=&%T:6]N.@H*(" @
  185. XM(" @(')E9F5R96YC92YD;V,Z"B @(" @(" @(" @(" @(" @("!!(&-O;7!L
  186. XM971E(')E9F5R96YC92!O9B!6:6T@*&QO;F<I"@H@(" @(" @=VEN9&]W<RYD
  187. XM;V,Z"B @(" @(" @(" @(" @(" @("!%>'!L86YA=&EO;B!O9B!T:&4@;75L
  188. XM=&D@=VEN9&]W<R @86YD("!B=69F97)S"B @(" @(" @(" @(" @(" @("!C
  189. XM;VUM86YD<R!A;F0@;W!T:6]N<PH*(" @(" @(&EN9&5X.B @(" @($]V97)V
  190. XM:65W("!O9B @86QL("!C;VUM86YD("!C:&%R86-T97)S("AU<V5F=6P*(" @
  191. XM(" @(" @(" @(" @(" @('=H96X@861D:6YG(&YE=R!M87!P:6YG<RD*"B @
  192. XM(" @("!D:69F97)E;F-E+F1O8SH*(" @(" @(" @(" @(" @(" @($]V97)V
  193. XM:65W(&]F('1H92!D:69F97)E;F-E<R!B971W965N('9I(&%N9"!6:6T*"B @
  194. XM(" @("!U;FEX+F1O8SH@("!5;FEX+7-P96-I9FEC(&-O;6UE;G1S"@H@(" @
  195. XM(" @=FEM+FAL<#H@(" @1FEL92!U<V5D(&)Y('1H92!O;BUL:6YE(&AE;' @
  196. XM*'-H;W)T*0H*00A!50A55 A42 A(3PA/4@A2"B @(" @("!-;W-T(&]F(%9)
  197. XM32!W87,@;6%D92!B>2!"<F%M($UO;VQE;F%A<BX*"@H*(" @(" @(" @(" @
  198. XM(" @(" @(" @(" @(" Q.3DT($%U9W5S=" Q,B @(" @(" @(" @(" @(" @
  199. XM(" @(" @(#,*"@H*"@I624TH,2D@(" @(" @(" @(" @(" @(" @(" @(" @
  200. XM(" @(" @(" @(" @(" @(" @(" @(" @(" @(%9)32@Q*0H*"B @(" @("!6
  201. XM24T@(&ES("!B87-E9"!O;B!3=&5V:64L('=O<FME9"!O;B!B>3H@5&EM(%1H
  202. XM;VUP<V]N+"!4;VYY"B @(" @("!!;F1R97=S(&%N9"!'+E(N("A&<F5D*2!7
  203. XM86QT97(*"D((0E4(54<(1U,(4PH@(" @(" @4')O8F%B;'DN"@H*"@H*"@H*
  204. XM"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H@
  205. XM(" @(" @(" @(" @(" @(" @(" @(" @(#$Y.30@075G=7-T(#$R(" @(" @
  206. X6(" @(" @(" @(" @(" @(" @- H*"B @
  207. Xend
  208. END_OF_FILE
  209.   if test 10854 -ne `wc -c <'vim/doc/vim.man.UU'`; then
  210.     echo shar: \"'vim/doc/vim.man.UU'\" unpacked with wrong size!
  211.   else
  212.     echo shar: Uudecoding \"'vim/doc/vim.man'\" \(7852 characters\)
  213.     cat vim/doc/vim.man.UU | uudecode
  214.     if test 7852 -ne `wc -c <'vim/doc/vim.man'`; then
  215.       echo shar: \"'vim/doc/vim.man'\" uudecoded with wrong size!
  216.     else
  217.       rm vim/doc/vim.man.UU
  218.     fi
  219.   fi
  220.   # end of 'vim/doc/vim.man.UU'
  221. fi
  222. if test -f 'vim/src/window.c' -a "${1}" != "-c" ; then 
  223.   echo shar: Will not clobber existing file \"'vim/src/window.c'\"
  224. else
  225.   echo shar: Extracting \"'vim/src/window.c'\" \(25721 characters\)
  226.   sed "s/^X//" >'vim/src/window.c' <<'END_OF_FILE'
  227. X/* vi:ts=4:sw=4
  228. X *
  229. X * VIM - Vi IMproved        by Bram Moolenaar
  230. X *
  231. X * Read the file "credits.txt" for a list of people who contributed.
  232. X * Read the file "uganda.txt" for copying and usage conditions.
  233. X */
  234. X
  235. X#include "vim.h"
  236. X#include "globals.h"
  237. X#include "proto.h"
  238. X#include "param.h"
  239. X
  240. Xstatic int win_comp_pos __ARGS((void));
  241. Xstatic void win_exchange __ARGS((long));
  242. Xstatic void win_rotate __ARGS((int, int));
  243. Xstatic void win_append __ARGS((WIN *, WIN *));
  244. Xstatic void win_remove __ARGS((WIN *));
  245. X
  246. Xstatic WIN        *prevwin = NULL;        /* previous window */
  247. X
  248. X/*
  249. X * all CTRL-W window commands are handled here, called from normal().
  250. X */
  251. X    void
  252. Xdo_window(nchar, Prenum)
  253. X    int        nchar;
  254. X    long    Prenum;
  255. X{
  256. X    long    Prenum1;
  257. X    WIN        *wp;
  258. X    char_u    *ptr;
  259. X
  260. X    if (Prenum == 0)
  261. X        Prenum1 = 1;
  262. X    else
  263. X        Prenum1 = Prenum;
  264. X
  265. X    switch (nchar)
  266. X    {
  267. X/* split current window in two parts */
  268. X    case 'S':
  269. X    case Ctrl('S'):
  270. X    case 's':    VIsual.lnum = 0;        /* stop Visual mode */
  271. X                win_split(Prenum, TRUE);
  272. X                break;
  273. X
  274. X/* open new window */
  275. X    case Ctrl('N'):
  276. X    case 'n':    VIsual.lnum = 0;                    /* stop Visual mode */
  277. X                stuffcharReadbuff(':');
  278. X                if (Prenum)
  279. X                    stuffnumReadbuff(Prenum);        /* window height */
  280. X                stuffReadbuff((char_u *)"new\n");    /* it is cmdline.c */
  281. X                break;
  282. X
  283. X/* quit current window */
  284. X    case Ctrl('Q'):
  285. X    case 'q':    VIsual.lnum = 0;        /* stop Visual mode */
  286. X                stuffReadbuff((char_u *)":quit\n");    /* it is cmdline.c */
  287. X                break;
  288. X
  289. X/* close current window */
  290. X    case Ctrl('C'):
  291. X    case 'c':    VIsual.lnum = 0;        /* stop Visual mode */
  292. X                stuffReadbuff((char_u *)":close\n");    /* it is cmdline.c */
  293. X                break;
  294. X
  295. X/* close all but current window */
  296. X    case Ctrl('O'):
  297. X    case 'o':    VIsual.lnum = 0;        /* stop Visual mode */
  298. X                stuffReadbuff((char_u *)":only\n");    /* it is cmdline.c */
  299. X                break;
  300. X
  301. X/* cursor to next window */
  302. X    case 'j':
  303. X    case K_DARROW:
  304. X    case Ctrl('J'):
  305. X                VIsual.lnum = 0;        /* stop Visual mode */
  306. X                for (wp = curwin; wp->w_next != NULL && Prenum1-- > 0;
  307. X                                                            wp = wp->w_next)
  308. X                    ;
  309. X                win_enter(wp, TRUE);
  310. X                cursupdate();
  311. X                break;
  312. X
  313. X/* cursor to next window with wrap around */
  314. X    case Ctrl('W'):
  315. X    case 'w':
  316. X                VIsual.lnum = 0;        /* stop Visual mode */
  317. X                if (lastwin == firstwin)        /* just one window */
  318. X                    beep();
  319. X                else
  320. X                {
  321. X                    if (Prenum)                    /* go to specified window */
  322. X                    {
  323. X                        for (wp = firstwin; --Prenum > 0; )
  324. X                        {
  325. X                            if (wp->w_next == NULL)
  326. X                                break;
  327. X                            else
  328. X                                wp = wp->w_next;
  329. X                        }
  330. X                    }
  331. X                    else                        /* go to next window */
  332. X                    {
  333. X                        wp = curwin->w_next;
  334. X                        if (wp == NULL)
  335. X                            wp = firstwin;        /* wrap around */
  336. X                    }
  337. X                    win_enter(wp, TRUE);
  338. X                    cursupdate();
  339. X                }
  340. X                break;
  341. X
  342. X/* cursor to window above */
  343. X    case 'k':
  344. X    case K_UARROW:
  345. X    case Ctrl('K'):
  346. X                VIsual.lnum = 0;        /* stop Visual mode */
  347. X                for (wp = curwin; wp->w_prev != NULL && Prenum1-- > 0;
  348. X                                                            wp = wp->w_prev)
  349. X                    ;
  350. X                win_enter(wp, TRUE);
  351. X                cursupdate();
  352. X                break;
  353. X
  354. X/* cursor to last accessed (previous) window */
  355. X    case 'p':
  356. X    case Ctrl('P'):
  357. X                VIsual.lnum = 0;        /* stop Visual mode */
  358. X                if (prevwin == NULL)
  359. X                    beep();
  360. X                else
  361. X                {
  362. X                    win_enter(prevwin, TRUE);
  363. X                    cursupdate();
  364. X                }
  365. X                break;
  366. X
  367. X/* exchange current and next window */
  368. X    case 'x':
  369. X    case Ctrl('X'):
  370. X                win_exchange(Prenum);
  371. X                break;
  372. X
  373. X/* rotate windows downwards */
  374. X    case Ctrl('R'):
  375. X    case 'r':    VIsual.lnum = 0;                    /* stop Visual mode */
  376. X                win_rotate(FALSE, (int)Prenum1);    /* downwards */
  377. X                break;
  378. X
  379. X/* rotate windows upwards */
  380. X    case 'R':    VIsual.lnum = 0;                    /* stop Visual mode */
  381. X                win_rotate(TRUE, (int)Prenum1);        /* upwards */
  382. X                break;
  383. X
  384. X/* make all windows the same height */
  385. X    case '=':    win_equal(NULL, TRUE);
  386. X                break;
  387. X
  388. X/* increase current window height */
  389. X    case '+':    win_setheight(curwin->w_height + (int)Prenum1);
  390. X                break;
  391. X
  392. X/* decrease current window height */
  393. X    case '-':    win_setheight(curwin->w_height - (int)Prenum1);
  394. X                break;
  395. X
  396. X/* set current window height */
  397. X    case Ctrl('_'):
  398. X    case '_':    win_setheight(Prenum ? (int)Prenum : 9999);
  399. X                break;
  400. X
  401. X/* jump to tag and split window if tag exists */
  402. X    case ']':
  403. X    case Ctrl(']'):
  404. X                VIsual.lnum = 0;        /* stop Visual mode */
  405. X                postponed_split = TRUE;
  406. X                stuffcharReadbuff(Ctrl(']'));
  407. X                break;
  408. X
  409. X/* edit file name under cursor in a new window */
  410. X    case 'f':
  411. X    case Ctrl('F'):
  412. X                VIsual.lnum = 0;        /* stop Visual mode */
  413. X                ptr = file_name_at_cursor();
  414. X                if (ptr == NULL)
  415. X                    beep();
  416. X                else
  417. X                {
  418. X                    stuffReadbuff((char_u *) ":split ");
  419. X                    stuffReadbuff(ptr);
  420. X                    stuffReadbuff((char_u *) "\n");
  421. X                    free(ptr);
  422. X                }
  423. X                break;
  424. X
  425. X    default:    beep();
  426. X                break;
  427. X    }
  428. X}
  429. X
  430. X/*
  431. X * split the current window, implements CTRL-W s and :split
  432. X *
  433. X * new_height is the height for the new window, 0 to make half of current height
  434. X * redraw is TRUE when redraw now
  435. X *
  436. X * return FAIL for failure, OK otherwise
  437. X */
  438. X    int
  439. Xwin_split(new_height, redraw)
  440. X    long    new_height;
  441. X    int        redraw;
  442. X{
  443. X    WIN            *wp;
  444. X    linenr_t    lnum;
  445. X    int            h;
  446. X    int            i;
  447. X    int            need_status;
  448. X    int            do_equal = (p_ea && new_height == 0);
  449. X    int            needed;
  450. X    int            available;
  451. X    
  452. X        /* add a status line when p_ls == 1 and splitting the first window */
  453. X    if (lastwin == firstwin && p_ls == 1 && curwin->w_status_height == 0)
  454. X        need_status = STATUS_HEIGHT;
  455. X    else
  456. X        need_status = 0;
  457. X
  458. X/*
  459. X * check if we are able to split the current window and compute its height
  460. X */
  461. X    available = curwin->w_height;
  462. X     needed = 2 * MIN_ROWS + STATUS_HEIGHT + need_status;
  463. X    if (p_ea)
  464. X    {
  465. X        for (wp = firstwin; wp != NULL; wp = wp->w_next)
  466. X            if (wp != curwin)
  467. X            {
  468. X                available += wp->w_height;
  469. X                needed += MIN_ROWS;
  470. X            }
  471. X    }
  472. X     if (available < needed)
  473. X    {
  474. X        EMSG(e_noroom);
  475. X        return FAIL;
  476. X    }
  477. X    if (need_status)
  478. X    {
  479. X        curwin->w_status_height = STATUS_HEIGHT;
  480. X        curwin->w_height -= STATUS_HEIGHT;
  481. X    }
  482. X    if (new_height == 0)
  483. X        new_height = curwin->w_height / 2;
  484. X
  485. X    if (new_height > curwin->w_height - MIN_ROWS - STATUS_HEIGHT)
  486. X        new_height = curwin->w_height - MIN_ROWS - STATUS_HEIGHT;
  487. X
  488. X    if (new_height < MIN_ROWS)
  489. X        new_height = MIN_ROWS;
  490. X
  491. X        /* if it doesn't fit in the current window, need win_equal() */
  492. X    if (curwin->w_height - new_height - STATUS_HEIGHT < MIN_ROWS)
  493. X        do_equal = TRUE;
  494. X/*
  495. X * allocate new window structure and link it in the window list
  496. X */
  497. X    if (p_sb)        /* new window below current one */
  498. X        wp = win_alloc(curwin);
  499. X    else
  500. X        wp = win_alloc(curwin->w_prev);
  501. X    if (wp == NULL)
  502. X        return FAIL;
  503. X/*
  504. X * compute the new screen positions
  505. X */
  506. X    wp->w_height = new_height;
  507. X    win_comp_scroll(wp);
  508. X    curwin->w_height -= new_height + STATUS_HEIGHT;
  509. X    win_comp_scroll(curwin);
  510. X    if (p_sb)        /* new window below current one */
  511. X    {
  512. X        wp->w_winpos = curwin->w_winpos + curwin->w_height + STATUS_HEIGHT;
  513. X        wp->w_status_height = curwin->w_status_height;
  514. X        curwin->w_status_height = STATUS_HEIGHT;
  515. X    }
  516. X    else            /* new window above current one */
  517. X    {
  518. X        wp->w_winpos = curwin->w_winpos;
  519. X        wp->w_status_height = STATUS_HEIGHT;
  520. X        curwin->w_winpos = wp->w_winpos + wp->w_height + STATUS_HEIGHT;
  521. X    }
  522. X/*
  523. X * make the contents of the new window the same as the current one
  524. X */
  525. X    wp->w_buffer = curbuf;
  526. X    curbuf->b_nwindows++;
  527. X    wp->w_cursor = curwin->w_cursor;
  528. X    wp->w_row = curwin->w_row;
  529. X    wp->w_col = curwin->w_col;
  530. X    wp->w_virtcol = curwin->w_virtcol;
  531. X    wp->w_curswant = curwin->w_curswant;
  532. X    wp->w_set_curswant = curwin->w_set_curswant;
  533. X    wp->w_empty_rows = curwin->w_empty_rows;
  534. X    wp->w_leftcol = curwin->w_leftcol;
  535. X    wp->w_pcmark = curwin->w_pcmark;
  536. X    wp->w_prev_pcmark = curwin->w_prev_pcmark;
  537. X
  538. X    wp->w_arg_idx = curwin->w_arg_idx;
  539. X    /*
  540. X     * copy tagstack and options from existing window
  541. X     */
  542. X    for (i = 0; i < curwin->w_tagstacklen; i++)
  543. X    {
  544. X        wp->w_tagstack[i].fmark = curwin->w_tagstack[i].fmark;
  545. X        wp->w_tagstack[i].tagname = strsave(curwin->w_tagstack[i].tagname);
  546. X    }
  547. X    wp->w_tagstackidx = curwin->w_tagstackidx;
  548. X    wp->w_tagstacklen = curwin->w_tagstacklen;
  549. X    win_copy_options(curwin, wp);
  550. X/*
  551. X * Both windows need redrawing
  552. X */
  553. X     wp->w_redr_type = NOT_VALID;
  554. X    wp->w_redr_status = TRUE;
  555. X     curwin->w_redr_type = NOT_VALID;
  556. X    curwin->w_redr_status = TRUE;
  557. X/*
  558. X * Cursor is put in middle of window in both windows
  559. X */
  560. X    if (wp->w_height < curwin->w_height)    /* use smallest of two heights */
  561. X        h = wp->w_height;
  562. X    else
  563. X        h = curwin->w_height;
  564. X    h >>= 1;
  565. X    for (lnum = wp->w_cursor.lnum; lnum > 1; --lnum)
  566. X    {
  567. X        h -= plines(lnum);
  568. X        if (h <= 0)
  569. X            break;
  570. X    }
  571. X    wp->w_topline = lnum;
  572. X    curwin->w_topline = lnum;
  573. X/*
  574. X * make the new window the current window and redraw
  575. X */
  576. X    if (do_equal)
  577. X        win_equal(wp, FALSE);
  578. X     win_enter(wp, FALSE);
  579. X    if (redraw)
  580. X        updateScreen(NOT_VALID);
  581. X    return OK;
  582. X}
  583. X
  584. X/*
  585. X * make 'count' windows on the screen
  586. X * return actual number of windows on the screen
  587. X * called when there is just one window, filling the whole screen.
  588. X */
  589. X    int
  590. Xmake_windows(count)
  591. X    int        count;
  592. X{
  593. X    int        maxcount;
  594. X    int        todo;
  595. X    int        p_sb_save;
  596. X
  597. X/*
  598. X * each window needs at least MIN_ROWS lines and a status line
  599. X */
  600. X    maxcount = (curwin->w_height + curwin->w_status_height) /
  601. X                                            (MIN_ROWS + STATUS_HEIGHT);
  602. X    if (count > maxcount)
  603. X        count = maxcount;
  604. X
  605. X    /*
  606. X     * add status line now, otherwise first window will be too big
  607. X     */
  608. X    if ((p_ls == 2 || (count > 1 && p_ls == 1)) && curwin->w_status_height == 0)
  609. X    {
  610. X        curwin->w_status_height = STATUS_HEIGHT;
  611. X        curwin->w_height -= STATUS_HEIGHT;
  612. X    }
  613. X
  614. X/*
  615. X * set 'splitbelow' off for a moment, don't what that now
  616. X */
  617. X    p_sb_save = p_sb;
  618. X    p_sb = FALSE;
  619. X        /* todo is number of windows left to create */
  620. X    for (todo = count - 1; todo > 0; --todo)
  621. X        if (win_split((long)(curwin->w_height - (curwin->w_height - todo
  622. X                * STATUS_HEIGHT) / (todo + 1) - STATUS_HEIGHT), FALSE) == FAIL)
  623. X            break;
  624. X    p_sb = p_sb_save;
  625. X
  626. X        /* return actual number of windows */
  627. X    return (count - todo);
  628. X}
  629. X
  630. X/*
  631. X * Exchange current and next window
  632. X */
  633. X    static void
  634. Xwin_exchange(Prenum)
  635. X    long        Prenum;
  636. X{
  637. X    WIN        *wp;
  638. X    WIN        *wp2;
  639. X    int        temp;
  640. X
  641. X    if (lastwin == firstwin)        /* just one window */
  642. X    {
  643. X        beep();
  644. X        return;
  645. X    }
  646. X
  647. X/*
  648. X * find window to exchange with
  649. X */
  650. X    if (Prenum)
  651. X    {
  652. X        wp = firstwin;
  653. X        while (wp != NULL && --Prenum > 0)
  654. X            wp = wp->w_next;
  655. X    }
  656. X    else if (curwin->w_next != NULL)    /* Swap with next */
  657. X        wp = curwin->w_next;
  658. X    else    /* Swap last window with previous */
  659. X        wp = curwin->w_prev;
  660. X
  661. X    if (wp == curwin || wp == NULL)
  662. X        return;
  663. X
  664. X/*
  665. X * 1. remove curwin from the list. Remember after which window it was in wp2
  666. X * 2. insert curwin before wp in the list
  667. X * if wp != wp2
  668. X *    3. remove wp from the list
  669. X *    4. insert wp after wp2
  670. X * 5. exchange the status line height
  671. X */
  672. X    wp2 = curwin->w_prev;
  673. X    win_remove(curwin);
  674. X    win_append(wp->w_prev, curwin);
  675. X    if (wp != wp2)
  676. X    {
  677. X        win_remove(wp);
  678. X        win_append(wp2, wp);
  679. X    }
  680. X    temp = curwin->w_status_height;
  681. X    curwin->w_status_height = wp->w_status_height;
  682. X    wp->w_status_height = temp;
  683. X
  684. X    win_comp_pos();                /* recompute window positions */
  685. X
  686. X    win_enter(wp, TRUE);
  687. X    cursupdate();
  688. X    updateScreen(CLEAR);
  689. X}
  690. X
  691. X/*
  692. X * rotate windows: if upwards TRUE the second window becomes the first one
  693. X *                   if upwards FALSE the first window becomes the second one
  694. X */
  695. X    static void
  696. Xwin_rotate(upwards, count)
  697. X    int        upwards;
  698. X    int        count;
  699. X{
  700. X    WIN             *wp;
  701. X    int             height;
  702. X
  703. X    if (firstwin == lastwin)            /* nothing to do */
  704. X    {
  705. X        beep();
  706. X        return;
  707. X    }
  708. X    while (count--)
  709. X    {
  710. X        if (upwards)            /* first window becomes last window */
  711. X        {
  712. X            wp = firstwin;
  713. X            win_remove(wp);
  714. X            win_append(lastwin, wp);
  715. X            wp = lastwin->w_prev;            /* previously last window */
  716. X        }
  717. X        else                    /* last window becomes first window */
  718. X        {
  719. X            wp = lastwin;
  720. X            win_remove(lastwin);
  721. X            win_append(NULL, wp);
  722. X            wp = firstwin;                    /* previously last window */
  723. X        }
  724. X            /* exchange status height of old and new last window */
  725. X        height = lastwin->w_status_height;
  726. X        lastwin->w_status_height = wp->w_status_height;
  727. X        wp->w_status_height = height;
  728. X
  729. X            /* recompute w_winpos for all windows */
  730. X        (void) win_comp_pos();
  731. X    }
  732. X
  733. X    cursupdate();
  734. X    updateScreen(CLEAR);
  735. X}
  736. X
  737. X/*
  738. X * make all windows the same height
  739. X */
  740. X    void
  741. Xwin_equal(next_curwin, redraw)
  742. X    WIN        *next_curwin;            /* pointer to current window to be */
  743. X    int        redraw;
  744. X{
  745. X    int        total;
  746. X    int        less;
  747. X    int        wincount;
  748. X    int        winpos;
  749. X    int        temp;
  750. X    WIN        *wp;
  751. X    int        new_height;
  752. X
  753. X/*
  754. X * count the number of lines available
  755. X */
  756. X    total = 0;
  757. X    wincount = 0;
  758. X    for (wp = firstwin; wp; wp = wp->w_next)
  759. X    {
  760. X        total += wp->w_height - MIN_ROWS;
  761. X        wincount++;
  762. X    }
  763. X
  764. X/*
  765. X * if next_curwin given and 'winheight' set, make next_curwin p_wh lines
  766. X */
  767. X    if (next_curwin != NULL && p_wh)
  768. X    {
  769. X        if (p_wh - MIN_ROWS > total)    /* all lines go to current window */
  770. X            less = total;
  771. X        else
  772. X        {
  773. X            less = p_wh - MIN_ROWS - total / wincount;
  774. X            if (less < 0)
  775. X                less = 0;
  776. X        }
  777. X    }
  778. X    else
  779. X        less = 0;
  780. X        
  781. X
  782. X/*
  783. X * spread the available lines over the windows
  784. X */
  785. X    winpos = 0;
  786. X    for (wp = firstwin; wp != NULL; wp = wp->w_next)
  787. X    {
  788. X        if (wp == next_curwin && less)
  789. X        {
  790. X            less = 0;
  791. X            temp = p_wh - MIN_ROWS;
  792. X            if (temp > total)
  793. X                temp = total;
  794. X        }
  795. X        else
  796. X            temp = (total - less + (wincount >> 1)) / wincount;
  797. X        new_height = MIN_ROWS + temp;
  798. X        if (wp->w_winpos != winpos || wp->w_height != new_height)
  799. X        {
  800. X            wp->w_redr_type = NOT_VALID;
  801. X            wp->w_redr_status = TRUE;
  802. X        }
  803. X        wp->w_winpos = winpos;
  804. X        wp->w_height = new_height;
  805. X        win_comp_scroll(wp);
  806. X        total -= temp;
  807. X        --wincount;
  808. X        winpos += wp->w_height + wp->w_status_height;
  809. X    }
  810. X    if (redraw)
  811. X    {
  812. X        cursupdate();
  813. X        updateScreen(CLEAR);
  814. X    }
  815. X}
  816. X
  817. X/*
  818. X * close current window
  819. X * If "free_buf" is TRUE related buffer may be freed.
  820. X *
  821. X * called by :quit, :close, :xit, :wq and findtag()
  822. X */
  823. X    void
  824. Xclose_window(free_buf)
  825. X    int        free_buf;
  826. X{
  827. X    WIN     *wp;
  828. X
  829. X    if (lastwin == firstwin)
  830. X    {
  831. X        EMSG("Cannot close last window");
  832. X        return;
  833. X    }
  834. X
  835. X/*
  836. X * Close the link to the buffer.
  837. X */
  838. X    close_buffer(curbuf, free_buf, FALSE);
  839. X
  840. X/*
  841. X * Remove the window.
  842. X */
  843. X    if (curwin->w_prev == NULL)        /* freed space goes to next window */
  844. X    {
  845. X        wp = curwin->w_next;
  846. X        wp->w_winpos = curwin->w_winpos;
  847. X    }
  848. X    else                            /* freed space goes to previous window */
  849. X        wp = curwin->w_prev;
  850. X    wp->w_height += curwin->w_height + curwin->w_status_height;
  851. X
  852. X    win_free(curwin);
  853. X    curwin = NULL;
  854. X    if (p_ea)
  855. X        win_equal(wp, FALSE);
  856. X    win_enter(wp, FALSE);
  857. X    /*
  858. X     * if last window has status line now and we don't want one,
  859. X     * remove the status line
  860. X     */
  861. X    if (lastwin->w_status_height &&
  862. X                        (p_ls == 0 || (p_ls == 1 && firstwin == lastwin)))
  863. X    {
  864. X        lastwin->w_height += lastwin->w_status_height;
  865. X        lastwin->w_status_height = 0;
  866. X        win_comp_scroll(lastwin);
  867. X    }
  868. X    win_comp_scroll(curwin);
  869. X    updateScreen(NOT_VALID);
  870. X}
  871. X
  872. X/*
  873. X * close all windows except current one
  874. X * buffers in the windows become hidden
  875. X *
  876. X * called by :only and do_arg_all();
  877. X */
  878. X    void
  879. Xclose_others(message)
  880. X    int        message;
  881. X{
  882. X    WIN     *wp;
  883. X    WIN     *nextwp;
  884. X
  885. X    if (lastwin == firstwin)
  886. X    {
  887. X        if (message)
  888. X            EMSG("Already only one window");
  889. X        return;
  890. X    }
  891. X
  892. X    for (wp = firstwin; wp != NULL; wp = nextwp)
  893. X    {
  894. X        nextwp = wp->w_next;
  895. X        if (wp == curwin)                /* don't close current window */
  896. X            continue;
  897. X    /*
  898. X     * Close the link to the buffer.
  899. X     */
  900. X        close_buffer(wp->w_buffer, FALSE, FALSE);
  901. X
  902. X    /*
  903. X     * Remove the window. All lines go to current window.
  904. X     */
  905. X        curwin->w_height += wp->w_height + wp->w_status_height;
  906. X
  907. X        win_free(wp);
  908. X    }
  909. X    /*
  910. X     * if current window has status line and we don't want one,
  911. X     * remove the status line
  912. X     */
  913. X    if (curwin->w_status_height && p_ls != 2)
  914. X    {
  915. X        curwin->w_height += curwin->w_status_height;
  916. X        curwin->w_status_height = 0;
  917. X    }
  918. X    curwin->w_winpos = 0;            /* put current window at top of the screen */
  919. X    win_comp_scroll(curwin);
  920. X    if (message)
  921. X        updateScreen(NOT_VALID);
  922. X}
  923. X
  924. X/*
  925. X * init the cursor in the window
  926. X *
  927. X * called when a new file is being edited
  928. X */
  929. X    void
  930. Xwin_init(wp)
  931. X    WIN        *wp;
  932. X{
  933. X    wp->w_redr_type = NOT_VALID;
  934. X    wp->w_cursor.lnum = 1;
  935. X    wp->w_curswant = wp->w_cursor.col = 0;
  936. X    wp->w_pcmark.lnum = 1;        /* pcmark not cleared but set to line 1 */
  937. X    wp->w_pcmark.col = 0;
  938. X    wp->w_prev_pcmark.lnum = 0;
  939. X    wp->w_prev_pcmark.col = 0;
  940. X    wp->w_topline = 1;
  941. X    wp->w_botline = 2;
  942. X}
  943. X
  944. X/*
  945. X * make window wp the current window
  946. X */
  947. X    void
  948. Xwin_enter(wp, undo_sync)
  949. X    WIN        *wp;
  950. X    int        undo_sync;
  951. X{
  952. X    if (wp == curwin)            /* nothing to do */
  953. X        return;
  954. X
  955. X        /* sync undo before leaving the current buffer */
  956. X    if (undo_sync && curbuf != wp->w_buffer)
  957. X        u_sync();
  958. X    if (curwin != NULL)
  959. X        prevwin = curwin;        /* remember for CTRL-W p */
  960. X    curwin = wp;
  961. X    curbuf = wp->w_buffer;
  962. X    maketitle();
  963. X            /* set window height to desired minimal value */
  964. X    if (p_wh && curwin->w_height < p_wh)
  965. X        win_setheight((int)p_wh);
  966. X}
  967. X
  968. X/*
  969. X * allocate a window structure and link it in the window list
  970. X */
  971. X    WIN *
  972. Xwin_alloc(after)
  973. X    WIN        *after;
  974. X{
  975. X    WIN        *new;
  976. X
  977. X/*
  978. X * allocate window structure and linesizes arrays
  979. X */
  980. X    new = (WIN *)alloc((unsigned)sizeof(WIN));
  981. X    if (new)
  982. X    {
  983. X/*
  984. X * most stucture members have to be zero
  985. X */
  986. X         memset((char *)new, 0, sizeof(WIN));
  987. X/*
  988. X * link the window in the window list
  989. X */
  990. X        win_append(after, new);
  991. X
  992. X        win_alloc_lsize(new);
  993. X
  994. X        /* position the display and the cursor at the top of the file. */
  995. X        new->w_topline = 1;
  996. X        new->w_cursor.lnum = 1;
  997. X    }
  998. X    return new;
  999. X}
  1000. X
  1001. X/*
  1002. X * remove window 'wp' from the window list and free the structure
  1003. X */
  1004. X    void
  1005. Xwin_free(wp)
  1006. X    WIN        *wp;
  1007. X{
  1008. X    if (prevwin == wp)
  1009. X        prevwin = NULL;
  1010. X    win_free_lsize(wp);
  1011. X    win_remove(wp);
  1012. X    free(wp);
  1013. X}
  1014. X
  1015. X    static void
  1016. Xwin_append(after, wp)
  1017. X    WIN        *after, *wp;
  1018. X{
  1019. X    WIN     *before;
  1020. X
  1021. X    if (after == NULL)        /* after NULL is in front of the first */
  1022. X        before = firstwin;
  1023. X    else
  1024. X        before = after->w_next;
  1025. X
  1026. X    wp->w_next = before;
  1027. X    wp->w_prev = after;
  1028. X    if (after == NULL)
  1029. X        firstwin = wp;
  1030. X    else
  1031. X        after->w_next = wp;
  1032. X    if (before == NULL)
  1033. X        lastwin = wp;
  1034. X    else
  1035. X        before->w_prev = wp;
  1036. X}
  1037. X
  1038. X/*
  1039. X * remove window from the window list
  1040. X */
  1041. X    static void
  1042. Xwin_remove(wp)
  1043. X    WIN        *wp;
  1044. X{
  1045. X    if (wp->w_prev)
  1046. X        wp->w_prev->w_next = wp->w_next;
  1047. X    else
  1048. X        firstwin = wp->w_next;
  1049. X    if (wp->w_next)
  1050. X        wp->w_next->w_prev = wp->w_prev;
  1051. X    else
  1052. X        lastwin = wp->w_prev;
  1053. X}
  1054. X
  1055. X/*
  1056. X * allocate lsize arrays for a window
  1057. X * return FAIL for failure, OK for success
  1058. X */
  1059. X    int
  1060. Xwin_alloc_lsize(wp)
  1061. X    WIN        *wp;
  1062. X{
  1063. X    wp->w_lsize_valid = 0;
  1064. X    wp->w_lsize_lnum = (linenr_t *) malloc((size_t) (Rows * sizeof(linenr_t)));
  1065. X    wp->w_lsize = (char_u *)malloc((size_t) Rows);
  1066. X    if (wp->w_lsize_lnum == NULL || wp->w_lsize == NULL)
  1067. X    {
  1068. X        win_free_lsize(wp);        /* one of the two may have worked */
  1069. X        wp->w_lsize_lnum = NULL;
  1070. X        wp->w_lsize = NULL;
  1071. X        return FAIL;
  1072. X    }
  1073. X    return OK;
  1074. X}
  1075. X
  1076. X/*
  1077. X * free lsize arrays for a window
  1078. X */
  1079. X     void
  1080. Xwin_free_lsize(wp)
  1081. X    WIN        *wp;
  1082. X{
  1083. X    free(wp->w_lsize_lnum);
  1084. X    free(wp->w_lsize);
  1085. X}
  1086. X
  1087. X/*
  1088. X * call this fuction whenever Rows changes value
  1089. X */
  1090. X    void
  1091. Xscreen_new_rows()
  1092. X{
  1093. X    WIN        *wp;
  1094. X    int        extra_lines;
  1095. X
  1096. X    if (firstwin == NULL)        /* not initialized yet */
  1097. X        return;
  1098. X/*
  1099. X * the number of extra lines is the difference between the position where
  1100. X * the command line should be and where it is now
  1101. X */
  1102. X    compute_cmdrow();
  1103. X    extra_lines = Rows - p_ch - cmdline_row;
  1104. X    if (extra_lines < 0)                        /* reduce windows height */
  1105. X    {
  1106. X        for (wp = lastwin; wp; wp = wp->w_prev)
  1107. X        {
  1108. X            if (wp->w_height - MIN_ROWS < -extra_lines)
  1109. X            {
  1110. X                extra_lines += wp->w_height - MIN_ROWS;
  1111. X                wp->w_height = MIN_ROWS;
  1112. X                win_comp_scroll(wp);
  1113. X            }
  1114. X            else
  1115. X            {
  1116. X                wp->w_height += extra_lines;
  1117. X                win_comp_scroll(wp);
  1118. X                break;
  1119. X            }
  1120. X        }
  1121. X        (void)win_comp_pos();                    /* compute w_winpos */
  1122. X    }
  1123. X    else if (extra_lines > 0)                    /* increase height of last window */
  1124. X    {
  1125. X        lastwin->w_height += extra_lines;
  1126. X        win_comp_scroll(lastwin);
  1127. X    }
  1128. X
  1129. X    compute_cmdrow();
  1130. X}
  1131. X
  1132. X/*
  1133. X * update the w_winpos field for all windows
  1134. X * returns the row just after the last window
  1135. X */
  1136. X    static int
  1137. Xwin_comp_pos()
  1138. X{
  1139. X    WIN        *wp;
  1140. X    int        row;
  1141. X
  1142. X    row = 0;
  1143. X    for (wp = firstwin; wp != NULL; wp = wp->w_next)
  1144. X    {
  1145. X        if (wp->w_winpos != row)        /* if position changes, redraw */
  1146. X        {
  1147. X            wp->w_winpos = row;
  1148. X            wp->w_redr_type = NOT_VALID;
  1149. X            wp->w_redr_status = TRUE;
  1150. X        }
  1151. X        row += wp->w_height + wp->w_status_height;
  1152. X    }
  1153. X    return row;
  1154. X}
  1155. X
  1156. X/*
  1157. X * set current window height
  1158. X */
  1159. X    void
  1160. Xwin_setheight(height)
  1161. X    int        height;
  1162. X{
  1163. X    WIN        *wp;
  1164. X    int        room;                /* total number of lines available */
  1165. X    int        take;                /* number of lines taken from other windows */
  1166. X    int        room_cmdline;        /* lines available from cmdline */
  1167. X    int        row;
  1168. X
  1169. X    if (height < MIN_ROWS)        /* need at least some lines */
  1170. X        height = MIN_ROWS;
  1171. X/*
  1172. X * compute the room we have from all the windows
  1173. X */
  1174. X    room = MIN_ROWS;            /* count the MIN_ROWS for the current window */
  1175. X    for (wp = firstwin; wp != NULL; wp = wp->w_next)
  1176. X        room += wp->w_height - MIN_ROWS;
  1177. X/*
  1178. X * compute the room available from the command line
  1179. X */
  1180. X    room_cmdline = Rows - p_ch - cmdline_row;
  1181. X/*
  1182. X * limit new height to the room available
  1183. X */
  1184. X    if (height > room + room_cmdline)            /* can't make it that large */
  1185. X        height = room + room_cmdline;            /* use all available room */
  1186. X/*
  1187. X * compute the number of lines we will take from the windows (can be negative)
  1188. X */
  1189. X    take = height - curwin->w_height;
  1190. X    if (take == 0)                                /* no change, nothing to do */
  1191. X        return;
  1192. X
  1193. X    if (take > 0)
  1194. X    {
  1195. X        take -= room_cmdline;                    /* use lines from cmdline first */
  1196. X        if (take < 0)
  1197. X            take = 0;
  1198. X    }
  1199. X/*
  1200. X * set the current window to the new height
  1201. X */
  1202. X    curwin->w_height = height;
  1203. X    win_comp_scroll(curwin);
  1204. X/*
  1205. X * take lines from the windows below the current window
  1206. X */
  1207. X    for (wp = curwin->w_next; wp != NULL && take != 0; wp = wp->w_next)
  1208. X    {
  1209. X        if (wp->w_height - take < MIN_ROWS)
  1210. X        {
  1211. X            take -= wp->w_height - MIN_ROWS;
  1212. X            wp->w_height = MIN_ROWS;
  1213. X        }
  1214. X        else
  1215. X        {
  1216. X            wp->w_height -= take;
  1217. X            take = 0;
  1218. X        }
  1219. X        win_comp_scroll(wp);                /* recompute p_scroll */
  1220. X        wp->w_redr_type = NOT_VALID;        /* need to redraw this window */
  1221. X        wp->w_redr_status = TRUE;
  1222. X    }
  1223. X/*
  1224. X * take lines from the windows above the current window
  1225. X */
  1226. X    for (wp = curwin->w_prev; wp != NULL && take != 0; wp = wp->w_prev)
  1227. X    {
  1228. X        if (wp->w_height - take < MIN_ROWS)
  1229. X        {
  1230. X            take -= wp->w_height - MIN_ROWS;
  1231. X            wp->w_height = MIN_ROWS;
  1232. X        }
  1233. X        else
  1234. X        {
  1235. X            wp->w_height -= take;
  1236. X            take = 0;
  1237. X        }
  1238. X        win_comp_scroll(wp);                /* recompute p_scroll */
  1239. X        wp->w_redr_type = NOT_VALID;        /* need to redraw this window */
  1240. X        wp->w_redr_status = TRUE;
  1241. X    }
  1242. X
  1243. X/* recompute the window positions */
  1244. X    row = win_comp_pos();
  1245. X
  1246. X/*
  1247. X * If there is extra space created between the last window and the command line,
  1248. X * clear it.
  1249. X */
  1250. X     screen_fill(row, cmdline_row, 0, (int)Columns, ' ', ' ');
  1251. X    cmdline_row = row;
  1252. X
  1253. X    updateScreen(NOT_VALID);
  1254. X}
  1255. X
  1256. X    void
  1257. Xwin_comp_scroll(wp)
  1258. X    WIN        *wp;
  1259. X{
  1260. X    wp->w_p_scroll = (wp->w_height >> 1);
  1261. X    if (wp->w_p_scroll == 0)
  1262. X        wp->w_p_scroll = 1;
  1263. X}
  1264. X
  1265. X/*
  1266. X * command_height: called whenever p_ch has been changed
  1267. X */
  1268. X    void
  1269. Xcommand_height()
  1270. X{
  1271. X    int        current;
  1272. X
  1273. X    current = Rows - cmdline_row;
  1274. X    if (current > p_ch)                /* p_ch got smaller */
  1275. X        lastwin->w_height += current - p_ch;
  1276. X    else                            /* p_ch got bigger */
  1277. X    {
  1278. X        if (lastwin->w_height - (p_ch - current) < MIN_ROWS)
  1279. X        {
  1280. X            emsg(e_noroom);
  1281. X            p_ch = lastwin->w_height - MIN_ROWS + current;
  1282. X        }
  1283. X        lastwin->w_height -= p_ch - current;
  1284. X                                    /* clear the lines added to cmdline */
  1285. X        screen_fill((int)(Rows - p_ch), (int)Rows, 0, (int)Columns, ' ', ' ');
  1286. X    }
  1287. X    win_comp_scroll(lastwin);
  1288. X    cmdline_row = Rows - p_ch;
  1289. X    lastwin->w_redr_type = NOT_VALID;
  1290. X    lastwin->w_redr_status = TRUE;
  1291. X    redraw_cmdline = TRUE;
  1292. X}
  1293. X
  1294. X    void
  1295. Xlast_status()
  1296. X{
  1297. X    if (lastwin->w_status_height)
  1298. X    {
  1299. X                    /* remove status line */
  1300. X        if (p_ls == 0 || (p_ls == 1 && firstwin == lastwin))
  1301. X        {
  1302. X            lastwin->w_status_height = 0;
  1303. X            lastwin->w_height++;
  1304. X            win_comp_scroll(lastwin);
  1305. X            lastwin->w_redr_status = TRUE;
  1306. X        }
  1307. X    }
  1308. X    else
  1309. X    {
  1310. X                    /* add status line */
  1311. X        if (p_ls == 2 || (p_ls == 1 && firstwin != lastwin))
  1312. X        {
  1313. X            if (lastwin->w_height <= MIN_ROWS)        /* can't do it */
  1314. X                emsg(e_noroom);
  1315. X            else
  1316. X            {
  1317. X                lastwin->w_status_height = 1;
  1318. X                lastwin->w_height--;
  1319. X                win_comp_scroll(lastwin);
  1320. X                lastwin->w_redr_status = TRUE;
  1321. X            }
  1322. X        }
  1323. X    }
  1324. X}
  1325. X
  1326. X/*
  1327. X * file_name_at_cursor()
  1328. X *
  1329. X * Return the name of the file under (or to the right of) the cursor.  The
  1330. X * p_path variable is searched if the file name does not start with '/'.
  1331. X * The string returned has been alloc'ed and should be freed by the caller.
  1332. X * NULL is returned if the file name or file is not found.
  1333. X */
  1334. X    char_u *
  1335. Xfile_name_at_cursor()
  1336. X{
  1337. X    char_u    *ptr;
  1338. X    char_u    *dir;
  1339. X    char_u    *file_name;
  1340. X    char_u    save_char;
  1341. X    int        col;
  1342. X    int        len;
  1343. X
  1344. X        /* characters in a file name besides alfa-num */
  1345. X#ifdef UNIX
  1346. X    char_u    *file_chars = (char_u *)"/.-_+,~$";
  1347. X#endif
  1348. X#ifdef AMIGA
  1349. X    char_u    *file_chars = (char_u *)"/.-_+,$:";
  1350. X#endif
  1351. X#ifdef MSDOS
  1352. X    char_u    *file_chars = (char_u *)"/.-_+,$\\:";
  1353. X#endif
  1354. X
  1355. X    ptr = ml_get(curwin->w_cursor.lnum);
  1356. X    col = curwin->w_cursor.col;
  1357. X
  1358. X        /* search forward for what could be the start of a file name */
  1359. X    while (!isalnum((char) ptr[col]) && STRCHR(file_chars, ptr[col]) == NULL)
  1360. X        ++col;
  1361. X    if (ptr[col] == NUL)            /* nothing found */
  1362. X        return NULL;
  1363. X
  1364. X        /* search backward for char that cannot be in a file name */
  1365. X    while (col >= 0 &&
  1366. X      (isalnum((char) ptr[col]) || STRCHR(file_chars, ptr[col]) != NULL))
  1367. X        --col;
  1368. X    ptr += col + 1;
  1369. X    col = 0;
  1370. X
  1371. X        /* search forward for a char that cannot be in a file name */
  1372. X    while (ptr[col] != NUL
  1373. X      && (isalnum((char) ptr[col]) || STRCHR(file_chars, ptr[col]) != NULL))
  1374. X        ++col;
  1375. X
  1376. X        /* copy file name into NameBuff, expanding environment variables */
  1377. X    save_char = ptr[col];
  1378. X    ptr[col] = NUL;
  1379. X    expand_env(ptr, NameBuff, MAXPATHL);
  1380. X    ptr[col] = save_char;
  1381. X
  1382. X    if (isFullName(NameBuff))            /* absolute path */
  1383. X    {
  1384. X        if ((file_name = strsave(NameBuff)) == NULL)
  1385. X            return NULL;
  1386. X        if (getperm(file_name) >= 0)
  1387. X            return file_name;
  1388. X    }
  1389. X    else                            /* relative path, use 'path' option */
  1390. X    {
  1391. X        if ((file_name = alloc((int)(STRLEN(p_path) + STRLEN(NameBuff) + 2))) == NULL)
  1392. X            return NULL;
  1393. X        dir = p_path;
  1394. X        for (;;)
  1395. X        {
  1396. X            skipspace(&dir);
  1397. X            for (len = 0; dir[len] != NUL && dir[len] != ' '; len++)
  1398. X                ;
  1399. X            if (len == 0)
  1400. X                break;
  1401. X            if (len == 1 && dir[0] == '.')        /* current dir */
  1402. X                STRCPY(file_name, NameBuff);
  1403. X            else
  1404. X            {
  1405. X                STRNCPY(file_name, dir, (size_t)len);
  1406. X#ifdef AMIGA            /* Amiga doesn't like c:/file */
  1407. X                if (file_name[len - 1] != ':')
  1408. X#endif
  1409. X                    file_name[len] = '/';
  1410. X                STRCPY(file_name + len + 1, NameBuff);
  1411. X            }
  1412. X            if (getperm(file_name) >= 0)
  1413. X                return file_name;
  1414. X            dir += len;
  1415. X        }
  1416. X    }
  1417. X    free(file_name);            /* file doesn't exist */
  1418. X    return NULL;
  1419. X}
  1420. END_OF_FILE
  1421.   if test 25721 -ne `wc -c <'vim/src/window.c'`; then
  1422.     echo shar: \"'vim/src/window.c'\" unpacked with wrong size!
  1423.   fi
  1424.   # end of 'vim/src/window.c'
  1425. fi
  1426. if test -f 'vim/tutor/tutor' -a "${1}" != "-c" ; then 
  1427.   echo shar: Will not clobber existing file \"'vim/tutor/tutor'\"
  1428. else
  1429.   echo shar: Extracting \"'vim/tutor/tutor'\" \(28799 characters\)
  1430.   sed "s/^X//" >'vim/tutor/tutor' <<'END_OF_FILE'
  1431. X*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
  1432. 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      *
  1433. X*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
  1434. X                             **************
  1435. X                             * Lesson 1.0 *
  1436. X                             **************
  1437. X
  1438. X     Vim is a very powerful editor that has many commands, too many to 
  1439. X     explain in a tutor such as this.  This tutor is designed to describe
  1440. X     enough of the commands that you will be able to easily use Vim as
  1441. X     an all-purpose editor. 
  1442. X
  1443. X     The approximate time required to complete the tutor is 25-30 minutes, 
  1444. X     depending upon how much time is spent with experimentation.
  1445. X
  1446. X     It is important to remember that this tutor is set up to teach by
  1447. X     use.  That means that the student needs to execute the commands to 
  1448. X     learn them properly.  
  1449. X
  1450. X     Now, make sure that your Shift-Lock key is NOT depressed and press
  1451. X     the   j   key enough times to move the cursor so that Lesson 1.1 
  1452. X     completely fills the screen.
  1453. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1454. X                             **************
  1455. X                             * Lesson 1.1 *
  1456. X                             **************
  1457. X                 =====>>>>> MOVING THE CURSOR <<<<<=====
  1458. X
  1459. X   ** To move the cursor, press the h,j,k,l keys as indicated. ** 
  1460. X                                   ^
  1461. X                                   k
  1462. X                             < h       l >
  1463. X                                   j
  1464. X                                   v
  1465. X  1. Move the cursor around the screen until you are comfortable.
  1466. X
  1467. X  2. Hold down the down key (j) until it repeats.
  1468. X---> Now you know how to move to the next lesson.
  1469. X
  1470. X  3. Using the down key, move to Lesson 1.2.
  1471. X
  1472. XNote: If you are ever unsure about something you typed, press <ESC> to place
  1473. X      you in Command Mode.  Then retype the command you wanted.
  1474. X
  1475. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1476. X                             **************
  1477. X                             * Lesson 1.2 *
  1478. X                             **************
  1479. X              =====>>>>> ENTERING AND EXITING VIM <<<<<=====
  1480. X
  1481. X  !! NOTE: Before executing any of the steps below, read this entire lesson!!
  1482. X
  1483. X  1. Press the <ESC> key (to make sure you are in Command Mode).
  1484. X
  1485. X  2. Type      :q! <RETURN>.
  1486. X
  1487. X---> This exits the editor WITHOUT saving any changes you have made.
  1488. X     If you want to save the changes and exit type        :wq  <RETURN>
  1489. X
  1490. X  3. When you see the shell prompt (%) type:    vim tutor <RETURN>.
  1491. X
  1492. X---> 'vim' means enter the vim editor, 'tutor' is the file you wish to edit.
  1493. X
  1494. X  4. If you have these steps memorized and are confident, execute steps
  1495. X     1 through 3 to exit and re-enter the editor.  Then cursor down to 
  1496. X     Lesson 1.3.
  1497. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1498. X                             **************
  1499. X                             * Lesson 1.3 *
  1500. X                             **************
  1501. X              =====>>>>> TEXT EDITING - DELETION <<<<<=====
  1502. X
  1503. X** While in Command Mode press  x  to delete the character under the cursor. **
  1504. X
  1505. X  1. Move the cursor to the line below marked --->.
  1506. X
  1507. X  2. To fix the errors, move the cursor until it is on top of the
  1508. X     character to be deleted.
  1509. X
  1510. X  3. Press the  x  key to delete the unwanted character.
  1511. X
  1512. X  4. Repeat steps 2 through 4 until the sentence is correct.
  1513. X
  1514. X---> The ccow jumpedd ovverr thhe mooon.
  1515. X
  1516. X  5. Now that the line is correct, go on to Lesson 1.4.
  1517. X
  1518. XNOTE: As you go through this tutor, do not try to memorize, learn by usage.
  1519. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1520. X                             **************
  1521. X                             * Lesson 1.4 *
  1522. X                             **************
  1523. X             =====>>>>> TEXT EDITING - INSERTION <<<<<=====
  1524. X
  1525. X         ** While in Command Mode press  i  to insert text. **
  1526. X
  1527. X  1. Move the cursor to the first line below marked --->.
  1528. X
  1529. X  2. To make the first line the same as the second, move the cursor on top 
  1530. X     of the first character AFTER where the text is to be inserted.
  1531. X
  1532. X  3. Press  i  and type in the necessary additions.
  1533. X
  1534. X  4. As each error is fixed press <ESC> to return to Command Mode.
  1535. X     Repeat steps 2 through 4 to correct the sentence.
  1536. X
  1537. X---> There is text misng this .
  1538. X---> There is some text missing from this line.
  1539. X
  1540. X  5. When you are comfortable inserting text move to the summary below.
  1541. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1542. X                          ********************
  1543. X                          * LESSON 1 SUMMARY *
  1544. X                          ********************
  1545. X
  1546. X  1. The cursor is moved using either the arrow keys or the h,j,k,l keys.
  1547. X         h (left)       j (down)       k (up)       l (right)
  1548. X
  1549. X  2. To enter Vim (from the % prompt) type:      % vim FILENAME <RETURN>
  1550. X
  1551. X  3. To exit Vim type:     <ESC>   :q!   <RETURN>
  1552. X             OR type:      <ESC>   :wq   <RETURN>  to save the changes.
  1553. X
  1554. X  4. To delete a character under the cursor in Command Mode type:  x
  1555. X
  1556. X  5. To insert text at the cursor while in Command Mode type:
  1557. X         i     type in text     <ESC>
  1558. X
  1559. XNOTE: Pressing <ESC> will place you in Command Mode or will cancel
  1560. X      an unwanted and partially completed command.
  1561. X
  1562. XNow continue with Lesson 2.
  1563. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1564. X                             **************
  1565. X                             * Lesson 2.1 *
  1566. X                             **************
  1567. X                =====>>>>> DELETION COMMANDS <<<<<=====
  1568. X
  1569. X            ** Type  dw  to delete to the end of a word. **
  1570. X
  1571. X  1. Press  <ESC>  to make sure you are in Command Mode.
  1572. X
  1573. X  2. Move the cursor to the line below marked --->.
  1574. X
  1575. X  3. Move the cursor to the beginning of a word that needs to be deleted.
  1576. X  
  1577. X  4. Type   dw   to make the word disappear.
  1578. X
  1579. X  NOTE: The letters dw will appear on the last line of the screen as you type
  1580. X      them. If you typed something wrong, press  <ESC>  and start over.
  1581. X
  1582. X---> There are a some words fun that don't belong paper in this sentence.
  1583. X
  1584. X  5. Repeat steps 3 and 4 until the sentence is correct and go to Lesson 2.2.
  1585. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1586. X                 **************
  1587. X                 * Lesson 2.2 *
  1588. X                 **************
  1589. X              =====>>>>> MORE DELETION COMMANDS <<<<<=====
  1590. X
  1591. X           ** Type  d$  to delete to the end of the line. **
  1592. X
  1593. X  1. Press  <ESC>  to make sure you are in Command Mode.
  1594. X
  1595. X  2. Move the cursor to the line below marked --->.
  1596. X
  1597. X  3. Move the cursor to the end of the correct line (AFTER the first . ).
  1598. X
  1599. X  4. Type    d$    to delete to the end of the line.
  1600. X
  1601. X---> Somebody typed the end of this line twice. end of this line twice.
  1602. X
  1603. X
  1604. X  5. Move on to Lesson 2.3 to understand what is happening.
  1605. X
  1606. X
  1607. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1608. X                 **************
  1609. X                 * Lesson 2.3 *
  1610. X                 **************
  1611. X             =====>>>>> ON COMMANDS AND OBJECTS <<<<<=====
  1612. X
  1613. X  The format for the  d  delete command is as follows:
  1614. X
  1615. X         [number]   d   object      OR       d   [number]   object
  1616. X  Where: 
  1617. X    number - is how many times to execute the command (optional, default=1).
  1618. X    d - is the command to delete.
  1619. X    object - is what the command will operate on (listed below).
  1620. X
  1621. X  A short list of objects:
  1622. X    w - from the cursor to the end of the word, including the space.
  1623. X    e - from the cursor to the end of the word, NOT including the space.
  1624. X    $ - from the cursor to the end of the line.
  1625. X    
  1626. XNOTE:  For the adventurous, pressing just the object while in Command Mode
  1627. X       without a command will move the cursor as specified in the object list.
  1628. X
  1629. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1630. X                             **************
  1631. X                             * Lesson 2.4 *
  1632. X                             **************
  1633. X        =====>>>>> AN EXCEPTION TO  'COMMAND-OBJECT' <<<<<=====
  1634. X
  1635. X               ** Type   dd   to delete a whole line. **
  1636. X
  1637. X  Due to the frequency of whole line deletion, the designers of Vim decided
  1638. X  it would be easier to simply type two d's in a row to delete a line.
  1639. X
  1640. X  1. Move the cursor to the second line in the phrase below. 
  1641. X
  1642. X  2. Type  dd  to delete the line.
  1643. X
  1644. X  3. Now move to the fourth line.
  1645. X
  1646. X  4. Type   2dd   (remember  number-command-object) to delete the two lines.
  1647. X
  1648. X      1)  Roses are red,
  1649. X      2)  Mud is fun,
  1650. X      3)  Violets are blue,
  1651. X      4)  I have a car,
  1652. X      5)  Clocks tell time,
  1653. X      6)  Sugar is sweet
  1654. X      7)  And so are you.
  1655. X
  1656. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1657. X                             **************
  1658. X                             * Lesson 2.5 *
  1659. X                             **************
  1660. X                 =====>>>>> THE UNDO COMMAND <<<<<=====
  1661. X
  1662. X   ** Press  u  to undo the last commands,   U   to fix a whole line. **
  1663. X
  1664. X  1. Move the cursor to the line below marked ---> and place it on the
  1665. X     first error.
  1666. X  2. Type  x  to delete the first unwanted character.
  1667. X  3. Now type  u  to undo the last command executed.
  1668. X  4. This time fix all the errors on the line using the  x  command.
  1669. X  5. Now type a capital  U  to return the line to its original state.
  1670. X  6. Now type  u  a few times to undo the  U  and preceding commands.
  1671. X  7. Now type CTRL-R (keeping CTRL key pressed while hitting R) a few times
  1672. X     to redo the commands (undo the undo's).
  1673. X
  1674. X---> Fiix the errors oon thhis line and reeplace them witth undo.
  1675. X
  1676. X  8. These are very useful commands.  Now move on to the Lesson 2 Summary.
  1677. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1678. X                          ********************
  1679. X                          * LESSON 2 SUMMARY *
  1680. X                          ********************
  1681. X
  1682. X  1. To delete from the cursor to the end of a word type:    dw
  1683. X
  1684. X  2. To delete from the cursor to the end of a line type:    d$
  1685. X
  1686. X  3. To delete a whole line type:    dd
  1687. X
  1688. X  4. The format for a command in command mode is:
  1689. X
  1690. X       [number]   command   object     OR     command   [number]   object
  1691. X     where:
  1692. X       number - is how many times to repeat the command
  1693. X       command - is what to do, such as  d  for delete
  1694. X       object - is what the command should act upon, such as  w (word),
  1695. X                $ (to the end of line), etc.
  1696. X
  1697. X  5. To undo previous actions, type:         u   (lowercase u)
  1698. X     To undo all the changes on a line type: U   (capital U)
  1699. X     To undo the undo's type:             CTRL-R
  1700. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1701. X                             **************
  1702. X                             * Lesson 3.1 *
  1703. X                             **************
  1704. X                 =====>>>>> THE PUT COMMAND <<<<<=====
  1705. X
  1706. X       ** Type  p  to put the last deletion after the cursor. **
  1707. X
  1708. X  1. Move the cursor to the first line in the set below.
  1709. X
  1710. X  2. Type  dd  to delete the line and store it in Vim's buffer.
  1711. X
  1712. X  3. Move the cursor to the line ABOVE where the deleted line should go.
  1713. X
  1714. X  4. While in Command Mode, type    p    to replace the line.
  1715. X
  1716. X  5. Repeat steps 2 through 4 to put all the lines in correct order.
  1717. X
  1718. X     d) Can you learn too?
  1719. X     b) Violets are blue,
  1720. X     c) Intelligence is learned,
  1721. X     a) Roses are red,
  1722. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1723. X                             **************
  1724. X                             * Lesson 3.2 *
  1725. X                             **************
  1726. X               =====>>>>> THE REPLACE COMMAND <<<<<=====
  1727. X
  1728. X  ** Type  r  and a character to replace the character under the cursor. **
  1729. X
  1730. X  1. Move the cursor to the first line below marked --->.
  1731. X
  1732. X  2. Move the cursor so that it is on top of the first error.
  1733. X
  1734. X  3. Type   r   and then the character which should replace the error.
  1735. X
  1736. X  4. Repeat steps 2 and 3 until the first line is correct.
  1737. X
  1738. X--->  Whan this lime was tuoed in, someone presswd some wrojg keys!
  1739. X--->  When this line was typed in, someone pressed some wrong keys!
  1740. X
  1741. X  5. Now move on to Lesson 3.2.
  1742. X
  1743. XNOTE: Remember that you should be learning by use, not memorization.
  1744. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1745. X                             **************
  1746. X                             * Lesson 3.3 *
  1747. X                             **************
  1748. X                =====>>>>> THE CHANGE COMMAND <<<<<=====
  1749. X
  1750. X           ** To change part or all of a word, type  cw . **
  1751. X
  1752. X  1. Move the cursor to the first line below marked --->.
  1753. X
  1754. X  2. Place the cursor on the u in lubw.  
  1755. X
  1756. X  3. Type  cw  and the correct word (in this case, type  'ine'.)
  1757. X
  1758. X  4. Press <ESC> and move to the next error (the first character to be changed.)
  1759. X
  1760. X  5. Repeat steps 3 and 4 until the first sentence is the same as the second.
  1761. X
  1762. X---> This lubw has a few wptfd that mrrf changing usf the change command.
  1763. X---> This line has a few words that need changing using the change command. 
  1764. X
  1765. XNotice that  cw  not only replaces the word, but also places you in insert.
  1766. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1767. X                             **************
  1768. X                             * Lesson 3.4 *
  1769. X                             **************
  1770. X               =====>>>>> MORE CHANGES USING c <<<<<=====
  1771. X
  1772. X     ** The change command is used with the same objects as delete. **
  1773. X
  1774. X  1. The change command works in the same way as delete.  The format is:
  1775. X
  1776. X       [number]   c   object       OR       c   [number]   object
  1777. X
  1778. X  2. The objects are also the same, such as   w (word), $ (end of line), etc.
  1779. X
  1780. X  3. Move to the first line below marked --->.
  1781. X
  1782. X  4. Move the cursor to the first error.
  1783. X  5. Type  c$  to make the rest of the line like the second and press <ESC>.
  1784. X
  1785. X---> The end of this line needs some help to make it like the second. 
  1786. X---> The end of this line needs to be corrected using the  c$  command.
  1787. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1788. X                          ********************
  1789. X                          * LESSON 3 SUMMARY *
  1790. X                          ********************
  1791. X
  1792. X  1. To replace text that has already been deleted, type   p .  This Puts the
  1793. X     deleted text AFTER the cursor (if a line was deleted it will go on the
  1794. X     line below the cursor).
  1795. X
  1796. X  2. To replace the character under the cursor, type   r   and then the 
  1797. X     character which will replace the original.
  1798. X
  1799. X  3. The change command allows you to change the specified object from the
  1800. X     cursor to the end of the object.  eg. Type  cw  to change from the
  1801. X     cursor to the end of the word, c$  to change to the end of a line.
  1802. X
  1803. X  4. The format for change is:
  1804. X    
  1805. X         [number]   c   object        OR        c   [number]   object
  1806. X
  1807. XNow go on to the next lesson.
  1808. X
  1809. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1810. X                             **************
  1811. X                             * Lesson 4.1 *
  1812. X                             **************
  1813. X             =====>>>>> LOCATION AND FILE STATUS <<<<<=====
  1814. X
  1815. X  ** Type CTRL-g to show your location in the file and the file status.   
  1816. X     Type SHIFT-G to move to a line in the file. **
  1817. X
  1818. X  Note: Read this entire lesson before executing any of the steps!!
  1819. X
  1820. X  1. Hold down the Ctrl key and press  g .  A status line will appear at the
  1821. X     bottom of the page with the filename and the line you are on.  Remember
  1822. X     the line number for Step 3.
  1823. X
  1824. X  2. Press shift-G to move you to the bottom of the file. 
  1825. X
  1826. X  3. Type in the number of the line you were on and then shift-G.  This will 
  1827. X     return you to the line you were on when you first pressed Ctrl-g.
  1828. X     (When you type in the numbers, they will NOT be displayed on the screen.)
  1829. X
  1830. X  4. If you feel confident to do this, execute steps 1 through 3.
  1831. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1832. X                             **************
  1833. X                             * Lesson 4.2 *
  1834. X                             **************
  1835. X                =====>>>>> THE SEARCH COMMAND <<<<<=====
  1836. X
  1837. X     ** Type  /  followed by a phrase to search for the phrase. **
  1838. X
  1839. X  1. In command mode type the  /  character.  Notice that it and the cursor
  1840. X     appear at the bottom of the screen as with the  :  command.
  1841. X
  1842. X  2. Now type 'errroor' <RETURN>.  This is the word you want to search for.
  1843. X
  1844. X  3. To search for the same phrase again, simply type  n .
  1845. X     To search for the same phrase in the opposite direction, type  Shift-N .
  1846. X
  1847. X  4. If you want to search for a phrase in the backwards direction, use the
  1848. X     command  ?  instead of /.
  1849. X
  1850. X---> When the search reaches the end of the file it will continue at the start.
  1851. X
  1852. X  "errroor" is not the way to spell error;  errroor is an error.
  1853. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1854. X                             **************
  1855. X                             * Lesson 4.3 *
  1856. X                             **************
  1857. X            =====>>>>> MATCHING PARENTHESES SEARCH <<<<<=====
  1858. X
  1859. X              ** Type  %  to find a matching ),], or } . **
  1860. X
  1861. X  1. Place the cursor on any (, [, or { in the line below marked --->. 
  1862. X
  1863. X  2. Now type the  %  character.
  1864. X
  1865. X  3. The cursor should be on the matching parenthesis or bracket.
  1866. X
  1867. X  4. Type  %  to move the cursor back to the first bracket (by matching).
  1868. X
  1869. X---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
  1870. X
  1871. XNote: This is very useful in debugging a program with unmatched parentheses!
  1872. X
  1873. X
  1874. X
  1875. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1876. X                             **************
  1877. X                             * Lesson 4.4 *
  1878. X                             **************
  1879. X              =====>>>>> A WAY TO CHANGE ERRORS <<<<<=====
  1880. X
  1881. X        ** Type  :s/old/new/g  to substitute 'new' for 'old'. **
  1882. X
  1883. X  1. Move the cursor to the line below marked --->.
  1884. X
  1885. X  2. Type  :s/thee/the <RETURN> .  Note that this command only changes the 
  1886. X     first occurrence on the line.
  1887. X
  1888. X  3. Now type    :s/thee/the/g     meaning substitute globally on the line.
  1889. X     This changes all occurrences on the line.
  1890. X
  1891. X---> thee best time to see thee flowers is in thee spring.
  1892. X
  1893. X  4. To change every occurrence of a character string between two lines,
  1894. X     type   :#,#s/old/new/g    where #,# are the numbers of the two lines.
  1895. X     Type   :%s/old/new/g    to change every occurrence in the whole file.
  1896. X
  1897. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1898. X                          ********************
  1899. X                          * LESSON 4 SUMMARY *
  1900. X                          ********************
  1901. X
  1902. X  1. Ctrl-g  displays your location in the file and the file status.
  1903. X     Shift-G  moves to the end of the file.  A line number followed 
  1904. X     by  Shift-G  moves to that line number.
  1905. X
  1906. X  2. Typing  /  followed by a phrase searches FORWARD for the phrase.
  1907. X     Typing  ?  followed by a phrase searches BACKWARD for the phrase.
  1908. X     After a search type  n  to find the next occurrence in the same direction
  1909. X     or  Shift-N  to search in the opposite direction.
  1910. X
  1911. X  3. Typing  %  while the cursor is on a  (,),[,],{, or }  locates its 
  1912. X     matching pair.
  1913. X
  1914. X  4. To substitute new for the first old on a line type    :s/old/new
  1915. X     To substitute new for all 'old's on a line type       :s/old/new/g
  1916. X     To substitute phrases between two line #'s type       :#,#s/old/new/g
  1917. X     To substitute all occurrences in the file type        :%s/old/new/g
  1918. X     To ask for confirmation each time add 'c'             :%s/old/new/gc
  1919. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1920. X                             **************
  1921. X                             * Lesson 5.1 *
  1922. X                             **************
  1923. X          =====>>>>> HOW TO EXECUTE AN AMIGA COMMAND <<<<<=====
  1924. X
  1925. X   ** Type  :!  followed by an Amiga command to execute that command. **
  1926. X
  1927. X  1. Type the familiar command  :  to set the cursor at the bottom of the
  1928. X     screen.  This allows you to enter a command.
  1929. X
  1930. X  2. Now type the  !  (exclamation point) character.  This allows you to 
  1931. X     execute an Amiga shell command.
  1932. X
  1933. X  3. As an example type   ls   following the !.  This will show you a listing
  1934. X     of your directory, just as if you were at the  %  prompt.
  1935. X
  1936. X---> Note:  It is possible to execute any shell command this way.
  1937. X
  1938. X
  1939. X
  1940. X
  1941. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1942. X                             **************
  1943. X                             * Lesson 5.2 *
  1944. X                             **************
  1945. X              =====>>>>> MORE ON WRITING FILES <<<<<=====
  1946. X
  1947. X     ** To save the changes made to the file, type  :w FILENAME. **
  1948. X
  1949. X  1. Type  :!dir  to get a listing of your directory.
  1950. X
  1951. X  2. Choose a filename that is not already in your area, such as TEST.
  1952. X
  1953. X  3. Now type:   :w TEST   (where TEST is the filename you chose.)
  1954. X
  1955. X  4. This saves the whole file  (Vim Tutor)  under the name TEST.
  1956. X     To verify this, type    :!dir   again to see your directory
  1957. X
  1958. X---> Note that if you were to exit Vim and enter again with the filename TEST,
  1959. X     the file would be an exact copy of the tutor when you saved it.
  1960. X
  1961. X  5. Now remove the file from your area by typing:     :!delete TEST
  1962. X
  1963. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1964. X                             **************
  1965. X                             * Lesson 5.3 *
  1966. X                             **************
  1967. X            =====>>>>> A SELECTIVE WRITE COMMAND <<<<<=====
  1968. X
  1969. X        ** To save part of the file, type   :#,# w FILENAME **
  1970. X
  1971. X  1. Once again, type    :!dir    to obtain a listing of your directory and
  1972. X     choose a suitable filename such as TEST.
  1973. X
  1974. X  2. Move the cursor to the top of this page and type  Ctrl-g  to find the 
  1975. X     number of that line.  REMEMBER THIS NUMBER!
  1976. X
  1977. X  3. Now move to the bottom of the page and type  Ctrl-g again.  REMEMBER THIS
  1978. X     LINE NUMBER ALSO!
  1979. X
  1980. X  4. To save ONLY a section to a file, type   :#,# w TEST   where #,# are
  1981. X     the two numbers you remembered (top,bottom) and TEST is your filename.
  1982. X
  1983. X  5. Again, see that the file is there with  :!dir  but DO NOT remove it.      
  1984. X
  1985. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1986. X                             **************
  1987. X                             * Lesson 5.4 *
  1988. X                             **************
  1989. X           =====>>>>> RETRIEVING AND MERGING FILES <<<<<=====
  1990. X
  1991. X       ** To insert the contents of a file, type   :r FILENAME **
  1992. X
  1993. X  1. Type   :!dir   to make sure your TEST filename is present from before.
  1994. X
  1995. X  2. Place the cursor at the top of this page.
  1996. X
  1997. XNOTE:  After executing Step 3 you will see Lesson 5.3.  Then move DOWN to
  1998. X       this lesson again.
  1999. X
  2000. X  3. Now retrieve your TEST file using the command   :r TEST   where TEST is 
  2001. X     the name of the file.  
  2002. X
  2003. XNOTE:  The file you retrieve is placed starting where the cursor is located.
  2004. X
  2005. X  4. To verify that a file was retrieved, cursor back and notice that there 
  2006. X     are now two copies of Lesson 5.3, the original and the file version. 
  2007. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2008. X                          ********************
  2009. X                          * LESSON 5 SUMMARY *
  2010. X                          ********************
  2011. X
  2012. X  1.  :!command  executes an Amiga system command.
  2013. X
  2014. X      Some useful examples are:
  2015. X          :!dir  -  shows a directory listing of your area.
  2016. X          :!delete FILENAME  -  removes file FILENAME from your area.
  2017. X
  2018. X  2.  :w FILENAME  writes the current Vim file to disk with name FILENAME.
  2019. X
  2020. X  3.  :#,# FILENAME  saves the lines # through # in file FILENAME.
  2021. X
  2022. X  4.  :r FILENAME  retrieves disk file FILENAME and inserts it into the
  2023. X      current file following the cursor position.
  2024. X
  2025. X
  2026. X
  2027. X
  2028. X
  2029. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2030. X                             **************
  2031. X                             * Lesson 6.1 *
  2032. X                             **************
  2033. X                 =====>>>>> THE OPEN COMMAND <<<<<=====
  2034. X
  2035. X ** Type  o  to open a line below the cursor and place you in insert mode. **
  2036. X
  2037. X  1. Move the cursor to the line below marked --->.
  2038. X
  2039. X  2. Type  o (lowercase) to open up a line BELOW the cursor and place you in
  2040. X     insert mode.
  2041. X
  2042. X  3. Now copy the line marked ---> and press <ESC> to exit insert mode.
  2043. X
  2044. X---> After typing  o  the cursor is placed on the open line in insert mode.
  2045. X
  2046. X  4. To open up a line ABOVE the cursor, simply type a capital  O , rather
  2047. X     than a lowercase  o.  Try this on the line below.
  2048. XOpen up a line above this by typing Shift-O while the cursor is on this line.
  2049. X
  2050. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2051. X                             **************
  2052. X                             * Lesson 6.2 *
  2053. X                             **************
  2054. X                =====>>>>> THE APPEND COMMAND <<<<<=====
  2055. X
  2056. X             ** Type  a  to insert text AFTER the cursor. **
  2057. X
  2058. X  1. Move the cursor to the end of the first line below marked ---> by 
  2059. X     typing  $  in Command mode.
  2060. X
  2061. X  2. Type an  a  (lowercase) to append text AFTER the character under the
  2062. X     cursor.  (Uppercase  A  appends to the end of the line.)
  2063. X
  2064. XNote: This avoids typing  i , the last character, the text to insert, <ESC>,
  2065. X      cursor-right, and finally, x , just to append to the end of a line!
  2066. X
  2067. X  3. Now complete the first line.  Note also that append is exactly the same
  2068. X     as insert mode, except for the location where text is inserted.
  2069. X
  2070. X---> This line will allow you to practice
  2071. X---> This line will allow you to practice appending text to the end of a line.
  2072. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2073. X                             **************
  2074. X                             * Lesson 6.3 *
  2075. X                             **************
  2076. X            =====>>>>> ANOTHER VERSION OF REPLACE <<<<<=====
  2077. X
  2078. X      ** Type a capital  R  to replace more than one character. **
  2079. X
  2080. X  1. Move the cursor to the first line below marked --->.
  2081. X
  2082. X  2. Place the cursor at the beginning of the first word that is different
  2083. X     from the second line marked ---> (the word 'last').
  2084. X
  2085. X  3. Now type  R  and replace the remainder of the text on the first line by
  2086. X     typing over the old text to make the first line the same as the second.
  2087. X
  2088. X---> To make the first line the same as the last on this page use the keys.
  2089. X---> To make the first line the same as the second, type R and the new text.
  2090. X
  2091. X  4. Note that when you press <ESC> to exit, any unaltered text remains.
  2092. X
  2093. X
  2094. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2095. X                             **************
  2096. X                             * Lesson 6.4 *
  2097. X                             **************
  2098. X            =====>>>>> SET ENVIRONMENT VARIABLE <<<<<=====
  2099. X
  2100. X      ** Change environment so a search or substitute ignores case **
  2101. X
  2102. X
  2103. X  1. Search for 'ignore' by entering: 
  2104. X     /ignore
  2105. X     Repeat several times by hitting the n key
  2106. X
  2107. X  2. Set the 'ic' (Ignore case) variable by typing: 
  2108. X     :set ic
  2109. X
  2110. X  3. Now search for 'ignore' again by entering: n
  2111. X     Repeat search several more times by hitting the n key
  2112. X
  2113. X
  2114. X
  2115. X
  2116. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2117. X                          ********************
  2118. X                          * LESSON 6 SUMMARY *
  2119. X                          ********************
  2120. X
  2121. X  1. Typing  o  opens a line BELOW the cursor and places the cursor on the open
  2122. X     line in insert mode.
  2123. X     Typing a capital  O  opens the line ABOVE the line the cursor is on.
  2124. X
  2125. X  2. Type an  a  to insert text AFTER the character the cursor is on.
  2126. X     Typing a capital  A  automatically appends text to the end of the line. 
  2127. X
  2128. X  3. Typing a capital  R  enters replace mode until  <ESC>  is pressed to exit.
  2129. X
  2130. X  4. Typing ":set xxx" sets the environment variable "xxx"
  2131. X
  2132. X
  2133. X
  2134. X
  2135. X
  2136. X
  2137. X
  2138. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2139. X
  2140. X  This concludes the Vim Tutor.  It was intended to give a brief overview of
  2141. X  the Vim editor, just enough to allow you to use the editor fairly easily.
  2142. X  It is far from complete as Vim has many many more commands.
  2143. X
  2144. X  For more information on Vim editor please refer to:
  2145. X
  2146. X    doc/reference.doc - a complete description of Vim
  2147. X    doc/index - a short summary of all commands
  2148. X    doc/difference.doc - summary of differences between vi and Vim
  2149. X
  2150. X  Or hit the HELP key!
  2151. X
  2152. X  This tutorial was written by Michael C. Pierce and Robert K. Ware,
  2153. X  Colorado School of Mines using ideas supplied by Charles Smith,
  2154. X  Colorado State University.
  2155. X  E-mail: bware@mines.colorado.edu.
  2156. X
  2157. X  Modified for Vim by Bram Moolenaar.
  2158. X
  2159. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2160. END_OF_FILE
  2161.   if test 28799 -ne `wc -c <'vim/tutor/tutor'`; then
  2162.     echo shar: \"'vim/tutor/tutor'\" unpacked with wrong size!
  2163.   fi
  2164.   # end of 'vim/tutor/tutor'
  2165. fi
  2166. echo shar: End of archive 19 \(of 26\).
  2167. cp /dev/null ark19isdone
  2168. MISSING=""
  2169. 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 24 25 26 ; do
  2170.     if test ! -f ark${I}isdone ; then
  2171.     MISSING="${MISSING} ${I}"
  2172.     fi
  2173. done
  2174. if test "${MISSING}" = "" ; then
  2175.     echo You have unpacked all 26 archives.
  2176.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2177. else
  2178.     echo You still must unpack the following archives:
  2179.     echo "        " ${MISSING}
  2180. fi
  2181. exit 0
  2182. exit 0 # Just in case...
  2183.