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

📄 cmds.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
📖 第 1 页 / 共 4 页
字号:
.syntx &lt.line_range&gt. List
.begdescr
Lists lines in the specified line range.
.exmode
.enddescr
.endfunc

.begfunc LOAD
.syntx * LOAD &lt.script&gt.
.begdescr
Loads a 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.
.np
For information on editor scripts,
see the chapter
:HDREF refid='scripts'.
:period.
.enddescr
.xmplsect begin
.begxmpl load rdme._vi
Loads the script
:fname.rdme._vi:efname.
and makes it resident.
.endxmpl
.xmplsect end
.alsosee begin
.seethis compile
.seethis source
.alsosee end
.endfunc

.begfunc MAP
.syntx * MAP '"!"' &lt.key&gt. &lt.string&gt.
.begdescr
Tells the editor to run the string of keys &parm3 whenver the
key &parm2 is pressed in &cmdmode
:period.
.np
If &parm1 is specified,
then the string of keys &parm3 is executed whenever &parm2 is pressed
in &tinsmode
:period.
.np
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.:
.millust begin
map a 0a
.millust end
will cause the editor to move to column 1, and then start appending
after the character in column 1.
.np
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.
.np
If you need to use one or more special keys (e.g. ENTER, F1, etc) in &parm3,
then you may enter:
.np
:INCLUDE file='spmapkey'
.np
To remove a mapping, use the
.keyref unmap
command.
.enddescr
.xmplsect begin
.begxmpl map K \x:next\n
Whenever K is pressed in &cmdmode, the
.keyref next
command is executed. The command window will not be displayed,
because of the
.param \x
:period.
.endxmpl
.begxmpl 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
.param \x
:period.
The command will not be added to the command history, because of the
.param \h
:period.
.endxmpl
.begxmpl map CTRL_W \x:fgrep \&lt.CTRL_W&gt.\n
Whenever CTRL_W is pressed in &cmdmode, an fgrep command, searching for
the current word, is executed.  The
.param \x
keeps the command window from opening.
.param \&lt.CTRL_W&gt.
simulates CTRL_W being pressed, so the current word is inserted into
the &cmdline
:period.
.endxmpl
.begxmpl 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.
.endxmpl
.xmplsect end
.alsosee begin
.seethis execute
.seethis keyadd
.seethis unmap
.alsosee end
.endfunc

.begfunc MAPBASE
.syntx * MAPBASE &lt.key&gt. &lt.string&gt.
.begdescr
Tells the editor to run the string of keys &parm3 whenver the
key &parm2 is pressed in &cmdmode
:period.
.np
This works the same as the
.keyref 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.
.enddescr
.alsosee begin
.seethis execute
.seethis keyadd
.seethis map
.seethis unmap
.alsosee end
.endfunc

.begfunc MARK
.syntx &lt.line_number&gt. MArk &lt.markname&gt.
.begdescr
Sets the
.keyword text mark
&parm1 on the line &range.
:period.
The mark name is a single letter from
.param a
to
.param 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.:
.millust begin
'a
.millust end
.enddescr
.xmplsect begin
.begxmpl mark a
Sets the mark
.param a
on the current line.  Typing the command
.param 'a
will return you to that mark.
.endxmpl
.begxmpl 100 mark z
Sets the mark
.param z
on line 100.
.endxmpl
.xmplsect end
:cmt. .alsosee begin
:cmt. .seethis *key=1 m
:cmt. .alsosee end
.endfunc

.begfunc MATCH
.syntx * match //&lt.rx1&gt./&lt.rx2&gt.//
.begdescr
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:
.millust begin
    if( ( i=foo( x ) ) ) return;
.millust end
moves the cursor to the last ')' in the line.
.np
This command allows you to extend what is matched to 
general regular expressions.
.param &lt.rx1&gt.
is the regular expression that opens a match,
.param &lt.rx2&gt.
is the regular expression that closes a match.
.np
Note that in the matching regular expressions, 
.keyref magic 1
is set (special characters automatically
have their meaning, and do not need to be escaped).
.np
For more information on regular expressions, see the chapter
:HDREF refid='rxchap'.
:period.
.enddescr
.xmplsect begin
.begxmpl match /# *if/# *endif/
This adds the matching of all
.param #if and
.param #endif
commands (an arbitrary number of spaces is allowed to occur between
the '#' sign and the
.param if
or
.param endif
words.  If '%' is pressed while over a
.param #if
statement, the cursor is moved to the corresponding
.param #endif
statement.
.endxmpl
.xmplsect end
:cmt. .alsosee begin
:cmt. .seethis *key=1 %
:cmt. .alsosee end
.endfunc

.begfunc MAXIMIZE
.syntx * MAXimize
.begdescr
Maximizes the current edit buffer window.
.enddescr
.alsosee begin
.seethis cascade
.seethis minimize
.seethis movewin
.seethis resize
.seethis size
.seethis tile
.alsosee end
.endfunc

.begfunc MINIMIZE
.syntx * MINimize
.begdescr
Minimizes the current edit buffer window.
.enddescr
.alsosee begin
.seethis cascade
.seethis maximize
.seethis movewin
.seethis resize
.seethis size
.seethis tile
.alsosee end
.endfunc

.begfunc MOVE
.syntx &lt.line_range&gt. Move &lt.line_number&gt.
.begdescr
Deletes the specified range of lines &range and places them
after the line &parm1.
:period.
.enddescr
.xmplsect begin
.begxmpl 1,10 move $
Moves the first 10 lines of the file after the last line in the file.
.endxmpl
.begxmpl 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.
.endxmpl
.xmplsect end
.alsosee begin
.seethis delete
.alsosee end
.endfunc

.begfunc MOVEWIN
.syntx * MOVEWin
.begdescr
Enter window movement mode.  The cursor keys are then used to move the
current edit buffer window.
.enddescr
.alsosee begin
.seethis cascade
.seethis maximize
.seethis minimize
.seethis resize
.seethis size
.seethis tile
.alsosee end
.endfunc

.begfunc NEXT
.syntx * Next
.begdescr
Moves to the next file in the list of files being edited.
.enddescr
.alsosee begin
:cmt. .seethis *key=1 F1
:cmt. .seethis *key=1 F2
.seethis prev
.alsosee end
.endfunc

.begfunc OPEN
.syntx * Open &lt.file&gt.
.begdescr
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.
.np
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:
.figure *depth='2.47' *scale='59' *file='vi030' Two views of the same file
.enddescr
.alsosee begin
.seethis edit
.seethis view
.seethis visual
.alsosee end
.endfunc

.begfunc POP
.syntx * POP
.begdescr
Restores the last pushed file position.
.np
The setting
.keyref maxpush
controls the maximum number of push commands that will be remembered.
.enddescr
.alsosee begin
:cmt. .seethis *key=1 F11
:cmt. .seethis *key=1 F12
.seethis push
.seethis tag
.alsosee end
.endfunc

.begfunc PREV
.syntx * Prev
.begdescr
Moves to the previous file in the list of files being edited.
.enddescr
.alsosee begin
:cmt. .seethis *key=1 F1
:cmt. .seethis *key=1 F2
.seethis next
.alsosee end
.endfunc

.begfunc PUSH
.syntx * PUSH
.begdescr
Saves the current file position.  The next
.keyref pop
command will cause a return to this position.
.np
The setting
.keyref maxpush
controls the maximum number of push commands that will be remembered.
.np
The
.keyref tag
command does an implicit push.
.enddescr
.alsosee begin
:cmt. .seethis *key=1 F11
:cmt. .seethis *key=1 F12
.seethis pop
.seethis tag
.alsosee end
.endfunc

.begfunc PUT
.syntx &lt.line_number&gt. PUt '"!"' &lt.buffer&gt.
.begdescr
Puts (pastes) the &copybuffer
&parm2 ('1'-'9', or 'a'-'z') after the
line &range.
:period.
.np
If &parm2 is not specified, the active &copybuffer is assumed.
.np
If &parm1 is specified, then the lines are put before the
line &range.
:period.
.enddescr
.xmplsect begin
.begxmpl put
Pastes the active &copybuffer after the current line.
.endxmpl
.begxmpl 1 put!
Pastes the active  &copybuffer before the first line in the edit buffer.
.endxmpl
.begxmpl $ put a
Pastes named &copybuffer
.param a
after the last line in the file.
.endxmpl
.begxmpl put! 4
Pastes numbered &copybuffer before the current line.
.endxmpl
.xmplsect end
.alsosee begin
.seethis delete
.seethis yank
:cmt. .seethis *key=1 p
:cmt. .seethis *key=1 P
.alsosee end
.endfunc

.begfunc QUIT
.syntx * Quit '"!"'
.begdescr
Quits the current file.
.keyref Quit
will not quit a modified file, unless &parm1 is specified, in which
case all changes are discarded and the file is exited.
.enddescr
.xmplsect begin
.begxmpl q!
Quits the current file, discarding all modifications since the last write.
.endxmpl
.xmplsect end
.alsosee begin
.seethis write
.seethis wq
.seethis xit
:cmt. .seethis *key=1 Z
.alsosee end
.endfunc

.begfunc QUITALL
.syntx * QUITAll
.begdescr
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.
.enddescr
.xmplsect begin
.begxmpl quitall
If files have been modified, the following prompt is displayed:
.figure *depth='2.47' *scale='59' *file='vi003' Really Exit prompt
.endxmpl
.xmplsect end
.alsosee begin
.seethis exitall
:cmt. .seethis *key=1 CTRL_C
.alsosee end
.endfunc

.begfunc READ
.syntx &lt.line_number&gt. Read &lt.file_name&gt.
.begdescr
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.
.np
Line 0 may be specified as &range in order to read a file
in before the first line of the current edit buffer.
.np
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.
.np
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.
.np
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.
.enddescr
.xmplsect begin
.begxmpl 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.
.endxmpl
.begxmpl r test.c
Reads the file test.c into the current edit buffer and places the text
after the current line.
.endxmpl
.begxmpl r $
Reads the current directory and places the data after the current line.
.endxmpl
.begxmpl r $*.c
Reads the current directory, matching only files with .c extensions,
and places the data after the current line.
.endxmpl
.begxmpl r $..\c\*.*
Reads the ..\c directory, and places the data after the current line.
.endxmpl
.begxmpl read
Gives a file selection display:
.figure *depth='2.47' *scale='59' *file='vi016' File Selection display
.endxmpl
.xmplsect end
.endfunc

.begfunc RESIZE
.syntx * RESize
.begdescr
Allows resizing of the current edit window with the keyboard.  The
cursor keys are used as follows:
:DL break.
.*
:DT.UP
:DD.move top border up

:DT.DOWN
:DD.move top border down

:DT.LEFT
:DD.move right border left

:DT.RIGHT
:DD.move right border right

:DT.SHIFT_UP
:DD.move bottom border up

:DT.SHIFT_DOWN
:DD.move bottom border down

:DT.SHIFT_LEFT
:DD.move left border left

:DT.SHIFT_RIGHT
:DD.move left border right
.*
:eDL.
.enddescr
.alsosee begin

⌨️ 快捷键说明

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