⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inter.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
📖 第 1 页 / 共 4 页
字号:
.****************************************************************************
.*
.*                            Open Watcom Project
.*
.*    Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
.*
.*  ========================================================================
.*
.*    This file contains Original Code and/or Modifications of Original
.*    Code as defined in and that are subject to the Sybase Open Watcom
.*    Public License version 1.0 (the 'License'). You may not use this file
.*    except in compliance with the License. BY USING THIS FILE YOU AGREE TO
.*    ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
.*    provided with the Original Code and Modifications, and is also
.*    available at www.sybase.com/developer/opensource.
.*
.*    The Original Code and all software distributed under the License are
.*    distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
.*    EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
.*    ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
.*    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
.*    NON-INFRINGEMENT. Please see the License for the specific language
.*    governing rights and limitations under the License.
.*
.*  ========================================================================
.*
.* Description:  Basic usage.
.*
.* Date         By              Reason
.* ----         --              ------
.* 10-aug-92    Craig Eisler    initial draft
.* 28-sep-05    L. Haynes       reformatted, figures
.* 30-apr-06    F. Beythien     minor updates, typing errors
.*
.****************************************************************************/
.chap *refid=inter 'Intermediate Usage'
.*
.np
This chapter discusses a number of the commonly used features of the &edname.
:period.
The knowledge of the information in the chapter
:HDREF page=no refid='basic'.
is assumed.
.* ******************************************************************
.section 'The Command Line'
.* ******************************************************************
.np
The &edname has a powerful set of commands that are entered in a special
command window. These commands
are referred to as &cmdline commands.  You can activate the command window
in two ways:
.*
:OL.

:LI.Select the
.keyword Enter command
item under the
.keyword File
menu.

:LI.Press the colon (':') key when in &cmdmode
:period.
Remember to press the
.param ESC
key to ensure that you are in &cmdmode
before pressing ':'.

:eOL.
.*
Once you have done one of the previous things, the following window will
appear on your screen:
.figure *depth='2.47' *scale='59' *file='vi015' The Command Entry window
You may enter a command in this window (for example: quit).  If you wish
to cancel the command that you are typing, just press the
.param ESC
key and the window will disappear.
.np
You may cursor back and forth in the command window, and use the
backspace and delete keys to change mistakes.  Once you press
.param ENTER
:cont.,
the command will be processed.
.np
If you cursor up, you will go through a list of commands
that you have entered at the command window (newest to oldest).  This
is your command
.keyword history
:period.
Cursoring
down will take you through the history from oldest to newest.  This is
very useful if you have typed a complicated command and did not get it
quite right or if you just wish to execute the command again.
.np
The chapter
:HDREF refid='cmds'.
describes the &cmdline in more detail.
.*
.beglevel
.* ******************************************************************
.section 'Line Numbers'
.* ******************************************************************
.np
Some &cmdline commands accept a line address or a line range as a
parameter.
For example, when specifying the
.keyref write
command, you may specify
.millust begin
:write
.millust end
or you may specify
.millust begin
:1,10 write
.millust end
.np
A line address is a number or a sum of numbers.  As well,
some special symbols may be used:
.*
:DL break.

:DT.. (dot)
:DD.Represents the current line number.

:DT.$ (dollar)
:DD.Represents the last line number.

:DT.'a (front quote)
:DD.Indicates the line with the mark 'a' set; marks 'a' through 'z'
may be used.  Marks are discussed later in this chapter.

:eDL.
.*
.np
A line range is two line addresses separated by a comma.
.np
Some examples of line addresses and line ranges are:
.millust begin
 .+5     - five lines past the current line.

 'a      - the line with mark a.

 $       - the last line

 1,5     - lines 1 to 5

 .,$     - current line in file to end line of file

 .-3,100 - the line 3 before the current to line 100
.millust end
Line addresses are discussed in greater detail in the section
:HDREF refid='lineadd'.
:period.
.np
If you just enter a line address on its own on the &cmdline, then
you will go directly to that line.
.*
.exercises
:OL.

:LI.Start up &edvi, and try selecting the
.keyword File
menu, and then selecting the
.keyword Enter command
item.  Notice how the window pops up.  Try typing and cursoring around.
When you are done, press the
.param ESC
key to cancel the command.

:LI.Make sure that you are in &cmdmode, then press the colon (':') key.
Once again, the command window pops up.
Try typing and cursoring around. When you are done, press the
.param ESC
key to cancel the command.

:LI.Add 10 lines to your file.  Then press the colon (':') key and
enter the number 5.  You will go to line 5.  Try entering different
numbers and see what happens.   If you enter a line number that
does not exist, you will see the message:
.millust begin
No such line
.millust end

:LI.Now that you have a number of commands entered, try cursoring up
and down in the command window.  You will see all the commands that
you have typed.

:eOL.
.*
.endlevel
.* ******************************************************************
.section 'Getting a File for Editing'
.* ******************************************************************
.np
In the chapter
:HDREF refid='basic' page=no.
:cont.,
you saw that you could edit a file by either specifying the name on the
command line when invoking &edvi, or by selecting the
.keyword File
menu and picking the
.keyword Edit new file
option.
.np
The general way to edit a new file is to use the &cmdline command
.keyref edit
:period.
To enter this command, make sure that you are in &cmdmode and press
the colon (':') key.  Once the command prompt is displayed, then
simply type
.keyref edit
(optionally followed by a file name or a list of files), and then press
.param ENTER
:period.
.np
If you do not specify a file, then a directory listing is displayed.
:INCLUDE file='fsdesc'.
.np
You may also specify one or more files after the
.keyref edit
command.
If a file you specify is the same as one already being edited,
then control is simply transferred to the window with that file.
.*
.exercises
:OL.

:LI.Start up &edvi without any files specified. Then try entering the
&cmdline command
.keyref edit
without any parameters (remember to press the colon (':') key first).
You will see a screen similar to the following:
.figure *depth='2.47' *scale='59' *file='vi016' File Selection display
Try changing to other directories or drives
with this list.  When you are done, press the
.param ESC
key to cancel the selection list.

:LI.Try entering the following &cmdline
.millust begin
:e afile
.millust end
This will cause &edvi to start editing a new file called "afile".

:LI.Try entering the command
.millust begin
:e bfile cfile
.millust end
This will cause &edvi to edit two new files, one named "bfile"
and one named "cfile".

:LI.Enter the command
.millust begin
:e afile
.millust end
This returns you to the first file ("afile") that you were already editing.

:LI.Press
.param CTRL_C
:cont., and &edvi will quit all the files that you have started editing.

:eOL.
.* ******************************************************************
.section 'Moving Between Files'
.* ******************************************************************
.np
There are a number of ways to move between files that you are editing.
As you have seen in the previous section,  you can move to a file
that you are already editing by using the &cmdline command
.keyref edit
and specifying the name of the file you wish to move to.
.np
You may press the
.param F1
key while in &cmdmode or &tinsmode
:period.
This function key moves you to the next file in the list of files that
you are editing.
.np
You may press the
.param F2
key while in &cmdmode or &tinsmode
:period.
This function key moves you to the previous file in the list of files that
you are editing.
.np
The previous two function keys that you may use also have &cmdline
equivalents.
The &cmdline command
.keyref next
moves you to the next file in the list of files that you are editing.
.np
The &cmdline command
.keyref prev
moves you to the previous file in the list of files that you are editing.
.np
It is also possible to display a list of all files that you are currently
editing.  You may press the
.param F7
key in either &cmdmode or &tinsmode, or enter the &cmdline command
.keyref files
:period.
Doing any one of these things will cause a list of all files currently
being edited to appear.  An asterisk ('*') will precede files that
have been modified.
From this list, you may go to one of the files,
quit one of the files, or save one of the files then quit it.
.*
.exercises
:OL.

:LI.Start up &edvi in the following way:
.millust begin
vi a b c
.millust end
This will cause you to edit three new files.
Now, press the
.param F7
key.  The following will appear:
.figure *depth='2.47' *scale='59' *file='vi017' Current File List
Select the file
.param b
:period.
That file will become the current file being edited.

:LI.Type the &cmdline
.millust begin
:files
.millust end
You will see the same result as you saw in the previous example.
Press the
.param ESC
key to cancel this display.

:LI.Press the
.param F1
key several times.  You will rotate through the three files that you
are editing.

:LI.Press the
.param F2
key several times.  You will rotate through the three files that you
are editing, but in the opposite order than when you were pressing the
.param F1
key.

:LI.Use the &cmdline commands
.keyref next
and
.keyref prev
to move through the files.  These commands behave the same as
pressing
.param F1
and
.param F2
:period.

:eOL.
.* ******************************************************************
.section *refid=maiaf 'Moving Around in a File'
.* ******************************************************************
.np
You have already learned to use the cursor keys to move around through
a file.  When you are in &cmdmode, there are a number of keys that
also cause movement through the file. Many of these keys may be
preceded with a repeat count.  You enter the repeat count
by typing a number (which will be echoed in a special window on the
screen).
.np
Once you have entered the repeat count, you may cancel it
by pressing the
.param ESC
key, or you may follow it with a movement command.  For example, if
you type:
.millust begin
3&lt.Down Arrow Key&gt.
.millust end
you will move down three lines instead of one.
.np
The basic &cmdmode movement commands are:
:INCLUDE file='basicmv'.
.np
There are additional commands that move you around the file which do not
require your fingers to move off the home row of your keyboard.
For a touch typist, this is a great advantage.
For a list of all of the movement commands, see the section
:HDREF refid='mvement'
in the chapter
:HDREF page=no refid='modes'
:period.
The following list of movement commands move you around on the
current line:
.*
:DL break.

:DT.$ (dollar sign)
:DD.Move to the end of the current line.

:DT.0 (zero)
:DD.Move to the start of the current line.

:DT.b
:DD.Move backwards to the previous word on the current line. If preceded
with a repeat count, you move back that many words.

:DT.h
:DD.Move right through the text.
If preceded with a repeat count, then you move right that many characters.

:DT.l
:DD.Move left through the text.
If preceded with a repeat count, then you move left that many characters.

:DT.w
:DD.Move forward to the next word on the current line. If preceded
with a repeat count, you move forward that many words.

:DT.B
:DD.Move backwards to the previous whitespace delimited word on the current line.
If preceded with a repeat count, you move back that many words.

:DT.W
:DD.Move forward to the next whitespace delimited word on the current line.
If preceded with a repeat count, you move forward that many words.

:eDL.
.*
.np
The following list of movement commands move you to other lines:
.*
:DL break.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -