📄 modes.gml
字号:
.np
.xmplsect begin
.begxmpl cr
Changes the current selected (highlighted) region in the edit buffer.
.endxmpl
.begxmpl cc
Change the current line. The current line is deleted, and &tinsmode
is entered.
.endxmpl
.begxmpl 95cc
Changes 95 lines, starting at the current. The lines are deleted,
and &tinsmode is entered.
.endxmpl
.begxmpl cw
Change the current word. The current word is highlighted, and once
a character other than
.param ESC
is typed, the word is deleted and &tinsmode is entered.
.endxmpl
.begxmpl c$
Changes from the current column to the end of the
current line.
The column range is highlighted, and once a character other than
.param ESC
is typed, the column range is deleted and &tinsmode is entered.
.endxmpl
.begxmpl 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
.param ESC
is typed, the column range is deleted and &tinsmode is entered.
.endxmpl
.xmplsect end
.endkey
.*
.keylist end
.* ******************************************************************
.section 'Shifting Text'
.* ******************************************************************
.np
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 begin 'Shifting Text'
.*
.begkey >. <.n>.>.<.oper>. (right angle bracket)
This is the shift right command. It shifts the specified lines to the right
.keyref shiftwidth
spaces, inserting necessary leading tabs if
.keyref realtabs 1
is specified.
.np
A repeat count
.param <.n>.
may precede the command, this causes
.param <.n>.
units of the
.param <.oper>.
command to be shifted to the right.
.np
.param <.oper>.
may be specified as
.param >.
:cont.,
which causes a single line to be shifted to the right.
.seecmd >.
.np
.xmplsect begin
.begxmpl 10>.>.
Shifts the current line and the next 9 lines to the right
.keyref shiftwidth
spaces.
.endxmpl
.begxmpl >.'a
Shifts all lines from the current line to the line with mark
.param a
to the right
.keyref shiftwidth
spaces.
.endxmpl
.begxmpl >.r
Shifts all lines in the selected (highlighted) region to the right
.keyref shiftwidth
spaces.
.endxmpl
.xmplsect end
.endkey
.begkey <. <.n>.<.<.oper>. (left angle bracket)
This is the shift left command. It shifts the specified lines to the left
.keyref shiftwidth
spaces.
.np
A repeat count
.param <.n>.
may precede the command, this causes
.param <.n>.
units of the
.param <.oper>.
command to be shifted to the left
.keyref shiftwidth
spaces.
.np
.param <.oper>.
may be specified as
.param <.
:cont.,
which causes a single line to be shifted to the left
.keyref shiftwidth
spaces.
.seecmd <.
.np
.xmplsect begin
.begxmpl <.<.
Shifts the current line to the left
.keyref shiftwidth
spaces.
.endxmpl
.begxmpl <.G
Shifts all lines from the current line to the last line in the
edit buffer to the left
.keyref shiftwidth
spaces.
.endxmpl
.begxmpl 10<.j
Shifts the current line and the next 10 lines to the left
.keyref shiftwidth
spaces.
.endxmpl
.xmplsect end
.endkey
.*
.keylist end
.* ******************************************************************
.section 'Case Toggling'
.* ******************************************************************
.np
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
.millust begin
This Is A Line Of Text.
.millust end
to
.millust begin
tHIS iS a lINE oF tEXT.
.millust end
.np
.se plural = 0
:INCLUDE file='oper'.
.*
.keylist begin 'Case Toggling'
.*
.begkey &tilde. <.n>.&tilde.<.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
.param &tilde.
only changes the case of the current character, and advances the
cursor to the next character.
.np
However, if
.keyword togglecaselikevi
is not set, then this command toggles the case of the characters
over the range specified by
.param <.oper>.
.np
A repeat count
.param <.n>.
may precede the command, this causes
.param <.n>.
units of the
.param <.oper>.
command to be case toggled.
.np
.param <.oper>.
may be specified as
.param &tilde.
:cont.,
which causes a single line to be have its case toggled.
.np
.xmplsect begin
.begxmpl &tilde.r
Toggles the case of the currently selected (highlighted) range.
.endxmpl
.begxmpl &tilde.$
Toggles the case of all characters from the current column of the
current line to the last character of the current line.
.endxmpl
.begxmpl &tilde.w
Toggles the case of the current word.
.endxmpl
.begxmpl 10&tilde.&tilde.
Toggles the case of the current line and the 9 lines following.
.endxmpl
.xmplsect end
.endkey
.*
.keylist end
.* ******************************************************************
.section 'Filters'
.* ******************************************************************
.np
The &cmdmode filter command has the same functionality as the
&cmdline command
.keyword filter
:period.
.se plural = 0
:INCLUDE file='oper'.
.*
.keylist begin Filters
.*
.begkey ! <.n>.!<.oper>. (exclamation mark)
Filter text. The line range specified by
.param <.oper>.
are run through a specified filter.
A repeat count
.param <.n>.
may precede the command, this causes
.param <.n>.
units of the
.param <.oper>.
command to be run through the filter.
.np
.param <.oper>.
may be specified as
.param !
:cont.,
which causes a single line to be run through the filter.
.np
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:
.figure *depth='2.47' *scale='59' *file='vi025' 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.
.np
There is a filter command history in the filter command prompt, the
size of which is controlled with the
.keyref maxfilterhistory
setting.
.seecmd !
.np
.xmplsect begin
.begxmpl !r
Runs the current selected (highlighted) region in the edit buffer
through a specified filter.
.endxmpl
.begxmpl !!
Runs the current line through a specified filter
.endxmpl
.begxmpl !G
Runs all lines from the current line to the end of the edit buffer
through a specified filter.
.endxmpl
.xmplsect end
.endkey
.*
.keylist end
.* ******************************************************************
.section 'Text Selection'
.* ******************************************************************
.np
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.
.np
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
.param ESC
key.
.np
A selected region is highlighted by exchanging the foreground and
background the colors of the line. A selected region could look
as follows:
.figure *depth='2.47' *scale='59' *file='vi026' Selected Text Region
.np
The following are the &cmdmode commands for selecting text and
manipulating selected text.
.*
.keylist begin 'Text Selection'
.*
.begkey CTRL_R CTRL_R
Starts text selection, if no text is selected. The current character is highlighted.
.np
If region is already selected, then cancel the selected region.
.endkey
.begkey 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
.param <.n>.
is specified, then the cursor moves up
.param <.n>.
lines, and all the lines between the starting and ending
position are selected.
.endkey
.begkey 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
.param <.n>.
is specified, then the cursor moves down
.param <.n>.
lines, and all the lines between the starting and ending
position are selected.
.endkey
.begkey 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
.param <.n>.
is specified, then the cursor moves left
.param <.n>.
characters, and all the characters between the starting and ending
position are selected.
.endkey
.begkey 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
.param <.n>.
is specified, then the cursor moves right
.param <.n>.
characters, and all the characters between the starting and ending
position are selected.
.endkey
.begkey SHIFT_DEL <."?>.SHIFT_DEL
Deletes the currently selected region. If the ©buffer
.param <."?>.
is specified, the region is copied into that buffer,
otherwise the data is copied into the active buffer.
.endkey
.begkey _ _ (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
.keyref word
:period.
.endkey
.*
.keylist end
.* ******************************************************************
.section 'Miscellaneous Keys'
.* ******************************************************************
.keylist begin 'Miscellaneous Keys'
.*
.begkey 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
.endkey
.begkey 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:
.millust begin
"test.c" [modified] line 5 of 100 -- 5% --
.np
"..\c\file.c" [read only] line 100 of 100 -- 100% --
.np
"\autoexec.bat" line 1 of 100 -- 1% --
.millust end
.endkey
.begkey CTRL_L CTRL_L
Redraws the current screen.
.endkey
.begkey CTRL_V CTRL_V
Displays the current version of &edvi in the message window.
.seecmd version
.endkey
.begkey 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:
.millust begin
Char 'e': 0x65 (101)
.millust end
.endkey
.begkey CTRL_] CTRL_] (control right square bracket)
Go to the tag given by the current word. The word is defined using the
&cmdline command
.keyref word
:period.
.seecmd tag
.np
See the appendix
:HDREF refid='ctags'.
for more information.
.endkey
.begkey ALT_W ALT_W
Activates the current edit window's menu. This menu is defined
using the
.keyword windowgadgetmenu
.keyref menu
:period.
See the chapter
:HDREF refid='winmenu'.
for more information on setting this menu.
.endkey
.begkey ALT_X ALT_X
Insert a character, at the current cursor position. When
.param ALT_X
is pressed, a prompt is displayed:
.figure *depth='2.47' *scale='59' *file='vi027' Character Insertion Prompt
Enter either a decimal or a hex number. That character will
be inserted directly into the edit buffer.
.endkey
.begkey : : (colon)
Allows entry of a &cmdline
:period.
See the chapter
:HDREF refid='cmds'
for full details on &cmdline commands.
.endkey
.begkey @ @<.?>. (at sign)
This command executes the ©buffer
.param <.?>.
:period.
&edvi behaves as if the contents
of the buffer were being typed at the keyboard.
.endkey
.begkey J <.n>.J
Joins the next line to the current line. If a repeat count
.param <.n>.
is specified, the next
.param <.n>.
lines are joined to the current line.
(lines are concatenated one after another).
.seecmd join
.np
.xmplsect begin
.begxmpl J
Joins the next line to the current line.
.endxmpl
.begxmpl 3J
Joins the next 3 lines to the current line.
.endxmpl
.xmplsect end
.endkey
.begkey Q Q
Enters
.keyword EX mode
:period.
.keyword EX mode
is a line-oriented mode of
&edvi.
:period.
To exit
.keyword EX mode
:cont.,
use the
.keyref visual
command.
.endkey
.begkey Z Z<.Z>.
Used when you are finished with the current edit buffer.
If the current edit buffer has been modified, it is saved.
.np
.xmplsect begin
.begxmpl ZZ
Finished with current edit buffer.
.endxmpl
.xmplsect end
.endkey
.begkey z <.n>.z<.?>.
Reorients the current screen position. The current line moves
as follows, depending on the value of
.param <.?>.
:cont.:
:DL break.
:DT.ENTER
:DD.Moves the current line to the top of the screen.
:DT.. (dot)
:DD.Moves the current line to the center of the screen.
:DT.- (dash)
:DD.Moves the current line to the bottom of the screen.
:eDL.
If a repeat count
.param <.n>.
is specified, then
.param <.n>.
is made the current line.
.np
.xmplsect begin
.begxmpl z-
Move the current line to the bottom of the screen.
.endxmpl
.begxmpl 100zENTER
Makes line 100 the current line, and puts line 100 at the
top of the screen.
.endxmpl
.begxmpl 25z.
Makes line 25 the current line, and puts line 25 at the
center of the screen.
.endxmpl
.xmplsect end
.endkey
.begkey F1 F1
Move forward through the file list to the next file.
.seecmd next
.endkey
.begkey F2 F2
Move backwards through the file list to the previous file.
.seecmd prev
.endkey
.begkey F11 F11
Push the current file and position. If you press
.param F12
:cont.,
you will be restored to this position. These positions are stacked
up, up to a maximum of
.keyref maxpush
:period.
.seecmd push
.endkey
.begkey F12 F12
Restore the last pushed file and position.
.seecmd pop
.endkey
.begkey . . (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 "
.param m.
:cont.".
(&edvi enters memorize mode).
:LI.Enter keystrokes.
:LI.Type "
.param .
:cont."
:eOL.
Now, whenever you press dot ('.'),
all the entered keystrokes will be executed.
.endkey
.begkey = = (equals sign)
Performs the last alternate memorized command sequence. The
.keyword alternate memorize mode
is used as follows:
:OL.
:LI.Type "
.param m=
:cont.".
(&edvi enters
.keyword alternate memorize mode
:cont.).
:LI.Enter keystrokes.
:LI.Type "
.param =
: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.
.np
This memorized keystroke sequence will last until you memorize
another, unlike using "
.param m.
:cont.".
.endkey
.begkey ALT_M ALT_M
Display current memory state. Shows the total amount of memory, the
amount of memory for use by &edvi, and how much extended memory and/or
disk space is available.
.endkey
.*
.keylist end
.*
.endlevel
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -