📄 vi.1
字号:
.\" SCCSID: @(#)vi.1 8.1 9/11/90.TH vi 1.SH Namevi \- screen editor.SH Syntax .B vi[.B \-t.I tag] [.BI + command] [.B \-l] [.B \-r] [.BI \-w n] [.B \-x].I name....SH Description.NX R "encryption" "vi screen editor" .NX R "editors" "vi (screen)" .NX R "vi (screen) editor" The.PN vi(visual) editor is a display-oriented text editor based on.MS ex 1 .The.PN excommand and the.PN vicommand run the same code. You can access the command mode of.PN exfrom within.PN vi ..PPThe following is a list of some of the .PN vi commands. See the\fIvi Beginner's Reference Card\fPand "An Introduction to Display Editing with vi" in the\fISupplementary Documents, Volume 1: General User\fPfor more details on using.PN vi ..PP.B Screen Control Commands.RS 5.IP <CTRL/L> 13 Reprints current screen..IP <CTRL/Y> Exposes one more line at top of screen..IP <CTRL/E> Exposes one more line at bottom of screen..RE.PP.B Paging Commands.RS 5.IP <CTRL/F> 13Pages forward one screen..IP <CTRL/B>Pages back one screen..IP <CTRL/D>Pages down half screen..IP <CTRL/U>Pages up half screen..RE.PP.B Cursor Positioning Commands.RS 5.IP j 13Moves cursor down one line, same column..IP kMoves cursor up one line, same column..IP hMoves cursor back one character..IP lMoves cursor forward one character..IP <RETURN>Moves cursor to beginning of next line..IP 0Moves cursor to beginning of current line..IP $Moves cursor to end of current line..IP <SPACE>Moves cursor forward one character..TP 13.IB n GMoves cursor to beginning of line.I n.Default is last line of file..TP.BI / patternMoves cursor forward to next occurrence of.I pattern..TP.BI ? patternMoves cursor backward to next occurrence of .I pattern..IP nRepeats last / or ? pattern search..RE.PP.B Text Insertion Commands.RS 5.IP a 13Appends text after cursor. Terminated by <ESC>..IP AAppends text at the end of the line. Terminated by <ESC>..IP iInserts text before cursor. Terminated by <ESC>..IP IInserts text at the beginning of the line. Terminated by <ESC>..IP oOpens new line below the current line for text insertion. Terminated by <ESC>..IP OOpens new line above the current line for text insertion. Terminated by <ESC>..IP <DELETE>Overwrites last character during text insertion..IP <ESC> Stops text insertion. .RE.PP.B Text Deletion Commands.RS 5.IP dw 13 Deletes current word..IP xDeletes current character..IP ddDeletes current line..IP "D, d$"Deletes from cursor to end of line. .IP PPuts back text from the previous delete..RE.PP.B Text Change Commands.RS 5.IP cw 13Changes characters of current word until stopped with escape key..IP c$Changes text up to the end of the line..IP "C, c$"Changes remaining text on current line until stopped bypressing the escape key. .IP ~Changes case of current character..IP xpTransposes current and following characters. .IP JJoins current line with next line..TP 13.BI r xReplaces current character with.I x..RE.PP.B Buffer Usage Commands.RS 5.TP 13.IB "[a\-z]n yyYanks.I nlines to the.I [a\-z]buffer. Default is current line..TP.IB "[a\-z]n pPuts.I nyanked text lines from the.I a\-zbuffer, after the cursor..RE.PP.B Exiting vi.RS 5.IP ZZ 13Exits .PN vi and saves changes.IP :wqWrites changes to current file and quits edit session..IP :qQuits edit session (no changes made)..RE.PPThe.PN viewcommand uses all of the same edit or commands as.PN vi .However,.PN viewdoes not allow you to write the file. See.MS view 1 ..SH Options.TP 10.BI \-t \ tagSpecifies a list of .I tagfiles. The.I tagfiles are preceded by a backslash (\e)and are separated by spaces. The .I tagoption should always be the first entry..TP.BI + commandTells the editor to begin by executing the specified .I command.A useful example would be.RI +/ patternto search for a .I pattern..IP \-lSets the showmatch and lisp options for editing LISP code..TP.BI \-r \ nameRetrieves the last saved version of the .IR name 'dfile in the event of an editor or system crash. If no file isspecified, a list of saved files is produced..TP.BI \-w nSets the default window size to.I n.This option is useful for starting in a small window on dialups..NTThe .B \-xoption is available only if the Encryption layered product is installed..NE.IP \-x 10Causes .PN vito prompt for a .I key.The .I keyis used to encrypt and decrypt the contents of the file. If the file contents have been encrypted with one .IR key ,you must use the same .I key to decrypt the file..SH Restrictions Software tabs using.B ^Twork only immediately after the.I autoindent..PPLeft and right shifts on intelligent terminals do not make use ofinsert and delete character operations in the terminal..PPThe.I wrapmarginoption sometimes works incorrectly because itlooks at output columns when blanks are typed.If a long word passes through the margin and ontothe next line without a break, then the line is not broken..PPInsert/delete within a line can be slowif tabs are present on intelligentterminals, since the terminals need help in doing this correctly..PPSaving text on deletes in the named buffers is somewhat inefficient..PPThe.I sourcecommand does not work when executed as.BR :source ;there is no way to use the.BR :append ,.BR :change ,and.BR :insertcommands, since it is not possible to give on a.BR :globalyou must.B Qto.PN excommand mode, execute them, and then reenter the screen editor with.PN vior.PN open ..SH See Alsoed(1), ex(1), view(1).br\fIThe Little Gray Book: An ULTRIX Primer\fP.br\fIThe Big Gray Book: The Next Step with ULTRIX\fP.br"An Introduction to Display Editing with Vi",\fISupplementary Documents, Volume 1: General User\fP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -