ExReferenceManual Version3.5/2.13−−September,1980 WilliamJoy Revisedforversions3.5/2.13by MarkHorton ComputerScienceDivision DepartmentofElectricalEngineeringandComputerScience UniversityofCalifornia,Berkeley Berkeley,Ca.94720 ABSTRACT Exalineorientedtexteditor,whichsupportsbothcommandanddisplay orientedediting.Thisreferencemanualdescribesthecommandorientedpartof ex;thedisplayeditingfeaturesofexaredescribedinAnIntroductiontoDisplay EditingwithVi.OtherdocumentsabouttheeditorincludetheintroductionEdit: Atutorial,theEx/editCommandSummary,andaViQuickReferencecard. 6April1993 ExReferenceManual Version3.5/2.13−−September,1980 WilliamJoy Revisedforversions3.5/2.13by MarkHorton ComputerScienceDivision DepartmentofElectricalEngineeringandComputerScience UniversityofCalifornia,Berkeley Berkeley,Ca.94720 1.Startingex Eachinstanceoftheeditorhasasetofoptions,whichcanbesettotailorittoyourliking. Thecommandeditinvokesaversionofexdesignedformorecasualorbeginningusersbychanging thedefaultsettingsofsomeoftheseoptions.Tosimplifythedescriptionwhichfollowsweassume thedefaultsettingsoftheoptions. Wheninvoked,exdeterminestheterminaltypefromtheTERMvariableintheenvironment. ItthereisaTERMCAPvariableintheenvironment,andthetypeoftheterminaldescribedthere matchestheTERMvariable,thenthatdescriptionisused.AlsoiftheTERMCAPvariablecontains apathname(beginningwitha/)thentheeditorwillseekthedescriptionoftheterminalinthat file(ratherthanthedefault/etc/termcap.)IfthereisavariableEXINITintheenvironment,then theeditorwillexecutethecommandsinthatvariable,otherwiseifthereisafile.exrcinyour HOMEdirectoryexreadscommandsfromthatfile,simulatingasourcecommand.Optionsetting commandsplacedinEXINITor.exrcwillbeexecutedbeforeeacheditorsession. Acommandtoenterexhasthefollowingprototype:† ex[−−][−−v][−−ttag][−−r][−−l][−−wn][−−x][−−R][+command]name... Themostcommoncaseeditsasinglefilewithnooptions,i.e.: exname The−−commandlineoptionoptionsuppressesallinteractive-userfeedbackandisusefulinpro-cessingeditorscriptsincommandfiles.The−−voptionisequivalenttousingviratherthanex. The−−toptionisequivalenttoaninitialtagcommand,editingthefilecontainingthetagand positioningtheeditoratitsdefinition.The−−roptionisusedinrecoveringafteraneditororsystemcrash,retrievingthelastsavedversionofthenamedfileor,ifnofileisspecified,typingalist ofsavedfiles.The−−loptionsetsupforeditingLISP,settingtheshowmatchandlispoptions. The−−woptionsetsthedefaultwindowsizeton,andisusefulondialupstostartinsmallwindows.The−−xoptioncausesextopromptforakey,whichisusedtoencryptanddecryptthe contentsofthefile,whichshouldalreadybeencryptedusingthesamekey,seecrypt(1).The−−R optionsetsthereadonlyoptionatthestart.‡Nameargumentsindicatefilestobeedited.An argumentoftheform+commandindicatesthattheeditorshouldbeginbyexecutingthespecified command.Ifcommandisomitted,thenitdefaultsto‘‘$’’,positioningtheeditoratthelastlineof thefirstfileinitially.Otherusefulcommandsherearescanningpatternsoftheform‘‘/pat’’or ThefinancialsupportofanIBMGraduateFellowshipandtheNationalScienceFoundationunder grantsMCS74-07644-A03andMCS78-07291isgratefullyacknowledged. †Brackets‘[’‘]’surroundoptionalparametershere. ‡Notavailableinallv2editorsduetomemoryconstraints.

-2-linenumbers,e.g.‘‘+100’’startingatline100. 2.Filemanipulation 2.1.Currentfile Exisnormallyeditingthecontentsofasinglefile,whosenameisrecordedinthecurrentfile name.Experformsalleditingactionsinabuffer(actuallyatemporaryfile)intowhichthetextof thefileisinitiallyread.Changesmadetothebufferhavenoeffectonthefilebeingeditedunless anduntilthebuffercontentsarewrittenouttothefilewithawritecommand.Afterthebuffer contentsarewritten,thepreviouscontentsofthewrittenfilearenolongeraccessible.Whenafile isedited,itsnamebecomesthecurrentfilename,anditscontentsarereadintothebuffer. Thecurrentfileisalmostalwaysconsideredtobeedited.Thismeansthatthecontentsof thebufferarelogicallyconnectedwiththecurrentfilename,sothatwritingthecurrentbuffer contentsontothatfile,evenifitexists,isareasonableaction.Ifthecurrentfileisnoteditedthen exwillnotnormallywriteonitifitalreadyexists.* 2.2.Alternatefile Eachtimeanewvalueisgiventothecurrentfilename,thepreviouscurrentfilenameis savedasthealternatefilename.Similarlyifafileismentionedbutdoesnotbecomethecurrent file,itissavedasthealternatefilename. 2.3.Filenameexpansion Filenameswithintheeditormaybespecifiedusingthenormalshellexpansionconventions. Inaddition,thecharacter‘%’infilenamesisreplacedbythecurrentfilenameandthecharacter ‘#’bythealternatefilename.† 2.4.Multiplefilesandnamedbuffers Ifmorethanonefileisgivenonthecommandline,thenthefirstfileiseditedasdescribed above.Theremainingargumentsareplacedwiththefirstfileintheargumentlist.Thecurrent argumentlistmaybedisplayedwiththeargscommand.Thenextfileintheargumentlistmay beeditedwiththenextcommand.Theargumentlistmayalsoberespecifiedbyspecifyingalist ofnamestothenextcommand.Thesenamesareexpanded,theresultinglistofnamesbecomes thenewargumentlist,andexeditsthefirstfileonthelist. Forsavingblocksoftextwhileediting,andespeciallywheneditingmorethanonefile,ex hasagroupofnamedbuffers.Thesearesimilartothenormalbuffer,exceptthatonlyalimited numberofoperationsareavailableonthem.Thebuffershavenamesathroughz.‡ 2.5.Readonly Itispossibletouseexinreadonlymodetolookatfilesthatyouhavenointentionofmodifying.Thismodeprotectsyoufromaccidentlyoverwritingthefile.Readonlymodeisonwhen thereadonlyoptionisset.Itcanbeturnedonwiththe−−Rcommandlineoption,bytheview commandlineinvocation,orbysettingthereadonlyoption.Itcanbeclearedbysettingnoreadonly.Itispossibletowrite,evenwhileinreadonlymode,byindicatingthatyoureallyknow whatyouaredoing.Youcanwritetoadifferentfile,orcanusethe!formofwrite,evenwhilein readonlymode. *Thefilecommandwillsay‘‘[Notedited]’’ifthecurrentfileisnotconsiderededited. †Thismakesiteasytodealalternatelywithtwofilesandeliminatestheneedforretypingthename suppliedonaneditcommandafteraNowritesincelastchangediagnosticisreceived. ‡ItisalsopossibletorefertoAthroughZ;theuppercasebuffersarethesameasthelowerbutcommandsappendtonamedbuffersratherthanreplacingifuppercasenamesareused.

-3-3.ExceptionalConditions 3.1.Errorsandinterrupts Whenerrorsoccurex(optionally)ringstheterminalbelland,inanycase,printsanerror diagnostic.Iftheprimaryinputisfromafile,editorprocessingwillterminate.Ifaninterrupt signalisreceived,exprints‘‘Interrupt’’andreturnstoitscommandlevel.Iftheprimaryinputis afile,thenexwillexitwhenthisoccurs. 3.2.Recoveringfromhangupsandcrashes Ifahangupsignalisreceivedandthebufferhasbeenmodifiedsinceitwaslastwrittenout, orifthesystemcrashes,eithertheeditor(inthefirstcase)orthesystem(afteritrebootsinthe second)willattempttopreservethebuffer.Thenexttimeyouloginyoushouldbeableto recovertheworkyouweredoing,losingatmostafewlinesofchangesfromthelastpointbefore thehanguporeditorcrash.Torecoverafileyoucanusethe−−roption.Ifyouwereeditingthe fileresume,thenyoushouldchangetothedirectorywhereyouwerewhenthecrashoccurred,givingthecommand ex−−rresume Aftercheckingthattheretrievedfileisindeedok,youcanwriteitoverthepreviouscontentsof thatfile. Youwillnormallygetmailfromthesystemtellingyouwhenafilehasbeensavedaftera crash.Thecommand ex−r willprintalistofthefileswhichhavebeensavedforyou.(Inthecaseofahangup,thefilewill notappearinthelist,althoughitcanberecovered.) 4.Editingmodes Exhasfivedistinctmodes.Theprimarymodeiscommandmode.Commandsareentered incommandmodewhena‘:’promptispresent,andareexecutedeachtimeacompletelineis sent.Intextinputmodeexgathersinputlinesandplacestheminthefile.Theappend,insert, andchangecommandsusetextinputmode.Nopromptisprintedwhenyouareintextinput mode.Thismodeisleftbytypinga‘.’aloneatthebeginningofaline,andcommandmode resumes. Thelastthreemodesareopenandvisualmodes,enteredbythecommandsofthesame name,and,withinopenandvisualmodestextinsertionmode.Openandvisualmodesallowlocal editingoperationstobeperformedonthetextinthefile.Theopencommanddisplaysonelineat atimeonanyterminalwhilevisualworksonCRTterminalswithrandompositioningcursors, usingthescreenasa(single)windowforfileeditingchanges.Thesemodesaredescribed(only)in AnIntroductiontoDisplayEditingwithVi. 5.Commandstructure MostcommandnamesareEnglishwords,andinitialprefixesofthewordsareacceptable abbreviations.Theambiguityofabbreviationsisresolvedinfavorofthemorecommonlyused commands.* 5.1.Commandparameters Mostcommandsacceptprefixaddressesspecifyingthelinesinthefileuponwhichtheyare tohaveeffect.Theformsoftheseaddresseswillbediscussedbelow.Anumberofcommandsalso *Asanexample,thecommandsubstitutecanbeabbreviated‘s’whiletheshortestavailableabbreviationforthesetcommandis‘se’.

-4-maytakeatrailingcountspecifyingthenumberoflinestobeinvolvedinthecommand.†Thus thecommand‘‘10p’’willprintthetenthlineinthebufferwhile‘‘delete5’’willdeletefivelines fromthebuffer,startingwiththecurrentline. Somecommandstakeotherinformationorparameters,thisinformationalwaysbeinggiven afterthecommandname.‡ 5.2.Commandvariants Anumberofcommandshavetwodistinctvariants.Thevariantformofthecommandis invokedbyplacingan‘!’immediatelyafterthecommandname.Someofthedefaultvariantsmay becontrolledbyoptions;inthiscase,the‘!’servestotogglethedefault. 5.3.Flagsaftercommands Thecharacters‘#’,‘p’and‘l’maybeplacedaftermanycommands.**Inthiscase,the commandabbreviatedbythesecharactersisexecutedafterthecommandcompletes.Sinceex normallyprintsthenewcurrentlineaftereachchange,‘p’israrelynecessary.Anynumberof‘+’ or‘−’charactersmayalsobegivenwiththeseflags.Iftheyappear,thespecifiedoffsetisapplied tothecurrentlinevaluebeforetheprintingcommandisexecuted. 5.4.Comments Itispossibletogiveeditorcommandswhichareignored.Thisisusefulwhenmakingcomplexeditorscriptsforwhichcommentsaredesired.Thecommentcharacteristhedoublequote: ".Anycommandlinebeginningwith"isignored.Commentsbeginningwith"mayalsobe placedattheendsofcommands,exceptincaseswheretheycouldbeconfusedaspartoftext (shellescapesandthesubstituteandmapcommands). 5.5.Multiplecommandsperline Morethanonecommandmaybeplacedonalinebyseparatingeachpairofcommandsbya ‘|’character.Howevertheglobalcommands,comments,andtheshellescape‘!’mustbethelast commandonaline,astheyarenotterminatedbya‘|’. 5.6.Reportinglargechanges Mostcommandswhichchangethecontentsoftheeditorbuffergivefeedbackifthescopeof thechangeexceedsathresholdgivenbythereportoption.Thisfeedbackhelpstodetectundesirablylargechangessothattheymaybequicklyandeasilyreversedwithanundo.Aftercommandswithmoreglobaleffectsuchasglobalorvisual,youwillbeinformedifthenetchangein thenumberoflinesinthebufferduringthiscommandexceedsthisthreshold. 6.Commandaddressing 6.1.Addressingprimitives .Thecurrentline.Mostcommandsleavethecurrentlineasthelastline whichtheyaffect.Thedefaultaddressformostcommandsisthecurrent line,thus‘.’israrelyusedaloneasanaddress. nThenthlineintheeditor’sbuffer,linesbeingnumberedsequentiallyfrom 1. $Thelastlineinthebuffer. †Countsareroundeddownifnecessary. ‡Exampleswouldbeoptionnamesinasetcommandi.e.‘‘setnumber’’,afilenameinaneditcommand,aregularexpressioninasubstitutecommand,oratargetaddressforacopycommand,i.e.‘‘1,5 copy25’’. **A‘p’or‘l’mustbeprecededbyablankortabexceptinthesinglespecialcase‘dp’.

-5- %Anabbreviationfor‘‘1,$’’,theentirebuffer. +n−nAnoffsetrelativetothecurrentbufferline.† /pat/?pat?Scanforwardandbackwardrespectivelyforalinecontainingpat,aregular expression(asdefinedbelow).Thescansnormallywraparoundtheendof thebuffer.Ifallthatisdesiredistoprintthenextlinecontainingpat, thenthetrailing/or?maybeomitted.Ifpatisomittedorexplicitly empty,thenthelastregularexpressionspecifiedislocated.‡ ´´´ xBeforeeachnon-relativemotionofthecurrentline‘.’,thepreviouscurrent lineismarkedwithatag,subsequentlyreferredtoas‘´ ´ ’.Thismakesit easytoreferorreturntothispreviouscontext.Marksmayalsobeestablishedbythemarkcommand,usingsinglelowercaselettersxandthe markedlinesreferredtoas‘´ x’. 6.2.Combiningaddressingprimitives Addressestocommandsconsistofaseriesofaddressingprimitives,separatedby‘,’or‘;’. Suchaddresslistsareevaluatedleft-to-right.Whenaddressesareseparatedby‘;’thecurrentline ‘.’issettothevalueofthepreviousaddressingexpressionbeforethenextaddressisinterpreted. Ifmoreaddressesaregiventhanthecommandrequires,thenallbutthelastoneortwoare ignored.Ifthecommandtakestwoaddresses,thefirstaddressedlinemustprecedethesecondin thebuffer.† 7.Commanddescriptions Thefollowingformisaprototypeforallexcommands: addresscommand!parameterscountflags Allpartsareoptional;thedegeneratecaseistheemptycommandwhichprintsthenextlinein thefile.Forsanitywithusefromwithinvisualmode,exignoresa‘‘:’’precedinganycommand. Inthefollowingcommanddescriptions,thedefaultaddressesareshowninparentheses, whicharenot,however,partofthecommand. abbreviatewordrhs abbr:ab Addthenamedabbreviationtothecurrentlist.Whenininputmodeinvisual,ifwordis typedasacompleteword,itwillbechangedtorhs. (.)append abbr:a text . Readstheinputtextandplacesitafterthespecifiedline.Afterthecommand,‘.’addresses thelastlineinputorthespecifiedlineifnolineswereinput.Ifaddress‘0’isgiven,textis placedatthebeginningofthebuffer. a! text . †Theforms‘.+3’‘+3’and‘+++’areallequivalent;ifthecurrentlineisline100theyalladdressline 103. ‡Theforms\\/and\\?scanusingthelastregularexpressionusedinascan;afterasubstitute//and ??wouldscanusingthesubstitute’sregularexpression. †Nulladdressspecificationsarepermittedinalistofaddresses,thedefaultinthiscaseisthecurrent line‘.’;thus‘,100’isequivalentto‘.,100’.Itisanerrortogiveaprefixaddresstoacommandwhich expectsnone.

-6-Thevariantflagtoappendtogglesthesettingfortheautoindentoptionduringtheinputof text. args Themembersoftheargumentlistareprinted,withthecurrentargumentdelimitedby‘[’ and‘]’. (.,.)changecount abbr:c text . Replacesthespecifiedlineswiththeinputtext.Thecurrentlinebecomesthelastline input;ifnolineswereinputitisleftasforadelete. c! text . Thevarianttogglesautoindentduringthechange. (.,.)copyaddrflags abbr:co Acopyofthespecifiedlinesisplacedafteraddr,whichmaybe‘0’.Thecurrentline‘.’ addressesthelastlineofthecopy.Thecommandtisasynonymforcopy. (.,.)deletebuffercountflags abbr:d Removesthespecifiedlinesfromthebuffer.Thelineafterthelastlinedeletedbecomesthe currentline;ifthelinesdeletedwereoriginallyattheend,thenewlastlinebecomesthecurrentline.Ifanamedbufferisspecifiedbygivingaletter,thenthespecifiedlinesaresaved inthatbuffer,orappendedtoitifanuppercaseletterisused. editfile abbr:e exfile Usedtobeginaneditingsessiononanewfile.Theeditorfirstcheckstoseeifthebufferhas beenmodifiedsincethelastwritecommandwasissued.Ifithasbeen,awarningisissued andthecommandisaborted.Thecommandotherwisedeletestheentirecontentsoftheeditorbuffer,makesthenamedfilethecurrentfileandprintsthenewfilename.Afterinsuring thatthisfileissensible†theeditorreadsthefileintoitsbuffer. Ifthereadofthefilecompleteswithouterror,thenumberoflinesandcharactersreadis typed.Iftherewereanynon-ASCIIcharactersinthefiletheyarestrippedoftheirnon-ASCII highbits,andanynullcharactersinthefilearediscarded.Ifnoneoftheseerrorsoccurred, thefileisconsiderededited.Ifthelastlineoftheinputfileismissingthetrailingnewline character,itwillbesuppliedandacomplaintwillbeissued.Thiscommandleavesthecurrentline‘.’atthelastlineread.‡ e!file Thevariantformsuppressesthecomplaintaboutmodificationshavingbeenmadeandnot writtenfromtheeditorbuffer,thusdiscardingallchangeswhichhavebeenmadebefore editingthenewfile. †I.e.,thatitisnotabinaryfilesuchasadirectory,ablockorcharacterspecialfileotherthan /dev/tty,aterminal,orabinaryorexecutablefile(asindicatedbythefirstword). ‡Ifexecutedfromwithinopenorvisual,thecurrentlineisinitiallythefirstlineofthefile.

-7-e+nfile Causestheeditortobeginatlinenratherthanatthelastline;nmayalsobeaneditor commandcontainingnospaces,e.g.:‘‘+/pat’’. file abbr:f Printsthecurrentfilename,whetherithasbeen‘[Modified]’sincethelastwritecommand, whetheritisreadonly,thecurrentline,thenumberoflinesinthebuffer,andthepercentageofthewaythroughthebufferofthecurrentline.* filefile Thecurrentfilenameischangedtofilewhichisconsidered‘[Notedited]’. (1,$)global/pat/cmds abbr:g Firstmarkseachlineamongthosespecifiedwhichmatchesthegivenregularexpression. Thenthegivencommandlistisexecutedwith‘.’initiallysettoeachmarkedline. Thecommandlistconsistsoftheremainingcommandsonthecurrentinputlineandmay continuetomultiplelinesbyendingallbutthelastsuchlinewitha‘\’.Ifcmds(andpossiblythetrailing/delimiter)isomitted,eachlinematchingpatisprinted.Append,insert, andchangecommandsandassociatedinputarepermitted;the‘.’terminatinginputmaybe omittedifitwouldbeonthelastlineofthecommandlist.Openandvisualcommandsare permittedinthecommandlistandtakeinputfromtheterminal. Theglobalcommanditselfmaynotappearincmds.Theundocommandisalsonotpermittedthere,asundoinsteadcanbeusedtoreversetheentireglobalcommand.Theoptions autoprintandautoindentareinhibitedduringaglobal,(andpossiblythetrailing/delimiter) andthevalueofthereportoptionistemporarilyinfinite,indeferencetoareportforthe entireglobal.Finally,thecontextmark‘´ ´ ’issettothevalueof‘.’beforetheglobalcommandbeginsandisnotchangedduringaglobalcommand,exceptperhapsbyanopenor visualwithintheglobal. g!/pat/cmds abbr:v Thevariantformofglobalrunscmdsateachlinenotmatchingpat. (.)insert abbr:i text . Placesthegiventextbeforethespecifiedline.Thecurrentlineisleftatthelastlineinput; iftherewerenoneinputitisleftatthelinebeforetheaddressedline.Thiscommanddiffers fromappendonlyintheplacementoftext. i! text . Thevarianttogglesautoindentduringtheinsert. (.,.+1)joincountflags abbr:j Placesthetextfromaspecifiedrangeoflinestogetherononeline.Whitespaceisadjusted ateachjunctiontoprovideatleastoneblankcharacter,twoiftherewasa‘.’attheendof theline,ornoneifthefirstfollowingcharacterisa‘)’.Ifthereisalreadywhitespaceatthe endoftheline,thenthewhitespaceatthestartofthenextlinewillbediscarded. *Intherarecasethatthecurrentfileis‘[Notedited]’thisisnotedalso;inthiscaseyouhavetouse theformw!towritetothefile,sincetheeditorisnotsurethatawritewillnotdestroyafileunrelatedtothecurrentcontentsofthebuffer.

-8-j! Thevariantcausesasimplerjoinwithnowhitespaceprocessing;thecharactersinthelines aresimplyconcatenated. (.)kx Thekcommandisasynonymformark.Itdoesnotrequireablankortabbeforethefollowingletter. (.,.)listcountflags Printsthespecifiedlinesinamoreunambiguousway:tabsareprintedas‘ˆ I’andtheendof eachlineismarkedwithatrailing‘$’.Thecurrentlineisleftatthelastlineprinted. maplhsrhs Themapcommandisusedtodefinemacrosforuseinvisualmode.Lhsshouldbeasingle character,orthesequence‘‘#n’’,fornadigit,referringtofunctionkeyn.Whenthischaracterorfunctionkeyistypedinvisualmode,itwillbeasthoughthecorrespondingrhshad beentyped.Onterminalswithoutfunctionkeys,youcantype‘‘#n’’.Seesection6.9ofthe ‘‘IntroductiontoDisplayEditingwithVi’’formoredetails. (.)markx Givesthespecifiedlinemarkx,asinglelowercaseletter.Thexmustbeprecededbya blankoratab.Theaddressingform‘´ x’thenaddressesthisline.Thecurrentlineisnot affectedbythiscommand. (.,.)moveaddr abbr:m Themovecommandrepositionsthespecifiedlinestobeafteraddr.Thefirstofthemoved linesbecomesthecurrentline. next abbr:n Thenextfilefromthecommandlineargumentlistisedited. n! Thevariantsuppresseswarningsaboutthemodificationstothebuffernothavingbeenwrittenout,discarding(irretrievably)anychangeswhichmayhavebeenmade. nfilelist n+commandfilelist Thespecifiedfilelistisexpandedandtheresultinglistreplacesthecurrentargumentlist;the firstfileinthenewlististhenedited.Ifcommandisgiven(itmustcontainnospaces),then itisexecutedaftereditingthefirstsuchfile. (.,.)numbercountflags abbr:#ornu Printseachspecifiedlineprecededbyitsbufferlinenumber.Thecurrentlineisleftatthe lastlineprinted. (.)openflags abbr:o (.)open/pat/flags Entersintralineeditingopenmodeateachaddressedline.Ifpatisgiven,thenthecursor willbeplacedinitiallyatthebeginningofthestringmatchedbythepattern.Toexitthis modeuseQ.SeeAnIntroductiontoDisplayEditingwithViformoredetails. ‡ ‡Notavailableinallv2editorsduetomemoryconstraints.

-9-preserve Thecurrenteditorbufferissavedasthoughthesystemhadjustcrashed.Thiscommandis foruseonlyinemergencieswhenawritecommandhasresultedinanerrorandyoudon’t knowhowtosaveyourwork.Afterapreserveyoushouldseekhelp. (.,.)printcount abbr:porP Printsthespecifiedlineswithnon-printingcharactersprintedascontrolcharacters‘ˆ x’; delete(octal177)isrepresentedas‘ˆ ?’.Thecurrentlineisleftatthelastlineprinted. (.)putbuffer abbr:pu Putsbackpreviouslydeletedoryankedlines.Normallyusedwithdeletetoeffectmovement oflines,orwithyanktoeffectduplicationoflines.Ifnobufferisspecified,thenthelast deletedoryankedtextisrestored.*Byusinganamedbuffer,textmayberestoredthatwas savedthereatanyprevioustime. quit abbr:q Causesextoterminate.Noautomaticwriteoftheeditorbuffertoafileisperformed.However,exissuesawarningmessageifthefilehaschangedsincethelastwritecommandwas issued,anddoesnotquit.†Normally,youwillwishtosaveyourchanges,andyoushould giveawritecommand;ifyouwishtodiscardthem,usetheq!commandvariant. q! Quitsfromtheeditor,discardingchangestothebufferwithoutcomplaint. (.)readfile abbr:r Placesacopyofthetextofthegivenfileintheeditingbufferafterthespecifiedline.Ifno fileisgiventhecurrentfilenameisused.Thecurrentfilenameisnotchangedunlessthere isnoneinwhichcasefilebecomesthecurrentname.Thesensibilityrestrictionsfortheedit commandapplyherealso.Ifthefilebufferisemptyandthereisnocurrentnamethenex treatsthisasaneditcommand. Address‘0’islegalforthiscommandandcausesthefiletobereadatthebeginningofthe buffer.Statisticsaregivenasfortheeditcommandwhenthereadsuccessfullyterminates. Afterareadthecurrentlineisthelastlineread.‡ (.)read!command Readstheoutputofthecommandcommandintothebufferafterthespecifiedline.Thisis notavariantformofthecommand,ratherareadspecifyingacommandratherthanafilename;ablankortabbeforethe!ismandatory. recoverfile Recoversfilefromthesystemsavearea.Usedafteraaccidentalhangupofthephone**ora systemcrash**orpreservecommand.Exceptwhenyouusepreserveyouwillbenotifiedby mailwhenafileissaved. *Butnomodifyingcommandsmayintervenebetweenthedeleteoryankandtheput,normaylines bemovedbetweenfileswithoutusinganamedbuffer. †Exwillalsoissueadiagnosticiftherearemorefilesintheargumentlist. ‡Withinopenandvisualthecurrentlineissettothefirstlinereadratherthanthelast. **Thesystemsavesacopyofthefileyouwereeditingonlyifyouhavemadechangestothefile.

-10-rewind abbr:rew Theargumentlistisrewound,andthefirstfileinthelistisedited. rew! Rewindstheargumentlistdiscardinganychangesmadetothecurrentbuffer. setparameter Withnoarguments,printsthoseoptionswhosevalueshavebeenchangedfromtheir defaults;withparameterallitprintsalloftheoptionvalues. Givinganoptionnamefollowedbya‘?’causesthecurrentvalueofthatoptiontobe printed.The‘?’isunnecessaryunlesstheoptionisBooleanvalued.Booleanoptionsare givenvalueseitherbytheform‘setoption’toturnthemonor‘setnooption’toturnthem off;stringandnumericoptionsareassignedviatheform‘setoption=value’. Morethanoneparametermaybegiventoset;theyareinterpretedleft-to-right. shell abbr:sh Anewshelliscreated.Whenitterminates,editingresumes. sourcefile abbr:so Readsandexecutescommandsfromthespecifiedfile.Sourcecommandsmaybenested. (.,.)substitute/pat/repl/optionscountflagsabbr:s Oneachspecifiedline,thefirstinstanceofpatternpatisreplacedbyreplacementpattern repl.Iftheglobalindicatoroptioncharacter‘g’appears,thenallinstancesaresubstituted;if theconfirmindicationcharacter‘c’appears,thenbeforeeachsubstitutionthelinetobesubstitutedistypedwiththestringtobesubstitutedmarkedwith‘↑’characters.Bytypingan ‘y’onecancausethesubstitutiontobeperformed,anyotherinputcausesnochangetotake place.Afterasubstitutethecurrentlineisthelastlinesubstituted. Linesmaybesplitbysubstitutingnew-linecharactersintothem.Thenewlineinreplmust beescapedbyprecedingitwitha‘\’.Othermetacharactersavailableinpatandreplare describedbelow. stop Suspendstheeditor,returningcontroltothetoplevelshell.Ifautowriteissetandthereare unsavedchanges,awriteisdonefirstunlesstheformstop!isused.Thiscommandsisonly availablewheresupportedbytheteletypedriverandoperatingsystem. (.,.)substituteoptionscountflags abbr:s Ifpatandreplareomitted,thenthelastsubstitutionisrepeated.Thisisasynonymforthe &command. (.,.)taddrflags Thetcommandisasynonymforcopy. tatag Thefocusofeditingswitchestothelocationoftag,switchingtoadifferentlineinthecurrentfilewhereitisdefined,orifnecessarytoanotherfile.‡ Thetagsfileisnormallycreatedbyaprogramsuchasctags,andconsistsofanumberof lineswiththreefieldsseparatedbyblanksortabs.Thefirstfieldgivesthenameofthetag, ‡Ifyouhavemodifiedthecurrentfilebeforegivingatagcommand,youmustwriteitout;giving anothertagcommand,specifyingnotagwillreusetheprevioustag.

-11-thesecondthenameofthefilewherethetagresides,andthethirdgivesanaddressingform whichcanbeusedbytheeditortofindthetag;thisfieldisusuallyacontextualscanusing ‘/pat/’tobeimmunetominorchangesinthefile.Suchscansarealwaysperformedasif nomagicwasset. Thetagnamesinthetagsfilemustbesortedalphabetically.‡ unabbreviateword abbr:una Deletewordfromthelistofabbreviations. undo abbr:u Reversesthechangesmadeinthebufferbythelastbuffereditingcommand.Notethat globalcommandsareconsideredasinglecommandforthepurposeofundo(asareopenand visual.)Also,thecommandswriteandeditwhichinteractwiththefilesystemcannotbe undone.Undoisitsowninverse. Undoalwaysmarksthepreviousvalueofthecurrentline‘.’as‘´ ´ ’.Afteranundothecurrentlineisthefirstlinerestoredorthelinebeforethefirstlinedeletedifnolineswere restored.Forcommandswithmoreglobaleffectsuchasglobalandvisualthecurrentline regainsit’spre-commandvalueafteranundo. unmaplhs Themacroexpansionassociatedbymapforlhsisremoved. (1,$)v/pat/cmds Asynonymfortheglobalcommandvariantg!,runningthespecifiedcmdsoneachlinewhich doesnotmatchpat. version abbr:ve Printsthecurrentversionnumberoftheeditoraswellasthedatetheeditorwaslast changed. (.)visualtypecountflags abbr:vi Entersvisualmodeatthespecifiedline.Typeisoptionalandmaybe‘−’,‘↑’or‘.’asin thezcommandtospecifytheplacementofthespecifiedlineonthescreen.Bydefault,if typeisomitted,thespecifiedlineisplacedasthefirstonthescreen.Acountspecifiesan initialwindowsize;thedefaultisthevalueoftheoptionwindow.SeethedocumentAn IntroductiontoDisplayEditingwithViformoredetails.Toexitthismode,typeQ. visualfile visual+nfile Fromvisualmode,thiscommandisthesameasedit. (1,$)writefile abbr:w Writeschangesmadebacktofile,printingthenumberoflinesandcharacterswritten.Normallyfileisomittedandthetextgoesbackwhereitcamefrom.Ifafileisspecified,then textwillbewrittentothatfile.*Ifthefiledoesnotexistitiscreated.Thecurrentfile nameischangedonlyifthereisnocurrentfilename;thecurrentlineisneverchanged. Ifanerroroccurswhilewritingthecurrentandeditedfile,theeditorconsidersthatthere hasbeen‘‘Nowritesincelastchange’’evenifthebufferhadnotpreviouslybeenmodified. ‡Notavailableinallv2editorsduetomemoryconstraints. *Theeditorwritestoafileonlyifitisthecurrentfileandisedited,ifthefiledoesnotexist,orifthe fileisactuallyateletype,/dev/tty,/dev/null.Otherwise,youmustgivethevariantformw!toforce thewrite.

-12- (1,$)write>>file abbr:w>> Writesthebuffercontentsattheendofanexistingfile. w!name Overridesthecheckingofthenormalwritecommand,andwillwritetoanyfilewhichthe systempermits. (1,$)w!command Writesthespecifiedlinesintocommand.Notethedifferencebetweenw!whichoverrides checksandw!whichwritestoacommand. wqname Likeawriteandthenaquitcommand. wq!name Thevariantoverridescheckingonthesensibilityofthewritecommand,asw!does. xitname Ifanychangeshavebeenmadeandnotwritten,writesthebufferout.Then,inanycase, quits. (.,.)yankbuffercount abbr:ya Placesthespecifiedlinesinthenamedbuffer,forlaterretrievalviaput.Ifnobuffernameis specified,thelinesgotoamorevolatileplace;seetheputcommanddescription. (.+1)zcount Printthenextcountlines,defaultwindow. (.)ztypecount Printsawindowoftextwiththespecifiedlineatthetop.Iftypeis‘−’thelineisplacedat thebottom;a‘.’causesthelinetobeplacedinthecenter.*Acountgivesthenumberof linestobedisplayedratherthandoublethenumberspecifiedbythescrolloption.OnaCRT thescreenisclearedbeforedisplaybeginsunlessacountwhichislessthanthescreensizeis given.Thecurrentlineisleftatthelastlineprinted. !command Theremainderofthelineafterthe‘!’characterissenttoashelltobeexecuted.Withinthe textofcommandthecharacters‘%’and‘#’areexpandedasinfilenamesandthecharacter ‘!’isreplacedwiththetextofthepreviouscommand.Thus,inparticular,‘!!’repeatsthe lastsuchshellescape.Ifanysuchexpansionisperformed,theexpandedlinewillbeechoed. Thecurrentlineisunchangedbythiscommand. Iftherehasbeen‘‘[Nowrite]’’ofthebuffercontentssincethelastchangetotheediting buffer,thenadiagnosticwillbeprintedbeforethecommandisexecutedasawarning.A single‘!’isprintedwhenthecommandcompletes. *Forms‘z=’and‘z↑’alsoexist;‘z=’placesthecurrentlineinthecenter,surroundsitwithlinesof ‘−’charactersandleavesthecurrentlineatthisline.Theform‘z↑’printsthewindowbefore‘z−’ would.Thecharacters‘+’,‘↑’and‘−’mayberepeatedforcumulativeeffect.Onsomev2editors,no typemaybegiven.

-13- (addr,addr)!command Takesthespecifiedaddressrangeandsuppliesitasstandardinputtocommand;theresultingoutputthenreplacestheinputlines. ($)= Printsthelinenumberoftheaddressedline.Thecurrentlineisunchanged. (.,.)>countflags (.,.)<countflags Performintelligentshiftingonthespecifiedlines;<shiftsleftand>shiftright.Thequantityofshiftisdeterminedbytheshiftwidthoptionandtherepetitionofthespecification character.Onlywhitespace(blanksandtabs)isshifted;nonon-whitecharactersaredis-cardedinaleft-shift.Thecurrentlinebecomesthelastlinewhichchangedduetotheshift-ing. ˆ D Anend-of-filefromaterminalinputscrollsthroughthefile.Thescrolloptionspecifiesthe sizeofthescroll,normallyahalfscreenoftext. (.+1,.+1) (.+1,.+1)| Anaddressalonecausestheaddressedlinestobeprinted.Ablanklineprintsthenextline inthefile. (.,.)&optionscountflags Repeatstheprevioussubstitutecommand. (.,.)˜ optionscountflags Replacesthepreviousregularexpressionwiththepreviousreplacementpatternfromasubstitution. 8.Regularexpressionsandsubstitutereplacementpatterns 8.1.Regularexpressions Aregularexpressionspecifiesasetofstringsofcharacters.Amemberofthissetofstrings issaidtobematchedbytheregularexpression.Exrememberstwopreviousregularexpressions: thepreviousregularexpressionusedinasubstitutecommandandthepreviousregularexpression usedelsewhere(referredtoasthepreviousscanningregularexpression.)Thepreviousregular expressioncanalwaysbereferredtobyanullre,e.g.‘//’or‘??’. 8.2.Magicandnomagic Theregularexpressionsallowedbyexareconstructedinoneoftwowaysdependingonthe settingofthemagicoption.Theexandvidefaultsettingofmagicgivesquickaccesstoapowerfulsetofregularexpressionmetacharacters.Thedisadvantageofmagicisthattheusermust rememberthatthesemetacharactersaremagicandprecedethemwiththecharacter‘\’touse themas‘‘ordinary’’characters.Withnomagic,thedefaultforedit,regularexpressionsaremuch simpler,therebeingonlytwometacharacters.Thepoweroftheothermetacharactersisstillavailablebyprecedingthe(now)ordinarycharacterwitha‘\’.Notethat‘\’isthusalwaysa metacharacter. Theremainderofthediscussionofregularexpressionsassumesthatthatthesettingofthis optionismagic.† -14-8.3.Basicregularexpressionsummary Thefollowingbasicconstructsareusedtoconstructmagicmoderegularexpressions. charAnordinarycharactermatchesitself.Thecharacters‘↑’atthebeginningofa line,‘$’attheendofline,‘*’asanycharacterotherthanthefirst,‘.’,‘\’,‘[’,and ‘˜ ’arenotordinarycharactersandmustbeescaped(preceded)by‘\’tobe treatedassuch. ↑↑Atthebeginningofapatternforcesthematchtosucceedonlyatthebeginning ofaline. $Attheendofaregularexpressionforcesthematchtosucceedonlyattheendof theline. .Matchesanysinglecharacterexceptthenew-linecharacter. \\<Forcesthematchtooccuronlyatthebeginningofa‘‘variable’’or‘‘word’’;that is,eitheratthebeginningofaline,orjustbeforealetter,digit,orunderlineand afteracharacternotoneofthese. \\>Similarto‘\<’,butmatchingtheendofa‘‘variable’’or‘‘word’’,i.e.eitherthe endofthelineorbeforecharacterwhichisneitheraletter,noradigit,northe underlinecharacter. [string]Matchesany(single)characterintheclassdefinedbystring.Mostcharactersin stringdefinethemselves.Apairofcharactersseparatedby‘−’instringdefines thesetofcharacterscollatingbetweenthespecifiedlowerandupperbounds, thus‘[a−z]’asaregularexpressionmatchesany(single)lower-caseletter.Ifthe firstcharacterofstringisan‘↑’thentheconstructmatchesthosecharacters whichitotherwisewouldnot;thus‘[↑a−z]’matchesanythingbutalower-case letter(andofcourseanewline).Toplaceanyofthecharacters‘↑’,‘[’,or‘−’in stringyoumustescapethemwithapreceding‘\’. 8.4.Combiningregularexpressionprimitives Theconcatenationoftworegularexpressionsmatchestheleftmostandthenlongeststring whichcanbedividedwiththefirstpiecematchingthefirstregularexpressionandthesecond piecematchingthesecond.Anyofthe(singlecharactermatching)regularexpressionsmentioned abovemaybefollowedbythecharacter‘*’toformaregularexpressionwhichmatchesany numberofadjacentoccurrences(including0)ofcharactersmatchedbytheregularexpressionit follows. Thecharacter‘˜ ’maybeusedinaregularexpression,andmatchesthetextwhichdefined thereplacementpartofthelastsubstitutecommand.Aregularexpressionmaybeenclosed betweenthesequences‘\(’and‘\)’withsideeffectsinthesubstitutereplacementpatterns. 8.5.Substitutereplacementpatterns Thebasicmetacharactersforthereplacementpatternare‘&’and‘˜ ’;thesearegivenas‘\&’ and‘\˜ ’whennomagicisset.Eachinstanceof‘&’isreplacedbythecharacterswhichtheregular expressionmatched.Themetacharacter‘˜ ’stands,inthereplacementpattern,forthedefining textofthepreviousreplacementpattern. Othermetasequencespossibleinthereplacementpatternarealwaysintroducedbythe escapingcharacter‘\’.Thesequence‘\n’isreplacedbythetextmatchedbythen-thregular subexpressionenclosedbetween‘\(’and‘\)’.†Thesequences‘\u’and‘\l’causetheimmediately †Todiscernwhatistruewithnomagicitsufficestorememberthattheonlyspecialcharactersinthis casewillbe‘↑’atthebeginningofaregularexpression,‘$’attheendofaregularexpression,and‘\’. Withnomagicthecharacters‘˜ ’and‘&’alsolosetheirspecialmeaningsrelatedtothereplacement patternofasubstitute. †Whennested,parenthesizedsubexpressionsarepresent,nisdeterminedbycountingoccurrencesof ‘\(’startingfromtheleft.

-15-followingcharacterinthereplacementtobeconvertedtoupper-orlower-caserespectivelyifthis characterisaletter.Thesequences‘\U’and‘\L’turnsuchconversionon,eitheruntil‘\E’or‘\e’ isencountered,oruntiltheendofthereplacementpattern. 9.Optiondescriptions autoindent,ai default:noai Canbeusedtoeasethepreparationofstructuredprogramtext.Atthebeginningofeach append,changeorinsertcommandorwhenanewlineisopenedorcreatedbyanappend, change,insert,orsubstituteoperationwithinopenorvisualmode,exlooksatthelinebeing appendedafter,thefirstlinechangedorthelineinsertedbeforeandcalculatestheamount ofwhitespaceatthestartoftheline.Itthenalignsthecursoratthelevelofindentationso determined. Iftheuserthentypeslinesoftextin,theywillcontinuetobejustifiedatthedisplayed indentinglevel.Ifmorewhitespaceistypedatthebeginningofaline,thefollowingline willstartalignedwiththefirstnon-whitecharacterofthepreviousline.Tobackthecursor uptotheprecedingtabstoponecanhitˆ D.Thetabstopsgoingbackwardsaredefinedat multiplesoftheshiftwidthoption.Youcannotbackspaceovertheindent,exceptbysending anend-of-filewithaˆ D. Speciallyprocessedinthismodeisalinewithnocharactersaddedtoit,whichturnsintoa completelyblankline(thewhitespaceprovidedfortheautoindentisdiscarded.)Alsospeciallyprocessedinthismodearelinesbeginningwithan‘↑’andimmediatelyfollowedbya ˆ D.Thiscausestheinputtoberepositionedatthebeginningoftheline,butretainingthe previousindentforthenextline.Similarly,a‘0’followedbyaˆ Drepositionsatthebeginningbutwithoutretainingthepreviousindent. Autoindentdoesn’thappeninglobalcommandsorwhentheinputisnotaterminal. autoprint,ap default:ap Causesthecurrentlinetobeprintedaftereachdelete,copy,join,move,substitute,t,undo orshiftcommand.Thishasthesameeffectassupplyingatrailing‘p’toeachsuchcommand.Autoprintissuppressedinglobals,andonlyappliestothelastofmanycommands onaline. autowrite,aw default:noaw Causesthecontentsofthebuffertobewrittentothecurrentfileifyouhavemodifieditand giveanext,rewind,stop,tag,or!command,oraˆ ↑↑(switchfiles)orˆ ](taggoto)commandinvisual.Note,thattheeditandexcommandsdonotautowrite.Ineachcase,there isanequivalentwayofswitchingwhenautowriteissettoavoidtheautowrite(editfornext, rewind!for.Irewind,stop!forstop,tag!fortag,shellfor!,and:e#anda:ta!command fromwithinvisual). beautify,bf default:nobeautify Causesallcontrolcharactersexcepttab,newlineandform-feedtobediscardedfromthe input.Acomplaintisregisteredthefirsttimeabackspacecharacterisdiscarded.Beautify doesnotapplytocommandinput. directory,dir default:dir=/tmp Specifiesthedirectoryinwhichexplacesitsbufferfile.Ifthisdirectoryinnotwritable, thentheeditorwillexitabruptlywhenitfailstobeabletocreateitsbufferthere.

-16-edcompatible default:noedcompatible Causesthepresenceofabsenceofgandcsuffixesonsubstitutecommandstoberemembered,andtobetoggledbyrepeatingthesuffices.Thesuffixrmakesthesubstitutionbeas inthe˜ command,insteadoflike&.‡‡ errorbells,eb default:noeb Errormessagesareprecededbyabell.*Ifpossibletheeditoralwaysplacestheerrormessageinastandoutmodeoftheterminal(suchasinversevideo)insteadofringingthebell. hardtabs,ht default:ht=8 Givestheboundariesonwhichterminalhardwaretabsareset(oronwhichthesystem expandstabs). ignorecase,ic default:noic Alluppercasecharactersinthetextaremappedtolowercaseinregularexpressionmatching.Inaddition,alluppercasecharactersinregularexpressionsaremappedtolowercase exceptincharacterclassspecifications. lisp default:nolisp Autoindentindentsappropriatelyforlispcode,andthe(){{}}[[and]]commandsinopen andvisualaremodifiedtohavemeaningforlisp. list default:nolist Allprintedlineswillbedisplayed(more)unambiguously,showingtabsandend-of-linesasin thelistcommand. magic default:magicforexandvi† Ifnomagicisset,thenumberofregularexpressionmetacharactersisgreatlyreduced,with only‘↑’and‘$’havingspecialeffects.Inadditionthemetacharacters‘˜ ’and‘&’ofthe replacementpatternaretreatedasnormalcharacters.Allthenormalmetacharactersmay bemademagicwhennomagicissetbyprecedingthemwitha‘\’. mesg default:mesg Causeswritepermissiontobeturnedofftotheterminalwhileyouareinvisualmode,if nomesgisset.‡‡ number,nu default:nonumber Causesalloutputlinestobeprintedwiththeirlinenumbers.Inadditioneachinputline willbepromptedforbysupplyingthelinenumberitwillhave. open default:open Ifnoopen,thecommandsopenandvisualarenotpermitted.Thisissetforedittoprevent confusionresultingfromaccidentalentrytoopenorvisualmode. ‡‡Version3only. *Bellringinginopenandvisualonerrorsisnotsuppressedbysettingnoeb. †Nomagicforedit. ‡‡Version3only.

-17-optimize,opt default:optimize Throughputoftextisexpeditedbysettingtheterminaltonotdoautomaticcarriagereturns whenprintingmorethanone(logical)lineofoutput,greatlyspeedingoutputonterminals withoutaddressablecursorswhentextwithleadingwhitespaceisprinted. paragraphs,para default:para=IPLPPPQPPLIbp Specifiestheparagraphsforthe{{and}}operationsinopenandvisual.Thepairsofcharactersintheoption’svaluearethenamesofthemacroswhichstartparagraphs. prompt default:prompt Commandmodeinputispromptedforwitha‘:’. redraw default:noredraw Theeditorsimulates(usinggreatamountsofoutput),anintelligentterminalonadumbterminal(e.g.duringinsertionsinvisualthecharacterstotherightofthecursorpositionare refreshedaseachinputcharacteristyped.)Usefulonlyatveryhighspeed. remap default:remap Ifon,macrosarerepeatedlytrieduntiltheyareunchanged.‡‡Forexample,ifoismapped toO,andOismappedtoI,thenifremapisset,owillmaptoI,butifnoremapisset,it willmaptoO. report default:report=5† Specifiesathresholdforfeedbackfromcommands.Anycommandwhichmodifiesmorethan thespecifiednumberoflineswillprovidefeedbackastothescopeofitschanges.Forcommandssuchasglobal,open,undo,andvisualwhichhavepotentiallymorefarreachingscope, thenetchangeinthenumberoflinesinthebufferispresentedattheendofthecommand, subjecttothissamethreshold.Thusnotificationissuppressedduringaglobalcommandon theindividualcommandsperformed. scroll default:scroll=1/2window Determinesthenumberoflogicallinesscrolledwhenanend-of-fileisreceivedfromatermi-nalinputincommandmode,andthenumberoflinesprintedbyacommandmodezcom-mand(doublethevalueofscroll). sections default:sections=SHNHHHU Specifiesthesectionmacrosforthe[[and]]operationsinopenandvisual.Thepairsof charactersintheoptions’svaluearethenamesofthemacroswhichstartparagraphs. shell,sh default:sh=/bin/sh Givesthepathnameoftheshellforkedfortheshellescapecommand‘!’,andbytheshell command.ThedefaultistakenfromSHELLintheenvironment,ifpresent. shiftwidth,sw default:sw=8 Givesthewidthasoftwaretabstop,usedinreversetabbingwithˆ Dwhenusingautoindent toappendtext,andbytheshiftcommands. ‡‡Version3only. †2foredit.

-18-showmatch,sm default:nosm Inopenandvisualmode,whena)or}}istyped,movethecursortothematching(or{{for onesecondifthismatchingcharacterisonthescreen.Extremelyusefulwithlisp. slowopen,slow terminaldependent Affectsthedisplayalgorithmusedinvisualmode,holdingoffdisplayupdatingduringinput ofnewtexttoimprovethroughputwhentheterminalinuseisbothslowandunintelligent. SeeAnIntroductiontoDisplayEditingwithViformoredetails. tabstop,ts default:ts=8 Theeditorexpandstabsintheinputfiletobeontabstopboundariesforthepurposesofdisplay. taglength,tl default:tl=0 Tagsarenotsignificantbeyondthismanycharacters.Avalueofzero(thedefault)means thatallcharactersaresignificant. tags default:tags=tags/usr/lib/tags Apathoffilestobeusedastagfilesforthetagcommand.‡‡Arequestedtagissearched forinthespecifiedfiles,sequentially.Bydefault(eveninversion2)filescalledtagsare searchedforinthecurrentdirectoryandin/usr/lib(amasterfilefortheentiresystem.) term fromenvironmentTERM Theterminaltypeoftheoutputdevice. terse default:noterse Shortererrordiagnosticsareproducedfortheexperienceduser. warn default:warn Warniftherehasbeen‘[Nowritesincelastchange]’beforea‘!’commandescape. window default:window=speeddependent Thenumberoflinesinatextwindowinthevisualcommand.Thedefaultis8atslow speeds(600baudorless),16atmediumspeed(1200baud),andthefullscreen(minusone line)athigherspeeds. w300,w1200w9600 Thesearenottrueoptionsbutsetwindowonlyifthespeedisslow(300),medium(1200), orhigh(9600),respectively.TheyaresuitableforanEXINITandmakeiteasytochange the8/16/fullscreenrule. wrapscan,ws default:ws Searchesusingtheregularexpressionsinaddressingwillwraparoundpasttheendofthe file. wrapmargin,wm default:wm=0 Definesamarginforautomaticwrapoveroftextduringinputinopenandvisualmodes.See AnIntroductiontoTextEditingwithVifordetails. ‡‡Version3only.

-19-writeany,wa default:nowa Inhibitthechecksnormallymadebeforewritecommands,allowingawritetoanyfilewhich thesystemprotectionmechanismwillallow. 10.Limitations Editorlimitsthattheuserislikelytoencounterareasfollows:1024charactersperline,256 charactersperglobalcommandlist,128charactersperfilename,128charactersintheprevious insertedanddeletedtextinopenorvisual,100charactersinashellescapecommand,63charactersinastringvaluedoption,and30charactersinatagname,andalimitof250000linesinthe fileissilentlyenforced. Thevisualimplementationlimitsthenumberofmacrosdefinedwithmapto32,andthe totalnumberofcharactersinmacrostobelessthan512. Acknowledgments.ChuckHaleycontributedgreatlytotheearlydevelopmentofex.BruceEnglar encouragedtheredesignwhichledtoexversion1.BillJoywroteversions1and2.0through2.7, andcreatedtheframeworkthatusersseeinthepresenteditor.MarkHortonaddedmacrosand otherfeaturesandmadetheeditorworkonalargenumberofterminalsandUnixsystems.