cmds.gml
来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 1,820 行 · 第 1/4 页
GML
1,820 行
If &parm1 is specified as
:ITALICS.on
:CONT.,
messages will start to appear in the message window again.
:BLANKLINE.
&parm2 may be surrounded by double quotes (") or a forward slash (/)
if it contains any spaces.
:EXAMPLE.echo 1 "hello world"
The words
:ITALICS.hello world
will appear on line 1 of the message window.
:EXAMPLE.echo off
Disables output to the message window.
:EXAMPLE.echo on
Enables output to the message window.
:EXAMPLE.echo 2 /Line 2 message/
The words
:ITALICS.Line 2 message
will appear on line 2 of the message window.
:eFUNC.
:FUNC.EDIT
:SYNTAX.* Edit '"!"' <files>
Edits the specified files &parm2.
:PERIOD.
&parm2 may be a single file or a list of files.
:BLANKLINE.
Each file name 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 specified, then the current file is discarded before editing
the new file(s).
:BLANKLINE.
If a file is already being edited,
then control is simply transferred to the window with that file.
If the file is already being edited and you specified a different path,
then a new copy of the file is read from the disk and is edited, unless
:KEYWORD.samefilecheck
is set.
If
:KEYWORD.samefilecheck
is set, then control is transferred to the window with the original copy
of the file.
:BLANKLINE.
If you wish to have have multiple views on the same file, the
:KEYWORD.open
command is available.
:BLANKLINE.
If &parm2 is not specified, then a window containing
a list of files in the current directory is opened.
:INCLUDE file='fsdesc'.
:EXAMPLE.edit test.c
Edits the file test.c.
:EXAMPLE.edit! test2.c
Discards the current file, and edits test2.c.
:EXAMPLE.edit test.(c|h)
Edits the file test.c if it exists, and the file test.h if it exists.
:EXAMPLE.edit ([a-c])*.c
Edits all files in the current directory that start with the letters
a, b or c and have the extension .c.
:EXAMPLE.edit *
Edits all files in the current directory.
:EXAMPLE.edit
Gives a file selection display:
:picture file='filesel' text='File Selection Display'.
:SEEALSO.
:SEE.open
:SEE.read
:SEE.view
:SEE.visual
:eSEEALSO.
:eFUNC.
:FUNC.EGREP
:SYNTAX.* EGRep <regexp> <files>
Searches the file list &parm2 for the regular expression &parm1.
:PERIOD.
:BLANKLINE.
&parm1 may be surrounded by double quotes (") or a forward slash (/)
if it contains any spaces.
:BLANKLINE.
&parm2 may be a single file, a directory, or a list of files. &parm2 may
contain file regular expressions, see the section
:HDREF refid='fmrx'.
in the chapter
:HDREF page=no refid='rxchap'
for more information.
:BLANKLINE.
If &parm2 is not specified, it defaults to the setting of
:KEYWORD.grepdefault
:PERIOD.
If a directory is specified for &parm2, then the files in that directory
are searched, based on the setting of
:KEYWORD.grepdefault
:PERIOD.
:BLANKLINE.
When all matches are found, a selection window is presented with
all the files that contained &parm1.
:PERIOD.
:BLANKLINE.
If you are not using regular
expressions, the
:KEYWORD.fgrep
command is much faster.
For more information on regular expressions, see the chapter
:HDREF refid='rxchap'.
:PERIOD.
:EXAMPLE.egrep ((if)|(while)) *.c
Searches all files in the current directory ending in the extension .c
for the regular expression
:ITALICS.((if)|(while))
:PERIOD.
:EXAMPLE.egrep [a-z]a+
Searches all files specified by
:KEYWORD.grepdefault
for the regular expression
:ITALICS.[a-z]a+
:PERIOD.
:EXAMPLE.egrep [a-z]a+ ..\c
Searches all files in the directory ..\c specified by
:KEYWORD.grepdefault
for the regular expression
:ITALICS.[a-z]a+
:PERIOD.
:SEEALSO.
:SEE.fgrep
:eSEEALSO.
:eFUNC.
:FUNC.EVAL
:SYNTAX.* EVAL <expr>
Evalutes a given mathematical expression, and displays the result on
line 1 of the message window. For a full explanation of the rules
for formulating the expression &parm1, see the chapter
:HDREF refid='scripts'.
:PERIOD.
:EXAMPLE.eval 5+7*3
Evaluates
:ITALICS.5+7*3
and displays the result (26) in the message window.
:EXAMPLE.eval (5+7)*3
Evaluates
:ITALICS.(5+7)*3
and displays the result (36) in the message window.
:EXAMPLE.eval ((12+3)*100)/50-3
Evaluates
:ITALICS.((12+3)*100)/50-3
and displays the result (27) in the message window.
:eFUNC.
:FUNC.EXECUTE
:SYNTAX.* EXECUTE <str>
Execute the string &parm1.
:PERIOD.
This causes the editor to behave as if
the string &parm1 was typed at the keyboard.
:BLANKLINE.
Special keys in the string are indicated as follows:
:INCLUDE file='spmapkey'
:BLANKLINE.
See
:KEYWORD.keypush
for delayed execution of keystrokes.
:EXAMPLE.execute dd
Acts as if
:ITALICS.dd
were typed, and the current line gets deleted.
:EXAMPLE.execute :eval 5*3\n
Acts as if
:ITALICS.:eval 5*3<ENTER>
was typed, and the number 15 gets displayed in the message window.
:SEEALSO.
:SEE.keyadd
:SEE.map
:SEE.mapbase
:eSEEALSO.
:eFUNC.
:FUNC.EXITALL
:SYNTAX.* EXITALL
Exits all files. For each file that has been modified, you are prompted
as to whether you want to save the file or not.
:SEEALSO.
:SEE.quitall
:SEE key=1.CTRL_C
:eSEEALSO.
:eFUNC.
:FUNC.EXPAND
:SYNTAX.* EXPAND
Replaces all tabs in the current edit buffer with spaces.
:eFUNC.
:FUNC.FGREP
:SYNTAX.* FGRep '"-c"' '"-u"' <string> <files>
Searches the file list &parm4 for the string &parm3.
:PERIOD.
:BLANKLINE
The search is by default case insensitive, unless
:CMDPARM.-c
is specified, which forces the search to be case sensitive.
Specifying
:CMDPARM.-u
causes the setting of
:KEYWORD.caseignore
to determine whether or not to be case sensitive in the search.
:BLANKLINE.
&parm3 may be surrounded by double quotes (") or a forward slash (/)
if it contains any spaces.
:BLANKLINE.
&parm4 may be a single file or a list of files. Each file name may
contain file regular expressions, see the section
:HDREF refid='fmrx'.
in the chapter
:HDREF page=no refid='rxchap'
for more information.
:BLANKLINE.
If &parm4 is not specified, it defaults to the setting of
:KEYWORD.grepdefault
:PERIOD.
:BLANKLINE.
While searching for the item, &edname displays a window that shows
all files being searched. This will appear as follows:
:picture file='grepsrch' text='Grep Working Display'.
When all matches are found, a selection window is presented with
all the files that contained &parm4.
:PERIOD.
:EXAMPLE.fgrep window *.c
Searches all files in the current directory ending in the extension .c
for the string
:ITALICS.window
:PERIOD.
This will produce out similar to the following:
:picture file='grepwin' text='Grep Result Display'.
:SEEALSO.
:SEE.egrep
:eSEEALSO.
:eFUNC.
:FUNC.FILES
:SYNTAX.* Files
Opens a window with the a list of all files current being edited.
Files that have been modified will have a '*' beside them.
A file may be selected from this list either with the keyboard or
with the mouse.
:EXAMPLE.files
Displays following screen
:picture file='files' text='Current File List'.
:eFUNC.
:FUNC.FLOATMENU
:SYNTAX.* FLOATMENU <id> <slen> <x1> <y1>
Activates the floating (popup) menu &parm1 (&parm1 may be 0, 1, 2 or 3).
:BLANKLINE.
The floating menus are defined using the &cmdline command
:KEYWORD.menu
(See the section
:HDREF refid='menucmd'.
).
:BLANKLINE.
&parm3, &parm4 specify the coordinates of the upper left hand corner
of the floating menu. (0,0) specifies the upper left hand corner
of the screen.
:BLANKLINE.
&parm2 defines the length of a string that the menu is around; the
floating menu will try to appear around the string (&parm1 may
be 0). This is useful if you wish to pop up a menu around some
selected characters on a line, for example.
:BLANKLINE.
If &parm2 is non-zero, then the coordinates
is assumed to be the lower right-hand side of the string that the menu
is popping up around.
:EXAMPLE.float 0 0 10 10
Bring up floating menu 0 at location (10,10) on the screen. There is
no string, so the menu position will simply cycle around (10,10)
in an attempt to position itself.
:EXAMPLE.float 0 6 50 20
Bring up floating menu 0 at location (50,20) on the screen. This
is assumed to be on the lower right hand side of a string of length 5
(i.e., it is assumed that the string is on line 19 and starts at column
45). If the menu cannot fit by opening at (50,20), it will try to open
at all other corners of the string.
:SEEALSO.
:SEE.menu
:SEE.input
:SEE.get
:eSEEALSO.
:eFUNC.
:FUNC.GENCONFIG
:SYNTAX.* GENCONFIG <filename>
Writes the current editor configuration out to the file &parm1.
:PERIOD.
If &parm1 is not specified, then the file name "ed.cfg" is assumed.
:eFUNC.
:FUNC.GLOBAL
:SYNTAX.<line_range> Global '"!"' /<regexp>/ <cmd>
For each line in the range &range that matches the regular expression
:CMDPARM.<regexp>
:CONT.,
the editor command &parm3 is executed. &parm3 may contain replacement
expressions, see the chapter
:HDREF refid='rxchap'.
for more information.
:BLANKLINE.
If &parm1 is specified, then the command &parm3 is executed on every line
that does NOT match the regular expression
:CMDPARM.<regexp>
:PERIOD.
:BLANKLINE.
If &range is not specified, then the
:KEYWORD.global
command operates on the entire line range of the current edit buffer.
:EXAMPLE.g/printf/d
Deletes all lines in the current edit buffer that have the word
:ITALICS.printf
:PERIOD.
:EXAMPLE.g!/[a-c]123/ d
Deletes all lines in the current edit buffer that DO not match the
regular expression
:ITALICS.[a-c]123
:PERIOD.
:EXAMPLE.g/(abc)*/ execute Iabc\e
For every line that matches the regular expression
:ITALICS.(abc)*
:CONT.,
execute the keystrokes
:ITALICS.Iabc<ESC>
(this will insert the characters abc at the start of the line).
:SEEALSO.
:SEE.substitute
:eSEEALSO.
:eFUNC.
:FUNC.HELP
:SYNTAX.* HELP <topic>
Starts a view-only edit buffer on help for a specified topic. Possible
topics are:
:DEFLIST.break
:DEFITEM.COMmandline
All &cmdline commands.
:DEFITEM.KEYS
What different keystrokes do in &cmdmode
:PERIOD.
:DEFITEM.REGularexpressions
How to use regular expressions.
:DEFITEM.SETtings
Everything that can be modified with the
:KEYWORD.set
&cmdline command.
:DEFITEM.SCRipts
&edname
:KEYWORD.script
guide.
:DEFITEM.STARTing
How to start the editor: switches, required files.
:eDEFLIST.
:EXAMPLE.help com
Gives help on &cmdline commands.
:EXAMPLE.help
Gives list of help topics.
:eFUNC.
:FUNC.INSERT
:SYNTAX.<line_number> Insert
Inserts text after a the specified line number &range.
:PERIOD.
Insert is terminated when a line with nothing but a '.' is entered.
:EXMODE.
:SEEALSO.
:SEE.append
:SEE.change
:eSEEALSO.
:eFUNC.
:FUNC.JOIN
:SYNTAX.<line_range> Join
Joins the lines in the specified range &range into a single line
(lines are concatenated one after another).
:EXAMPLE..,.+2 join
Joins the current line and the next 2 lines into a single line.
:SEEALSO.
:SEE key=1.J
:eSEEALSO.
:eFUNC.
:FUNC.KEYADD
:SYNTAX.* KEYAdd <string>
Adds a set of keystrokes &parm1 to the key buffer just as if they
were typed by the user. The processing of these keystrokes is deferred
until &edname finishes its current processing, and is ready to process
keystrokes again.
This is different than the
:KEYWORD.execute
command, which processes the keystrokes immediately.
:BLANKLINE.
:KEYWORD.Keyadd
is useful in a
:KEYWORD.script
:CONT.,
because it allows keystrokes to be executed after the
:KEYWORD.script
is exited.
This prevents re-entrance of a script that is being executed by a
mapped key in input mode, for example.
:BLANKLINE.
Keys are processed in FIFO order. Multiple
:KEYWORD.keyadd
commands cause more keys to queue up for processing.
:BLANKLINE.
If you need to use one or more special keys (e.g. ENTER, F1, etc) in &parm1,
they may specified as follows:
:BLANKLINE.
:INCLUDE file='spmapkey'
:BLANKLINE.
:EXAMPLE.keyadd dd
Acts as if
:ITALICS.dd
were typed, and the current line gets deleted.
:EXAMPLE.keyadd :eval 5*3\n
Acts as if
:ITALICS.:eval 5*3<ENTER>
was typed, and the number 15 gets displayed in the message window.
:SEEALSO.
:SEE.execute
:SEE.map
:SEE.mapbase
:eSEEALSO.
:eFUNC.
:FUNC.LIST
:SYNTAX.<line_range> List
Lists lines in the specified line range.
:EXMODE.
:eFUNC.
:FUNC.LOAD
:SYNTAX.* LOAD <script>
Loads a
:KEYWORD.script
into memory for the life of the edit session.
This allows for much faster access to the script,
since the data structures for the script do not have to be built
every time the script is invoked. This is especially important
for a
:KEYWORD.hook script
:PERIOD.
:BLANKLINE.
For information on editor
:KEYWORD.scripts
:CONT.,
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?