📄 cmds.gml
字号:
.seethis cascade
.seethis maximize
.seethis minimize
.seethis movewin
.seethis size
.seethis tile
.alsosee end
.endfunc
.begfunc SET
.syntx * SEt <.variable>. <.value>.
.begdescr
Certain variables within &edvi. may be changed after &edvi. is
executing. &parm2 is assigned to &parm1.
:period.
.np
If &parm1 and
&parm2 are not specified, the a window containing a list
of all boolean values is displayed.
.np
If &parm1 is specified
as a
.param 2
:cont.,
then a window containing all other values is displayed.
.np
From the selection window, a variable may be selected (with ENTER or
double clicking the mouse), and a
new value entered. If the variable was boolean, then pressing
ENTER or double clicking toggles the value.
.np
If a variable is a boolean variable, then it is be set via
.millust begin
set var - set var to TRUE
set novar - set var to FALSE
.millust end
.np
Variables other than boolean variables are set via
.millust begin
set var = test - set var to 'test'
set var test - set var to 'test'
.millust end
Note that the '=' operator is optional.
.np
For information on all the different settable options,
see the chapter
:HDREF refid='edset'.
:period.
.enddescr
.endfunc
.begfunc SETCOLOR
.syntx * SETCOLOR <.c>. <.r>. <.g>. <.b>.
.begdescr
Set the color number &parm1 to have the RGB value &parm2, &parm3, &parm4.
:period.
&parm1 may have a value of 0 to 15.
&parm1, &parm2, and &parm3 may have values from 0 to 63.
.np
This command only has an affect under operating systems where it is possible
to remap the colors in some way (DOS).
.enddescr
.xmplsect begin
.begxmpl setcolor 1 63 0 38
This remaps color number 1 to a pink color.
.endxmpl
.begxmpl setcolor 15 25 40 38
This remaps color number 15 to a pale green color.
.endxmpl
.xmplsect end
.endfunc
.begfunc SHELL
.syntx * SHell
.begdescr
Escapes to an operating system shell.
.enddescr
.alsosee begin
.seethis !
:cmt. .seethis *key=1 !
.alsosee end
.endfunc
.begfunc SIZE
.syntx * SIZE <.x1>. <.y1>. <.x2>. <.y2>.
.begdescr
Resizes the current edit buffer window to have upper left-hand corner at
(&parm1,&parm2) and lower right-hand corner at (&parm3,&parm4).
.enddescr
.xmplsect begin
.begxmpl SIZE 0 0 10 10
Changes the size of the current edit buffer window to have
upper left-hand corner at (0,0) and lower right-hand corner at (10,10).
.endxmpl
.xmplsect end
.alsosee begin
.seethis cascade
.seethis maximize
.seethis minimize
.seethis movewin
.seethis resize
.seethis tile
.alsosee end
.endfunc
.begfunc SOURCE
.syntx * SOurce <.script>. <.p1>. <.p2>. ... <.pn>.
.begdescr
Execute &edvi. source script file &parm1.
:period.
Optional parameters &parm2 to
&parm5 may be specified, these are passed to the specified script.
.np
If "." is specified as the script name, the current
file being edited is run as a script.
.np
For information on editor scripts,
see the chapter
:HDREF refid='scripts'.
:period.
.enddescr
.xmplsect begin
.begxmpl source foo.vi abc
Executes the script
.param foo.vi
:cont.,
passing it the parm
.param abc
:period.
.endxmpl
.begxmpl source .
Executes the current edit buffer as a script
:period.
.endxmpl
.xmplsect end
.alsosee begin
.seethis compile
.seethis load
.alsosee end
.endfunc
.begfunc SUBSTITUTE
.syntx <.line_range>. Substitute /<.regexp>./<.replexp>./<.g>.<.i>.
.begdescr
Over the line range &range,
replace each occurrence of regular expression
.param <.regexp>.
with the replacement expression
.param <.replexp>.
:period.
.np
Only the first occurrence on each line is replaced, unless
.param <.g>.
is specified, in which case all occurrences on a line are replaced.
.np
If
.param <.i>.
is specified, each replacement is verified before it is performed.
.np
See the chapter
:HDREF refid='rxchap'.
for more information on regular expression matching and substitution.
.enddescr
.xmplsect begin
.begxmpl %s/foo/bar/
Changes the first occurrence of
.param foo
to
.param bar
on each line of the entire file.
.endxmpl
.begxmpl 1,.s/(([a-z]bc)*)/Abc\2/g
Changes all occurrences of the regular expression
.param (([a-z]bc)*)
to the substitution expression
.param Abc\2
:period.
The changes are only applied on lines 1 to the current line of the
current edit buffer.
.endxmpl
.begxmpl 'a,'b/^abc//i
Any line that starts with
.param abc
has the
.param abc
changed to the null string.
The user is prompted before each change. The changes are only applied
from the line containing mark
.param a
to the line containing mark
.param b
:period.
.endxmpl
.xmplsect end
.alsosee begin
.seethis global
.alsosee end
.endfunc
.begfunc TAG
.syntx * TAG <.tagname>.
.begdescr
Searches for the tag &parm1.
:period.
Tags are kept in a special file,
which must be located somewhere in your path.
This file is controlled with the
.keyref tagfilename
setting; the default for this setting is
.param tags
:period.
The tags file contains a collection of procedure names and typedefs,
along with the file in which they are located and a search command/line
number with which to exactly locate the tag.
.np
See the appendix
:HDREF refid='ctags'
for more information.
.enddescr
.xmplsect begin
.begxmpl tag MyFunc
Locates the tag
.param MyFunc
in the tags file, edits the source file that contains the function
.param MyFunc
:cont.,
and moves the cursor to the definition of the function in the source file.
.endxmpl
.xmplsect end
:cmt. .alsosee begin
:cmt. .seethis *key=1 ^]
:cmt. .alsosee end
.endfunc
.begfunc TILE
.syntx * TILE '"h"' '|' '"v"' '|' <.x>. <.y>.
.begdescr
Tile all current file windows. The tiling layout is specified
as an &parm5 by &parm6 grid. The or bars ('|') in the command
syntax indicate that only one of the options may be used.
.np
If no parameters are specified,
.keyref maxwindowtilex
and
.keyref maxwindowtiley
are used (this is the default tile grid).
.np
If &parm1 is specified,
then files are tiled horizontally (as many as will fit).
.np
If &parm3 is specified, then files are tiled vertically (as many as will fit).
.np
Specifying &parm5 &parm6 overrides the default tile grid. As a special
case, specifying &parm5 &parm6 as 1 1 causes all windows to be restored.
.enddescr
.xmplsect begin
.begxmpl tile 3 5
Tile windows 3 across and 5 high.
.endxmpl
.begxmpl tile 1 1
Untile windows.
.endxmpl
.begxmpl tile h
Tile windows horizontally.
.endxmpl
.begxmpl tile
Tile windows according to default tile grid.
.endxmpl
.xmplsect end
.alsosee begin
.seethis cascade
.seethis maximize
.seethis minimize
.seethis resize
.seethis size
.seethis movewin
.alsosee end
.endfunc
.begfunc UNABBREV
.syntx * UNABbrev <.abbrev>.
.begdescr
Removes the abbreviation &parm1.
:period.
See the
.keyref abbrev
command for how to set an abbreviation.
.enddescr
.xmplsect begin
.begxmpl unabbrev wh
Remove the abbreviation
.param wh
:period.
.endxmpl
.xmplsect end
.alsosee begin
.seethis abbrev
.alsosee end
.endfunc
.begfunc UNALIAS
.syntx * UNALias <.alias>.
.begdescr
Removes the &cmdline alias &parm1.
:period.
See the
.keyref alias
command for how to set a &cmdline alias.
.enddescr
.xmplsect begin
.begxmpl unalias ai
Remove the &cmdline alias
.param ai
:period.
.endxmpl
.xmplsect end
.alsosee begin
.seethis alias
.alsosee end
.endfunc
.begfunc 'UNDO (command)'
:cmt. .ix 'undo command'
.syntx * Undo '"!"'
.begdescr
Undo the last change. There is no limit on the number of undo's
that can be saved, except for memory. Continuing to issue undo commands
walks you backwards through your edit history.
.np
Specifying &parm1 undoes the last undo (redo). Again, there are no
restrictions on this. However, once you modify the file, you can longer undo the
last undo.
.enddescr
:cmt. .alsosee begin
:cmt. .seethis *key=1 u
:cmt. .seethis *key=1 U
:cmt. .alsosee end
.endfunc
.begfunc UNMAP
.syntx * UNMAP '"!"' <.key>.
.begdescr
Removes the mapping of the key &parm2 for &cmdmode
:period.
If &parm1 is specified, then the key mapping is removed for &tinsmode
:period.
See the
.keyref map
command for details on mapping keys.
.np
There are a number of pre-defined
symbols that are recognized for &parm1.
:period.
These are described in the Appendix
:HDREF refid='symkey'.
:period.
.enddescr
.xmplsect begin
.begxmpl unmap CTRL_W
Removes the mapping of CTRL_W for &cmdmode
:period.
Pressing CTRL_W in command
mode will now do the default action.
.endxmpl
.begxmpl unmap! F1
Removes the mapping of F1 for &tinsmode
:period.
Typing F1 in &tinsmode will now do the default action.
.endxmpl
.xmplsect end
.alsosee begin
.seethis map
.seethis mapbase
.alsosee end
.endfunc
.begfunc VERSION
.syntx * VERsion
.begdescr
Displays the current version of &edvi. in the message window.
.enddescr
:cmt. .alsosee begin
:cmt. .seethis *key=1 ^V
:cmt. .alsosee end
.endfunc
.begfunc VIEW
.syntx * VIEw '"!"' <.file_name>.
.begdescr
Functions the same as the
.keyref edit
command, except that it causes the file edited to be a "view only"
file (no modification commands work).
.enddescr
.xmplsect begin
.begxmpl view test.c
Edits the file
.param test.c
in view-only mode.
.endxmpl
.xmplsect end
.alsosee begin
.seethis edit
.seethis open
.seethis visual
.alsosee end
.endfunc
.begfunc VISUAL
.syntx * VIsual <.file_name>.
.begdescr
Causes &edvi. to re-enter visual mode (full screen editing mode)
if &edvi. is in
.keyword EX mode
:period.
If the filename &parm1 is specified,
this functions just like the
.keyref edit
command.
.enddescr
.xmplsect begin
.begxmpl vi test.c
Return to full screen editing mode (if in
.keyword EX mode
:cont.)
and edit the file
test.c
.endxmpl
.begxmpl vi
Return to full screen editing mode (if in
.keyword EX mode
:cont.)
:period.
.endxmpl
.xmplsect end
.alsosee begin
.seethis edit
.seethis open
.seethis view
.alsosee end
.endfunc
.begfunc WRITE
.syntx <.line_range>. Write '"!"' <.file_name>.
.begdescr
Writes the specified range of lines &range to the file &parm2.
:period.
.np
If no line range is specified, then all lines are written.
.np
If &parm2 is not specified, then the current file is written.
If &parm2 exists, and is not the name of the file that you are writing,
then the write will fail.
.np
Specifying &parm1 forces an overwrite of an existing file.
.enddescr
.xmplsect begin
.begxmpl 1,10 w! test.c
Write the first 10 lines of the current file to the file
.param test.c
:cont.,
and overwrite
.param test.c
if it already exists.
.endxmpl
.begxmpl w
Write out the current file.
.endxmpl
.xmplsect end
.alsosee begin
.seethis quit
.seethis wq
.seethis xit
:cmt. .seethis *key=1 Z
.alsosee end
.endfunc
.begfunc WQ
.syntx * WQ
.begdescr
Writes current file, and exits.
.enddescr
.alsosee begin
.seethis quit
.seethis write
.seethis xit
:cmt. .seethis *key=1 Z
.alsosee end
.endfunc
.begfunc YANK
.syntx <.line_range>. Yank <.buffer>.
.begdescr
Yank (make a copy of) the specified line range &range.
:period.
.np
If &parm1 is not specified, the text is yanked (copied) into the active
©buffer
:period.
.np
If &parm1 ('1'-'9', or 'a'-'z') is specified, the text is yanked into
that ©buffer
:period.
.np
The
.keyref put
command may be used to place the contents of a ©buffer into the file.
.enddescr
.xmplsect begin
.begxmpl % y
Yanks (copies) all lines into the active ©buffer
:period.
.endxmpl
.begxmpl .,$ y z
Yanks the lines from the current line to the last line in the file
into the ©buffer
.param z
:period.
.endxmpl
.xmplsect end
.alsosee begin
.seethis delete
.seethis put
:cmt. .seethis *key=1 d
:cmt. .seethis *key=1 y
:cmt. .seethis *key=1 p
:cmt. .seethis *key=1 P
.alsosee end
.endfunc
.begfunc XIT
.syntx Xit
.begdescr
Exits the current file, saving it if it has been modified.
.enddescr
.alsosee begin
.seethis quit
.seethis write
.seethis wq
:cmt. .seethis *key=1 Z
.alsosee end
.endfunc
.*
.fnlist end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -