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

📄 inter.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
📖 第 1 页 / 共 4 页
字号:
Once text selection has been started, then any movement command may
be used to expand or shrink the selected region.  Multiple line selections
always select complete lines.  A portion of a single line can be
selected (i.e. a word) by growing the selection left or right.  A portion
of a line is called a column region and a multiple line selection is
called a line region.
.np
You can select text with the mouse by holding down the right or left mouse
button, and moving the mouse up and down or left and right.
When using the right button, a selection menu will appear after the mouse
button is released , from which you choose what
you wish to do with the selected text.
.np
If you highlight a region by holding down the left button and moving
the mouse, then releasing the button has no effect
(the region simply remains highlighted).  This region may then be operated
on from the &cmdline, using different &cmdmode commands, or by right-clicking
the mouse in the selected region.
.np
If you click the right mouse button (right-click) while the mouse cursor
is in a highlighted (selected) set of lines, then a selection menu
for the lines appears.  If you right-click in a selected group of characters
on a single line (a column region) then a selection menu for that column
region appears.  The two menus are different.  You may also bring up
these menus by pressing the underscore
('_') key.
.np
If you click the right mouse button (right-click) in an unselected region,
the current word will be highlighted and the selection menu will appear.
This can also be accomplished by pressing the underscore ('_') key.
.np
If you double click the left mouse button, the current word will be
highlighted and the selection menu will appear.  However, the word selected here
is slightly different than the word selected by clicking the right mouse
button.  This word is defined to include the characters '.', ':' and '\', so
that double clicking the left mouse button on a file name will select the
entire path.
.*
.exercises
:OL.

:LI.Edit the file "atest" created in the Exercises section of
:HDREF refid='maiaf'
:period.
Click the left mouse button when the mouse cursor is on the top line,
and drag your mouse down until the first 10 lines are selected.
If you do not have a mouse, then press the shift key and cursor down
until the first 10 lines are selected.
.np
Now, click the right mouse button somewhere inside the selected
region.  If you do not have a mouse, press the underscore ('_') key. A
menu will appear.
The selected region and the menu will appear as follows:
.figure *depth='2.47' *scale='59' *file='vi019' Selected Lines menu
From this menu, you can either delete or yank (copy) the lines.  You
may cancel the menu by pressing
.param ESC
(the region remains highlighted). You can cancel the selected region by
pressing
.param ESC
again.
.np
If you click your left mouse button somewhere outside the selected region,
both the menu and the selected region will be cancelled.

:LI.Make sure the selected region is cancelled (press
.param ESC
until it is gone).
Now press the right mouse button on the word "This" in the first line of
the file.  If you do not have a mouse, then position the cursor somewhere
in the word "This" and press the underscore ('_') key.  You will see the following
menu appear:
.figure *depth='2.47' *scale='59' *file='vi020' Selected Columns menu
You may do a number of things from the popup menu:
.*
:DL break.

:DT.Open
:DD.Open (edit) the file indicated by the highlighted (selected) text.  The
selected text is treated like a file name, and an edit session for that file is
started.  The file will be given the name of the highlighted text.

:DT.Change
:DD.Change the selected word.

:DT.Delete
:DD.Delete the selected word.

:DT.Yank
:DD.Yank (copy) the selected word.

:DT.Fgrep
:DD.Search the current directory for any files containing the selected word.
See the &cmdline command
.keyref fgrep
in the chapter
:HDREF refid='cmds'.
for more information.

:DT.Tag
:DD.Search your tags file for the selected word.
See the &cmdline command
.keyref tag
in the chapter
:HDREF refid='cmds'.
for more information.

:eDL.
.*
:LI.Make sure the selected region is cancelled.  Then add the following
line to the start of the file (use the &cmdmode key capital o ('O')
to open a line above the first line):
.millust begin
#include &lt.c:\h\test.h&gt.
.millust end
Now, try right mouse clicking on parts of the file name.  Notice how
only individual pieces of the file name are selected.  Now, try double
clicking the left mouse button somewhere on the file name.  The
menu from the previous example will appear, selecting the entire file name
as shown below:
.figure *depth='2.47' *scale='59' *file='vi021' Double Click Selection

:LI.Try using
.param CTRL_R
to start a selection and then move around in your file.  Use the
.param ESC
key to cancel your selection.

:LI.Try using the shifted cursor keys to select lines.  Use the
.param ESC
key to cancel your selection.

:eOL.
.* ******************************************************************
.section 'Joining Text'
.* ******************************************************************
.np
&edvi has the ability to join two lines together.  If you press the
letter 'J' (capital 'j') while in &cmdmode, then the next line will join to the
end of the current line.  All white space except for a single space
will be removed. For example, typing 'J' while on the first line in these
two lines:
.millust begin
This is a line.
      This is another line.
.millust end
produces the line:
.millust begin
This is a line. This is another line.
.millust end
If you precede 'J' with a repeat count, then that many lines after the current
line will be joined to the current line.  For example, typing
.millust begin
4J
.millust end
while on the first line of:
.millust begin
Line 1.
   Line 2.
   Line 3.
Line 4.
    Line 5.
    Line 6.
.millust end
will produce the result:
.millust begin
Line 1. Line 2. Line 3. Line 4. Line 5.
    Line 6.
.millust end
.np
There is also a &cmdline command called
.keyref join
that is used to join lines of text together.  This command is used
as follows:
.millust begin
&lt.linerange&gt. join
.millust end
The lines in the specified range
.param &lt.linerange&gt.
are joined together.  If a single line number is specified, then the
line after that line is joined to the specified line.  If no line number
is specified, then the line after the current line is joined to the current
line.  For example, the command:
.millust begin
:1,5 join
.millust end
will cause the lines 1 through 5 of the file to be joined into a single
line.
.* ******************************************************************
.section 'Using Marks'
.* ******************************************************************
.np
:INCLUDE file='markinfo'.
.np
A mark is useful in that you do not have to remember a specific line
number, you just need to remember the letter that you picked for the
mark name.   You can then return to the line or even the exact position
on the line easily.
.np
You may set a mark by pressing the letter 'm' (in &cmdmode) and pressing one
of the letters from 'a' to 'z'.  For example, if you type
.millust begin
ma
.millust end
you will set the mark 'a' at the current position in the file, and
you will see the following message appear:
.millust begin
Mark 'a' set
.millust end
.np
You can set a mark with the &cmdline command
.keyref mark
:period.
The syntax of the command is
.millust begin
&lt.line&gt. mark &lt.letter&gt.
.millust end
You specify which line the mark is to be set on with
.param &lt.line&gt.
:period.
If no line is specified, the current line is assumed.  You specify
the mark id ('a'-'z') with
.param &lt.letter&gt.
:period.
.np
For example, the following &cmdline commands may be used to set marks:
.millust begin
mark a   - sets the mark 'a' on the current line.
5 mark b - sets the mark 'b' on line 5.
.millust end
.np
Once you have set a mark, you may return to the mark by pressing either
the front quote (apostrophy) (') or the back quote (`), followed by the
letter of the mark you wish to return to.  Using the back quote causes you
to return to the row and column position of the mark.
Using the front quote (apostrophy) causes you to return to the line with the
mark (the cursor moves to the first column on the line).
.np
For example, after setting the mark 'a', you can return to it by typing:
.millust begin
'a   - return to the line with the mark 'a'.
`a   - return to the exact position with the mark 'a'.
.millust end
.np
Marks are useful when you need to go searching a file for something,
but you want to be able to return to a specific position.  They are
also useful when deleting and copying text (see the section
:HDREF refid='dcapt'.
later on in this chapter).
.np
For more information on marks, see the section
:HDREF refid='marks'
in the chapter
:HDREF page=no refid='modes'
:period.
.*
.exercises
:OL.

:LI.Edit the file "atest" created in the Exercises section of
:HDREF refid='maiaf'
:period.
Cursor to the letter 'i' in the word 'is' on the first line, and type
.millust begin
ma
.millust end
This will set the mark 'a' at that position.

:LI.Page down twice.  Now, type
.millust begin
`a
.millust end
You will be moved to the 'i' in the word 'is' on the first line.

:LI.Page down twice.  Now, type
.millust begin
'a
.millust end
You will be moved to the first column of the first line.

:LI.Go to the bottom of the file.  Now, enter the &cmdline command
.keyref mark
as follows (remember to press colon (':') to bring up the command window)
.millust begin
:mark z
.millust end

:LI.Go to the top of the file (using CTRL_PAGEUP), and enter the
&cmdline
.millust begin
:'z
.millust end
This will return you to the last line of the file

:LI.Now, type the following &cmdline
.millust begin
:'a
.millust end
This will take you back to line 1, where you set the mark 'a'.

:eOL.
.* ******************************************************************
.section *refid=stext 'Searching for Text'
.* ******************************************************************
.np
You can search a file for a string in either a forwards or backwards
direction.
By using the &cmdmode key '/', you are prompted for a string to
search for in the forwards direction.  By using the &cmdmode key '?',
you are prompted for a string to search for in the backwards direction.
.np
When the string is found, your cursor is moved to the first character
of the string, and the string is highlighted.
.np
If the string (for example, "abc") is not found, you will see the message:
.millust begin
String 'abc' not found
.millust end
.np
When you press '/' (forward search), the following window will appear:
.figure *depth='2.47' *scale='59' *file='vi022' Search String Entry Window
This window behaves just like the command window:
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.  If you press
.param ESC
:cont.,
the search in cancelled.
.np
If you press '?' (backwards search), you will be able to enter a backwards
search string.
.np
If you press 'n', &edvi will take you to the next occurrence of the
last search string, searching in the same direction as the last
search command.
.np
If you press 'N', &edvi will take you to the next occurrence of the
last search string, only it will search in the opposite direction as
the last search command.
.np
:INCLUDE file='rxexp'.
.np
The section
:HDREF refid='srching'.
in the chapter
:HDREF page=no refid='modes'.
describes the searching in more detail.
.*
.exercises
:OL.

:LI.Edit the file "atest" created in the Exercises section of
:HDREF refid='maiaf'
:period.
Press the forward slash ('/') key, and enter the string "this".
The word "This" on the first line will be highlighted, and your cursor
will be on the 'T'. (notice that the search is case insensitive).

:LI.Now press, the 'n' key.  You will move to the word "This" on the
second line.

:LI.Press 'n' two more times.  You will now be on the word "This" on
the fourth line.

:LI.Press 'N'.  You will move to the word "This" on the third line.

:LI.Press the question mark ('?') key, and enter the string "1".  You
will move to the '1' on the first line.

:LI.Press 'n'.  The search will wrap around to the end of the file,
and search backwards until the '1' on line 21 is encountered.

:LI.Press 'n'.  You will move to the '1' on line 19.

:LI.Press 'N'.  You will move back to the '1' on line 21.

:eOL.
.* ******************************************************************
.section *refid=dcapt 'Deleting, Copying, and Pasting Text'
.* ******************************************************************
.np
There are two useful commands in &edvi for deleting and
copying text.  In &cmdmode, you press the 'd' key to start the delete
sub-mode.  You press the 'y' key to start the yank (copy) sub-mode.  Each
of these sub-modes is indicated on the mode indicator on the menu bar:
.millust begin
Mode: delete
.millust end
or
.millust begin
Mode: yank
.millust end
.np
Once you have entered the sub-mode, you can then specify one of the following
operations:
:INCLUDE file='operlist'.
.np
Some examples are:
.millust begin
dw     -  delete a word
yr     -  yank (copy) highlighted region
d/text - delete up to the word "text".
.millust end
.np
These commands can be preceded by an optional repeat count.  This repeat
count specifies the number of times that the command will be executed.
If the repeat count is not specified, the command is executed once.
For example:
.millust begin
3dw - delete 3 words
2yy - copy 2 lines
.millust end
.np
A &copybuffer can be specified between the repeat count and the command.
The buffer is identified by preceding it with double quotes (").  For
example:
.millust begin
3"ayy - copy 3 lines into buffer 'a'.
"zdd  - delete 3 lines into buffer 'z'.
.millust end
The optional &copybuffer is a place where deleted or yanked text resides.  If
you do not specify a buffer, then the active &copybuffer is assumed.
There are 9 numbered buffers (1-9) that may be selected as the active
buffer (buffer 1 is the default active buffer).  When text enters the
active &copybuffer, the old contents of the active buffer spills into the
next buffer.  The contents of each buffer spills into the next, with the end
buffer (9) losing its contents.
.np
The active copy buffer may be selected by pressing

⌨️ 快捷键说明

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