📄 vi.summary
字号:
.\" Copyright (c) 1980, 1993.\" The Regents of the University of California. All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)vi.summary 8.1 (Berkeley) 6/8/93.\".ds CH.ds CF.de TS.br.if !\\n(1T .RT.ul 0.ti \\n(.iu.if t .sp 0.25.if n .sp.if \\$1H .TQ.nr IX 1...nr PS 9.ps 9.nr VS 11.vs 11.nr HM .50i.nr FM .25i.nr PO 0.po 0.nr LL 3.5i.ll 3.5i.de nc.bp...de h.LG.B\\$1.R.NL...LG.LG.B.ceEx Quick Reference.R.NL.LP.LP.h "Entering/leaving ex".TSaw(1.4i)b aw(1.8i).% ex \fIname\fP edit \fIname\fP, start at end% ex +\fIn\fP \fIname\fP ... at line \fIn\fP% ex \-t \fItag\fP start at \fItag\fP% ex \-r list saved files% ex \-r \fIname\fP recover file \fIname\fP% ex \fIname\fP ... edit first; rest via \fB:n\fP% ex \-R \fIname\fP read only mode: x exit, saving changes: q! exit, discarding changes.TE.h "Ex states".TSlw(1i) lw(2.0i).Command T{Normal and initial state. Input prompted for by \fB:\fP.Your kill character cancels partial command.T}Insert T{Entered by \fBa\fP \fBi\fP and \fBc\fP.Arbitrary text then terminates with line having only \fB.\fPcharacter on it or abnormally with interrupt.T}Open/visual T{Entered by \fBopen\fP or \fBvi\fP, terminates with \fBQ\fPor ^\e.T}.TE.h "Ex commands".TSlw(.45i) lw(.08i)b lw(.45i) lw(.08i)b lw(.45i) lw(.08i)b.abbrev ab next n unabbrev unaappend a number nu undo uargs ar open o unmap unmchange c preserve pre version vecopy co print p visual videlete d put pu write wedit e quit q xit xfile f read re yank yaglobal g recover rec \fIwindow\fP zinsert i rewind rew \fIescape\fP !join j set se \fIlshift\fP <list l shell sh \fIprint next\fP \fRCR\fPmap source so \fIresubst\fP &mark ma stop st \fIrshift\fP >move m substitute s \fIscroll\fP ^D.TE.h "Ex command addresses".TSlw(.3i)b lw(0.8i) lw(.3i)b lw(0.8i).\fIn\fP line \fIn\fP /\fIpat\fP next with \fIpat\fP\&. current ?\fIpat\fP previous with \fIpat\fP$ last \fIx\fP-\fIn\fP \fIn\fP before \fIx\fP+ next \fIx\fP,\fIy\fP \fIx\fP through \fIy\fP\- previous \(aa\fIx\fP marked with \fIx\fP+\fIn\fP \fIn\fP forward \(aa\(aa previous context% 1,$.TE.nc.h "Specifying terminal type".TSaw(1.7i)b aw(1.5i).% setenv TERM \fItype\fP \fIcsh\fP and all version 6$ TERM=\fItype\fP; export TERM \fIsh\fP in Version 7See also \fItset\fR(1).TE.h "Some terminal types".TSlw(.4i) lw(.4i) lw(.4i) lw(.4i) lw(.4i).2621 43 adm31 dw1 h192645 733 adm3a dw2 i100300s 745 c100 gt40 mime33 act4 dm1520 gt42 owl37 act5 dm2500 h1500 t10614014 adm3 dm3025 h1510 vt52.TE.h "Initializing options".TSlw(.9i)b aw(1.5i).EXINIT place \fBset\fP's here in environment var.set \fIx\fP enable optionset no\fIx\fP disable optionset \fIx\fP=\fIval\fP give value \fIval\fPset show changed optionsset all show all optionsset \fIx\fP? show value of option \fIx\fP.TE.h "Useful options".TSlw(.9i)b lw(.3i) lw(1.0i).autoindent ai supply indentautowrite aw write before changing filesignorecase ic in scanninglisp \fB( ) { }\fP are s-exp'slist print ^I for tab, $ at endmagic \fB. [ *\fP special in patternsnumber nu number linesparagraphs para macro names which start ...redraw simulate smart terminalscroll command mode linessections sect macro names ...shiftwidth sw for \fB< >\fP, and input \fB^D\fPshowmatch sm to \fB)\fP and \fB}\fP as typedslowopen slow choke updates during insertwindow visual mode lineswrapscan ws around end of buffer?wrapmargin wm automatic line splitting.TE.LP.h "Scanning pattern formation".TSaw(.9i)b aw(1.0i).\(ua beginning of line$ end of line\fB.\fR any character\e< beginning of word\e> end of word[\fIstr\fP] any char in \fIstr\fP[\(ua\fIstr\fP] ... not in \fIstr\fP[\fIx\-y\fP] ... between \fIx\fP and \fIy\fP* any number of preceding.TE.nc.LP.LG.LG.B.ceVi Quick Reference.NL.R.LP.LP.h "Entering/leaving vi".TSaw(1.4i)b aw(1.8i).% vi \fIname\fP edit \fIname\fP at top% vi +\fIn\fP \fIname\fP ... at line \fIn\fP% vi + \fIname\fP ... at end% vi \-r list saved files% vi \-r \fIname\fP recover file \fIname\fP% vi \fIname\fP ... edit first; rest via \fB:n\fP% vi \-t \fItag\fP start at \fItag\fP% vi +/\fIpat\fP \fIname\fP search for \fIpat\fP% view \fIname\fP read only modeZZ exit from vi, saving changes^Z stop vi for later resumption.TE.h "The display".TSlw(.75i) lw(2.2i).Last line T{Error messages, echoing input to \fB: / ?\fP and \fB!\fR,feedback about i/o and large changes.T}@ lines On screen only, not in file.~ lines Lines past end of file.^\fIx\fP Control characters, ^? is delete.tabs Expand to spaces, cursor at last..TE.LP.h "Vi states".TSlw(.75i) lw(2.2i).Command T{Normal and initial state. Others return here.ESC (escape) cancels partial command.T}Insert T{Entered by \fBa i A I o O c C s S\fP \fBR\fP.Arbitrary text then terminates with ESC character,or abnormally with interrupt.T}Last line T{Reading input for \fB: / ?\fP or \fB!\fP; terminatewith ESC or CR to execute, interrupt to cancel.T}.TE.h "Counts before vi commands".TSlw(1.5i) lw(1.7i)b.line/column number z G | scroll amount ^D ^Ureplicate insert a i A Irepeat effect \fRmost rest\fP.TE.h "Simple commands".TSlw(1.5i)b lw(1.7i).dw delete a wordde ... leaving punctuationdd delete a line3dd ... 3 linesi\fItext\fP\fRESC\fP insert text \fIabc\fPcw\fInew\fP\fRESC\fP change word to \fInew\fPea\fIs\fP\fRESC\fP pluralize wordxp transpose characters.TE.nc.h "Interrupting, cancelling".TSaw(0.75i)b aw(1.6i).ESC end insert or incomplete cmd^? (delete or rubout) interrupts^L reprint screen if \fB^?\fR scrambles it.TE.h "File manipulation".TSaw(0.75i)b aw(1.6i).:w write back changes:wq write and quit:q quit:q! quit, discard changes:e \fIname\fP edit file \fIname\fP:e! reedit, discard changes:e + \fIname\fP edit, starting at end:e +\fIn\fR edit starting at line \fIn\fR:e # edit alternate file^\(ua synonym for \fB:e #\fP:w \fIname\fP write file \fIname\fP:w! \fIname\fP overwrite file \fIname\fP:sh run shell, then return:!\fIcmd\fP run \fIcmd\fR, then return:n edit next file in arglist:n \fIargs\fP specify new arglist:f show current file and line^G synonym for \fB:f\fP:ta \fItag\fP to tag file entry \fItag\fP^] \fB:ta\fP, following word is \fItag\fP.TE.h "Positioning within file".TSaw(0.75i)b aw(1.6i).^F forward screenfull^B backward screenfull^D scroll down half screen^U scroll up half screenG goto line (end default)/\fIpat\fR next line matching \fIpat\fR?\fIpat\fR prev line matching \fIpat\fRn repeat last \fB/\fR or \fB?\fRN reverse last \fB/\fR or \fB?\fR/\fIpat\fP/+\fIn\fP n'th line after \fIpat\fR?\fIpat\fP?\-\fIn\fP n'th line before \fIpat\fR]] next section/function[[ previous section/function% find matching \fB( ) {\fP or \fB}\fP.TE.h "Adjusting the screen".TSaw(0.75i)b aw(1.6i).^L clear and redraw^R retype, eliminate @ linesz\fRCR\fP redraw, current at window topz\- ... at bottomz\|. ... at center/\fIpat\fP/z\- \fIpat\fP line at bottomz\fIn\fP\|. use \fIn\fP line window^E scroll window down 1 line^Y scroll window up 1 line.TE.nc.h "Marking and returning.TSaw(0.5i)b aw(2.0i).\(ga\(ga previous context\(aa\(aa ... at first non-white in linem\fIx\fP mark position with letter \fIx\fP\(ga\fIx\fP to mark \fIx\fP\(aa\fIx\fP ... at first non-white in line.TE.h "Line positioning".TSaw(0.5i)b aw(2.0i).H home window lineL last window lineM middle window line+ next line, at first non-white\- previous line, at first non-white\fRCR\fP return, same as +\(da \fRor\fP j next line, same column\(ua \fRor\fP k previous line, same column.TE.h "Character positioning".TSaw(0.5i)b aw(2.0i).\(ua first non white0 beginning of line$ end of lineh \fRor\fP \(-> forwardl \fRor\fP \(<- backwards^H same as \fB\(<-\fP\fRspace\fP same as \fB\(->\fPf\fIx\fP find \fIx\fP forwardF\fIx\fP \fBf\fR backwardt\fIx\fP upto \fIx\fP forwardT\fIx\fP back upto \fIx\fP; repeat last \fBf F t\fP or \fBT\fP, inverse of \fB;\fP| to specified column% find matching \fB( { )\fP or \fB}\fR.TE.h "Words, sentences, paragraphs".TSaw(0.5i)b aw(2.0i).w word forwardb back worde end of word) to next sentence} to next paragraph( back sentence{ back paragraphW blank delimited wordB back \fBW\fPE to end of \fBW\fP.TE.h "Commands for \s-2LISP\s0".TSaw(0.5i)b aw(2.0i).) Forward s-expression} ... but don't stop at atoms( Back s-expression{ ... but don't stop at atoms.TE.nc.h "Corrections during insert".TSaw(.5i)b aw(2.0i).^H erase last character^W erases last word\fRerase\fP your erase, same as \fB^H\fP\fRkill\fP your kill, erase input this line\e escapes \fB^H\fR, your erase and kill\fRESC\fP ends insertion, back to command^? interrupt, terminates insert^D backtab over \fIautoindent\fP\(ua^D kill \fIautoindent\fP, save for next0^D ... but at margin next also^V quote non-printing character.TE.h "Insert and replace".TSaw(.5i)b aw(2.0i).a append after cursori insert beforeA append at end of lineI insert before first non-blanko open line belowO open abover\fIx\fP replace single char with \fIx\fPR replace characters.TE.h "Operators (double to affect lines)".TSaw(0.5i)b aw(2.0i).d deletec change< left shift> right shift! filter through command\&\= indent for \s-2LISP\s0y yank lines to buffer.TE.h "Miscellaneous operations".TSaw(0.5i)b aw(2.0i).C change rest of lineD delete rest of lines substitute charsS substitute linesJ join linesx delete charactersX ... before cursorY yank lines.TE.h "Yank and put".TSaw(0.5i)b aw(2.0i).p put back linesP put before"\fIx\fPp put from buffer \fIx\fP"\fIx\fPy yank to buffer \fIx\fP"\fIx\fPd delete into buffer \fIx\fP.TE.h "Undo, redo, retrieve".TSaw(0.5i)b aw(2.0i).u undo last changeU restore current line\fB.\fP repeat last change"\fId\fP\|p retrieve \fId\fP'th last delete.TE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -