资源描述:
《[Linux英文原版图书系列].OREILIY-Learning_The_VI_Editor_Sixth_Edition》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、Chapter1.TheviTextEditorUNIXhasanumberofeditorsthatcanprocessthecontentsoftextfiles,whetherthosefilescontaindata,sourcecode,orsentences.Therearelineeditors,suchasedandex,whichdisplayalineofthefileonthescreen;andtherearescreeneditors,suchasviandemacs,whichdisplayapartofthefileonyourterminalscreen.Te
2、xteditorsbasedontheXWindowSystemarealsocommonlyavailable,andarebecomingincreasingpopular.BothGNUemacsanditsderivativexemacsprovidemultipleXwindows;aninterestingalternativeisthesameditorfromBellLabs.AllbutoneoftheviclonesdescribedinPartIIofthisbookalsoprovideX-basedinterfaces.viisthemostusefulstanda
3、rdtexteditoronyoursystem.(viisshortforvisualeditorandispronounced"vee-eye.")Unlikeemacs,itisavailableinnearlyidenticalformonalmosteveryUNIXsystem,thusprovidingakindoftext-editinglinguafranca.[1]Thesamemightbesaidofedandex,butscreeneditorsaregenerallymucheasiertouse.Withascreeneditor,youcanscrollthe
4、page,movethecursor,deletelines,insertcharacters,andmore,whileseeingtheresultsofyoureditsasyoumakethem.Screeneditorsareverypopular,sincetheyallowyoutomakechangesasyoureadthroughafile,likeyouwouldeditaprintedcopy,onlyfaster.[1]Actually,thesedays,GNUemacsisprettymuchtheuniversalversionofemacs;theonlyp
5、roblemisitdoesn'tcomestandardwithmostcommercialUNIXsystems;youmustretrieveandinstallityourself.Tomanybeginners,vilooksunintuitiveandcumbersome—insteadofusingspecialcontrolkeysforwordprocessingfunctionsandjustlettingyoutypenormally,itusesalloftheregularkeyboardkeysforissuingcommands.Whenthekeyboardk
6、eysareissuingcommands,viissaidtobeincommandmode.Youmustbeinaspecialinsertmodebeforeyoucantypeactualtextonthescreen.Inaddition,thereseemtobesomanycommands.Onceyoustartlearning,however,yourealizethatviiswelldesigned.Youneedonlyafewkeystrokestotellvitodocomplextasks.Asyoulearnvi,youlearnshortcutsthatt
7、ransfermoreandmoreoftheeditingworktothecomputer—whereitbelongs.vi(likeanytexteditor)isnota"whatyouseeiswhatyouget"wordprocessor.Ifyouwanttoproduceformatteddocuments,youmusttypeincodesthatareusedbyanotherfor