📄 modes.gml
字号:
.****************************************************************************
.*
.* Open Watcom Project
.*
.* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
.*
.* ========================================================================
.*
.* This file contains Original Code and/or Modifications of Original
.* Code as defined in and that are subject to the Sybase Open Watcom
.* Public License version 1.0 (the 'License'). You may not use this file
.* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
.* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
.* provided with the Original Code and Modifications, and is also
.* available at www.sybase.com/developer/opensource.
.*
.* The Original Code and all software distributed under the License are
.* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
.* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
.* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
.* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
.* NON-INFRINGEMENT. Please see the License for the specific language
.* governing rights and limitations under the License.
.*
.* ========================================================================
.*
.* Description: Root file of VI documentation.
.*
.* Date By Reason
.* ---- -- ------
.* 01-aug-92 Craig Eisler initial draft
.* 28-sep-05 L. Haynes reformatted for hlp, figures
.*
.****************************************************************************/
.chap *refid=modes 'Modes'
:cmt. .if &e'&dohelp eq 0 .do begin
:cmt. . .section 'Introduction'
:cmt. .do end
.np
The &edname is a modal editor. When you are in &cmdmode
(the default mode), there are a number of valid keys that may be pressed.
To ensure that you are in &cmdmode,
press the
.param ESC
key until the mode indicator
on the menu bar displays:
.millust begin
Mode: command
.millust end
.np
When in &tinsmode, text may be entered. There are two aspects to
&tinsmode.:
.keyword insert
and
.keyword overstrike
:period.
.keyword Text insertion mode
is entered via a number of different commands from &cmdmode,
and is indicated by a
larger cursor, along with a mode line indication. The
types of cursor are controlled with the
.keyref commandcursortype
:cont.,
.keyref insertcursortype
:cont.,
and
.keyref overstrikecursortype
settings.
.np
When &edvi is in a &tinsmode.,
the mode indicator on the menu bar displays one of:
.millust begin
Mode: insert
.millust end
or
.millust begin
Mode: overstrike
.millust end
.* ******************************************************************
.section *refid=timode 'Text Insertion Mode'
.* ******************************************************************
.np
When in &tinsmode (either inserting or overstriking), you
may enter text and freely cursor about through the file. When you
are finished adding text, the
.param ESC
key returns you to &cmdmode
:period.
.np
It should be remembered that an undo applies to
changes caused by commands; so all changes made while in &tinsmode
are part of a single undo record. For more information on
undos, see the section
:HDREF refid='cmundo'.
later on in this chapter.
.np
The following keys, when pressed in &cmdmode, place you into &tinsmode:
.*
:DL break.
.*
:DT.a
:DD.Starts appending (inserting) text after the current character in
the edit buffer.
:DT.A
:DD.Starts appending (inserting) text after the last character on the
current line in the edit buffer.
:DT.C
:DD.Changes text from the current position to the end of the current line.
Deletes the text, and enters &tinsmode
:period.
:DT.<.n>.c<.oper>.
:DD.Change command. Deletes the text in the range specified by
.param <.oper>.
:cont., and enters &tinsmode
:period.
:DT.g
:DD.Starts inserting or overstriking text at the current cursor position,
depending on how you were adding text the last time you were in &tinsmode
:period.
:DT.i
:DD.Starts inserting text at the current cursor position.
:DT.I
:DD.Starts inserting text before the first non-white space character on
the current line.
:DT.o
:DD.Opens a line after the current line, and enters &tinsmode
:period.
:DT.O
:DD.Opens a line before the current line, and enters &tinsmode
:period.
:DT.R
:DD.Starts overstriking text at the current character in the edit buffer.
:DT.<.n>.s
:DD.Substitute
.param <.n>.
characters. The first
.param <.n>.
characters from the current cursor position are deleted, and &tinsmode
is entered.
:DT.<.n>.S
:DD.Substitute lines of text.
.param <.n>.
lines from the current line forward are deleted, and &tinsmode is entered.
:DT.INS
:DD.Start inserting text at the current cursor position.
.*
:eDL.
.*
.beglevel
.* ******************************************************************
.section 'Special Keys'
.* ******************************************************************
.np
While in &tinsmode, certain keys do special things. These keys are:
.*
:DL break.
.*
:DT.Arrow Keys
:DD.:DL break.
:DT.Up
:DD.Cursor up through the text.
:DT.DOWN
:DD.Cursor down through the text.
:DT.LEFT
:DD.Cursor left through the text.
:DT.RIGHT
:DD.Cursor right through the text.
:eDL.
:DT.Text Selection Keys
:DD.:INCLUDE file='textsel'.
:DT.CTRL_PAGEUP
:DD.Moves to the first non-white space character on the first line
of the current edit buffer.
:DT.CTRL_PAGEDOWN
:DD.Moves to the last character on the last line
of the current edit buffer.
:DT.SHIFT_DEL
:DD.Deletes the currently selected region into the active ©buffer
:period.
:DT.SHIFT_INS
:DD.Pastes the active ©buffer
into the text after the current position.
:DT.SHIFT_TAB
:DD.Move back to the previous tab stop, deleting the characters before the
cursor.
:DT.CTRL_DEL (ctrl-delete)
:DD.Delete the current line into the active ©buffer
:period.
:DT.CTRL_INS (ctrl-insert)
:DD.Pastes the active ©buffer into the text before the current position.
:DT.CTRL_D
:DD.Move backwards
.keyref shiftwidth
spaces, deleting the characters before the cursor. A
.keyref shiftwidth
is a number that you may set, its default value is 4.
:DT.CTRL_T
:DD.Insert
.keyref shiftwidth
spaces. If
.keyref realtabs 1
is set, then once
.keyref tabamount
spaces are inserted, the spaces are replaced with a tab character.
:DT.CTRL_V
:DD.The next key typed is inserted directly, without any interpretation.
:DT.CTRL_Q
:DD.The next key typed is inserted directly, without any interpretation.
:DT.BS
:DD.Backspace one on the current line, deleting the character before the
cursor.
:DT.DEL
:DD.Delete the character under the cursor. If you are at the end of the line,
.keyword DEL
has the same effect as pressing
.keyword BS
:period.
:DT.ENTER
:DD.Start a new line.
:DT.END
:DD.Move to the end of the current line.
:DT.HOME
:DD.Move to the start of the current line.
:DT.INS
:DD.Toggles between insert and overstrike mode.
:DT.PAGEUP
:DD.Move up one page in the text.
:DT.PAGEDOWN
:DD.Move up down one page in the text.
:DT.TAB
:DD.Move forward to the next tab stop. If
.keyref realtabs 1
is set, a tab character is inserted into the file. Otherwise, spaces
are inserted.
.*
:eDL.
.*
.endlevel
.* ******************************************************************
.section 'Command Mode'
.* ******************************************************************
.np
The following &cmdmode command descriptions show items within
angle brackets (<.>.).
The angle brackets are there to indicate items that you may supply.
You are not required to type the brackets. For example, <.n>. simply
means that in the corresponding place in the command you can enter
a number.
.np
Many commands may be preceded with a repeat count, which is
indicated by a
.param <.n>.
before a command.
The number is not required; if it is not supplied, it is usually assumed
that a 1 was entered for the repeat count. As long as the setting
.keyref repeatinfo
is enabled, the number that is typed appears in a special window called the
.keyref countwindow
:period.
.np
Other commands may be preceded with a ©buffer
name, which is indicated with a
.param <."?>.
:period.
If you do not want the result of the operation to be copied into the
active buffer, then an alternate buffer may be specified.
The double quotes (")
are required (this indicates that an alternate buffer is being specified),
and then a buffer '1'-'9' or 'a'-'z' is specified. See the section
:HDREF refid='cpybuff'.
for more information.
.*
.beglevel
.* ******************************************************************
.section *refid=mvement 'Movement'
.* ******************************************************************
.np
The following are &cmdmode commands that cause movement in the
current edit buffer.
.*
.keylist begin Movement
.*
.begkey "|" "<.n>.|" '(or bar)'
Move to the column number specified by
.param <.n>.
:period.
.np
.xmplsect begin
.begxmpl |
Move to column 1 of the current line.
.endxmpl
.begxmpl 15|
Move to column 15 of the current line.
.endxmpl
.xmplsect end
.endkey
.begkey ` `<.?>. (back quote)
Moves to the mark position (line and column) specified by
.param <.?>.
See the section
:HDREF refid='marks'.
for more information.
.seecmd mark
.np
.xmplsect begin
.begxmpl `a
Move to the line and column with mark
.param a
:period.
.endxmpl
.xmplsect end
.endkey
.begkey "'" "'<.?>." (front quote)
Move to the start of line with the mark
.param <.?>.
:period.
See the section
:HDREF refid='marks'.
for more information.
.seecmd mark
.np
.xmplsect begin
.begxmpl 'z
Move to the start of the line with mark
.param z
:period.
.endxmpl
.xmplsect end
.endkey
.begkey '%' '%' (percent)
Moves to matching brace or other defined match string.
Defaults are "{","}"
and "(",")". For example, by pressing
.param %
while on the first opening brace ('(') on the line:
.millust begin
if( ( i=foo( x ) ) ) return;
.millust end
moves the cursor to the last closing brace (')') on the line.
It is possible to set arbitrary pairs of match strings using the
&cmdline command
.keyref match
:period.
.endkey
.begkey '$' '$' (dollar)
Moves the cursor to the last character on the current line.
.endkey
.begkey '&caret.' '&caret.' (caret)
Moves the cursor to the first non-whitespace character on the current line.
.endkey
.begkey ';' ';' (semi-colon)
Repeats the last
.keyword f
:cont.,
.keyword F
:cont.,
.keyword t
or
.keyword T
movement commands.
.endkey
.begkey ',' ',' (comma)
Repeats the last
.keyword f
:cont.,
.keyword F
:cont.,
.keyword t
or
.keyword T
movement commands, but the search is done in the opposite direction.
.np
If the last movement command was an
.keyword F
then an
.keyword f
movement command is executed.
If the last movement command was a
.keyword t
then a
.keyword T
movement command is executed.
.np
Similarly, if the last movement
command was an
.keyword f
then an
.keyword F
movement command is executed.
If the last movement command was a
.keyword t
then a
.keyword T
movement command is executed.
.endkey
.begkey - <.n>.- (dash)
Moves the cursor to the start of the previous line. If a repeat count
.param <.n>.
is specified, then you are moved up
.param <.n>.
lines.
.endkey
.begkey + <.n>.+ (plus)
Moves the cursor to the start of the next line. If a repeat count
.param <.n>.
is specified, then you are moved down
.param <.n>.
lines.
.endkey
.begkey '0' '0'
Moves the cursor the first character of the current line.
.endkey
.begkey CTRL_PAGEUP CTRL_PAGEUP
Moves to the first non-white space character on the first line
of the current edit buffer.
.endkey
.begkey CTRL_PAGEDOWN CTRL_PAGEDOWN
Moves to the last character on the last line
of the current edit buffer.
.endkey
.begkey DOWN <.n>.DOWN
Move the cursor down one line.
.param <.n>.
is specified, the cursor moves down
.param <.n>.
lines.
.endkey
.begkey END END
Moves the cursor to the last character on the current line.
.endkey
.begkey ENTER <.n>.ENTER
Moves the cursor to the start of the next line. If a repeat count
.param <.n>.
is specified, then the cursor is moved down
.param <.n>.
lines.
.endkey
.begkey HOME HOME
Moves the cursor the first character of the current line.
.endkey
.begkey LEFT <.n>.LEFT
Move the cursor left one character. If
.param <.n>.
is specified, the cursor moves left
.param <.n>.
characters.
.endkey
.begkey PAGEDOWN <.n>.PAGEDOWN
Moves forwards one page. If a repeat count
.param <.n>.
is specified, then you are moved ahead
.param <.n>.
pages.
The number of lines of context maintained
is controlled by the
.keyref pagelinesexposed
setting.
.endkey
.begkey PAGEUP <.n>.PAGEUP
Moves backwards one page. If a repeat count
.param <.n>.
is specified, then you are moved back
.param <.n>.
pages.
The number of lines of context maintained
is controlled by the
.keyref pagelinesexposed
setting.
.endkey
.begkey RIGHT <.n>.RIGHT
Move the cursor right one character. If
.param <.n>.
is specified, the cursor moves right
.param <.n>.
characters.
.endkey
.begkey SHIFT_TAB <.n>.SHIFT_TAB
Moves the cursor left by
.keyref tabamount
characters. A repeat count
.param <.n>.
multiplies this.
.endkey
.begkey TAB <.n>.TAB
Moves the cursor right by
.keyref tabamount
characters. A repeat count
.param <.n>.
multiplies this.
.endkey
.begkey UP <.n>.UP
Move the cursor up one line.
.param <.n>.
is specified, the cursor moves up
.param <.n>.
lines.
.endkey
.begkey CTRL_B <.n>.CTRL_B
Moves backwards one page. If a repeat count
.param <.n>.
is specified, then you are moved back
.param <.n>.
pages.
The number of lines of context maintained
is controlled by the
.keyref pagelinesexposed
setting.
.endkey
.begkey CTRL_D <.n>.CTRL_D
Move down a certain number of lines. The default is to move down
half a page. If the repeat count
.param <.n>.
is specified, then that becomes the number of lines moved from then on.
Also see the
.param CTRL_U
key.
.endkey
.begkey CTRL_E <.n>.CTRL_E
Expose the line below the last line in the current edit window,
leaving the cursor on the same line if possible. If a repeat
count
.param <.n>.
is specified, then that many lines are exposed.
.endkey
.begkey CTRL_F <.n>.CTRL_F
Moves forwards one page. If a repeat count
.param <.n>.
is specified, then you are moved ahead
.param <.n>.
pages.
The number of lines of context maintained
is controlled by the
.keyref pagelinesexposed
setting.
.endkey
.begkey CTRL_N <.n>.CTRL_N
Move the cursor to the next line. If a repeat count
.param <.n>.
is specified, then you are moved down
.param <.n>.
lines.
.endkey
.begkey CTRL_P <.n>.CTRL_P
Move the cursor to the previous line. If a repeat count
.param <.n>.
is specified, then you are moved up
.param <.n>.
lines.
.endkey
.begkey CTRL_U <.n>.CTRL_U
Move up a certain number of lines. The default is to move up
half a page. If the repeat count
.param <.n>.
is specified, then that becomes the number of lines moved from then on.
Also see the
.keyword CTRL_D
key.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -