home *** CD-ROM | disk | FTP | other *** search
- From: mool@oce.nl (Bram Moolenaar)
- Newsgroups: comp.sources.misc
- Subject: v44i038: vim - Vi IMproved editor, v3.0, Part19/26
- Date: 18 Aug 1994 14:03:16 -0500
- Organization: Sterling Software
- Sender: kent@sparky.sterling.com
- Approved: kent@sparky.sterling.com
- Message-ID: <330b9k$e6u@sparky.sterling.com>
- X-Md4-Signature: bc96f7297c32538306ffcebe4bda327b
-
- Submitted-by: mool@oce.nl (Bram Moolenaar)
- Posting-number: Volume 44, Issue 38
- Archive-name: vim/part19
- Environment: UNIX, AMIGA, MS-DOS, Windows NT
- Supersedes: vim: Volume 41, Issue 50-75
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: vim/doc/vim.man.UU vim/src/window.c vim/tutor/tutor
- # Wrapped by kent@sparky on Mon Aug 15 21:44:10 1994
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 19 (of 26)."'
- if test -f 'vim/doc/vim.man.UU' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vim/doc/vim.man.UU'\"
- else
- echo shar: Extracting \"'vim/doc/vim.man.UU'\" \(10854 characters\)
- sed "s/^X//" >'vim/doc/vim.man.UU' <<'END_OF_FILE'
- Xbegin 644 vim/doc/vim.man
- XM"@H*5DE-*#$I(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
- XM(" @(" @(" @(" @(" @("!624TH,2D*"@I."$Y!"$%-"$U%"$4*(" @(" @
- XM('9I;2 M(%9I($E-<')O=F5D+"!A('!R;V=R86UM97)S('1E>'0@961I=&]R
- XM"@I3"%-9"%E."$Y/"$]0"%!3"%-)"$E3"%,*(" @(" @('8(=FD(:6T(;2!;
- XM;W!T:6]N<UT@6V9I;&4@+BY="B @(" @("!V"'9I"&EM"&T@6V]P=&EO;G-=
- XM("UT('1A9PH@(" @(" @=@AV:0AI;0AM(%MO<'1I;VYS72 M92!;97)R;W)F
- XM:6QE70H*1 A$10A%4PA30PA#4@A220A)4 A05 A420A)3PA/3@A."B @(" @
- XM("!6"%9I"&EM"&T@(&ES(&$@=&5X="!E9&ET;W(@=&AA="!I<R!U<'=A<F1S
- XM(&-O;7!A=&EB;&4@=&\@=FDN($ET"B @(" @("!C86X@8F4@=7-E9"!T;R!E
- XM9&ET(&%N>2!!4T-)22!T97AT+B!)="!I<R!E<W!E8VEA;&QY("!U<V4M"B @
- XM(" @("!F=6P@9F]R(&5D:71I;F<@<')O9W)A;7,N"@H@(" @(" @5&AE<F4@
- XM(&%R92 @82 @;&]T("!O9B @96YH86YC96UE;G1S(&%B;W9E('9I.B!M=6QT
- XM:2!L979E; H@(" @(" @=6YD;RP@;75L=&D@=VEN9&]W<R!A;F0@(&)U9F9E
- XM<G,L("!C;VUM86YD("!L:6YE("!E9&ET:6YG+ H@(" @(" @9FEL96YA;64@
- XM8V]M<&QE=&EO;BP@;VXM;&EN92!H96QP+"!V:7-U86P@<V5L96-T:6]N+"!E
- XM=&,N+@H@(" @(" @4F5A9"!D:69F97)E;F-E+F1O8R @9F]R("!A("!S=6UM
- XM87)Y("!O9B @=&AE("!D:69F97)E;F-E<PH@(" @(" @8F5T=V5E;B!V:2!A
- XM;F0@5FEM+@H*(" @(" @($UO<W0@(&]F=&5N("!6"%9I"&EM"&T@:7,@<W1A
- XM<G1E9"!T;R!E9&ET(&$@<VEN9VQE(&9I;&4@=VET:"!T:&4*(" @(" @(&-O
- XM;6UA;F0*"B @(" @(" @(" @('9I;2!F:6QE"@H@(" @(" @36]R92!G96YE
- XM<F%L;'D@5DE-(&ES('-T87)T960@=VET:#H*"B @(" @(" @(" @('9I;2!;
- XM;W!T:6]N<UT@6V9I;&5L:7-T70H*(" @(" @($EF('1H92!F:6QE;&ES="!I
- XM<R!M:7-S:6YG+"!T:&4@961I=&]R('=I;&P@<W1A<G0@=VET:" @86X*(" @
- XM(" @(&5M<'1Y("!B=69F97(N("!/=&AE<G=I<V4@97AA8W1L>2!O;F4@;W5T
- XM(&]F('1H92!F;VQL;W=I;F<*(" @(" @('1H<F5E(&UA>2!B92!U<V5D('1O
- XM("!C:&]O<V4@(&]N92 @;W(@(&UO<F4@(&9I;&5S("!T;R @8F4*(" @(" @
- XM(&5D:71E9"X*"B @(" @("!F:6QE("XN(" @("!!(&QI<W0@;V8@9FEL92!N
- XM86UE<RX@5&AE(&9I<G-T(&]N92 H86QP:&%B970M"B @(" @(" @(" @(" @
- XM(" @("!I8V%L;'DI('=I;&P@8F4@=&AE(&-U<G)E;G0@9FEL92!A;F0@<F5A
- XM9"!I;G1O"B @(" @(" @(" @(" @(" @("!T:&4@(&)U9F9E<BX@(%1H92!C
- XM=7)S;W(@=VEL;"!B92!P;W-I=&EO;F5D(&]N"B @(" @(" @(" @(" @(" @
- XM("!T:&4@9FER<W0@;&EN92!O9B!T:&4@8G5F9F5R+B!9;W4@8V%N("!G970@
- XM('1O"B @(" @(" @(" @(" @(" @("!T:&4@;W1H97(@9FEL97,@=VET:"!T
- XM:&4@(CIN97AT(B!C;VUM86YD+@H*(" @(" @("UT('MT86=](" @(%1H92 @
- XM9FEL92!T;R!E9&ET(&%N9"!T:&4@:6YI=&EA;"!C=7)S;W(@<&]S:2T*(" @
- XM(" @(" @(" @(" @(" @('1I;VX@9&5P96YD<R!O;B!A(")T86<B+"!A('-O
- XM<G0@;V8@9V]T;R!L86)E;"X*(" @(" @(" @(" @(" @(" @('MT86=](&ES
- XM(&QO;VME9"!U<"!I;B!T:&4@=&%G<R!F:6QE+"!T:&4@87-S;RT*(" @(" @
- XM(" @(" @(" @(" @(&-I871E9"!F:6QE(&)E8V]M97,@=&AE(&-U<G)E;G0@
- XM9FEL92 @86YD("!T:&4*(" @(" @(" @(" @(" @(" @(&%S<V]C:6%T960@
- XM8V]M;6%N9"!I<R!E>&5C=71E9"X@36]S=&QY('1H:7,@:7,*(" @(" @(" @
- XM(" @(" @(" @('5S960@9F]R($,@<')O9W)A;7,N('MT86=]('1H96X@('-H
- XM;W5L9" @8F4@(&$*(" @(" @(" @(" @(" @(" @(&9U;F-T:6]N("!N86UE
- XM+B @5&AE("!E9F9E8W0@(&ES('1H870@=&AE(&9I;&4*(" @(" @(" @(" @
- XM(" @(" @(&-O;G1A:6YI;F<@=&AA="!F=6YC=&EO;B!B96-O;65S("!T:&4@
- XM(&-U<G)E;G0*(" @(" @(" @(" @(" @(" @(&9I;&4@86YD('1H92!C=7)S
- XM;W(@:7,@<&]S:71I;VYE9"!O;B!T:&4@<W1A<G0*(" @(" @(" @(" @(" @
- XM(" @(&]F('1H92!F=6YC=&EO;B @*'-E92 @<F5F97)E;F-E+F1O8RP@('-E
- XM8W1I;VX*(" @(" @(" @(" @(" @(" @(")T86<@<V5A<F-H97,B*2X*"B @
- XM(" @(" M92!;97)R;W)F:6QE70H@(" @(" @(" @(" @(" @(" @4W1A<G0@
- XM(&EN("!Q=6EC:T9I>"!M;V1E+B!4:&4@9FEL92!;97)R;W)F:6QE70H@(" @
- XM(" @(" @(" @(" @(" @:7,@<F5A9"!A;F0@=&AE(&9I<G-T(&5R<F]R(&ES
- XM("!D:7-P;&%Y960N("!)9@H*"@H@(" @(" @(" @(" @(" @(" @(" @(" @
- XM(#$Y.30@075G=7-T(#$R(" @(" @(" @(" @(" @(" @(" @(" @,0H*"@H*
- XM"E9)32@Q*2 @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
- XM(" @(" @(" @(" @(" @5DE-*#$I"@H*(" @(" @(" @(" @(" @(" @(%ME
- XM<G)O<F9I;&5=(" @:7,@(&]M:71T960@('1H92 @9FEL92 @;F%M92 @:7,*
- XM(" @(" @(" @(" @(" @(" @(&]B=&%I;F5D(&9R;VT@=&AE("=E<G)O<F9I
- XM;&4G(&]P=&EO;B H9&5F875L=',*(" @(" @(" @(" @(" @(" @('1O(" B
- XM07IT96-#+D5R<B(@(&9O<B @=&AE("!!;6EG82P@(F5R<F]R<R(@;VX*(" @
- XM(" @(" @(" @(" @(" @(&]T:&5R('-Y<W1E;7,I+B!&=7)T:&5R(&5R<F]R
- XM<R!C86X@(&)E("!J=6UP960*(" @(" @(" @(" @(" @(" @('1O("!W:71H
- XM("!T:&4@(CIC;B(@8V]M;6%N9"X@4V5E(')E9F5R96YC92YD;V,*(" @(" @
- XM(" @(" @(" @(" @('-E8W1I;VX@-2XU+@H*3PA/4 A05 A420A)3PA/3@A.
- XM4PA3"B @(" @("!4:&4@;W!T:6]N<RP@:68@<')E<V5N="P@;75S="!P<F5C
- XM961E("!T:&4@(&9I;&5L:7-T+B @5&AE"B @(" @("!O<'1I;VYS(&UA>2!B
- XM92!G:79E;B!I;B!A;GD@;W)D97(N"@H@(" @(" @+7(@(" @(" @(" @4F5C
- XM;W9E<GD@(&UO9&4N("!4:&4@('-W87 @(&9I;&4@(&ES("!U<V5D("!T;PH@
- XM(" @(" @(" @(" @(" @(" @<F5C;W9E<B!A(&-R87-H960@961I=&EN9R @
- XM<V5S<VEO;BX@(%1H92 @<W=A< H@(" @(" @(" @(" @(" @(" @9FEL92 @
- XM:7,@82!F:6QE('=I=&@@=&AE('-A;64@9FEL92!N86UE(&%S('1H90H@(" @
- XM(" @(" @(" @(" @(" @=&5X="!F:6QE('=I=&@@("(N<W=P(B @87!P96YD
- XM960N("!3964@(')E9F5R+0H@(" @(" @(" @(" @(" @(" @96YC92YD;V,L
- XM(&-H87!T97(@(E)E8V]V97)Y(&%F=&5R(&$@8W)A<V@B+@H*(" @(" @("UV
- XM(" @(" @(" @(%9I97<@(&UO9&4N(%1H92 G<F5A9&]N;'DG(&]P=&EO;B!W
- XM:6QL(&)E('-E="X*(" @(" @(" @(" @(" @(" @(%EO=2!C86X@<W1I;&P@
- XM961I="!T:&4@(&)U9F9E<BP@(&)U=" @=VEL;" @8F4*(" @(" @(" @(" @
- XM(" @(" @('!R979E;G1E9" @9G)O;2!A8V-I9&5N=&QY(&]V97)W<FET:6YG
- XM(&$@9FEL92X*(" @(" @(" @(" @(" @(" @($EF('EO=2!D;R!W86YT('1O
- XM(&]V97)W<FET92 @82 @9FEL92P@(&%D9" @86X*(" @(" @(" @(" @(" @
- XM(" @(&5X8VQA;6%T:6]N("!M87)K("!T;R @=&AE("!%>" @8V]M;6%N9"P@
- XM87,@:6X*(" @(" @(" @(" @(" @(" @("(Z=R$B+B @5&AE("UV("!O<'1I
- XM;VX@(&%L<V\@(&EM<&QI97,@('1H92 @+6X*(" @(" @(" @(" @(" @(" @
- XM(&]P=&EO;B H<V5E(&)E;&]W*2X@(%1H92 G<F5A9&]N;'DG(&]P=&EO;B!C
- XM86X*(" @(" @(" @(" @(" @(" @(&)E(')E<V5T('=I=&@@(CIS970@;F]R
- XM;R(@*'-E92 @<F5F97)E;F-E+F1O8RP*(" @(" @(" @(" @(" @(" @(&]P
- XM=&EO;G,@8VAA<'1E<BDN"@H@(" @(" @+6(@(" @(" @(" @0FEN87)Y+B @
- XM02 @9F5W(&]P=&EO;G,@=VEL;"!B92!S970@=&AA="!M86ME<PH@(" @(" @
- XM(" @(" @(" @(" @:70@<&]S<VEB;&4@=&\@961I=" @82 @8FEN87)Y("!O
- XM<B @97AE8W5T86)L90H@(" @(" @(" @(" @(" @(" @9FEL92X*"B @(" @
- XM(" K6VYU;5T@(" @("!&;W(@('1H92 @9FER<W0@(&9I;&4@=&AE(&-U<G-O
- XM<B!W:6QL(&)E('!O<VDM"B @(" @(" @(" @(" @(" @("!T:6]N960@;VX@
- XM;&EN92 B;G5M(BX@268@(FYU;2(@:7,@;6ES<VEN9RP@=&AE"B @(" @(" @
- XM(" @(" @(" @("!C=7)S;W(@=VEL;"!B92!P;W-I=&EO;F5D(&]N('1H92!L
- XM87-T(&QI;F4N"@H@(" @(" @*R]P870@(" @(" @1F]R("!T:&4@(&9I<G-T
- XM("!F:6QE('1H92!C=7)S;W(@=VEL;"!B92!P;W-I+0H@(" @(" @(" @(" @
- XM(" @(" @=&EO;F5D(&]N('1H92!F:7)S="!O8V-U<G)E;F-E(&]F(" B<&%T
- XM(B @*'-E90H@(" @(" @(" @(" @(" @(" @<F5F97)E;F-E+F1O8RP@('-E
- XM8W1I;VX@(G!A='1E<FX@<V5A<F-H97,B(&9O<@H@(" @(" @(" @(" @(" @
- XM(" @=&AE(&%V86EL86)L92!S96%R8V@@<&%T=&5R;G,I+@H*(" @(" @("M[
- XM8V]M;6%N9'T*"B @(" @(" M8R![8V]M;6%N9'T*(" @(" @(" @(" @(" @
- XM(" @('MC;VUM86YD?2!W:6QL(&)E("!E>&5C=71E9" @869T97(@('1H92 @
- XM9FER<W0*(" @(" @(" @(" @(" @(" @(&9I;&4@(&AA<R @8F5E;B!R96%D
- XM+B![8V]M;6%N9'T@:7,@:6YT97)P<F5T960*(" @(" @(" @(" @(" @(" @
- XM(&%S(&%N($5X(&-O;6UA;F0N($EF("!T:&4@('MC;VUM86YD?2 @8V]N=&%I
- XM;G,*(" @(" @(" @(" @(" @(" @('-P86-E<R @:70@(&UU<W0@(&)E(&5N
- XM8VQO<V5D(&EN(&1O=6)L92!Q=6]T97,*(" @(" @(" @(" @(" @(" @("AT
- XM:&ES(&1E<&5N9',@;VX@('1H92 @<VAE;&P@('1H870@(&ES("!U<V5D*2X*
- XM(" @(" @(" @(" @(" @(" @($5X86UP;&4Z(%9I;2 B*W-E="!S:2(@;6%I
- XM;BYC"@H@(" @(" @+7@@(" @(" @(" @*$%M:6=A("!O;FQY*2 @5FEM("!I
- XM<R!N;W0@<F5S=&%R=&5D('1O(&]P96X@80H@(" @(" @(" @(" @(" @(" @
- XM;F5W('=I;F1O=RX@5&AI<R!O<'1I;VX@<VAO=6QD("!B92 @=7-E9" @=VAE
- XM;@H@(" @(" @(" @(" @(" @(" @5FEM("!I<R @97AE8W5T960@(&)Y(&$@
- XM<')O9W)A;2!T:&%T('=I;&P@=V%I= H@(" @(" @(" @(" @(" @(" @9F]R
- XM('1H92!E9&ET('-E<W-I;VX@=&\@(&9I;FES:" @*&4N9RX@(&UA:6PI+@H*
- XM"@H@(" @(" @(" @(" @(" @(" @(" @(" @(#$Y.30@075G=7-T(#$R(" @
- XM(" @(" @(" @(" @(" @(" @(" @,@H*"@H*"E9)32@Q*2 @(" @(" @(" @
- XM(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @5DE-
- XM*#$I"@H*(" @(" @(" @(" @(" @(" @(%1H92 B.G-H(B!A;F0@(CHA(B!C
- XM;VUM86YD<R!W:6QL(&YO="!W;W)K+@H*(" @(" @("UO6TY=(" @(" @($]P
- XM96X@($X@('=I;F1O=W,N("!7:&5N($X@:7,@;VUI='1E9"P@;W!E;B!O;F4*
- XM(" @(" @(" @(" @(" @(" @('=I;F1O=R!F;W(@96%C:"!F:6QE+@H*(" @
- XM(" @("UN(" @(" @(" @($YO('-W87 @9FEL92!W:6QL(&)E('5S960N("!2
- XM96-O=F5R>2 @869T97(@(&$*(" @(" @(" @(" @(" @(" @(&-R87-H('=I
- XM;&P@8F4@:6UP;W-S:6)L92X@2&%N9'D@:68@>6]U('=A;G0@=&\*(" @(" @
- XM(" @(" @(" @(" @(&5D:70@82 @9FEL92 @;VX@(&$@('9E<GD@('-L;W<@
- XM(&UE9&EU;2 @*&4N9RX*(" @(" @(" @(" @(" @(" @(&9L;W!P>2DN("!#
- XM86X@(&%L<V\@(&)E(&1O;F4@=VET:" B.G-E="!U8STP(BX*(" @(" @(" @
- XM(" @(" @(" @($-A;B!B92!U;F1O;F4@=VET:" B.G-E="!U8STR,# B+@H*
- XM(" @(" @("US('MS8W)I<'1I;GT*(" @(" @(" @(" @(" @(" @(%1H92!S
- XM8W)I<'0@9FEL92E860N(%1H92 @8VAA<BT*(" @
- XM(" @(" @(" @(" @(" @(&%C=&5R<R @:6X@('1H92!F:6QE(&%R92!I;G1E
- XM<G!R971E9"!A<R!I9B!Y;W4*(" @(" @(" @(" @(" @(" @(&AA9"!T>7!E
- XM9"!T:&5M+B!4:&4@<V%M92!C86X@8F4@9&]N92!W:71H("!T:&4*(" @(" @
- XM(" @(" @(" @(" @(&-O;6UA;F0@("(Z<V]U<F-E(2 @>W-C<FEP=&EN?2(N
- XM($EF('1H92!E;F0@;V8*(" @(" @(" @(" @(" @(" @('1H92!F:6QE(&ES
- XM(')E86-H960@8F5F;W)E('1H92 @961I=&]R("!E>&ET<RP*(" @(" @(" @
- XM(" @(" @(" @(&9U<G1H97(@8VAA<F%C=&5R<R!A<F4@<F5A9"!F<F]M('1H
- XM92!K97EB;V%R9"X*"B @(" @(" M=R![<V-R:7!T;W5T?0H@(" @(" @(" @
- XM(" @(" @(" @06QL('1H92!C:&%R86-T97)S('1H870@>6]U('1Y<&4@87)E
- XM("!R96-O<F1E9 H@(" @(" @(" @(" @(" @(" @:6X@('1H92 @9FEL92![
- XM<V-R:7!T;W5T?2P@=6YT:6P@>6]U(&5X:70@5DE-+@H@(" @(" @(" @(" @
- XM(" @(" @5&AI<R!I<R!U<V5F=6P@:68@>6]U('=A;G0@=&\@8W)E871E(&$@
- XM('-C<FEP= H@(" @(" @(" @(" @(" @(" @9FEL92!T;R!B92!U<V5D('=I
- XM=&@@(G9I;2 M<R(@;W(@(CIS;W5R8V4A(BX*"B @(" @(" M5"!T97)M:6YA
- XM;"!496QL<R @5FEM("!T:&4@(&YA;64@(&]F('1H92!T97)M:6YA;"!Y;W4@
- XM87)E"B @(" @(" @(" @(" @(" @("!U<VEN9RX@4VAO=6QD("!B92 @82 @
- XM=&5R;6EN86P@(&MN;W=N("!T;R @5FEM"B @(" @(" @(" @(" @(" @(" H
- XM8G5I;'1I;BD@;W(@9&5F:6YE9"!I;B!T:&4@=&5R;6-A<"!F:6QE+@H*(" @
- XM(" @("UD(&1E=FEC92 @($]P96X@(")D979I8V4B("!F;W(@=7-E(&%S(&$@
- XM=&5R;6EN86PN($]N;'D@;VX*(" @(" @(" @(" @(" @(" @('1H92!!;6EG
- XM82X@17AA;7!L93H@(BUD(&-O;CHR,"\S,"\V,# O,34P(BX*"E,(4T4(144(
- XM12!!"$%,"$Q3"%-/"$\*(" @(" @(%9I;2!D;V-U;65N=&%T:6]N.@H*(" @
- XM(" @(')E9F5R96YC92YD;V,Z"B @(" @(" @(" @(" @(" @("!!(&-O;7!L
- XM971E(')E9F5R96YC92!O9B!6:6T@*&QO;F<I"@H@(" @(" @=VEN9&]W<RYD
- XM;V,Z"B @(" @(" @(" @(" @(" @("!%>'!L86YA=&EO;B!O9B!T:&4@;75L
- XM=&D@=VEN9&]W<R @86YD("!B=69F97)S"B @(" @(" @(" @(" @(" @("!C
- XM;VUM86YD<R!A;F0@;W!T:6]N<PH*(" @(" @(&EN9&5X.B @(" @($]V97)V
- XM:65W("!O9B @86QL("!C;VUM86YD("!C:&%R86-T97)S("AU<V5F=6P*(" @
- XM(" @(" @(" @(" @(" @('=H96X@861D:6YG(&YE=R!M87!P:6YG<RD*"B @
- XM(" @("!D:69F97)E;F-E+F1O8SH*(" @(" @(" @(" @(" @(" @($]V97)V
- XM:65W(&]F('1H92!D:69F97)E;F-E<R!B971W965N('9I(&%N9"!6:6T*"B @
- XM(" @("!U;FEX+F1O8SH@("!5;FEX+7-P96-I9FEC(&-O;6UE;G1S"@H@(" @
- XM(" @=FEM+FAL<#H@(" @1FEL92!U<V5D(&)Y('1H92!O;BUL:6YE(&AE;' @
- XM*'-H;W)T*0H*00A!50A55 A42 A(3PA/4@A2"B @(" @("!-;W-T(&]F(%9)
- XM32!W87,@;6%D92!B>2!"<F%M($UO;VQE;F%A<BX*"@H*(" @(" @(" @(" @
- XM(" @(" @(" @(" @(" Q.3DT($%U9W5S=" Q,B @(" @(" @(" @(" @(" @
- XM(" @(" @(#,*"@H*"@I624TH,2D@(" @(" @(" @(" @(" @(" @(" @(" @
- XM(" @(" @(" @(" @(" @(" @(" @(" @(" @(%9)32@Q*0H*"B @(" @("!6
- XM24T@(&ES("!B87-E9"!O;B!3=&5V:64L('=O<FME9"!O;B!B>3H@5&EM(%1H
- XM;VUP<V]N+"!4;VYY"B @(" @("!!;F1R97=S(&%N9"!'+E(N("A&<F5D*2!7
- XM86QT97(*"D((0E4(54<(1U,(4PH@(" @(" @4')O8F%B;'DN"@H*"@H*"@H*
- XM"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H@
- XM(" @(" @(" @(" @(" @(" @(" @(" @(#$Y.30@075G=7-T(#$R(" @(" @
- X6(" @(" @(" @(" @(" @(" @- H*"B @
- X
- Xend
- END_OF_FILE
- if test 10854 -ne `wc -c <'vim/doc/vim.man.UU'`; then
- echo shar: \"'vim/doc/vim.man.UU'\" unpacked with wrong size!
- else
- echo shar: Uudecoding \"'vim/doc/vim.man'\" \(7852 characters\)
- cat vim/doc/vim.man.UU | uudecode
- if test 7852 -ne `wc -c <'vim/doc/vim.man'`; then
- echo shar: \"'vim/doc/vim.man'\" uudecoded with wrong size!
- else
- rm vim/doc/vim.man.UU
- fi
- fi
- # end of 'vim/doc/vim.man.UU'
- fi
- if test -f 'vim/src/window.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vim/src/window.c'\"
- else
- echo shar: Extracting \"'vim/src/window.c'\" \(25721 characters\)
- sed "s/^X//" >'vim/src/window.c' <<'END_OF_FILE'
- X/* vi:ts=4:sw=4
- X *
- X * VIM - Vi IMproved by Bram Moolenaar
- X *
- X * Read the file "credits.txt" for a list of people who contributed.
- X * Read the file "uganda.txt" for copying and usage conditions.
- X */
- X
- X#include "vim.h"
- X#include "globals.h"
- X#include "proto.h"
- X#include "param.h"
- X
- Xstatic int win_comp_pos __ARGS((void));
- Xstatic void win_exchange __ARGS((long));
- Xstatic void win_rotate __ARGS((int, int));
- Xstatic void win_append __ARGS((WIN *, WIN *));
- Xstatic void win_remove __ARGS((WIN *));
- X
- Xstatic WIN *prevwin = NULL; /* previous window */
- X
- X/*
- X * all CTRL-W window commands are handled here, called from normal().
- X */
- X void
- Xdo_window(nchar, Prenum)
- X int nchar;
- X long Prenum;
- X{
- X long Prenum1;
- X WIN *wp;
- X char_u *ptr;
- X
- X if (Prenum == 0)
- X Prenum1 = 1;
- X else
- X Prenum1 = Prenum;
- X
- X switch (nchar)
- X {
- X/* split current window in two parts */
- X case 'S':
- X case Ctrl('S'):
- X case 's': VIsual.lnum = 0; /* stop Visual mode */
- X win_split(Prenum, TRUE);
- X break;
- X
- X/* open new window */
- X case Ctrl('N'):
- X case 'n': VIsual.lnum = 0; /* stop Visual mode */
- X stuffcharReadbuff(':');
- X if (Prenum)
- X stuffnumReadbuff(Prenum); /* window height */
- X stuffReadbuff((char_u *)"new\n"); /* it is cmdline.c */
- X break;
- X
- X/* quit current window */
- X case Ctrl('Q'):
- X case 'q': VIsual.lnum = 0; /* stop Visual mode */
- X stuffReadbuff((char_u *)":quit\n"); /* it is cmdline.c */
- X break;
- X
- X/* close current window */
- X case Ctrl('C'):
- X case 'c': VIsual.lnum = 0; /* stop Visual mode */
- X stuffReadbuff((char_u *)":close\n"); /* it is cmdline.c */
- X break;
- X
- X/* close all but current window */
- X case Ctrl('O'):
- X case 'o': VIsual.lnum = 0; /* stop Visual mode */
- X stuffReadbuff((char_u *)":only\n"); /* it is cmdline.c */
- X break;
- X
- X/* cursor to next window */
- X case 'j':
- X case K_DARROW:
- X case Ctrl('J'):
- X VIsual.lnum = 0; /* stop Visual mode */
- X for (wp = curwin; wp->w_next != NULL && Prenum1-- > 0;
- X wp = wp->w_next)
- X ;
- X win_enter(wp, TRUE);
- X cursupdate();
- X break;
- X
- X/* cursor to next window with wrap around */
- X case Ctrl('W'):
- X case 'w':
- X VIsual.lnum = 0; /* stop Visual mode */
- X if (lastwin == firstwin) /* just one window */
- X beep();
- X else
- X {
- X if (Prenum) /* go to specified window */
- X {
- X for (wp = firstwin; --Prenum > 0; )
- X {
- X if (wp->w_next == NULL)
- X break;
- X else
- X wp = wp->w_next;
- X }
- X }
- X else /* go to next window */
- X {
- X wp = curwin->w_next;
- X if (wp == NULL)
- X wp = firstwin; /* wrap around */
- X }
- X win_enter(wp, TRUE);
- X cursupdate();
- X }
- X break;
- X
- X/* cursor to window above */
- X case 'k':
- X case K_UARROW:
- X case Ctrl('K'):
- X VIsual.lnum = 0; /* stop Visual mode */
- X for (wp = curwin; wp->w_prev != NULL && Prenum1-- > 0;
- X wp = wp->w_prev)
- X ;
- X win_enter(wp, TRUE);
- X cursupdate();
- X break;
- X
- X/* cursor to last accessed (previous) window */
- X case 'p':
- X case Ctrl('P'):
- X VIsual.lnum = 0; /* stop Visual mode */
- X if (prevwin == NULL)
- X beep();
- X else
- X {
- X win_enter(prevwin, TRUE);
- X cursupdate();
- X }
- X break;
- X
- X/* exchange current and next window */
- X case 'x':
- X case Ctrl('X'):
- X win_exchange(Prenum);
- X break;
- X
- X/* rotate windows downwards */
- X case Ctrl('R'):
- X case 'r': VIsual.lnum = 0; /* stop Visual mode */
- X win_rotate(FALSE, (int)Prenum1); /* downwards */
- X break;
- X
- X/* rotate windows upwards */
- X case 'R': VIsual.lnum = 0; /* stop Visual mode */
- X win_rotate(TRUE, (int)Prenum1); /* upwards */
- X break;
- X
- X/* make all windows the same height */
- X case '=': win_equal(NULL, TRUE);
- X break;
- X
- X/* increase current window height */
- X case '+': win_setheight(curwin->w_height + (int)Prenum1);
- X break;
- X
- X/* decrease current window height */
- X case '-': win_setheight(curwin->w_height - (int)Prenum1);
- X break;
- X
- X/* set current window height */
- X case Ctrl('_'):
- X case '_': win_setheight(Prenum ? (int)Prenum : 9999);
- X break;
- X
- X/* jump to tag and split window if tag exists */
- X case ']':
- X case Ctrl(']'):
- X VIsual.lnum = 0; /* stop Visual mode */
- X postponed_split = TRUE;
- X stuffcharReadbuff(Ctrl(']'));
- X break;
- X
- X/* edit file name under cursor in a new window */
- X case 'f':
- X case Ctrl('F'):
- X VIsual.lnum = 0; /* stop Visual mode */
- X ptr = file_name_at_cursor();
- X if (ptr == NULL)
- X beep();
- X else
- X {
- X stuffReadbuff((char_u *) ":split ");
- X stuffReadbuff(ptr);
- X stuffReadbuff((char_u *) "\n");
- X free(ptr);
- X }
- X break;
- X
- X default: beep();
- X break;
- X }
- X}
- X
- X/*
- X * split the current window, implements CTRL-W s and :split
- X *
- X * new_height is the height for the new window, 0 to make half of current height
- X * redraw is TRUE when redraw now
- X *
- X * return FAIL for failure, OK otherwise
- X */
- X int
- Xwin_split(new_height, redraw)
- X long new_height;
- X int redraw;
- X{
- X WIN *wp;
- X linenr_t lnum;
- X int h;
- X int i;
- X int need_status;
- X int do_equal = (p_ea && new_height == 0);
- X int needed;
- X int available;
- X
- X /* add a status line when p_ls == 1 and splitting the first window */
- X if (lastwin == firstwin && p_ls == 1 && curwin->w_status_height == 0)
- X need_status = STATUS_HEIGHT;
- X else
- X need_status = 0;
- X
- X/*
- X * check if we are able to split the current window and compute its height
- X */
- X available = curwin->w_height;
- X needed = 2 * MIN_ROWS + STATUS_HEIGHT + need_status;
- X if (p_ea)
- X {
- X for (wp = firstwin; wp != NULL; wp = wp->w_next)
- X if (wp != curwin)
- X {
- X available += wp->w_height;
- X needed += MIN_ROWS;
- X }
- X }
- X if (available < needed)
- X {
- X EMSG(e_noroom);
- X return FAIL;
- X }
- X if (need_status)
- X {
- X curwin->w_status_height = STATUS_HEIGHT;
- X curwin->w_height -= STATUS_HEIGHT;
- X }
- X if (new_height == 0)
- X new_height = curwin->w_height / 2;
- X
- X if (new_height > curwin->w_height - MIN_ROWS - STATUS_HEIGHT)
- X new_height = curwin->w_height - MIN_ROWS - STATUS_HEIGHT;
- X
- X if (new_height < MIN_ROWS)
- X new_height = MIN_ROWS;
- X
- X /* if it doesn't fit in the current window, need win_equal() */
- X if (curwin->w_height - new_height - STATUS_HEIGHT < MIN_ROWS)
- X do_equal = TRUE;
- X/*
- X * allocate new window structure and link it in the window list
- X */
- X if (p_sb) /* new window below current one */
- X wp = win_alloc(curwin);
- X else
- X wp = win_alloc(curwin->w_prev);
- X if (wp == NULL)
- X return FAIL;
- X/*
- X * compute the new screen positions
- X */
- X wp->w_height = new_height;
- X win_comp_scroll(wp);
- X curwin->w_height -= new_height + STATUS_HEIGHT;
- X win_comp_scroll(curwin);
- X if (p_sb) /* new window below current one */
- X {
- X wp->w_winpos = curwin->w_winpos + curwin->w_height + STATUS_HEIGHT;
- X wp->w_status_height = curwin->w_status_height;
- X curwin->w_status_height = STATUS_HEIGHT;
- X }
- X else /* new window above current one */
- X {
- X wp->w_winpos = curwin->w_winpos;
- X wp->w_status_height = STATUS_HEIGHT;
- X curwin->w_winpos = wp->w_winpos + wp->w_height + STATUS_HEIGHT;
- X }
- X/*
- X * make the contents of the new window the same as the current one
- X */
- X wp->w_buffer = curbuf;
- X curbuf->b_nwindows++;
- X wp->w_cursor = curwin->w_cursor;
- X wp->w_row = curwin->w_row;
- X wp->w_col = curwin->w_col;
- X wp->w_virtcol = curwin->w_virtcol;
- X wp->w_curswant = curwin->w_curswant;
- X wp->w_set_curswant = curwin->w_set_curswant;
- X wp->w_empty_rows = curwin->w_empty_rows;
- X wp->w_leftcol = curwin->w_leftcol;
- X wp->w_pcmark = curwin->w_pcmark;
- X wp->w_prev_pcmark = curwin->w_prev_pcmark;
- X
- X wp->w_arg_idx = curwin->w_arg_idx;
- X /*
- X * copy tagstack and options from existing window
- X */
- X for (i = 0; i < curwin->w_tagstacklen; i++)
- X {
- X wp->w_tagstack[i].fmark = curwin->w_tagstack[i].fmark;
- X wp->w_tagstack[i].tagname = strsave(curwin->w_tagstack[i].tagname);
- X }
- X wp->w_tagstackidx = curwin->w_tagstackidx;
- X wp->w_tagstacklen = curwin->w_tagstacklen;
- X win_copy_options(curwin, wp);
- X/*
- X * Both windows need redrawing
- X */
- X wp->w_redr_type = NOT_VALID;
- X wp->w_redr_status = TRUE;
- X curwin->w_redr_type = NOT_VALID;
- X curwin->w_redr_status = TRUE;
- X/*
- X * Cursor is put in middle of window in both windows
- X */
- X if (wp->w_height < curwin->w_height) /* use smallest of two heights */
- X h = wp->w_height;
- X else
- X h = curwin->w_height;
- X h >>= 1;
- X for (lnum = wp->w_cursor.lnum; lnum > 1; --lnum)
- X {
- X h -= plines(lnum);
- X if (h <= 0)
- X break;
- X }
- X wp->w_topline = lnum;
- X curwin->w_topline = lnum;
- X/*
- X * make the new window the current window and redraw
- X */
- X if (do_equal)
- X win_equal(wp, FALSE);
- X win_enter(wp, FALSE);
- X if (redraw)
- X updateScreen(NOT_VALID);
- X return OK;
- X}
- X
- X/*
- X * make 'count' windows on the screen
- X * return actual number of windows on the screen
- X * called when there is just one window, filling the whole screen.
- X */
- X int
- Xmake_windows(count)
- X int count;
- X{
- X int maxcount;
- X int todo;
- X int p_sb_save;
- X
- X/*
- X * each window needs at least MIN_ROWS lines and a status line
- X */
- X maxcount = (curwin->w_height + curwin->w_status_height) /
- X (MIN_ROWS + STATUS_HEIGHT);
- X if (count > maxcount)
- X count = maxcount;
- X
- X /*
- X * add status line now, otherwise first window will be too big
- X */
- X if ((p_ls == 2 || (count > 1 && p_ls == 1)) && curwin->w_status_height == 0)
- X {
- X curwin->w_status_height = STATUS_HEIGHT;
- X curwin->w_height -= STATUS_HEIGHT;
- X }
- X
- X/*
- X * set 'splitbelow' off for a moment, don't what that now
- X */
- X p_sb_save = p_sb;
- X p_sb = FALSE;
- X /* todo is number of windows left to create */
- X for (todo = count - 1; todo > 0; --todo)
- X if (win_split((long)(curwin->w_height - (curwin->w_height - todo
- X * STATUS_HEIGHT) / (todo + 1) - STATUS_HEIGHT), FALSE) == FAIL)
- X break;
- X p_sb = p_sb_save;
- X
- X /* return actual number of windows */
- X return (count - todo);
- X}
- X
- X/*
- X * Exchange current and next window
- X */
- X static void
- Xwin_exchange(Prenum)
- X long Prenum;
- X{
- X WIN *wp;
- X WIN *wp2;
- X int temp;
- X
- X if (lastwin == firstwin) /* just one window */
- X {
- X beep();
- X return;
- X }
- X
- X/*
- X * find window to exchange with
- X */
- X if (Prenum)
- X {
- X wp = firstwin;
- X while (wp != NULL && --Prenum > 0)
- X wp = wp->w_next;
- X }
- X else if (curwin->w_next != NULL) /* Swap with next */
- X wp = curwin->w_next;
- X else /* Swap last window with previous */
- X wp = curwin->w_prev;
- X
- X if (wp == curwin || wp == NULL)
- X return;
- X
- X/*
- X * 1. remove curwin from the list. Remember after which window it was in wp2
- X * 2. insert curwin before wp in the list
- X * if wp != wp2
- X * 3. remove wp from the list
- X * 4. insert wp after wp2
- X * 5. exchange the status line height
- X */
- X wp2 = curwin->w_prev;
- X win_remove(curwin);
- X win_append(wp->w_prev, curwin);
- X if (wp != wp2)
- X {
- X win_remove(wp);
- X win_append(wp2, wp);
- X }
- X temp = curwin->w_status_height;
- X curwin->w_status_height = wp->w_status_height;
- X wp->w_status_height = temp;
- X
- X win_comp_pos(); /* recompute window positions */
- X
- X win_enter(wp, TRUE);
- X cursupdate();
- X updateScreen(CLEAR);
- X}
- X
- X/*
- X * rotate windows: if upwards TRUE the second window becomes the first one
- X * if upwards FALSE the first window becomes the second one
- X */
- X static void
- Xwin_rotate(upwards, count)
- X int upwards;
- X int count;
- X{
- X WIN *wp;
- X int height;
- X
- X if (firstwin == lastwin) /* nothing to do */
- X {
- X beep();
- X return;
- X }
- X while (count--)
- X {
- X if (upwards) /* first window becomes last window */
- X {
- X wp = firstwin;
- X win_remove(wp);
- X win_append(lastwin, wp);
- X wp = lastwin->w_prev; /* previously last window */
- X }
- X else /* last window becomes first window */
- X {
- X wp = lastwin;
- X win_remove(lastwin);
- X win_append(NULL, wp);
- X wp = firstwin; /* previously last window */
- X }
- X /* exchange status height of old and new last window */
- X height = lastwin->w_status_height;
- X lastwin->w_status_height = wp->w_status_height;
- X wp->w_status_height = height;
- X
- X /* recompute w_winpos for all windows */
- X (void) win_comp_pos();
- X }
- X
- X cursupdate();
- X updateScreen(CLEAR);
- X}
- X
- X/*
- X * make all windows the same height
- X */
- X void
- Xwin_equal(next_curwin, redraw)
- X WIN *next_curwin; /* pointer to current window to be */
- X int redraw;
- X{
- X int total;
- X int less;
- X int wincount;
- X int winpos;
- X int temp;
- X WIN *wp;
- X int new_height;
- X
- X/*
- X * count the number of lines available
- X */
- X total = 0;
- X wincount = 0;
- X for (wp = firstwin; wp; wp = wp->w_next)
- X {
- X total += wp->w_height - MIN_ROWS;
- X wincount++;
- X }
- X
- X/*
- X * if next_curwin given and 'winheight' set, make next_curwin p_wh lines
- X */
- X if (next_curwin != NULL && p_wh)
- X {
- X if (p_wh - MIN_ROWS > total) /* all lines go to current window */
- X less = total;
- X else
- X {
- X less = p_wh - MIN_ROWS - total / wincount;
- X if (less < 0)
- X less = 0;
- X }
- X }
- X else
- X less = 0;
- X
- X
- X/*
- X * spread the available lines over the windows
- X */
- X winpos = 0;
- X for (wp = firstwin; wp != NULL; wp = wp->w_next)
- X {
- X if (wp == next_curwin && less)
- X {
- X less = 0;
- X temp = p_wh - MIN_ROWS;
- X if (temp > total)
- X temp = total;
- X }
- X else
- X temp = (total - less + (wincount >> 1)) / wincount;
- X new_height = MIN_ROWS + temp;
- X if (wp->w_winpos != winpos || wp->w_height != new_height)
- X {
- X wp->w_redr_type = NOT_VALID;
- X wp->w_redr_status = TRUE;
- X }
- X wp->w_winpos = winpos;
- X wp->w_height = new_height;
- X win_comp_scroll(wp);
- X total -= temp;
- X --wincount;
- X winpos += wp->w_height + wp->w_status_height;
- X }
- X if (redraw)
- X {
- X cursupdate();
- X updateScreen(CLEAR);
- X }
- X}
- X
- X/*
- X * close current window
- X * If "free_buf" is TRUE related buffer may be freed.
- X *
- X * called by :quit, :close, :xit, :wq and findtag()
- X */
- X void
- Xclose_window(free_buf)
- X int free_buf;
- X{
- X WIN *wp;
- X
- X if (lastwin == firstwin)
- X {
- X EMSG("Cannot close last window");
- X return;
- X }
- X
- X/*
- X * Close the link to the buffer.
- X */
- X close_buffer(curbuf, free_buf, FALSE);
- X
- X/*
- X * Remove the window.
- X */
- X if (curwin->w_prev == NULL) /* freed space goes to next window */
- X {
- X wp = curwin->w_next;
- X wp->w_winpos = curwin->w_winpos;
- X }
- X else /* freed space goes to previous window */
- X wp = curwin->w_prev;
- X wp->w_height += curwin->w_height + curwin->w_status_height;
- X
- X win_free(curwin);
- X curwin = NULL;
- X if (p_ea)
- X win_equal(wp, FALSE);
- X win_enter(wp, FALSE);
- X /*
- X * if last window has status line now and we don't want one,
- X * remove the status line
- X */
- X if (lastwin->w_status_height &&
- X (p_ls == 0 || (p_ls == 1 && firstwin == lastwin)))
- X {
- X lastwin->w_height += lastwin->w_status_height;
- X lastwin->w_status_height = 0;
- X win_comp_scroll(lastwin);
- X }
- X win_comp_scroll(curwin);
- X updateScreen(NOT_VALID);
- X}
- X
- X/*
- X * close all windows except current one
- X * buffers in the windows become hidden
- X *
- X * called by :only and do_arg_all();
- X */
- X void
- Xclose_others(message)
- X int message;
- X{
- X WIN *wp;
- X WIN *nextwp;
- X
- X if (lastwin == firstwin)
- X {
- X if (message)
- X EMSG("Already only one window");
- X return;
- X }
- X
- X for (wp = firstwin; wp != NULL; wp = nextwp)
- X {
- X nextwp = wp->w_next;
- X if (wp == curwin) /* don't close current window */
- X continue;
- X /*
- X * Close the link to the buffer.
- X */
- X close_buffer(wp->w_buffer, FALSE, FALSE);
- X
- X /*
- X * Remove the window. All lines go to current window.
- X */
- X curwin->w_height += wp->w_height + wp->w_status_height;
- X
- X win_free(wp);
- X }
- X /*
- X * if current window has status line and we don't want one,
- X * remove the status line
- X */
- X if (curwin->w_status_height && p_ls != 2)
- X {
- X curwin->w_height += curwin->w_status_height;
- X curwin->w_status_height = 0;
- X }
- X curwin->w_winpos = 0; /* put current window at top of the screen */
- X win_comp_scroll(curwin);
- X if (message)
- X updateScreen(NOT_VALID);
- X}
- X
- X/*
- X * init the cursor in the window
- X *
- X * called when a new file is being edited
- X */
- X void
- Xwin_init(wp)
- X WIN *wp;
- X{
- X wp->w_redr_type = NOT_VALID;
- X wp->w_cursor.lnum = 1;
- X wp->w_curswant = wp->w_cursor.col = 0;
- X wp->w_pcmark.lnum = 1; /* pcmark not cleared but set to line 1 */
- X wp->w_pcmark.col = 0;
- X wp->w_prev_pcmark.lnum = 0;
- X wp->w_prev_pcmark.col = 0;
- X wp->w_topline = 1;
- X wp->w_botline = 2;
- X}
- X
- X/*
- X * make window wp the current window
- X */
- X void
- Xwin_enter(wp, undo_sync)
- X WIN *wp;
- X int undo_sync;
- X{
- X if (wp == curwin) /* nothing to do */
- X return;
- X
- X /* sync undo before leaving the current buffer */
- X if (undo_sync && curbuf != wp->w_buffer)
- X u_sync();
- X if (curwin != NULL)
- X prevwin = curwin; /* remember for CTRL-W p */
- X curwin = wp;
- X curbuf = wp->w_buffer;
- X maketitle();
- X /* set window height to desired minimal value */
- X if (p_wh && curwin->w_height < p_wh)
- X win_setheight((int)p_wh);
- X}
- X
- X/*
- X * allocate a window structure and link it in the window list
- X */
- X WIN *
- Xwin_alloc(after)
- X WIN *after;
- X{
- X WIN *new;
- X
- X/*
- X * allocate window structure and linesizes arrays
- X */
- X new = (WIN *)alloc((unsigned)sizeof(WIN));
- X if (new)
- X {
- X/*
- X * most stucture members have to be zero
- X */
- X memset((char *)new, 0, sizeof(WIN));
- X/*
- X * link the window in the window list
- X */
- X win_append(after, new);
- X
- X win_alloc_lsize(new);
- X
- X /* position the display and the cursor at the top of the file. */
- X new->w_topline = 1;
- X new->w_cursor.lnum = 1;
- X }
- X return new;
- X}
- X
- X/*
- X * remove window 'wp' from the window list and free the structure
- X */
- X void
- Xwin_free(wp)
- X WIN *wp;
- X{
- X if (prevwin == wp)
- X prevwin = NULL;
- X win_free_lsize(wp);
- X win_remove(wp);
- X free(wp);
- X}
- X
- X static void
- Xwin_append(after, wp)
- X WIN *after, *wp;
- X{
- X WIN *before;
- X
- X if (after == NULL) /* after NULL is in front of the first */
- X before = firstwin;
- X else
- X before = after->w_next;
- X
- X wp->w_next = before;
- X wp->w_prev = after;
- X if (after == NULL)
- X firstwin = wp;
- X else
- X after->w_next = wp;
- X if (before == NULL)
- X lastwin = wp;
- X else
- X before->w_prev = wp;
- X}
- X
- X/*
- X * remove window from the window list
- X */
- X static void
- Xwin_remove(wp)
- X WIN *wp;
- X{
- X if (wp->w_prev)
- X wp->w_prev->w_next = wp->w_next;
- X else
- X firstwin = wp->w_next;
- X if (wp->w_next)
- X wp->w_next->w_prev = wp->w_prev;
- X else
- X lastwin = wp->w_prev;
- X}
- X
- X/*
- X * allocate lsize arrays for a window
- X * return FAIL for failure, OK for success
- X */
- X int
- Xwin_alloc_lsize(wp)
- X WIN *wp;
- X{
- X wp->w_lsize_valid = 0;
- X wp->w_lsize_lnum = (linenr_t *) malloc((size_t) (Rows * sizeof(linenr_t)));
- X wp->w_lsize = (char_u *)malloc((size_t) Rows);
- X if (wp->w_lsize_lnum == NULL || wp->w_lsize == NULL)
- X {
- X win_free_lsize(wp); /* one of the two may have worked */
- X wp->w_lsize_lnum = NULL;
- X wp->w_lsize = NULL;
- X return FAIL;
- X }
- X return OK;
- X}
- X
- X/*
- X * free lsize arrays for a window
- X */
- X void
- Xwin_free_lsize(wp)
- X WIN *wp;
- X{
- X free(wp->w_lsize_lnum);
- X free(wp->w_lsize);
- X}
- X
- X/*
- X * call this fuction whenever Rows changes value
- X */
- X void
- Xscreen_new_rows()
- X{
- X WIN *wp;
- X int extra_lines;
- X
- X if (firstwin == NULL) /* not initialized yet */
- X return;
- X/*
- X * the number of extra lines is the difference between the position where
- X * the command line should be and where it is now
- X */
- X compute_cmdrow();
- X extra_lines = Rows - p_ch - cmdline_row;
- X if (extra_lines < 0) /* reduce windows height */
- X {
- X for (wp = lastwin; wp; wp = wp->w_prev)
- X {
- X if (wp->w_height - MIN_ROWS < -extra_lines)
- X {
- X extra_lines += wp->w_height - MIN_ROWS;
- X wp->w_height = MIN_ROWS;
- X win_comp_scroll(wp);
- X }
- X else
- X {
- X wp->w_height += extra_lines;
- X win_comp_scroll(wp);
- X break;
- X }
- X }
- X (void)win_comp_pos(); /* compute w_winpos */
- X }
- X else if (extra_lines > 0) /* increase height of last window */
- X {
- X lastwin->w_height += extra_lines;
- X win_comp_scroll(lastwin);
- X }
- X
- X compute_cmdrow();
- X}
- X
- X/*
- X * update the w_winpos field for all windows
- X * returns the row just after the last window
- X */
- X static int
- Xwin_comp_pos()
- X{
- X WIN *wp;
- X int row;
- X
- X row = 0;
- X for (wp = firstwin; wp != NULL; wp = wp->w_next)
- X {
- X if (wp->w_winpos != row) /* if position changes, redraw */
- X {
- X wp->w_winpos = row;
- X wp->w_redr_type = NOT_VALID;
- X wp->w_redr_status = TRUE;
- X }
- X row += wp->w_height + wp->w_status_height;
- X }
- X return row;
- X}
- X
- X/*
- X * set current window height
- X */
- X void
- Xwin_setheight(height)
- X int height;
- X{
- X WIN *wp;
- X int room; /* total number of lines available */
- X int take; /* number of lines taken from other windows */
- X int room_cmdline; /* lines available from cmdline */
- X int row;
- X
- X if (height < MIN_ROWS) /* need at least some lines */
- X height = MIN_ROWS;
- X/*
- X * compute the room we have from all the windows
- X */
- X room = MIN_ROWS; /* count the MIN_ROWS for the current window */
- X for (wp = firstwin; wp != NULL; wp = wp->w_next)
- X room += wp->w_height - MIN_ROWS;
- X/*
- X * compute the room available from the command line
- X */
- X room_cmdline = Rows - p_ch - cmdline_row;
- X/*
- X * limit new height to the room available
- X */
- X if (height > room + room_cmdline) /* can't make it that large */
- X height = room + room_cmdline; /* use all available room */
- X/*
- X * compute the number of lines we will take from the windows (can be negative)
- X */
- X take = height - curwin->w_height;
- X if (take == 0) /* no change, nothing to do */
- X return;
- X
- X if (take > 0)
- X {
- X take -= room_cmdline; /* use lines from cmdline first */
- X if (take < 0)
- X take = 0;
- X }
- X/*
- X * set the current window to the new height
- X */
- X curwin->w_height = height;
- X win_comp_scroll(curwin);
- X/*
- X * take lines from the windows below the current window
- X */
- X for (wp = curwin->w_next; wp != NULL && take != 0; wp = wp->w_next)
- X {
- X if (wp->w_height - take < MIN_ROWS)
- X {
- X take -= wp->w_height - MIN_ROWS;
- X wp->w_height = MIN_ROWS;
- X }
- X else
- X {
- X wp->w_height -= take;
- X take = 0;
- X }
- X win_comp_scroll(wp); /* recompute p_scroll */
- X wp->w_redr_type = NOT_VALID; /* need to redraw this window */
- X wp->w_redr_status = TRUE;
- X }
- X/*
- X * take lines from the windows above the current window
- X */
- X for (wp = curwin->w_prev; wp != NULL && take != 0; wp = wp->w_prev)
- X {
- X if (wp->w_height - take < MIN_ROWS)
- X {
- X take -= wp->w_height - MIN_ROWS;
- X wp->w_height = MIN_ROWS;
- X }
- X else
- X {
- X wp->w_height -= take;
- X take = 0;
- X }
- X win_comp_scroll(wp); /* recompute p_scroll */
- X wp->w_redr_type = NOT_VALID; /* need to redraw this window */
- X wp->w_redr_status = TRUE;
- X }
- X
- X/* recompute the window positions */
- X row = win_comp_pos();
- X
- X/*
- X * If there is extra space created between the last window and the command line,
- X * clear it.
- X */
- X screen_fill(row, cmdline_row, 0, (int)Columns, ' ', ' ');
- X cmdline_row = row;
- X
- X updateScreen(NOT_VALID);
- X}
- X
- X void
- Xwin_comp_scroll(wp)
- X WIN *wp;
- X{
- X wp->w_p_scroll = (wp->w_height >> 1);
- X if (wp->w_p_scroll == 0)
- X wp->w_p_scroll = 1;
- X}
- X
- X/*
- X * command_height: called whenever p_ch has been changed
- X */
- X void
- Xcommand_height()
- X{
- X int current;
- X
- X current = Rows - cmdline_row;
- X if (current > p_ch) /* p_ch got smaller */
- X lastwin->w_height += current - p_ch;
- X else /* p_ch got bigger */
- X {
- X if (lastwin->w_height - (p_ch - current) < MIN_ROWS)
- X {
- X emsg(e_noroom);
- X p_ch = lastwin->w_height - MIN_ROWS + current;
- X }
- X lastwin->w_height -= p_ch - current;
- X /* clear the lines added to cmdline */
- X screen_fill((int)(Rows - p_ch), (int)Rows, 0, (int)Columns, ' ', ' ');
- X }
- X win_comp_scroll(lastwin);
- X cmdline_row = Rows - p_ch;
- X lastwin->w_redr_type = NOT_VALID;
- X lastwin->w_redr_status = TRUE;
- X redraw_cmdline = TRUE;
- X}
- X
- X void
- Xlast_status()
- X{
- X if (lastwin->w_status_height)
- X {
- X /* remove status line */
- X if (p_ls == 0 || (p_ls == 1 && firstwin == lastwin))
- X {
- X lastwin->w_status_height = 0;
- X lastwin->w_height++;
- X win_comp_scroll(lastwin);
- X lastwin->w_redr_status = TRUE;
- X }
- X }
- X else
- X {
- X /* add status line */
- X if (p_ls == 2 || (p_ls == 1 && firstwin != lastwin))
- X {
- X if (lastwin->w_height <= MIN_ROWS) /* can't do it */
- X emsg(e_noroom);
- X else
- X {
- X lastwin->w_status_height = 1;
- X lastwin->w_height--;
- X win_comp_scroll(lastwin);
- X lastwin->w_redr_status = TRUE;
- X }
- X }
- X }
- X}
- X
- X/*
- X * file_name_at_cursor()
- X *
- X * Return the name of the file under (or to the right of) the cursor. The
- X * p_path variable is searched if the file name does not start with '/'.
- X * The string returned has been alloc'ed and should be freed by the caller.
- X * NULL is returned if the file name or file is not found.
- X */
- X char_u *
- Xfile_name_at_cursor()
- X{
- X char_u *ptr;
- X char_u *dir;
- X char_u *file_name;
- X char_u save_char;
- X int col;
- X int len;
- X
- X /* characters in a file name besides alfa-num */
- X#ifdef UNIX
- X char_u *file_chars = (char_u *)"/.-_+,~$";
- X#endif
- X#ifdef AMIGA
- X char_u *file_chars = (char_u *)"/.-_+,$:";
- X#endif
- X#ifdef MSDOS
- X char_u *file_chars = (char_u *)"/.-_+,$\\:";
- X#endif
- X
- X ptr = ml_get(curwin->w_cursor.lnum);
- X col = curwin->w_cursor.col;
- X
- X /* search forward for what could be the start of a file name */
- X while (!isalnum((char) ptr[col]) && STRCHR(file_chars, ptr[col]) == NULL)
- X ++col;
- X if (ptr[col] == NUL) /* nothing found */
- X return NULL;
- X
- X /* search backward for char that cannot be in a file name */
- X while (col >= 0 &&
- X (isalnum((char) ptr[col]) || STRCHR(file_chars, ptr[col]) != NULL))
- X --col;
- X ptr += col + 1;
- X col = 0;
- X
- X /* search forward for a char that cannot be in a file name */
- X while (ptr[col] != NUL
- X && (isalnum((char) ptr[col]) || STRCHR(file_chars, ptr[col]) != NULL))
- X ++col;
- X
- X /* copy file name into NameBuff, expanding environment variables */
- X save_char = ptr[col];
- X ptr[col] = NUL;
- X expand_env(ptr, NameBuff, MAXPATHL);
- X ptr[col] = save_char;
- X
- X if (isFullName(NameBuff)) /* absolute path */
- X {
- X if ((file_name = strsave(NameBuff)) == NULL)
- X return NULL;
- X if (getperm(file_name) >= 0)
- X return file_name;
- X }
- X else /* relative path, use 'path' option */
- X {
- X if ((file_name = alloc((int)(STRLEN(p_path) + STRLEN(NameBuff) + 2))) == NULL)
- X return NULL;
- X dir = p_path;
- X for (;;)
- X {
- X skipspace(&dir);
- X for (len = 0; dir[len] != NUL && dir[len] != ' '; len++)
- X ;
- X if (len == 0)
- X break;
- X if (len == 1 && dir[0] == '.') /* current dir */
- X STRCPY(file_name, NameBuff);
- X else
- X {
- X STRNCPY(file_name, dir, (size_t)len);
- X#ifdef AMIGA /* Amiga doesn't like c:/file */
- X if (file_name[len - 1] != ':')
- X#endif
- X file_name[len] = '/';
- X STRCPY(file_name + len + 1, NameBuff);
- X }
- X if (getperm(file_name) >= 0)
- X return file_name;
- X dir += len;
- X }
- X }
- X free(file_name); /* file doesn't exist */
- X return NULL;
- X}
- END_OF_FILE
- if test 25721 -ne `wc -c <'vim/src/window.c'`; then
- echo shar: \"'vim/src/window.c'\" unpacked with wrong size!
- fi
- # end of 'vim/src/window.c'
- fi
- if test -f 'vim/tutor/tutor' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vim/tutor/tutor'\"
- else
- echo shar: Extracting \"'vim/tutor/tutor'\" \(28799 characters\)
- sed "s/^X//" >'vim/tutor/tutor' <<'END_OF_FILE'
- X*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
- 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 *
- X*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
- X **************
- X * Lesson 1.0 *
- X **************
- X
- X Vim is a very powerful editor that has many commands, too many to
- X explain in a tutor such as this. This tutor is designed to describe
- X enough of the commands that you will be able to easily use Vim as
- X an all-purpose editor.
- X
- X The approximate time required to complete the tutor is 25-30 minutes,
- X depending upon how much time is spent with experimentation.
- X
- X It is important to remember that this tutor is set up to teach by
- X use. That means that the student needs to execute the commands to
- X learn them properly.
- X
- X Now, make sure that your Shift-Lock key is NOT depressed and press
- X the j key enough times to move the cursor so that Lesson 1.1
- X completely fills the screen.
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 1.1 *
- X **************
- X =====>>>>> MOVING THE CURSOR <<<<<=====
- X
- X ** To move the cursor, press the h,j,k,l keys as indicated. **
- X ^
- X k
- X < h l >
- X j
- X v
- X 1. Move the cursor around the screen until you are comfortable.
- X
- X 2. Hold down the down key (j) until it repeats.
- X---> Now you know how to move to the next lesson.
- X
- X 3. Using the down key, move to Lesson 1.2.
- X
- XNote: If you are ever unsure about something you typed, press <ESC> to place
- X you in Command Mode. Then retype the command you wanted.
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 1.2 *
- X **************
- X =====>>>>> ENTERING AND EXITING VIM <<<<<=====
- X
- X !! NOTE: Before executing any of the steps below, read this entire lesson!!
- X
- X 1. Press the <ESC> key (to make sure you are in Command Mode).
- X
- X 2. Type :q! <RETURN>.
- X
- X---> This exits the editor WITHOUT saving any changes you have made.
- X If you want to save the changes and exit type :wq <RETURN>
- X
- X 3. When you see the shell prompt (%) type: vim tutor <RETURN>.
- X
- X---> 'vim' means enter the vim editor, 'tutor' is the file you wish to edit.
- X
- X 4. If you have these steps memorized and are confident, execute steps
- X 1 through 3 to exit and re-enter the editor. Then cursor down to
- X Lesson 1.3.
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 1.3 *
- X **************
- X =====>>>>> TEXT EDITING - DELETION <<<<<=====
- X
- X** While in Command Mode press x to delete the character under the cursor. **
- X
- X 1. Move the cursor to the line below marked --->.
- X
- X 2. To fix the errors, move the cursor until it is on top of the
- X character to be deleted.
- X
- X 3. Press the x key to delete the unwanted character.
- X
- X 4. Repeat steps 2 through 4 until the sentence is correct.
- X
- X---> The ccow jumpedd ovverr thhe mooon.
- X
- X 5. Now that the line is correct, go on to Lesson 1.4.
- X
- XNOTE: As you go through this tutor, do not try to memorize, learn by usage.
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 1.4 *
- X **************
- X =====>>>>> TEXT EDITING - INSERTION <<<<<=====
- X
- X ** While in Command Mode press i to insert text. **
- X
- X 1. Move the cursor to the first line below marked --->.
- X
- X 2. To make the first line the same as the second, move the cursor on top
- X of the first character AFTER where the text is to be inserted.
- X
- X 3. Press i and type in the necessary additions.
- X
- X 4. As each error is fixed press <ESC> to return to Command Mode.
- X Repeat steps 2 through 4 to correct the sentence.
- X
- X---> There is text misng this .
- X---> There is some text missing from this line.
- X
- X 5. When you are comfortable inserting text move to the summary below.
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X ********************
- X * LESSON 1 SUMMARY *
- X ********************
- X
- X 1. The cursor is moved using either the arrow keys or the h,j,k,l keys.
- X h (left) j (down) k (up) l (right)
- X
- X 2. To enter Vim (from the % prompt) type: % vim FILENAME <RETURN>
- X
- X 3. To exit Vim type: <ESC> :q! <RETURN>
- X OR type: <ESC> :wq <RETURN> to save the changes.
- X
- X 4. To delete a character under the cursor in Command Mode type: x
- X
- X 5. To insert text at the cursor while in Command Mode type:
- X i type in text <ESC>
- X
- XNOTE: Pressing <ESC> will place you in Command Mode or will cancel
- X an unwanted and partially completed command.
- X
- XNow continue with Lesson 2.
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 2.1 *
- X **************
- X =====>>>>> DELETION COMMANDS <<<<<=====
- X
- X ** Type dw to delete to the end of a word. **
- X
- X 1. Press <ESC> to make sure you are in Command Mode.
- X
- X 2. Move the cursor to the line below marked --->.
- X
- X 3. Move the cursor to the beginning of a word that needs to be deleted.
- X
- X 4. Type dw to make the word disappear.
- X
- X NOTE: The letters dw will appear on the last line of the screen as you type
- X them. If you typed something wrong, press <ESC> and start over.
- X
- X---> There are a some words fun that don't belong paper in this sentence.
- X
- X 5. Repeat steps 3 and 4 until the sentence is correct and go to Lesson 2.2.
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 2.2 *
- X **************
- X =====>>>>> MORE DELETION COMMANDS <<<<<=====
- X
- X ** Type d$ to delete to the end of the line. **
- X
- X 1. Press <ESC> to make sure you are in Command Mode.
- X
- X 2. Move the cursor to the line below marked --->.
- X
- X 3. Move the cursor to the end of the correct line (AFTER the first . ).
- X
- X 4. Type d$ to delete to the end of the line.
- X
- X---> Somebody typed the end of this line twice. end of this line twice.
- X
- X
- X 5. Move on to Lesson 2.3 to understand what is happening.
- X
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 2.3 *
- X **************
- X =====>>>>> ON COMMANDS AND OBJECTS <<<<<=====
- X
- X The format for the d delete command is as follows:
- X
- X [number] d object OR d [number] object
- X Where:
- X number - is how many times to execute the command (optional, default=1).
- X d - is the command to delete.
- X object - is what the command will operate on (listed below).
- X
- X A short list of objects:
- X w - from the cursor to the end of the word, including the space.
- X e - from the cursor to the end of the word, NOT including the space.
- X $ - from the cursor to the end of the line.
- X
- XNOTE: For the adventurous, pressing just the object while in Command Mode
- X without a command will move the cursor as specified in the object list.
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 2.4 *
- X **************
- X =====>>>>> AN EXCEPTION TO 'COMMAND-OBJECT' <<<<<=====
- X
- X ** Type dd to delete a whole line. **
- X
- X Due to the frequency of whole line deletion, the designers of Vim decided
- X it would be easier to simply type two d's in a row to delete a line.
- X
- X 1. Move the cursor to the second line in the phrase below.
- X
- X 2. Type dd to delete the line.
- X
- X 3. Now move to the fourth line.
- X
- X 4. Type 2dd (remember number-command-object) to delete the two lines.
- X
- X 1) Roses are red,
- X 2) Mud is fun,
- X 3) Violets are blue,
- X 4) I have a car,
- X 5) Clocks tell time,
- X 6) Sugar is sweet
- X 7) And so are you.
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 2.5 *
- X **************
- X =====>>>>> THE UNDO COMMAND <<<<<=====
- X
- X ** Press u to undo the last commands, U to fix a whole line. **
- X
- X 1. Move the cursor to the line below marked ---> and place it on the
- X first error.
- X 2. Type x to delete the first unwanted character.
- X 3. Now type u to undo the last command executed.
- X 4. This time fix all the errors on the line using the x command.
- X 5. Now type a capital U to return the line to its original state.
- X 6. Now type u a few times to undo the U and preceding commands.
- X 7. Now type CTRL-R (keeping CTRL key pressed while hitting R) a few times
- X to redo the commands (undo the undo's).
- X
- X---> Fiix the errors oon thhis line and reeplace them witth undo.
- X
- X 8. These are very useful commands. Now move on to the Lesson 2 Summary.
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X ********************
- X * LESSON 2 SUMMARY *
- X ********************
- X
- X 1. To delete from the cursor to the end of a word type: dw
- X
- X 2. To delete from the cursor to the end of a line type: d$
- X
- X 3. To delete a whole line type: dd
- X
- X 4. The format for a command in command mode is:
- X
- X [number] command object OR command [number] object
- X where:
- X number - is how many times to repeat the command
- X command - is what to do, such as d for delete
- X object - is what the command should act upon, such as w (word),
- X $ (to the end of line), etc.
- X
- X 5. To undo previous actions, type: u (lowercase u)
- X To undo all the changes on a line type: U (capital U)
- X To undo the undo's type: CTRL-R
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 3.1 *
- X **************
- X =====>>>>> THE PUT COMMAND <<<<<=====
- X
- X ** Type p to put the last deletion after the cursor. **
- X
- X 1. Move the cursor to the first line in the set below.
- X
- X 2. Type dd to delete the line and store it in Vim's buffer.
- X
- X 3. Move the cursor to the line ABOVE where the deleted line should go.
- X
- X 4. While in Command Mode, type p to replace the line.
- X
- X 5. Repeat steps 2 through 4 to put all the lines in correct order.
- X
- X d) Can you learn too?
- X b) Violets are blue,
- X c) Intelligence is learned,
- X a) Roses are red,
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 3.2 *
- X **************
- X =====>>>>> THE REPLACE COMMAND <<<<<=====
- X
- X ** Type r and a character to replace the character under the cursor. **
- X
- X 1. Move the cursor to the first line below marked --->.
- X
- X 2. Move the cursor so that it is on top of the first error.
- X
- X 3. Type r and then the character which should replace the error.
- X
- X 4. Repeat steps 2 and 3 until the first line is correct.
- X
- X---> Whan this lime was tuoed in, someone presswd some wrojg keys!
- X---> When this line was typed in, someone pressed some wrong keys!
- X
- X 5. Now move on to Lesson 3.2.
- X
- XNOTE: Remember that you should be learning by use, not memorization.
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 3.3 *
- X **************
- X =====>>>>> THE CHANGE COMMAND <<<<<=====
- X
- X ** To change part or all of a word, type cw . **
- X
- X 1. Move the cursor to the first line below marked --->.
- X
- X 2. Place the cursor on the u in lubw.
- X
- X 3. Type cw and the correct word (in this case, type 'ine'.)
- X
- X 4. Press <ESC> and move to the next error (the first character to be changed.)
- X
- X 5. Repeat steps 3 and 4 until the first sentence is the same as the second.
- X
- X---> This lubw has a few wptfd that mrrf changing usf the change command.
- X---> This line has a few words that need changing using the change command.
- X
- XNotice that cw not only replaces the word, but also places you in insert.
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 3.4 *
- X **************
- X =====>>>>> MORE CHANGES USING c <<<<<=====
- X
- X ** The change command is used with the same objects as delete. **
- X
- X 1. The change command works in the same way as delete. The format is:
- X
- X [number] c object OR c [number] object
- X
- X 2. The objects are also the same, such as w (word), $ (end of line), etc.
- X
- X 3. Move to the first line below marked --->.
- X
- X 4. Move the cursor to the first error.
- X
- X 5. Type c$ to make the rest of the line like the second and press <ESC>.
- X
- X---> The end of this line needs some help to make it like the second.
- X---> The end of this line needs to be corrected using the c$ command.
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X ********************
- X * LESSON 3 SUMMARY *
- X ********************
- X
- X 1. To replace text that has already been deleted, type p . This Puts the
- X deleted text AFTER the cursor (if a line was deleted it will go on the
- X line below the cursor).
- X
- X 2. To replace the character under the cursor, type r and then the
- X character which will replace the original.
- X
- X 3. The change command allows you to change the specified object from the
- X cursor to the end of the object. eg. Type cw to change from the
- X cursor to the end of the word, c$ to change to the end of a line.
- X
- X 4. The format for change is:
- X
- X [number] c object OR c [number] object
- X
- XNow go on to the next lesson.
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 4.1 *
- X **************
- X =====>>>>> LOCATION AND FILE STATUS <<<<<=====
- X
- X ** Type CTRL-g to show your location in the file and the file status.
- X Type SHIFT-G to move to a line in the file. **
- X
- X Note: Read this entire lesson before executing any of the steps!!
- X
- X 1. Hold down the Ctrl key and press g . A status line will appear at the
- X bottom of the page with the filename and the line you are on. Remember
- X the line number for Step 3.
- X
- X 2. Press shift-G to move you to the bottom of the file.
- X
- X 3. Type in the number of the line you were on and then shift-G. This will
- X return you to the line you were on when you first pressed Ctrl-g.
- X (When you type in the numbers, they will NOT be displayed on the screen.)
- X
- X 4. If you feel confident to do this, execute steps 1 through 3.
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 4.2 *
- X **************
- X =====>>>>> THE SEARCH COMMAND <<<<<=====
- X
- X ** Type / followed by a phrase to search for the phrase. **
- X
- X 1. In command mode type the / character. Notice that it and the cursor
- X appear at the bottom of the screen as with the : command.
- X
- X 2. Now type 'errroor' <RETURN>. This is the word you want to search for.
- X
- X 3. To search for the same phrase again, simply type n .
- X To search for the same phrase in the opposite direction, type Shift-N .
- X
- X 4. If you want to search for a phrase in the backwards direction, use the
- X command ? instead of /.
- X
- X---> When the search reaches the end of the file it will continue at the start.
- X
- X "errroor" is not the way to spell error; errroor is an error.
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 4.3 *
- X **************
- X =====>>>>> MATCHING PARENTHESES SEARCH <<<<<=====
- X
- X ** Type % to find a matching ),], or } . **
- X
- X 1. Place the cursor on any (, [, or { in the line below marked --->.
- X
- X 2. Now type the % character.
- X
- X 3. The cursor should be on the matching parenthesis or bracket.
- X
- X 4. Type % to move the cursor back to the first bracket (by matching).
- X
- X---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
- X
- XNote: This is very useful in debugging a program with unmatched parentheses!
- X
- X
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 4.4 *
- X **************
- X =====>>>>> A WAY TO CHANGE ERRORS <<<<<=====
- X
- X ** Type :s/old/new/g to substitute 'new' for 'old'. **
- X
- X 1. Move the cursor to the line below marked --->.
- X
- X 2. Type :s/thee/the <RETURN> . Note that this command only changes the
- X first occurrence on the line.
- X
- X 3. Now type :s/thee/the/g meaning substitute globally on the line.
- X This changes all occurrences on the line.
- X
- X---> thee best time to see thee flowers is in thee spring.
- X
- X 4. To change every occurrence of a character string between two lines,
- X type :#,#s/old/new/g where #,# are the numbers of the two lines.
- X Type :%s/old/new/g to change every occurrence in the whole file.
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X ********************
- X * LESSON 4 SUMMARY *
- X ********************
- X
- X 1. Ctrl-g displays your location in the file and the file status.
- X Shift-G moves to the end of the file. A line number followed
- X by Shift-G moves to that line number.
- X
- X 2. Typing / followed by a phrase searches FORWARD for the phrase.
- X Typing ? followed by a phrase searches BACKWARD for the phrase.
- X After a search type n to find the next occurrence in the same direction
- X or Shift-N to search in the opposite direction.
- X
- X 3. Typing % while the cursor is on a (,),[,],{, or } locates its
- X matching pair.
- X
- X 4. To substitute new for the first old on a line type :s/old/new
- X To substitute new for all 'old's on a line type :s/old/new/g
- X To substitute phrases between two line #'s type :#,#s/old/new/g
- X To substitute all occurrences in the file type :%s/old/new/g
- X To ask for confirmation each time add 'c' :%s/old/new/gc
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 5.1 *
- X **************
- X =====>>>>> HOW TO EXECUTE AN AMIGA COMMAND <<<<<=====
- X
- X ** Type :! followed by an Amiga command to execute that command. **
- X
- X 1. Type the familiar command : to set the cursor at the bottom of the
- X screen. This allows you to enter a command.
- X
- X 2. Now type the ! (exclamation point) character. This allows you to
- X execute an Amiga shell command.
- X
- X 3. As an example type ls following the !. This will show you a listing
- X of your directory, just as if you were at the % prompt.
- X
- X---> Note: It is possible to execute any shell command this way.
- X
- X
- X
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 5.2 *
- X **************
- X =====>>>>> MORE ON WRITING FILES <<<<<=====
- X
- X ** To save the changes made to the file, type :w FILENAME. **
- X
- X 1. Type :!dir to get a listing of your directory.
- X
- X 2. Choose a filename that is not already in your area, such as TEST.
- X
- X 3. Now type: :w TEST (where TEST is the filename you chose.)
- X
- X 4. This saves the whole file (Vim Tutor) under the name TEST.
- X To verify this, type :!dir again to see your directory
- X
- X---> Note that if you were to exit Vim and enter again with the filename TEST,
- X the file would be an exact copy of the tutor when you saved it.
- X
- X 5. Now remove the file from your area by typing: :!delete TEST
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 5.3 *
- X **************
- X =====>>>>> A SELECTIVE WRITE COMMAND <<<<<=====
- X
- X ** To save part of the file, type :#,# w FILENAME **
- X
- X 1. Once again, type :!dir to obtain a listing of your directory and
- X choose a suitable filename such as TEST.
- X
- X 2. Move the cursor to the top of this page and type Ctrl-g to find the
- X number of that line. REMEMBER THIS NUMBER!
- X
- X 3. Now move to the bottom of the page and type Ctrl-g again. REMEMBER THIS
- X LINE NUMBER ALSO!
- X
- X 4. To save ONLY a section to a file, type :#,# w TEST where #,# are
- X the two numbers you remembered (top,bottom) and TEST is your filename.
- X
- X 5. Again, see that the file is there with :!dir but DO NOT remove it.
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 5.4 *
- X **************
- X =====>>>>> RETRIEVING AND MERGING FILES <<<<<=====
- X
- X ** To insert the contents of a file, type :r FILENAME **
- X
- X 1. Type :!dir to make sure your TEST filename is present from before.
- X
- X 2. Place the cursor at the top of this page.
- X
- XNOTE: After executing Step 3 you will see Lesson 5.3. Then move DOWN to
- X this lesson again.
- X
- X 3. Now retrieve your TEST file using the command :r TEST where TEST is
- X the name of the file.
- X
- XNOTE: The file you retrieve is placed starting where the cursor is located.
- X
- X 4. To verify that a file was retrieved, cursor back and notice that there
- X are now two copies of Lesson 5.3, the original and the file version.
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X ********************
- X * LESSON 5 SUMMARY *
- X ********************
- X
- X 1. :!command executes an Amiga system command.
- X
- X Some useful examples are:
- X :!dir - shows a directory listing of your area.
- X :!delete FILENAME - removes file FILENAME from your area.
- X
- X 2. :w FILENAME writes the current Vim file to disk with name FILENAME.
- X
- X 3. :#,# FILENAME saves the lines # through # in file FILENAME.
- X
- X 4. :r FILENAME retrieves disk file FILENAME and inserts it into the
- X current file following the cursor position.
- X
- X
- X
- X
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 6.1 *
- X **************
- X =====>>>>> THE OPEN COMMAND <<<<<=====
- X
- X ** Type o to open a line below the cursor and place you in insert mode. **
- X
- X 1. Move the cursor to the line below marked --->.
- X
- X 2. Type o (lowercase) to open up a line BELOW the cursor and place you in
- X insert mode.
- X
- X 3. Now copy the line marked ---> and press <ESC> to exit insert mode.
- X
- X---> After typing o the cursor is placed on the open line in insert mode.
- X
- X 4. To open up a line ABOVE the cursor, simply type a capital O , rather
- X than a lowercase o. Try this on the line below.
- XOpen up a line above this by typing Shift-O while the cursor is on this line.
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 6.2 *
- X **************
- X =====>>>>> THE APPEND COMMAND <<<<<=====
- X
- X ** Type a to insert text AFTER the cursor. **
- X
- X 1. Move the cursor to the end of the first line below marked ---> by
- X typing $ in Command mode.
- X
- X 2. Type an a (lowercase) to append text AFTER the character under the
- X cursor. (Uppercase A appends to the end of the line.)
- X
- XNote: This avoids typing i , the last character, the text to insert, <ESC>,
- X cursor-right, and finally, x , just to append to the end of a line!
- X
- X 3. Now complete the first line. Note also that append is exactly the same
- X as insert mode, except for the location where text is inserted.
- X
- X---> This line will allow you to practice
- X---> This line will allow you to practice appending text to the end of a line.
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 6.3 *
- X **************
- X =====>>>>> ANOTHER VERSION OF REPLACE <<<<<=====
- X
- X ** Type a capital R to replace more than one character. **
- X
- X 1. Move the cursor to the first line below marked --->.
- X
- X 2. Place the cursor at the beginning of the first word that is different
- X from the second line marked ---> (the word 'last').
- X
- X 3. Now type R and replace the remainder of the text on the first line by
- X typing over the old text to make the first line the same as the second.
- X
- X---> To make the first line the same as the last on this page use the keys.
- X---> To make the first line the same as the second, type R and the new text.
- X
- X 4. Note that when you press <ESC> to exit, any unaltered text remains.
- X
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X **************
- X * Lesson 6.4 *
- X **************
- X =====>>>>> SET ENVIRONMENT VARIABLE <<<<<=====
- X
- X ** Change environment so a search or substitute ignores case **
- X
- X
- X 1. Search for 'ignore' by entering:
- X /ignore
- X Repeat several times by hitting the n key
- X
- X 2. Set the 'ic' (Ignore case) variable by typing:
- X :set ic
- X
- X 3. Now search for 'ignore' again by entering: n
- X Repeat search several more times by hitting the n key
- X
- X
- X
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X ********************
- X * LESSON 6 SUMMARY *
- X ********************
- X
- X 1. Typing o opens a line BELOW the cursor and places the cursor on the open
- X line in insert mode.
- X Typing a capital O opens the line ABOVE the line the cursor is on.
- X
- X 2. Type an a to insert text AFTER the character the cursor is on.
- X Typing a capital A automatically appends text to the end of the line.
- X
- X 3. Typing a capital R enters replace mode until <ESC> is pressed to exit.
- X
- X 4. Typing ":set xxx" sets the environment variable "xxx"
- X
- X
- X
- X
- X
- X
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- X
- X This concludes the Vim Tutor. It was intended to give a brief overview of
- X the Vim editor, just enough to allow you to use the editor fairly easily.
- X It is far from complete as Vim has many many more commands.
- X
- X For more information on Vim editor please refer to:
- X
- X doc/reference.doc - a complete description of Vim
- X doc/index - a short summary of all commands
- X doc/difference.doc - summary of differences between vi and Vim
- X
- X Or hit the HELP key!
- X
- X This tutorial was written by Michael C. Pierce and Robert K. Ware,
- X Colorado School of Mines using ideas supplied by Charles Smith,
- X Colorado State University.
- X E-mail: bware@mines.colorado.edu.
- X
- X Modified for Vim by Bram Moolenaar.
- X
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- END_OF_FILE
- if test 28799 -ne `wc -c <'vim/tutor/tutor'`; then
- echo shar: \"'vim/tutor/tutor'\" unpacked with wrong size!
- fi
- # end of 'vim/tutor/tutor'
- fi
- echo shar: End of archive 19 \(of 26\).
- cp /dev/null ark19isdone
- MISSING=""
- 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
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 26 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-