cmds.gml
来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 1,820 行 · 第 1/4 页
GML
1,820 行
see the chapter
:HDREF refid='scripts'.
:PERIOD.
:EXAMPLE.load rdme._vi
Loads the
:KEYWORD.script
:ITALICS.rdme._vi
and makes it resident.
:SEEALSO.
:SEE.compile
:SEE.source
:eSEEALSO.
:eFUNC.
:FUNC.MAP
:SYNTAX.* MAP '"!"' <key> <string>
Tells the editor to run the string of keys &parm3 whenver the
key &parm2 is pressed in &cmdmode
:PERIOD.
:BLANKLINE.
If &parm1 is specified,
then the string of keys &parm3 is executed whenever &parm2 is pressed
in &tinsmode
:PERIOD.
:BLANKLINE.
When a mapped key is pressed, it acts is if the characters in &parm3
are being typed at the keyboard.
Recursion does not occur; if a key that is mapped is executed after
it has been executed as a mapped key, then the default behaviour for that
key is used, e.g.:
:ILLUST.
map a 0a
:eILLUST.
will cause the editor to move to column 1, and then start appending
after the character in column 1.
:BLANKLINE.
If you need to specify a special key (e.g. ENTER, F1, etc) in &parm2,
you specify a symbolic name for that key.
There are a number of pre-defined keys
symbols that are recognized when specifying which key is being
mapped/unmapped. These are described in the Appendix
:HDREF refid='symkey'.
:PERIOD.
:BLANKLINE.
If you need to use one or more special keys (e.g. ENTER, F1, etc) in &parm3,
then you may enter:
:BLANKLINE.
:INCLUDE file='spmapkey'
:BLANKLINE.
To remove a mapping, use the
:KEYWORD.unmap
command.
:EXAMPLE.map K \x:next\n
Whenever K is pressed in &cmdmode, the
:KEYWORD.next
command is executed. The command window will not be displayed,
because of the
:ITALICS.\x
:PERIOD.
:EXAMPLE.map CTRL_T \x:\hda\n
Whenever CTRL_T is pressed in &cmdmode,
the current date is displayed. The command window will not be
displayed, because of the
:ITALICS.\x
:PERIOD.
The command will not be added to the command history, because of the
:ITALICS.\h
:PERIOD.
:EXAMPLE.map CTRL_W \x:fgrep \<CTRL_W>\n
Whenever CTRL_W is pressed in &cmdmode, an fgrep command, searching for
the current word, is executed. The
:ITALICS.\x
keeps the command window from opening.
:ITALICS.\<CTRL_W>
simulates CTRL_W being pressed, so the current word is inserted into
the &cmdline
:PERIOD.
:EXAMPLE.map! CTRL_W \edwi
Whenever CTRL_W is pressed in &tinsmode, &tinsmode
is exited (\e simulates the ESC key being pressed), the current word is
deleted, and &tinsmode is re-entered. This has the effect of
deleting the current word in &tinsmode
and appearing to remain in &tinsmode
:PERIOD.
:SEEALSO.
:SEE.execute
:SEE.keyadd
:SEE.unmap
:eSEEALSO.
:eFUNC.
:FUNC.MAPBASE
:SYNTAX.* MAPBASE <key> <string>
Tells the editor to run the string of keys &parm3 whenver the
key &parm2 is pressed in &cmdmode
:PERIOD.
:BLANKLINE.
This works the same as the
:KEYWORD.map
command, only all characters in &parm2 work as their base meaning; that is,
all key mappings are ignored and the keys have their default
behaviour.
:SEEALSO.
:SEE.execute
:SEE.keyadd
:SEE.map
:SEE.unmap
:eSEEALSO.
:eFUNC.
:FUNC.MARK
:SYNTAX.<line_number> MArk <markname>
Sets the
:KEYWORD.text mark
&parm1 on the line &range.
:PERIOD.
The mark name is a single letter from
:ITALICS.a
to
:ITALICS.z
:PERIOD.
This mark may then be referred to on the &cmdline or in &cmdmode
by using a front quote (') before the mark name, e.g.:
:ILLUST.
'a
:eILLUST.
:EXAMPLE.mark a
Sets the mark
:ITALICS.a
on the current line. Typing the command
:ITALICS.'a
will return you to that mark.
:EXAMPLE.100 mark z
Sets the mark
:ITALICS.z
on line 100.
:SEEALSO.
:SEE key=1.m
:eSEEALSO.
:eFUNC.
:FUNC.MATCH
:SYNTAX.* match //<rx1>/<rx2>//
Set what is matched by the '%' &cmdmode command. Defaults are "{","}"
and "(",")". For example, by pressing the percent key ('%') when
the cursor is on the first open bracket ('(') in the line:
:ILLUST.
if( ( i=foo( x ) ) ) return;
:eILLUST.
moves the cursor to the last ')' in the line.
:BLANKLINE.
This command allows you to extend what is matched to
general regular expressions.
:ITALICS.<rx1>
is the regular expression that opens a match,
:ITALICS.<rx2>
is the regular expression that closes a match.
:BLANKLINE.
Note that in the matching regular expressions,
:KEYWORD.magic
is set (special characters automatically
have their meaning, and do not need to be escaped).
:BLANKLINE.
For more information on regular expressions, see the chapter
:HDREF refid='rxchap'.
:PERIOD.
:EXAMPLE.match /# *if/# *endif/
This adds the matching of all
:ITALICS.#if and
:ITALICS.#endif
commands (an arbitrary number of spaces is allowed to occur between
the '#' sign and the
:ITALICS.if
or
:ITALICS.endif
words. If '%' is pressed while over a
:ITALICS.#if
statement, the cursor is moved to the corresponding
:ITALICS.#endif
statement.
:SEEALSO.
:SEE key=1.%
:eSEEALSO.
:eFUNC.
:FUNC.MAXIMIZE
:SYNTAX.* MAXimize
Maximizes the current edit buffer window.
:SEEALSO.
:SEE.cascade
:SEE.minimize
:SEE.movewin
:SEE.resize
:SEE.size
:SEE.tile
:eSEEALSO.
:eFUNC.
:FUNC.MINIMIZE
:SYNTAX.* MINimize
Minimizes the current edit buffer window.
:SEEALSO.
:SEE.cascade
:SEE.maximize
:SEE.movewin
:SEE.resize
:SEE.size
:SEE.tile
:eSEEALSO.
:eFUNC.
:FUNC.MOVE
:SYNTAX.<line_range> Move <line_number>
Deletes the specified range of lines &range and places them
after the line &parm1.
:PERIOD.
:EXAMPLE.1,10 move $
Moves the first 10 lines of the file after the last line in the file.
:EXAMPLE.1,. move .+1
Deletes all lines from the beginning of the file to the current line
and places the lines one line after the current line.
:SEEALSO.
:SEE.delete
:eSEEALSO.
:eFUNC.
:FUNC.MOVEWIN
:SYNTAX.* MOVEWin
Enter window movement mode. The cursor keys are then used to move the
current edit buffer window.
:SEEALSO.
:SEE.cascade
:SEE.maximize
:SEE.minimize
:SEE.resize
:SEE.size
:SEE.tile
:eSEEALSO.
:eFUNC.
:FUNC.NEXT
:SYNTAX.* Next
Moves to the next file in the list of files being edited.
:SEEALSO.
:SEE key=1.F1
:SEE key=1.F2
:SEE.prev
:eSEEALSO.
:eFUNC.
:FUNC.OPEN
:SYNTAX.* Open <file>
Opens a new window on the specified file.
If no file is specified,
then a new window is opened on the current edit buffer.
These new
windows are different views on the same edit buffer.
:BLANKLINE.
Once multiple views
on an edit buffer are opened, the window border contains a number indicating
which view of the edit buffer is associated with that file:
:picture file='open' text='Two Views On The Same File'.
:SEEALSO.
:SEE.edit
:SEE.view
:SEE.visual
:eSEEALSO.
:eFUNC.
:FUNC.POP
:SYNTAX.* POP
Restores the last pushed file position.
:BLANKLINE
The setting
:KEYWORD.maxpush
controls the maximum number of push commands that will be remembered.
:SEEALSO.
:SEE key=1.F11
:SEE key=1.F12
:SEE.push
:SEE.tag
:eSEEALSO.
:eFUNC.
:FUNC.PREV
:SYNTAX.* Prev
Moves to the previous file in the list of files being edited.
:SEEALSO.
:SEE key=1.F1
:SEE key=1.F2
:SEE.next
:eSEEALSO.
:eFUNC.
:FUNC.PUSH
:SYNTAX.* PUSH
Saves the current file position. The next
:KEYWORD.pop
command will cause a return to this position.
:BLANKLINE
The setting
:KEYWORD.maxpush
controls the maximum number of push commands that will be remembered.
:BLANKLINE
The
:KEYWORD.tag
command does an implicit push.
:SEEALSO.
:SEE key=1.F11
:SEE key=1.F12
:SEE.pop
:SEE.tag
:eSEEALSO.
:eFUNC.
:FUNC.PUT
:SYNTAX.<line_number> PUt '"!"' <buffer>
Puts (pastes) the ©buffer
&parm2 ('1'-'9', or 'a'-'z') after the
line &range.
:PERIOD.
:BLANKLINE.
If &parm2 is not specified, the active ©buffer is assumed.
:BLANKLINE.
If &parm1 is specified, then the lines are put before the
line &range.
:PERIOD.
:EXAMPLE.put
Pastes the active ©buffer after the current line.
:EXAMPLE.1 put!
Pastes the active ©buffer before the first line in the edit buffer.
:EXAMPLE.$ put a
Pastes named ©buffer
:ITALICS.a
after the last line in the file.
:EXAMPLE.put! 4
Pastes numbered ©buffer before the current line.
:SEEALSO.
:SEE.delete
:SEE.yank
:SEE key=1.p
:SEE key=1.P
:eSEEALSO.
:eFUNC.
:FUNC.QUIT
:SYNTAX.* Quit '"!"'
Quits the current file.
:KEYWORD.Quit
will not quit a modified file, unless &parm1 is specified, in which
case all changes are discarded and the file is exited.
:EXAMPLE.q!
Quits the current file, discarding all modifications since the last write.
:SEEALSO.
:SEE.write
:SEE.wq
:SEE.xit
:SEE key=1.Z
:eSEEALSO.
:eFUNC.
:FUNC.QUITALL
:SYNTAX.* QUITAll
Exits the editor if no files have been modified. If files have been modified,
a prompt is displayed asking to you verify that you really want to discard
the modified file(s).
If you do not respond with a 'y', then the command is cancelled.
:EXAMPLE.quitall
If files have been modified, the following prompt is displayed:
:picture file='quitall' text='Really Exit Prompt'.
:SEEALSO.
:SEE.exitall
:SEE key=1.CTRL_C
:eSEEALSO.
:eFUNC.
:FUNC.READ
:SYNTAX.<line_number> Read <file_name>
Reads the text from file &parm1 into the current edit buffer.
The lines are placed after line specified by &range.
:PERIOD.
If &range is not specified, the current line is assumed.
:BLANKLINE.
Line 0 may be specified as &range in order to read a file
in before the first line of the current edit buffer.
:BLANKLINE.
Each file name &parm1 may contain file regular expressions, see the section
:HDREF refid='fmrx'.
in the chapter
:HDREF page=no refid='rxchap'
for more information.
:BLANKLINE.
If &parm1 is not specified, then a window containing
a list of files in the current directory is opened, from
which a file may be selected.
:BLANKLINE.
If the first character of &parm1 is a dollar sign ('$'), then this
indicates that a directory is to be read in. If nothing follows,
then the current directory is read. Otherwise, all characters that
follow the dollar sign are treated as a file regular expression, which
is used to read in the directory.
:EXAMPLE.0 read test.c
Reads the file test.c into the current edit buffer and places the text
before the first line of the file.
:EXAMPLE.r test.c
Reads the file test.c into the current edit buffer and places the text
after the current line.
:EXAMPLE.r $
Reads the current directory and places the data after the current line.
:EXAMPLE.r $*.c
Reads the current directory, matching only files with .c extensions,
and places the data after the current line.
:EXAMPLE.r $..\c\*.*
Reads the ..\c directory, and places the data after the current line.
:EXAMPLE.read
Gives a file selection display:
:picture file='filesel' text='File Selection Display'.
:eFUNC.
:FUNC.RESIZE
:SYNTAX.* RESize
Allows resizing of the current edit window with the keyboard. The
cursor keys are used as follows:
:DEFLIST.break
:DEFITEM.UP
move top border up
:DEFITEM.DOWN
move top border down
:DEFITEM.LEFT
move right border left
:DEFITEM.RIGHT
move right border right
:DEFITEM.SHIFT_UP
move bottom border up
:DEFITEM.SHIFT_DOWN
move bottom border down
:DEFITEM.SHIFT_LEFT
move left border left
:DEFITEM.SHIFT_RIGHT
move left border right
:eDEFLIST.
:SEEALSO.
:SEE.cascade
:SEE.maximize
:SEE.minimize
:SEE.movewin
:SEE.size
:SEE.tile
:eSEEALSO.
:eFUNC.
:FUNC.SET
:SYNTAX.* SEt <variable> <value>
Certain variables within &edname may be changed after &edname is
executing. &parm2 is assigned to &parm1.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?