modes.gml
来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 2,044 行 · 第 1/4 页
GML
2,044 行
When text is yanked/deleted into the active ©buffer,
the contents of the the buffers are cascaded forward from the active
buffer into the next one, with the last numbered ©buffer
losing its contents. Any buffers that are before the active
©buffer have their contents preserved. For example, if buffer 3
is the active buffer, then a deletion will cascade buffer 3 to buffer 4,
buffer 4 to buffer 5, and so on, with the contents of buffer 9 being lost.
Buffers 1 and 2 remain untouched, and buffer 3 gets a copy of the deleted text.
:P.
There are several &cmdmode commands that add text to buffers; they
are
:DEFLIST.
:DEFITEM.<"?><n>d<oper>
Deletes text in various ways.
:DEFITEM.<n>DEL
Deletes the character at the current cursor position.
:DEFITEM.D
Deletes text from the current cursor position to the end of the current line.
:DEFITEM.<n>x
Deletes the character at the current cursor position.
:DEFITEM.<n>X
Deletes the character before the current cursor position.
:DEFITEM.<"?><n>y<oper>
Yanks (copies) text in various ways.
:DEFITEM.<n>Y
Yanks (copies) the current line.
:eDEFLIST.
There is more information on these &cmdmode
commands later in this chapter.
:P.
Text may be yanked/deleted into a specific ©buffer
by typing "[1-9] before
the appropriate command. As well, there are 26 named buffers that may
be used, 'a'-'z'. When text is yanked or deleted into a named buffer,
it remains there for the life of the editing session (or until replaced).
:P.
To retrieve the contents of a buffer, use:
:KEYLIST.
:KEY.SHIFT_INS <"?>SHIFT_INS
Puts (pastes) the contents of the active ©buffer
after the cursor position in the current edit buffer.
:SEECMD.put
:EXAMPLE."aSHIFT_INS
Copy the data in the named buffer
:ITALICS.a
after the current position in the file.
:EXAMPLE.SHIFT_INS
Copy the data in the active buffer
after the current position in the file.
:KEY.p <"?>p
Puts (pastes) the contents of the active ©buffer
after the cursor position in the current edit buffer.
:SEECMD.put
:EXAMPLE.p
Copies the data in the active buffer after the current position in the file.
:EXAMPLE."5p
Copies the data in the numbered buffer
:ITALICS.5
after the current position in the file.
:KEY.P <"?>P
Puts (pastes) the contents of the active ©buffer
before the cursor position in the current edit buffer.
:SEECMD.put
:P.
:EXAMPLE."aP
Copy the data in the named buffer
:ITALICS.a
before the current position in the file.
:EXAMPLE.P
Copy the data in the active buffer
before the current position in the file.
:eKEYLIST.
Without a
:ITALICS."?
prefix, these commands retrieve the contents of the active buffer.
:P.
The contents of a ©buffer
may be executed, as if the contents were typed from the
keyboard. See the
:HILITE.@
&cmdmode command later in this chapter.
:eCMSECT.
:CMSECT id='srching'.Searching
The following &cmdmode commands are used for searching for text:
:KEYLIST.
:KEY.'/' '/' (forward slash)
Enter a regular expression to search for from current position forwards.
:KEY.? ? (question mark)
Enter a regular expression to search for from current position backwards.
:KEY.n n
Repeat last search command, in the direction of the last search.
:KEY.N N
Repeat last search command, in the opposite direction of the last search.
:eKEYLIST.
For more information on regular expressions, see
:HDREF refid='rxchap'.
:PERIOD.
:P.
Once you press the
:HILITE./
or the
:HILITE.?
keys, a search string entry window will appear:
:picture file='srchent' text='Search String Entry Window'.
This position and size of the search string entry window are controlled
using
the
:KEYWORD.commandwindow
windowing command.
Search strings may be up to 512 bytes in length; the search string window
scrolls.
:P.
The search string window has a history associated with it; the size
of this search string history is controlled using the
:KEYWORD.maxfindhistory
setting. As well, the search string history is preserved across sessions of
&edname if the
:KEYWORD.historyfile
parameter is set.
:P.
If the first letter of a search string is a CTRL_A (entered by typing
a CTRL_V followed by a CTRL_A)
then that search string will not be added to the search string history.
:SUBSECT.Special Keys In The Search String Window
Once in the search string window, a number of keys have special meaning:
.se searching = 1
:INCLUDE file='speckeys'.
:eSUBSECT.
:eCMSECT
:CMSECT.Inserting Text
The following commands cause &edname to go from &cmdmode
directly into &tinsmode:
:KEYLIST.
:KEY.INS INS
Starts inserting text before the current character in the edit buffer.
:KEY.a a
Starts appending (inserting) text after the current character in
the edit buffer.
:KEY.A A
Starts appending (inserting) text after the last character on the
current line in the edit buffer.
:PERIOD.
:INCLUDE file='gkey'.
:KEY.i i
Starts inserting text before the current character in the edit buffer.
:KEY.I I
Starts inserting text before the first non-white space character in the
edit buffer.
:KEY.o o
Opens a line after the current line, and enters &tinsmode
:PERIOD.
:KEY.O O
Opens a line before the current line, and enters &tinsmode
:PERIOD.
:eKEYLIST.
Once you are in &tinsmode, you can toggle back and forth between
insert and overstrike using the
:HILITE.INS
key. You exit &tinsmode by pressing the
:HILITE.ESC
key. See the previous section,
:HDREF refid='timode'.
:CONT.,
for more information on manipulating text in &tinsmode
:PERIOD.
:eCMSECT.
:CMSECT.Replacing Text
The following commands are used to replace text:
:KEYLIST.
:INCLUDE file='gkey'.
:KEY.R R
Starts overstriking text at the current character in the edit buffer.
Once you are overstriking text, you can toggle back and forth between
overstrike and insert using the
:HILITE.INS
key. You exit &tinsmode by pressing the
:HILITE.ESC
key. See the previous section,
:HDREF refid='timode'.
:CONT.,
for more information on manipulating text in &tinsmode
:PERIOD.
:KEY.r <n>r<?>
Replaces the current character with the next character typed,
:ITALICS.<?>
:PERIOD.
If a repeat count is specified, then the next
:ITALICS.<n>
characters are replaced with the character
:ITALICS.<?>
:PERIOD.
:EXAMPLE.ra
Replaces the current character with the letter
:ITALICS.a
:PERIOD.
:EXAMPLE.10rZ
Replaces the next 10 characters with the letter
:ITALICS.Z
:PERIOD.
:eKEYLIST.
:eCMSECT.
:CMSECT id='deltext'.Deleting Text
The commands in this section are for deleting text in
an edit buffer. All deleted text is copied into a ©buffer
for later use, see the section
:HDREF refid='cpybuff'.
:PERIOD.
:KEYLIST.
:KEY.D <"?>D
Deletes the characters from the current position to the end of line.
:EXAMPLE."aD
Deletes characters from current position to the end of line into the named
buffer
:ITALICS.a
:PERIOD.
:KEY.X <n><"?>X
Delete the character before the current cursor position.
:EXAMPLE.X
Delete the previous character.
:EXAMPLE.10X
Delete the 10 previous characters.
:EXAMPLE."z5X
Delete the 5 previous characters into the named buffer
:ITALICS.z
:PERIOD.
:KEY.x <n><"?>x
Delete the character at the current cursor position.
:EXAMPLE.x
Delete the current character.
:EXAMPLE.3x
Delete the next 3 characters.
:EXAMPLE."217x
Delete the next 17 characters into the numbered buffer
:ITALICS.2
:PERIOD.
:KEY.DEL <n><"?>DEL
Delete the character at the current cursor position. This behaves
the same as the &cmdmode command
:HILITE.x
:PERIOD.
:EXAMPLE.DEL
Delete the current character.
:EXAMPLE.12DEL
Delete the next 12 characters.
:EXAMPLE."a5DEL
Delete the next 5 characters into the named buffer
:ITALICS.a
:PERIOD.
:eKEYLIST.
:P.
.se plural=0
:INCLUDE file='oper'.
:KEYLIST.
:KEY.d <n><"?>d<oper>
Delete text from the current position in the file to the
position specified by
:ITALICS.<oper>
:PERIOD.
A copy of the text is placed into the specified ©buffer
:ITALICS.<"?>
:PERIOD.
If no buffer is specified, then the text is placed into the active
buffer.
A repeat count
:ITALICS.<n>
may precede the command, this causes
:ITALICS.<n>
units of the
:ITALICS.<oper>
command to be deleted.
:BLANKLINE.
:ITALICS.<oper>
may be specified as
:HILITE.d
:CONT.,
which causes a single line to be deleted.
:SEECMD.delete
:EXAMPLE.dr
Deletes the current selected (highlighted) region in the edit buffer.
A copy is placed into the active ©buffer
:PERIOD.
:EXAMPLE."zdd
Deletes the current line. A copy is placed into the named ©buffer
:ITALICS.z
:PERIOD.
:EXAMPLE.95dd
Deletes 95 lines, starting at the current. A copy of the lines
is placed into the active buffer.
:EXAMPLE."cdfa
Deletes the characters from the current column up to and including
the first
:ITALICS.a
on the current line. A copy of the text is placed
in the named buffer
:ITALICS.c
:PERIOD.
:EXAMPLE."5d'a
Deletes the lines from the current line to the line with mark
:ITALICS.m
into the numbered buffer
:ITALICS.5
:PERIOD.
:EXAMPLE.dG
Deletes all lines from the current line to the end of the current edit
buffer.
:eKEYLIST.
:eCMSECT.
:CMSECT id='cpytext'.Copying Text
This section describes commands that are for yanking (copying) text.
This text is placed into a ©buffer, see the section
:HDREF refid='cpybuff'.
for more information.
:KEYLIST.
:KEY.Y <n>Y
Yank (copy) the current line. If a repeat count
:ITALICS.<n>
is specified, then
:ITALICS.<n>
lines are copied.
:BLANKLINE.
This command is the same as typing
:HILITE.yy
:PERIOD.
:eKEYLIST.
.se plural = 0
:INCLUDE file='oper'.
:KEYLIST.
:KEY.y <n><"?>y<oper>
Yanks (copies) text from the current position in the file to the
position specified by
:ITALICS.<oper>
:PERIOD.
Text is placed into the specified ©buffer
:ITALICS.<"?>
:PERIOD.
If no buffer is specified, then the text is placed into the active
buffer.
A repeat count
:ITALICS.<n>
may precede the command, this causes
:ITALICS.<n>
units of the
:ITALICS.<oper>
command to be copied.
:BLANKLINE.
:ITALICS.<oper>
may be specified as
:HILITE.y
:CONT.,
which causes a single line to be yanked.
:SEECMD.delete
:EXAMPLE.yy
Yanks (copies) the current line into the active ©buffer
:PERIOD.
:EXAMPLE.10yy
Copies 10 lines, starting at the current, into the active buffer.
:EXAMPLE.y$
Copies the characters from the current column to the end of the
current line into
the active buffer.
:EXAMPLE."ay'm
Yanks the lines from the current line to the line with mark
:ITALICS.m
into the named buffer
:ITALICS.a
:PERIOD.
:EXAMPLE.y/foo
Copies:
:UL compact.
:LI.the part of the current line from the current position to the
end of the line
:LI.all lines between the current line and the first line
containing the string
:ITALICS.foo
:LI the part of the line containing
:ITALICS.foo
from the start of the line to the first letter in the string
:ITALICS.foo
:eUL.
:eKEYLIST.
:eCMSECT.
:CMSECT id='cmchg'.Changing Text
The following commands are for changing text.
If a range of lines is being changed, the lines are deleted and &edname
enters &tinsmode
:PERIOD.
:BLANKLINE.
If the change is taking place on the single line, the range of
characters being changed is highlighted, and the last character in the
range is indicated with a dollar sign ('$').
If the
:ITALICS.ESC
key is pressed, and
:KEYWORD.changelikevi
is not set, then the change command is cancelled. If
:KEYWORD.changelikevi
is set, then the highlighted area is deleted. If anything other than the
:ITALICS.ESC
key is pressed, the highlighted area is deleted and &edname enters &tinsmode
:PERIOD.
:KEYLIST.
:KEY.C C
This command changes the characters on the current line from the current
character to the end of the line. The character range is highlighted, and
once a character is typed, the highlighted text is
deleted, and &tinsmode
is entered.
:BLANKLINE.
This command is the same as typing
:HILITE.c$
:PERIOD.
:KEY.S <n>S
This command substitutes the current line with text. The text on the current
line is deleted, and &tinsmode is entered. If a repeat count
:ITALICS.<n>
is specified, then
:ITALICS.<n>
lines are deleted.
:BLANKLINE.
This command is the same as typing
:HILITE.cc
:PERIOD.
:KEY.s <n>s
This command substitutes the current character with text. If
:ITALICS.<n>
is specified, then
:ITALICS.<n>
characters are substituted.
:BLANKLINE.
This command is the same as typing
:HILITE.cl
:CONT.,
:HILITE.cRIGHT
:CONT.,
or
:HILITE.cSPACE
:PERIOD.
:eKEYLIST.
.se plural = 0
:INCLUDE file='oper'
:KEYLIST.
:KEY.c <n>c<oper>
Change text from the current position in the file to the
position specified by
:ITALICS.<oper>
:PERIOD.
A repeat count
:ITALICS.<n>
may precede the command, this causes
:ITALICS.<n>
units of the
:ITALICS.<oper>
command to be changed.
:BLANKLINE.
:ITALICS.<oper>
may be specified as
:HILITE.c
:CONT.,
which causes a single line to be changed.
:EXAMPLE.cr
Changes the current selected (highlighted) region in the edit buffer.
:EXAMPLE.cc
Change the current line. The current line is deleted, and &tinsmode
is entered.
:EXAMPLE.95cc
Changes 95 lines, starting at the current. The lines are deleted,
and &tinsmode is entered.
:EXAMPLE.cw
Change the current word. The current word is highlighted, and once
a character other than
:ITALICS.ESC
is typed, the word is deleted and &tinsmode is entered.
:EXAMPLE.c$
Changes from the current column to the end of the
current line.
The column range is highlighted, and once a character other than
:ITALICS.ESC
is typed, the column range is deleted and &tinsmode is entered.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?