modes.gml

来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 2,044 行 · 第 1/4 页

GML
2,044
字号
:EXAMPLE.2cfa
Changes from the current column to the second letter a on 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.
:eKEYLIST.

:eCMSECT.

:CMSECT.Shifting Text

The following commands are used to shift lines to the right or left,
inserting or deleting leading whitespace. 
.se plural = 1
:INCLUDE file='oper'.

:KEYLIST.
:KEY.> <n>><oper> (right angle bracket)
This is the shift right command. It shifts the specified lines to the right
:KEYWORD.shiftwidth
spaces, inserting necessary leading tabs if
:KEYWORD.realtabs
is specified.
:BLANKLINE.
A repeat count
:ITALICS.<n>
may precede the command, this causes
:ITALICS.<n>
units of the
:ITALICS.<oper>
command to be shifted to the right.
:BLANKLINE.
:ITALICS.<oper>
may be specified as
:HILITE.>
:CONT.,
which causes a single line to be shifted to the right.
:SEECMD.>
:EXAMPLE.10>>
Shifts the current line and the next 9 lines to the right
:KEYWORD.shiftwidth
spaces.
:EXAMPLE.>'a
Shifts all lines from the current line to the line with mark
:ITALICS.a
to the right
:KEYWORD.shiftwidth
spaces.
:EXAMPLE.>r
Shifts all lines in the selected (highlighted) region to the right
:KEYWORD.shiftwidth
spaces.

:KEY.< <n><<oper> (left angle bracket)
This is the shift left command. It shifts the specified lines to the left
:KEYWORD.shiftwidth
spaces.
:BLANKLINE.
A repeat count
:ITALICS.<n>
may precede the command, this causes
:ITALICS.<n>
units of the
:ITALICS.<oper>
command to be shifted to the left
:KEYWORD.shiftwidth
spaces.
:BLANKLINE.
:ITALICS.<oper>
may be specified as
:HILITE.<
:CONT.,
which causes a single line to be shifted to the left
:KEYWORD.shiftwidth
spaces.
:SEECMD.<
:EXAMPLE.<<
Shifts the current line to the left
:KEYWORD.shiftwidth
spaces.
:EXAMPLE.<G
Shifts all lines from the current line to the last line in the
edit buffer to the left
:KEYWORD.shiftwidth
spaces.
:EXAMPLE.10<j
Shifts the current line and the next 10 lines to the left
:KEYWORD.shiftwidth
spaces.
:eKEYLIST.
:eCMSECT.


:CMSECT.Case Toggling

The case toggle &cmdmode command switches upper case letters to
lower case, and lower case letters to upper case.
 An example of its behaviour is changing the
line
:ILLUST.
This Is A Line Of Text.
:eILLUST.
to
:ILLUST.
tHIS iS a lINE oF tEXT.
:eILLUST.
.se plural = 0
:INCLUDE file='oper'.

:KEYLIST.
:KEY.~~ <n>~~<oper>  (tilde)
This is the case toggle command.
This command only works if the
:KEYWORD.togglecaselikevi
setting is not turned on.  If
:KEYWORD.togglecaselikevi
is set, then pressing
:HILITE.~~
only changes the case of the current character, and advances the
cursor to the next character.
:BLANKLINE.
However, if
:KEYWORD.togglecaselikevi
is not set, then this command toggles the case of the characters
over the range specified by
:ITALICS.<oper>
:BLANKLINE.
A repeat count
:ITALICS.<n>
may precede the command, this causes
:ITALICS.<n>
units of the
:ITALICS.<oper>
command to be case toggled.
:BLANKLINE.
:ITALICS.<oper>
may be specified as
:HILITE.~~
:CONT.,
which causes a single line to be have its case toggled.
:EXAMPLE.~~r
Toggles the case of the currently selected (highlighted) range.
:EXAMPLE.~~$
Toggles the case of all characters from the current column of the
current line to the last character of the current line.
:EXAMPLE.~~w
Toggles the case of the current word.
:EXAMPLE.10~~~~
Toggles the case of the current line and the 9 lines following.
:eKEYLIST.

:eCMSECT.

:CMSECT.Filters

The &cmdmode filter command has the same functionality as the
&cmdline command
:KEYWORD.filter
:PERIOD.
.se plural = 0
:INCLUDE file='oper'.
:KEYLIST.
:KEY.! <n>!<oper> (exclamation mark)
Filter text. The line range specified by
:ITALICS.<oper>
are run through a specified filter.
A repeat count
:ITALICS.<n>
may precede the command, this causes
:ITALICS.<n>
units of the
:ITALICS.<oper>
command to be run through the filter.
:BLANKLINE.
:ITALICS.<oper>
may be specified as
:HILITE.!
:CONT.,
which causes a single line to be run through the filter.
:BLANKLINE.
The lines specified are run through a specified
system command (filter).  Once the filter range has been specified, a window
is displayed, prompting for a system command:
:picture file='filter' text='Filter System Command Prompt'.
The system command must take input from standard in and put
its output to standard out. The lines specified are replaced with the output
of the the command.
:BLANKLINE.
There is a filter command history in the filter command prompt, the
size of which is controlled with the
:KEYWORD.maxfilterhistory
setting.
:SEECMD.!
:EXAMPLE.!r
Runs the current selected (highlighted) region in the edit buffer
through a specified filter.
:EXAMPLE.!!
Runs the current line through a specified filter
:EXAMPLE.!G
Runs all lines from the current line to the end of the edit buffer
through a specified filter.
:eKEYLIST.

:eCMSECT.

:CMSECT.Text Selection
Text may be selected with the mouse. However, if you do not wish
to use the mouse, there is a keyboard interface to allow you to
accomplish the same thing.
:P.
Once text selection has been started, any movement command adds to
the selected region.   The selected region may be cleared, and
text selection ended, by
pressing the
:ITALICS.ESC
key.
:BLANKLINE.
A selected region is highlighted by exchanging the foreground and
background the colors of the line.  A selected region could look
as follows:
:picture file='selrgn' text='Selected Text Region'.
:P.
The following are the &cmdmode commands for selecting text and
manipulating selected text.

:KEYLIST.
:KEY.CTRL_R CTRL_R
Starts text selection, if no text is selected.  The current character is highlighted.
:ADDLINE.
If region is already selected, then cancel the selected region.

:KEY.SHIFT_UP <n>SHIFT_UP
Starts selection (if not already started) and moves up to the previous
line.  The previous line and the current line are selected.
If a repeat count
:ITALICS.<n>
is specified, then the cursor moves up
:ITALICS.<n>
lines, and all the lines between the starting and ending
position are selected.

:KEY.SHIFT_DOWN <n>SHIFT_DOWN
Starts selection (if not already started) and moves down to the next line.
The next line and the current line are selected.
If a repeat count
:ITALICS.<n>
is specified, then the cursor moves down
:ITALICS.<n>
lines, and all the lines between the starting and ending
position are selected.

:KEY.SHIFT_LEFT <n>SHIFT_LEFT
Starts selection (if not already started) and move left to the previous
character.  The current character and the previous character are selected.
If a repeat count
:ITALICS.<n>
is specified, then the cursor moves left
:ITALICS.<n>
characters, and all the characters between the starting and ending
position are selected.

:KEY.SHIFT_RIGHT <n>SHIFT_RIGHT
Starts selection (if not already started) and move right to the next
character.  The current character and the next character are selected.
If a repeat count
:ITALICS.<n>
is specified, then the cursor moves right
:ITALICS.<n>
characters, and all the characters between the starting and ending
position are selected.

:KEY.SHIFT_DEL <"?>SHIFT_DEL
Deletes the currently selected region.  If the &copybuffer
:ITALICS.<"?>
is specified, the region is copied into that buffer,
otherwise the data is copied into the active buffer.

:KEY._ _ (underscore)
Simulates the right mouse being clicked at the current cursor position.
If a region is not selected, then the current word will be selected.
The word is defined using the &cmdline command
:KEYWORD.word
:PERIOD.
:eKEYLIST.

:eCMSECT.

:CMSECT.Miscellaneous Keys

:KEYLIST.
:KEY.CTRL_C CTRL_C
Exits the editor if no files have been modified.  If files have been modified,
a prompt is displayed asking you to verify that you really want to discard
the modified file(s).  
If you do not respond with a 'y', then the command is cancelled.
:SEECMD.quitall

:KEY.CTRL_G CTRL_G
Display information about the current file in the edit window.  The
information includes:
:UL compact.
:LI.the file name.
:LI.a special indicator if the file is read-only.
:LI.a special indicator if the file is view-only.
:LI.a special indicator if the file has been modified.
:LI.the current line number, and the last line number.
:LI.The percentage of the way through the file.
:eUL.
Some sample results are:
:ILLUST.
"test.c" [modified] line 5 of 100  -- 5% --
:BLANKLINE.
"..\c\file.c" [read only] line 100 of 100  -- 100% --
:BLANKLINE.
"\autoexec.bat" line 1 of 100  -- 1% --
:eILLUST.

:KEY.CTRL_L CTRL_L
Redraws the current screen.

:KEY.CTRL_V CTRL_V
Displays the current version of &edname in the message window.
:SEECMD.version

:KEY.CTRL_X CTRL_X
Displays the hex value (and the decimal value) of the current
character.  A sample of the output in the message window is:
:ILLUST.
Char 'e': 0x65 (101)
:eILLUST.

:KEY.CTRL_] CTRL_]  (control right square bracket)
Go to the tag given by the current word.  The word is defined using the
&cmdline command
:KEYWORD.word
:PERIOD.
:SEECMD.tag
:BLANKLINE.
See the appendix
:HDREF refid='ctags'.
for more information.

:KEY.ALT_W ALT_W
Activates the current edit window's menu.  This menu is defined
using the
:ITALICS.windowgadgetmenu
:KEYWORD.menu
:PERIOD.
See the chapter
:HDREF refid='winmenu'.
for more information on setting this menu.

:KEY.ALT_X ALT_X
Insert a character, at the current cursor position.  When
:ITALICS.ALT_X
is pressed, a prompt is displayed:
:picture file='altx' text='Character Insertion Prompt'.
Enter either a decimal or a hex number.  That character will
be inserted directly into the edit buffer.

:KEY.: : (colon)
Allows entry of a &cmdline
:PERIOD.
See the chapter
:HDREF refid='cmds'
for full details on &cmdline commands.

:KEY.@ @<?> (at sign)
This command executes the &copybuffer
:ITALICS.<?>
:PERIOD.
&edname behaves as if the contents
of the buffer were being typed at the keyboard.


:KEY.J <n>J
Joins the next line to the current line.  If a repeat count
:ITALICS.<n>
is specified, the next
:ITALICS.<n>
lines are joined to the current line.
(lines are concatenated one after another).
:SEECMD.join
:EXAMPLE.J
Joins the next line to the current line.
:EXAMPLE.3J
Joins the next 3 lines to the current line.

:KEY.Q Q
Enters
:KEYWORD pc=1.EX mode
:PERIOD.
:KEYWORD pc=1.EX mode
is a line-oriented mode of
&edname.
:PERIOD.
To exit
:KEYWORD pc=1.EX mode
:CONT.,
use the
:KEYWORD.visual
command.

:KEY.Z Z<Z>
Used when you are finished with the current edit buffer.
If the current edit buffer has been modified, it is saved.
:EXAMPLE.ZZ
Finished with current edit buffer.

:KEY.z <n>z<?>
Reorients the current screen position.  The current line moves
as follows, depending on the value of
:ITALICS.<?>
:CONT.:
:DEFLIST.
:DEFITEM.ENTER
Moves the current line to the top of the screen.
:DEFITEM.. (dot)
Moves the current line to the center of the screen.
:DEFITEM.- (dash)
Moves the current line to the bottom of the screen.
:eDEFLIST.
If a repeat count
:ITALICS.<n>
is specified, then
:ITALICS.<n>
is made the current line.
:EXAMPLE.z-
Move the current line to the bottom of the screen.
:EXAMPLE.100zENTER
Makes line 100 the current line, and puts line 100 at the
top of the screen.
:EXAMPLE.25z.
Makes line 25 the current line, and puts line 25 at the
center of the screen.

:KEY.F1 F1
Move forward through the file list to the next file.
:SEECMD.next

:KEY.F2 F2
Move backwards through the file list to the previous file.
:SEECMD.prev

:KEY.F11 F11
Push the current file and position.  If you press
:HILITE.F12
:CONT.,
you will be restored to this position.  These positions are stacked
up, up to a maximum of
:KEYWORD.maxpush
:PERIOD.
:SEECMD.push

:KEY.F12 F12
Restore the last pushed file and position.
:SEECMD.pop

:KEY.. . (dot)
Repeat the last &cmdmode command that changed text in
the edit buffer. It is also possible to memorize more than
just one command for '.' by using
:KEYWORD.memorize mode
:CONT.:
:OL.
:LI.Type "
:HILITE.m.
:CONT.".
(&edname enters memorize mode).
:LI.Enter keystrokes.
:LI.Type "
:HILITE..
:CONT."
:eOL.
Now, whenever you press dot ('.'),
all the entered keystrokes will be executed.

:KEY.= = (equals sign)
Performs the last alternate memorized command sequence.  The
:KEYWORD.alternate memorize mode
is used as follows:
:OL.
:LI.Type "
:HILITE.m=
:CONT.".
(&edname enters
:KEYWORD.alternate memorize mode
:CONT.).
:LI.Enter keystrokes.
:LI.Type "
:HILITE.=
:CONT."
:eOL.
Now, whenever you press the equals sign ('='),
all the entered keystrokes will be executed as if you typed them
again from the keyboard.
:BLANKLINE.
This memorized keystroke sequence will last until you memorize
another, unlike using "
:HILITE.m.
:CONT.".

:KEY.ALT_M ALT_M
Display current memory state.  Shows the total amount of memory, the
amount of memory for use by &edname, and how much extended memory and/or
disk space is available.

:eKEYLIST.

:eCMSECT.

⌨️ 快捷键说明

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