pi_netrw.txt 178 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419
  1. *pi_netrw.txt* For Vim version 8.2. Last change: 2020 Aug 15
  2. ------------------------------------------------
  3. NETRW REFERENCE MANUAL by Charles E. Campbell
  4. ------------------------------------------------
  5. Author: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
  6. (remove NOSPAM from Campbell's email first)
  7. Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright*
  8. The VIM LICENSE applies to the files in this package, including
  9. netrw.vim, pi_netrw.txt, netrwFileHandlers.vim, netrwSettings.vim, and
  10. syntax/netrw.vim. Like anything else that's free, netrw.vim and its
  11. associated files are provided *as is* and comes with no warranty of
  12. any kind, either expressed or implied. No guarantees of
  13. merchantability. No guarantees of suitability for any purpose. By
  14. using this plugin, you agree that in no event will the copyright
  15. holder be liable for any damages resulting from the use of this
  16. software. Use at your own risk!
  17. *netrw*
  18. *dav* *ftp* *netrw-file* *rcp* *scp*
  19. *davs* *http* *netrw.vim* *rsync* *sftp*
  20. *fetch* *network*
  21. ==============================================================================
  22. 1. Contents *netrw-contents* {{{1
  23. 1. Contents..............................................|netrw-contents|
  24. 2. Starting With Netrw...................................|netrw-start|
  25. 3. Netrw Reference.......................................|netrw-ref|
  26. EXTERNAL APPLICATIONS AND PROTOCOLS.................|netrw-externapp|
  27. READING.............................................|netrw-read|
  28. WRITING.............................................|netrw-write|
  29. SOURCING............................................|netrw-source|
  30. DIRECTORY LISTING...................................|netrw-dirlist|
  31. CHANGING THE USERID AND PASSWORD....................|netrw-chgup|
  32. VARIABLES AND SETTINGS..............................|netrw-variables|
  33. PATHS...............................................|netrw-path|
  34. 4. Network-Oriented File Transfer........................|netrw-xfer|
  35. NETRC...............................................|netrw-netrc|
  36. PASSWORD............................................|netrw-passwd|
  37. 5. Activation............................................|netrw-activate|
  38. 6. Transparent Remote File Editing.......................|netrw-transparent|
  39. 7. Ex Commands...........................................|netrw-ex|
  40. 8. Variables and Options.................................|netrw-variables|
  41. 9. Browsing..............................................|netrw-browse|
  42. Introduction To Browsing............................|netrw-intro-browse|
  43. Quick Reference: Maps...............................|netrw-browse-maps|
  44. Quick Reference: Commands...........................|netrw-browse-cmds|
  45. Banner Display......................................|netrw-I|
  46. Bookmarking A Directory.............................|netrw-mb|
  47. Browsing............................................|netrw-cr|
  48. Squeezing the Current Tree-Listing Directory........|netrw-s-cr|
  49. Browsing With A Horizontally Split Window...........|netrw-o|
  50. Browsing With A New Tab.............................|netrw-t|
  51. Browsing With A Vertically Split Window.............|netrw-v|
  52. Change File Permission..............................|netrw-gp|
  53. Change Listing Style.(thin wide long tree)..........|netrw-i|
  54. Changing To A Bookmarked Directory..................|netrw-gb|
  55. Changing To A Predecessor Directory.................|netrw-u|
  56. Changing To A Successor Directory...................|netrw-U|
  57. Customizing Browsing With A Special Handler.........|netrw-x|
  58. Deleting Bookmarks..................................|netrw-mB|
  59. Deleting Files Or Directories.......................|netrw-D|
  60. Directory Exploring Commands........................|netrw-explore|
  61. Exploring With Stars and Patterns...................|netrw-star|
  62. Displaying Information About File...................|netrw-qf|
  63. Edit File Or Directory Hiding List..................|netrw-ctrl-h|
  64. Editing The Sorting Sequence........................|netrw-S|
  65. Forcing treatment as a file or directory............|netrw-gd| |netrw-gf|
  66. Going Up............................................|netrw--|
  67. Hiding Files Or Directories.........................|netrw-a|
  68. Improving Browsing..................................|netrw-ssh-hack|
  69. Listing Bookmarks And History.......................|netrw-qb|
  70. Making A New Directory..............................|netrw-d|
  71. Making The Browsing Directory The Current Directory.|netrw-cd|
  72. Marking Files.......................................|netrw-mf|
  73. Unmarking Files.....................................|netrw-mF|
  74. Marking Files By Location List......................|netrw-qL|
  75. Marking Files By QuickFix List......................|netrw-qF|
  76. Marking Files By Regular Expression.................|netrw-mr|
  77. Marked Files: Arbitrary Shell Command...............|netrw-mx|
  78. Marked Files: Arbitrary Shell Command, En Bloc......|netrw-mX|
  79. Marked Files: Arbitrary Vim Command.................|netrw-mv|
  80. Marked Files: Argument List.........................|netrw-ma| |netrw-mA|
  81. Marked Files: Buffer List...........................|netrw-cb| |netrw-cB|
  82. Marked Files: Compression And Decompression.........|netrw-mz|
  83. Marked Files: Copying...............................|netrw-mc|
  84. Marked Files: Diff..................................|netrw-md|
  85. Marked Files: Editing...............................|netrw-me|
  86. Marked Files: Grep..................................|netrw-mg|
  87. Marked Files: Hiding and Unhiding by Suffix.........|netrw-mh|
  88. Marked Files: Moving................................|netrw-mm|
  89. Marked Files: Printing..............................|netrw-mp|
  90. Marked Files: Sourcing..............................|netrw-ms|
  91. Marked Files: Setting the Target Directory..........|netrw-mt|
  92. Marked Files: Tagging...............................|netrw-mT|
  93. Marked Files: Target Directory Using Bookmarks......|netrw-Tb|
  94. Marked Files: Target Directory Using History........|netrw-Th|
  95. Marked Files: Unmarking.............................|netrw-mu|
  96. Netrw Browser Variables.............................|netrw-browser-var|
  97. Netrw Browsing And Option Incompatibilities.........|netrw-incompatible|
  98. Netrw Settings Window...............................|netrw-settings-window|
  99. Obtaining A File....................................|netrw-O|
  100. Preview Window......................................|netrw-p|
  101. Previous Window.....................................|netrw-P|
  102. Refreshing The Listing..............................|netrw-ctrl-l|
  103. Reversing Sorting Order.............................|netrw-r|
  104. Renaming Files Or Directories.......................|netrw-R|
  105. Selecting Sorting Style.............................|netrw-s|
  106. Setting Editing Window..............................|netrw-C|
  107. 10. Problems and Fixes....................................|netrw-problems|
  108. 11. Debugging Netrw Itself................................|netrw-debug|
  109. 12. History...............................................|netrw-history|
  110. 13. Todo..................................................|netrw-todo|
  111. 14. Credits...............................................|netrw-credits|
  112. ==============================================================================
  113. 2. Starting With Netrw *netrw-start* {{{1
  114. Netrw makes reading files, writing files, browsing over a network, and
  115. local browsing easy! First, make sure that you have plugins enabled, so
  116. you'll need to have at least the following in your <.vimrc>:
  117. (or see |netrw-activate|) >
  118. set nocp " 'compatible' is not set
  119. filetype plugin on " plugins are enabled
  120. <
  121. (see |'cp'| and |:filetype-plugin-on|)
  122. Netrw supports "transparent" editing of files on other machines using urls
  123. (see |netrw-transparent|). As an example of this, let's assume you have an
  124. account on some other machine; if you can use scp, try: >
  125. vim scp://hostname/path/to/file
  126. <
  127. Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|!
  128. So, what if you have ftp, not ssh/scp? That's easy, too; try >
  129. vim ftp://hostname/path/to/file
  130. <
  131. Want to make ftp simpler to use? See if your ftp supports a file called
  132. <.netrc> -- typically it goes in your home directory, has read/write
  133. permissions for only the user to read (ie. not group, world, other, etc),
  134. and has lines resembling >
  135. machine HOSTNAME login USERID password "PASSWORD"
  136. machine HOSTNAME login USERID password "PASSWORD"
  137. ...
  138. default login USERID password "PASSWORD"
  139. <
  140. Windows' ftp doesn't support .netrc; however, one may have in one's .vimrc: >
  141. let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\MyUserName\MACHINE'
  142. <
  143. Netrw will substitute the host's machine name for "MACHINE" from the URL it is
  144. attempting to open, and so one may specify >
  145. userid
  146. password
  147. for each site in a separate file: c:\Users\MyUserName\MachineName.
  148. Now about browsing -- when you just want to look around before editing a
  149. file. For browsing on your current host, just "edit" a directory: >
  150. vim .
  151. vim /home/userid/path
  152. <
  153. For browsing on a remote host, "edit" a directory (but make sure that
  154. the directory name is followed by a "/"): >
  155. vim scp://hostname/
  156. vim ftp://hostname/path/to/dir/
  157. <
  158. See |netrw-browse| for more!
  159. There are more protocols supported by netrw than just scp and ftp, too: see the
  160. next section, |netrw-externapp|, on how to use these external applications with
  161. netrw and vim.
  162. PREVENTING LOADING *netrw-noload*
  163. If you want to use plugins, but for some reason don't wish to use netrw, then
  164. you need to avoid loading both the plugin and the autoload portions of netrw.
  165. You may do so by placing the following two lines in your <.vimrc>: >
  166. :let g:loaded_netrw = 1
  167. :let g:loaded_netrwPlugin = 1
  168. <
  169. ==============================================================================
  170. 3. Netrw Reference *netrw-ref* {{{1
  171. Netrw supports several protocols in addition to scp and ftp as mentioned
  172. in |netrw-start|. These include dav, fetch, http,... well, just look
  173. at the list in |netrw-externapp|. Each protocol is associated with a
  174. variable which holds the default command supporting that protocol.
  175. EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2
  176. Protocol Variable Default Value
  177. -------- ---------------- -------------
  178. dav: *g:netrw_dav_cmd* = "cadaver" if cadaver is executable
  179. dav: g:netrw_dav_cmd = "curl -o" elseif curl is available
  180. fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available
  181. ftp: *g:netrw_ftp_cmd* = "ftp"
  182. http: *g:netrw_http_cmd* = "elinks" if elinks is available
  183. http: g:netrw_http_cmd = "links" elseif links is available
  184. http: g:netrw_http_cmd = "curl" elseif curl is available
  185. http: g:netrw_http_cmd = "wget" elseif wget is available
  186. http: g:netrw_http_cmd = "fetch" elseif fetch is available
  187. http: *g:netrw_http_put_cmd* = "curl -T"
  188. rcp: *g:netrw_rcp_cmd* = "rcp"
  189. rsync: *g:netrw_rsync_cmd* = "rsync" (see |g:netrw_rsync_sep|)
  190. scp: *g:netrw_scp_cmd* = "scp -q"
  191. sftp: *g:netrw_sftp_cmd* = "sftp"
  192. file: *g:netrw_file_cmd* = "elinks" or "links"
  193. *g:netrw_http_xcmd* : the option string for http://... protocols are
  194. specified via this variable and may be independently overridden. By
  195. default, the option arguments for the http-handling commands are: >
  196. elinks : "-source >"
  197. links : "-dump >"
  198. curl : "-L -o"
  199. wget : "-q -O"
  200. fetch : "-o"
  201. <
  202. For example, if your system has elinks, and you'd rather see the
  203. page using an attempt at rendering the text, you may wish to have >
  204. let g:netrw_http_xcmd= "-dump >"
  205. < in your .vimrc.
  206. g:netrw_http_put_cmd: this option specifies both the executable and
  207. any needed options. This command does a PUT operation to the url.
  208. READING *netrw-read* *netrw-nread* {{{2
  209. Generally, one may just use the URL notation with a normal editing
  210. command, such as >
  211. :e ftp://[user@]machine/path
  212. <
  213. Netrw also provides the Nread command:
  214. :Nread ? give help
  215. :Nread "machine:path" uses rcp
  216. :Nread "machine path" uses ftp w/ <.netrc>
  217. :Nread "machine id password path" uses ftp
  218. :Nread "dav://machine[:port]/path" uses cadaver
  219. :Nread "fetch://[user@]machine/path" uses fetch
  220. :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
  221. :Nread "http://[user@]machine/path" uses http uses wget
  222. :Nread "rcp://[user@]machine/path" uses rcp
  223. :Nread "rsync://[user@]machine[:port]/path" uses rsync
  224. :Nread "scp://[user@]machine[[:#]port]/path" uses scp
  225. :Nread "sftp://[user@]machine/path" uses sftp
  226. WRITING *netrw-write* *netrw-nwrite* {{{2
  227. One may just use the URL notation with a normal file writing
  228. command, such as >
  229. :w ftp://[user@]machine/path
  230. <
  231. Netrw also provides the Nwrite command:
  232. :Nwrite ? give help
  233. :Nwrite "machine:path" uses rcp
  234. :Nwrite "machine path" uses ftp w/ <.netrc>
  235. :Nwrite "machine id password path" uses ftp
  236. :Nwrite "dav://machine[:port]/path" uses cadaver
  237. :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
  238. :Nwrite "rcp://[user@]machine/path" uses rcp
  239. :Nwrite "rsync://[user@]machine[:port]/path" uses rsync
  240. :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp
  241. :Nwrite "sftp://[user@]machine/path" uses sftp
  242. http: not supported!
  243. SOURCING *netrw-source* {{{2
  244. One may just use the URL notation with the normal file sourcing
  245. command, such as >
  246. :so ftp://[user@]machine/path
  247. <
  248. Netrw also provides the Nsource command:
  249. :Nsource ? give help
  250. :Nsource "dav://machine[:port]/path" uses cadaver
  251. :Nsource "fetch://[user@]machine/path" uses fetch
  252. :Nsource "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
  253. :Nsource "http://[user@]machine/path" uses http uses wget
  254. :Nsource "rcp://[user@]machine/path" uses rcp
  255. :Nsource "rsync://[user@]machine[:port]/path" uses rsync
  256. :Nsource "scp://[user@]machine[[:#]port]/path" uses scp
  257. :Nsource "sftp://[user@]machine/path" uses sftp
  258. DIRECTORY LISTING *netrw-trailingslash* *netrw-dirlist* {{{2
  259. One may browse a directory to get a listing by simply attempting to
  260. edit the directory: >
  261. :e scp://[user]@hostname/path/
  262. :e ftp://[user]@hostname/path/
  263. <
  264. For remote directory listings (ie. those using scp or ftp), that
  265. trailing "/" is necessary (the slash tells netrw to treat the argument
  266. as a directory to browse instead of as a file to download).
  267. The Nread command may also be used to accomplish this (again, that
  268. trailing slash is necessary): >
  269. :Nread [protocol]://[user]@hostname/path/
  270. <
  271. *netrw-login* *netrw-password*
  272. CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2
  273. Attempts to use ftp will prompt you for a user-id and a password.
  274. These will be saved in global variables |g:netrw_uid| and
  275. |s:netrw_passwd|; subsequent use of ftp will re-use those two strings,
  276. thereby simplifying use of ftp. However, if you need to use a
  277. different user id and/or password, you'll want to call |NetUserPass()|
  278. first. To work around the need to enter passwords, check if your ftp
  279. supports a <.netrc> file in your home directory. Also see
  280. |netrw-passwd| (and if you're using ssh/scp hoping to figure out how
  281. to not need to use passwords for scp, look at |netrw-ssh-hack|).
  282. :NetUserPass [uid [password]] -- prompts as needed
  283. :call NetUserPass() -- prompts for uid and password
  284. :call NetUserPass("uid") -- prompts for password
  285. :call NetUserPass("uid","password") -- sets global uid and password
  286. (Related topics: |ftp| |netrw-userpass| |netrw-start|)
  287. NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2
  288. (Also see:
  289. |netrw-browser-var| : netrw browser option variables
  290. |netrw-protocol| : file transfer protocol option variables
  291. |netrw-settings| : additional file transfer options
  292. |netrw-browser-options| : these options affect browsing directories
  293. )
  294. Netrw provides a lot of variables which allow you to customize netrw to your
  295. preferences. One way to look at them is via the command :NetrwSettings (see
  296. |netrw-settings|) which will display your current netrw settings. Most such
  297. settings are described below, in |netrw-browser-options|, and in
  298. |netrw-externapp|:
  299. *b:netrw_lastfile* last file Network-read/written retained on a
  300. per-buffer basis (supports plain :Nw )
  301. *g:netrw_bufsettings* the settings that netrw buffers have
  302. (default) noma nomod nonu nowrap ro nobl
  303. *g:netrw_chgwin* specifies a window number where subsequent file edits
  304. will take place. (also see |netrw-C|)
  305. (default) -1
  306. *g:Netrw_funcref* specifies a function (or functions) to be called when
  307. netrw edits a file. The file is first edited, and
  308. then the function reference (|Funcref|) is called.
  309. This variable may also hold a |List| of Funcrefs.
  310. (default) not defined. (the capital in g:Netrw...
  311. is required by its holding a function reference)
  312. >
  313. Example: place in .vimrc; affects all file opening
  314. fun! MyFuncRef()
  315. endfun
  316. let g:Netrw_funcref= function("MyFuncRef")
  317. <
  318. *g:Netrw_UserMaps* specifies a function or |List| of functions which can
  319. be used to set up user-specified maps and functionality.
  320. See |netrw-usermaps|
  321. *g:netrw_ftp* if it doesn't exist, use default ftp
  322. =0 use default ftp (uid password)
  323. =1 use alternate ftp method (user uid password)
  324. If you're having trouble with ftp, try changing the
  325. value of this variable to see if the alternate ftp
  326. method works for your setup.
  327. *g:netrw_ftp_options* Chosen by default, these options are supposed to
  328. turn interactive prompting off and to restrain ftp
  329. from attempting auto-login upon initial connection.
  330. However, it appears that not all ftp implementations
  331. support this (ex. ncftp).
  332. ="-i -n"
  333. *g:netrw_ftpextracmd* default: doesn't exist
  334. If this variable exists, then any string it contains
  335. will be placed into the commands set to your ftp
  336. client. As an example:
  337. ="passive"
  338. *g:netrw_ftpmode* ="binary" (default)
  339. ="ascii"
  340. *g:netrw_ignorenetrc* =0 (default for linux, cygwin)
  341. =1 If you have a <.netrc> file but it doesn't work and
  342. you want it ignored, then set this variable as
  343. shown. (default for Windows + cmd.exe)
  344. *g:netrw_menu* =0 disable netrw's menu
  345. =1 (default) netrw's menu enabled
  346. *g:netrw_nogx* if this variable exists, then the "gx" map will not
  347. be available (see |netrw-gx|)
  348. *g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis
  349. *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis
  350. *g:netrw_preview* =0 (default) preview window shown in a horizontally
  351. split window
  352. =1 preview window shown in a vertically split window.
  353. Also affects the "previous window" (see |netrw-P|)
  354. in the same way.
  355. The |g:netrw_alto| variable may be used to provide
  356. additional splitting control:
  357. g:netrw_preview g:netrw_alto result
  358. 0 0 |:aboveleft|
  359. 0 1 |:belowright|
  360. 1 0 |:topleft|
  361. 1 1 |:botright|
  362. To control sizing, see |g:netrw_winsize|
  363. *g:netrw_scpport* = "-P" : option to use to set port for scp
  364. *g:netrw_sshport* = "-p" : option to use to set port for ssh
  365. *g:netrw_sepchr* =\0xff
  366. =\0x01 for enc == euc-jp (and perhaps it should be for
  367. others, too, please let me know)
  368. Separates priority codes from filenames internally.
  369. See |netrw-p12|.
  370. *g:netrw_silent* =0 : transfers done normally
  371. =1 : transfers done silently
  372. *g:netrw_use_errorwindow* =2: messages from netrw will use a popup window
  373. Move the mouse and pause to remove the popup window.
  374. (default value if popup windows are available)
  375. =1 : messages from netrw will use a separate one
  376. line window. This window provides reliable
  377. delivery of messages.
  378. (default value if popup windows are not available)
  379. =0 : messages from netrw will use echoerr ;
  380. messages don't always seem to show up this
  381. way, but one doesn't have to quit the window.
  382. *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank
  383. lines that o/s's ftp "provides" on transfers
  384. =0 force normal ftp behavior (no trailing line removal)
  385. *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also
  386. permits network browsing to use ls with time and
  387. size sorting (default if windows)
  388. =0 assume Windows' scp accepts windows-style paths
  389. Network browsing uses dir instead of ls
  390. This option is ignored if you're using unix
  391. *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP
  392. =1 use WinNT's rcp in binary mode (default)
  393. PATHS *netrw-path* {{{2
  394. Paths to files are generally user-directory relative for most protocols.
  395. It is possible that some protocol will make paths relative to some
  396. associated directory, however.
  397. >
  398. example: vim scp://user@host/somefile
  399. example: vim scp://user@host/subdir1/subdir2/somefile
  400. <
  401. where "somefile" is in the "user"'s home directory. If you wish to get a
  402. file using root-relative paths, use the full path:
  403. >
  404. example: vim scp://user@host//somefile
  405. example: vim scp://user@host//subdir1/subdir2/somefile
  406. <
  407. ==============================================================================
  408. 4. Network-Oriented File Transfer *netrw-xfer* {{{1
  409. Network-oriented file transfer under Vim is implemented by a vim script
  410. (<netrw.vim>) using plugin techniques. It currently supports both reading and
  411. writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch,
  412. dav/cadaver, rsync, or sftp.
  413. http is currently supported read-only via use of wget or fetch.
  414. <netrw.vim> is a standard plugin which acts as glue between Vim and the
  415. various file transfer programs. It uses autocommand events (BufReadCmd,
  416. FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. >
  417. ex. vim ftp://hostname/path/to/file
  418. <
  419. The characters preceding the colon specify the protocol to use; in the
  420. example, it's ftp. The <netrw.vim> script then formulates a command or a
  421. series of commands (typically ftp) which it issues to an external program
  422. (ftp, scp, etc) which does the actual file transfer/protocol. Files are read
  423. from/written to a temporary file (under Unix/Linux, /tmp/...) which the
  424. <netrw.vim> script will clean up.
  425. Now, a word about Jan Minář's "FTP User Name and Password Disclosure"; first,
  426. ftp is not a secure protocol. User names and passwords are transmitted "in
  427. the clear" over the internet; any snooper tool can pick these up; this is not
  428. a netrw thing, this is a ftp thing. If you're concerned about this, please
  429. try to use scp or sftp instead.
  430. Netrw re-uses the user id and password during the same vim session and so long
  431. as the remote hostname remains the same.
  432. Jan seems to be a bit confused about how netrw handles ftp; normally multiple
  433. commands are performed in a "ftp session", and he seems to feel that the
  434. uid/password should only be retained over one ftp session. However, netrw
  435. does every ftp operation in a separate "ftp session"; so remembering the
  436. uid/password for just one "ftp session" would be the same as not remembering
  437. the uid/password at all. IMHO this would rapidly grow tiresome as one
  438. browsed remote directories, for example.
  439. On the other hand, thanks go to Jan M. for pointing out the many
  440. vulnerabilities that netrw (and vim itself) had had in handling "crafted"
  441. filenames. The |shellescape()| and |fnameescape()| functions were written in
  442. response by Bram Moolenaar to handle these sort of problems, and netrw has
  443. been modified to use them. Still, my advice is, if the "filename" looks like
  444. a vim command that you aren't comfortable with having executed, don't open it.
  445. *netrw-putty* *netrw-pscp* *netrw-psftp*
  446. One may modify any protocol's implementing external application by setting a
  447. variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
  448. "scp -q"). As an example, consider using PuTTY: >
  449. let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch'
  450. let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"'
  451. <
  452. (note: it has been reported that windows 7 with putty v0.6's "-batch" option
  453. doesn't work, so its best to leave it off for that system)
  454. See |netrw-p8| for more about putty, pscp, psftp, etc.
  455. Ftp, an old protocol, seems to be blessed by numerous implementations.
  456. Unfortunately, some implementations are noisy (ie., add junk to the end of the
  457. file). Thus, concerned users may decide to write a NetReadFixup() function
  458. that will clean up after reading with their ftp. Some Unix systems (ie.,
  459. FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is
  460. not noisy and more convenient, actually, for <netrw.vim> to use.
  461. Consequently, if "fetch" is available (ie. executable), it may be preferable
  462. to use it for ftp://... based transfers.
  463. For rcp, scp, sftp, and http, one may use network-oriented file transfers
  464. transparently; ie.
  465. >
  466. vim rcp://[user@]machine/path
  467. vim scp://[user@]machine/path
  468. <
  469. If your ftp supports <.netrc>, then it too can be transparently used
  470. if the needed triad of machine name, user id, and password are present in
  471. that file. Your ftp must be able to use the <.netrc> file on its own, however.
  472. >
  473. vim ftp://[user@]machine[[:#]portnumber]/path
  474. <
  475. Windows provides an ftp (typically c:\Windows\System32\ftp.exe) which uses
  476. an option, -s:filename (filename can and probably should be a full path)
  477. which contains ftp commands which will be automatically run whenever ftp
  478. starts. You may use this feature to enter a user and password for one site: >
  479. userid
  480. password
  481. < *netrw-windows-netrc* *netrw-windows-s*
  482. If |g:netrw_ftp_cmd| contains -s:[path/]MACHINE, then (on Windows machines
  483. only) netrw will substitute the current machine name requested for ftp
  484. connections for MACHINE. Hence one can have multiple machine.ftp files
  485. containing login and password for ftp. Example: >
  486. let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE'
  487. vim ftp://myhost.somewhere.net/
  488. will use a file >
  489. C:\Users\Myself\myhost.ftp
  490. <
  491. Often, ftp will need to query the user for the userid and password.
  492. The latter will be done "silently"; ie. asterisks will show up instead of
  493. the actually-typed-in password. Netrw will retain the userid and password
  494. for subsequent read/writes from the most recent transfer so subsequent
  495. transfers (read/write) to or from that machine will take place without
  496. additional prompting.
  497. *netrw-urls*
  498. +=================================+============================+============+
  499. | Reading | Writing | Uses |
  500. +=================================+============================+============+
  501. | DAV: | | |
  502. | dav://host/path | | cadaver |
  503. | :Nread dav://host/path | :Nwrite dav://host/path | cadaver |
  504. +---------------------------------+----------------------------+------------+
  505. | DAV + SSL: | | |
  506. | davs://host/path | | cadaver |
  507. | :Nread davs://host/path | :Nwrite davs://host/path | cadaver |
  508. +---------------------------------+----------------------------+------------+
  509. | FETCH: | | |
  510. | fetch://[user@]host/path | | |
  511. | fetch://[user@]host:http/path | Not Available | fetch |
  512. | :Nread fetch://[user@]host/path| | |
  513. +---------------------------------+----------------------------+------------+
  514. | FILE: | | |
  515. | file:///* | file:///* | |
  516. | file://localhost/* | file://localhost/* | |
  517. +---------------------------------+----------------------------+------------+
  518. | FTP: (*3) | (*3) | |
  519. | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) |
  520. | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc |
  521. | :Nread host path | :Nwrite host path | ftp+.netrc |
  522. | :Nread host uid pass path | :Nwrite host uid pass path | ftp |
  523. +---------------------------------+----------------------------+------------+
  524. | HTTP: wget is executable: (*4) | | |
  525. | http://[user@]host/path | Not Available | wget |
  526. +---------------------------------+----------------------------+------------+
  527. | HTTP: fetch is executable (*4) | | |
  528. | http://[user@]host/path | Not Available | fetch |
  529. +---------------------------------+----------------------------+------------+
  530. | RCP: | | |
  531. | rcp://[user@]host/path | rcp://[user@]host/path | rcp |
  532. +---------------------------------+----------------------------+------------+
  533. | RSYNC: | | |
  534. | rsync://[user@]host/path | rsync://[user@]host/path | rsync |
  535. | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync |
  536. | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp |
  537. +---------------------------------+----------------------------+------------+
  538. | SCP: | | |
  539. | scp://[user@]host/path | scp://[user@]host/path | scp |
  540. | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) |
  541. +---------------------------------+----------------------------+------------+
  542. | SFTP: | | |
  543. | sftp://[user@]host/path | sftp://[user@]host/path | sftp |
  544. | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) |
  545. +=================================+============================+============+
  546. (*1) For an absolute path use scp://machine//path.
  547. (*2) if <.netrc> is present, it is assumed that it will
  548. work with your ftp client. Otherwise the script will
  549. prompt for user-id and password.
  550. (*3) for ftp, "machine" may be machine#port or machine:port
  551. if a different port is needed than the standard ftp port
  552. (*4) for http:..., if wget is available it will be used. Otherwise,
  553. if fetch is available it will be used.
  554. Both the :Nread and the :Nwrite ex-commands can accept multiple filenames.
  555. NETRC *netrw-netrc*
  556. The <.netrc> file, typically located in your home directory, contains lines
  557. therein which map a hostname (machine name) to the user id and password you
  558. prefer to use with it.
  559. The typical syntax for lines in a <.netrc> file is given as shown below.
  560. Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't.
  561. >
  562. machine {full machine name} login {user-id} password "{password}"
  563. default login {user-id} password "{password}"
  564. Your ftp client must handle the use of <.netrc> on its own, but if the
  565. <.netrc> file exists, an ftp transfer will not ask for the user-id or
  566. password.
  567. Note:
  568. Since this file contains passwords, make very sure nobody else can
  569. read this file! Most programs will refuse to use a .netrc that is
  570. readable for others. Don't forget that the system administrator can
  571. still read the file! Ie. for Linux/Unix: chmod 600 .netrc
  572. Even though Windows' ftp clients typically do not support .netrc, netrw has
  573. a work-around: see |netrw-windows-s|.
  574. PASSWORD *netrw-passwd*
  575. The script attempts to get passwords for ftp invisibly using |inputsecret()|,
  576. a built-in Vim function. See |netrw-userpass| for how to change the password
  577. after one has set it.
  578. Unfortunately there doesn't appear to be a way for netrw to feed a password to
  579. scp. Thus every transfer via scp will require re-entry of the password.
  580. However, |netrw-ssh-hack| can help with this problem.
  581. ==============================================================================
  582. 5. Activation *netrw-activate* {{{1
  583. Network-oriented file transfers are available by default whenever Vim's
  584. |'nocompatible'| mode is enabled. Netrw's script files reside in your
  585. system's plugin, autoload, and syntax directories; just the
  586. plugin/netrwPlugin.vim script is sourced automatically whenever you bring up
  587. vim. The main script in autoload/netrw.vim is only loaded when you actually
  588. use netrw. I suggest that, at a minimum, you have at least the following in
  589. your <.vimrc> customization file: >
  590. set nocp
  591. if version >= 600
  592. filetype plugin indent on
  593. endif
  594. <
  595. By also including the following lines in your .vimrc, one may have netrw
  596. immediately activate when using [g]vim without any filenames, showing the
  597. current directory: >
  598. " Augroup VimStartup:
  599. augroup VimStartup
  600. au!
  601. au VimEnter * if expand("%") == "" | e . | endif
  602. augroup END
  603. <
  604. ==============================================================================
  605. 6. Transparent Remote File Editing *netrw-transparent* {{{1
  606. Transparent file transfers occur whenever a regular file read or write
  607. (invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd|
  608. events) is made. Thus one may read, write, or source files across networks
  609. just as easily as if they were local files! >
  610. vim ftp://[user@]machine/path
  611. ...
  612. :wq
  613. See |netrw-activate| for more on how to encourage your vim to use plugins
  614. such as netrw.
  615. For password-free use of scp:, see |netrw-ssh-hack|.
  616. ==============================================================================
  617. 7. Ex Commands *netrw-ex* {{{1
  618. The usual read/write commands are supported. There are also a few
  619. additional commands available. Often you won't need to use Nwrite or
  620. Nread as shown in |netrw-transparent| (ie. simply use >
  621. :e URL
  622. :r URL
  623. :w URL
  624. instead, as appropriate) -- see |netrw-urls|. In the explanations
  625. below, a {netfile} is a URL to a remote file.
  626. *:Nwrite* *:Nw*
  627. :[range]Nw[rite] Write the specified lines to the current
  628. file as specified in b:netrw_lastfile.
  629. (related: |netrw-nwrite|)
  630. :[range]Nw[rite] {netfile} [{netfile}]...
  631. Write the specified lines to the {netfile}.
  632. *:Nread* *:Nr*
  633. :Nr[ead] Read the lines from the file specified in b:netrw_lastfile
  634. into the current buffer. (related: |netrw-nread|)
  635. :Nr[ead] {netfile} {netfile}...
  636. Read the {netfile} after the current line.
  637. *:Nsource* *:Ns*
  638. :Ns[ource] {netfile}
  639. Source the {netfile}.
  640. To start up vim using a remote .vimrc, one may use
  641. the following (all on one line) (tnx to Antoine Mechelynck) >
  642. vim -u NORC -N
  643. --cmd "runtime plugin/netrwPlugin.vim"
  644. --cmd "source scp://HOSTNAME/.vimrc"
  645. < (related: |netrw-source|)
  646. :call NetUserPass() *NetUserPass()*
  647. If g:netrw_uid and s:netrw_passwd don't exist,
  648. this function will query the user for them.
  649. (related: |netrw-userpass|)
  650. :call NetUserPass("userid")
  651. This call will set the g:netrw_uid and, if
  652. the password doesn't exist, will query the user for it.
  653. (related: |netrw-userpass|)
  654. :call NetUserPass("userid","passwd")
  655. This call will set both the g:netrw_uid and s:netrw_passwd.
  656. The user-id and password are used by ftp transfers. One may
  657. effectively remove the user-id and password by using empty
  658. strings (ie. "").
  659. (related: |netrw-userpass|)
  660. :NetrwSettings This command is described in |netrw-settings| -- used to
  661. display netrw settings and change netrw behavior.
  662. ==============================================================================
  663. 8. Variables and Options *netrw-var* *netrw-settings* {{{1
  664. (also see: |netrw-options| |netrw-variables| |netrw-protocol|
  665. |netrw-browser-settings| |netrw-browser-options| )
  666. The <netrw.vim> script provides several variables which act as options to
  667. affect <netrw.vim>'s file transfer behavior. These variables typically may be
  668. set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|)
  669. *netrw-options*
  670. >
  671. -------------
  672. Netrw Options
  673. -------------
  674. Option Meaning
  675. -------------- -----------------------------------------------
  676. <
  677. b:netrw_col Holds current cursor position (during NetWrite)
  678. g:netrw_cygwin =1 assume scp under windows is from cygwin
  679. (default/windows)
  680. =0 assume scp under windows accepts windows
  681. style paths (default/else)
  682. g:netrw_ftp =0 use default ftp (uid password)
  683. g:netrw_ftpmode ="binary" (default)
  684. ="ascii" (your choice)
  685. g:netrw_ignorenetrc =1 (default)
  686. if you have a <.netrc> file but you don't
  687. want it used, then set this variable. Its
  688. mere existence is enough to cause <.netrc>
  689. to be ignored.
  690. b:netrw_lastfile Holds latest method/machine/path.
  691. b:netrw_line Holds current line number (during NetWrite)
  692. g:netrw_silent =0 transfers done normally
  693. =1 transfers done silently
  694. g:netrw_uid Holds current user-id for ftp.
  695. g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
  696. =1 use WinNT/2K/XP's rcp, binary mode
  697. g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc
  698. =1 use default method to do ftp >
  699. -----------------------------------------------------------------------
  700. <
  701. *netrw-internal-variables*
  702. The script will also make use of the following variables internally, albeit
  703. temporarily.
  704. >
  705. -------------------
  706. Temporary Variables
  707. -------------------
  708. Variable Meaning
  709. -------- ------------------------------------
  710. <
  711. b:netrw_method Index indicating rcp/ftp+.netrc/ftp
  712. w:netrw_method (same as b:netrw_method)
  713. g:netrw_machine Holds machine name parsed from input
  714. b:netrw_fname Holds filename being accessed >
  715. ------------------------------------------------------------
  716. <
  717. *netrw-protocol*
  718. Netrw supports a number of protocols. These protocols are invoked using the
  719. variables listed below, and may be modified by the user.
  720. >
  721. ------------------------
  722. Protocol Control Options
  723. ------------------------
  724. Option Type Setting Meaning
  725. --------- -------- -------------- ---------------------------
  726. < netrw_ftp variable =doesn't exist userid set by "user userid"
  727. =0 userid set by "user userid"
  728. =1 userid set by "userid"
  729. NetReadFixup function =doesn't exist no change
  730. =exists Allows user to have files
  731. read via ftp automatically
  732. transformed however they wish
  733. by NetReadFixup()
  734. g:netrw_dav_cmd var ="cadaver" if cadaver is executable
  735. g:netrw_dav_cmd var ="curl -o" elseif curl is executable
  736. g:netrw_fetch_cmd var ="fetch -o" if fetch is available
  737. g:netrw_ftp_cmd var ="ftp"
  738. g:netrw_http_cmd var ="fetch -o" if fetch is available
  739. g:netrw_http_cmd var ="wget -O" else if wget is available
  740. g:netrw_http_put_cmd var ="curl -T"
  741. |g:netrw_list_cmd| var ="ssh USEPORT HOSTNAME ls -Fa"
  742. g:netrw_rcp_cmd var ="rcp"
  743. g:netrw_rsync_cmd var ="rsync"
  744. *g:netrw_rsync_sep* var ="/" used to separate the hostname
  745. from the file spec
  746. g:netrw_scp_cmd var ="scp -q"
  747. g:netrw_sftp_cmd var ="sftp" >
  748. -------------------------------------------------------------------------
  749. <
  750. *netrw-ftp*
  751. The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|)
  752. specify the external program to use handle the ftp protocol. They may
  753. include command line options (such as -p for passive mode). Example: >
  754. let g:netrw_ftp_cmd= "ftp -p"
  755. <
  756. Browsing is supported by using the |g:netrw_list_cmd|; the substring
  757. "HOSTNAME" will be changed via substitution with whatever the current request
  758. is for a hostname.
  759. Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's
  760. that give trouble . In order to best understand how to use these options if
  761. ftp is giving you troubles, a bit of discussion is provided on how netrw does
  762. ftp reads.
  763. For ftp, netrw typically builds up lines of one of the following formats in a
  764. temporary file:
  765. >
  766. IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1
  767. ---------------------------------- ------------------------------
  768. <
  769. open machine [port] open machine [port]
  770. user userid password userid password
  771. [g:netrw_ftpmode] password
  772. [g:netrw_ftpextracmd] [g:netrw_ftpmode]
  773. get filename tempfile [g:netrw_extracmd]
  774. get filename tempfile >
  775. ---------------------------------------------------------------------
  776. <
  777. The |g:netrw_ftpmode| and |g:netrw_ftpextracmd| are optional.
  778. Netrw then executes the lines above by use of a filter:
  779. >
  780. :%! {g:netrw_ftp_cmd} -i [-n]
  781. <
  782. where
  783. g:netrw_ftp_cmd is usually "ftp",
  784. -i tells ftp not to be interactive
  785. -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>)
  786. If <.netrc> exists it will be used to avoid having to query the user for
  787. userid and password. The transferred file is put into a temporary file.
  788. The temporary file is then read into the main editing session window that
  789. requested it and the temporary file deleted.
  790. If your ftp doesn't accept the "user" command and immediately just demands a
  791. userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
  792. *netrw-cadaver*
  793. To handle the SSL certificate dialog for untrusted servers, one may pull
  794. down the certificate and place it into /usr/ssl/cert.pem. This operation
  795. renders the server treatment as "trusted".
  796. *netrw-fixup* *netreadfixup*
  797. If your ftp for whatever reason generates unwanted lines (such as AUTH
  798. messages) you may write a NetReadFixup() function:
  799. >
  800. function! NetReadFixup(method,line1,line2)
  801. " a:line1: first new line in current file
  802. " a:line2: last new line in current file
  803. if a:method == 1 "rcp
  804. elseif a:method == 2 "ftp + <.netrc>
  805. elseif a:method == 3 "ftp + machine,uid,password,filename
  806. elseif a:method == 4 "scp
  807. elseif a:method == 5 "http/wget
  808. elseif a:method == 6 "dav/cadaver
  809. elseif a:method == 7 "rsync
  810. elseif a:method == 8 "fetch
  811. elseif a:method == 9 "sftp
  812. else " complain
  813. endif
  814. endfunction
  815. >
  816. The NetReadFixup() function will be called if it exists and thus allows you to
  817. customize your reading process. As a further example, <netrw.vim> contains
  818. just such a function to handle Windows 95 ftp. For whatever reason, Windows
  819. 95's ftp dumps four blank lines at the end of a transfer, and so it is
  820. desirable to automate their removal. Here's some code taken from <netrw.vim>
  821. itself:
  822. >
  823. if has("win95") && g:netrw_win95ftp
  824. fun! NetReadFixup(method, line1, line2)
  825. if method == 3 " ftp (no <.netrc>)
  826. let fourblanklines= line2 - 3
  827. silent fourblanklines .. "," .. line2 .. "g/^\s*/d"
  828. endif
  829. endfunction
  830. endif
  831. >
  832. (Related topics: |ftp| |netrw-userpass| |netrw-start|)
  833. ==============================================================================
  834. 9. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1
  835. *netrw-browser* *netrw-dir* *netrw-list*
  836. INTRODUCTION TO BROWSING *netrw-intro-browse* {{{2
  837. (Quick References: |netrw-quickmaps| |netrw-quickcoms|)
  838. Netrw supports the browsing of directories on your local system and on remote
  839. hosts; browsing includes listing files and directories, entering directories,
  840. editing files therein, deleting files/directories, making new directories,
  841. moving (renaming) files and directories, copying files and directories, etc.
  842. One may mark files and execute any system command on them! The Netrw browser
  843. generally implements the previous explorer's maps and commands for remote
  844. directories, although details (such as pertinent global variable names)
  845. necessarily differ. To browse a directory, simply "edit" it! >
  846. vim /your/directory/
  847. vim .
  848. vim c:\your\directory\
  849. <
  850. (Related topics: |netrw-cr| |netrw-o| |netrw-p| |netrw-P| |netrw-t|
  851. |netrw-mf| |netrw-mx| |netrw-D| |netrw-R| |netrw-v| )
  852. The Netrw remote file and directory browser handles two protocols: ssh and
  853. ftp. The protocol in the url, if it is ftp, will cause netrw also to use ftp
  854. in its remote browsing. Specifying any other protocol will cause it to be
  855. used for file transfers; but the ssh protocol will be used to do remote
  856. browsing.
  857. To use Netrw's remote directory browser, simply attempt to read a "file" with
  858. a trailing slash and it will be interpreted as a request to list a directory:
  859. >
  860. vim [protocol]://[user@]hostname/path/
  861. <
  862. where [protocol] is typically scp or ftp. As an example, try: >
  863. vim ftp://ftp.home.vim.org/pub/vim/
  864. <
  865. For local directories, the trailing slash is not required. Again, because it's
  866. easy to miss: to browse remote directories, the URL must terminate with a
  867. slash!
  868. If you'd like to avoid entering the password repeatedly for remote directory
  869. listings with ssh or scp, see |netrw-ssh-hack|. To avoid password entry with
  870. ftp, see |netrw-netrc| (if your ftp supports it).
  871. There are several things you can do to affect the browser's display of files:
  872. * To change the listing style, press the "i" key (|netrw-i|).
  873. Currently there are four styles: thin, long, wide, and tree.
  874. To make that change "permanent", see |g:netrw_liststyle|.
  875. * To hide files (don't want to see those xyz~ files anymore?) see
  876. |netrw-ctrl-h|.
  877. * Press s to sort files by name, time, or size.
  878. See |netrw-browse-cmds| for all the things you can do with netrw!
  879. *netrw-getftype* *netrw-filigree* *netrw-ftype*
  880. The |getftype()| function is used to append a bit of filigree to indicate
  881. filetype to locally listed files:
  882. directory : /
  883. executable : *
  884. fifo : |
  885. links : @
  886. sockets : =
  887. The filigree also affects the |g:netrw_sort_sequence|.
  888. QUICK HELP *netrw-quickhelp* {{{2
  889. (Use ctrl-] to select a topic)~
  890. Intro to Browsing...............................|netrw-intro-browse|
  891. Quick Reference: Maps.........................|netrw-quickmap|
  892. Quick Reference: Commands.....................|netrw-browse-cmds|
  893. Hiding
  894. Edit hiding list..............................|netrw-ctrl-h|
  895. Hiding Files or Directories...................|netrw-a|
  896. Hiding/Unhiding by suffix.....................|netrw-mh|
  897. Hiding dot-files.............................|netrw-gh|
  898. Listing Style
  899. Select listing style (thin/long/wide/tree)....|netrw-i|
  900. Associated setting variable...................|g:netrw_liststyle|
  901. Shell command used to perform listing.........|g:netrw_list_cmd|
  902. Quick file info...............................|netrw-qf|
  903. Sorted by
  904. Select sorting style (name/time/size).........|netrw-s|
  905. Editing the sorting sequence..................|netrw-S|
  906. Sorting options...............................|g:netrw_sort_options|
  907. Associated setting variable...................|g:netrw_sort_sequence|
  908. Reverse sorting order.........................|netrw-r|
  909. *netrw-quickmap* *netrw-quickmaps*
  910. QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
  911. >
  912. --- ----------------- ----
  913. Map Quick Explanation Link
  914. --- ----------------- ----
  915. < <F1> Causes Netrw to issue help
  916. <cr> Netrw will enter the directory or read the file |netrw-cr|
  917. <del> Netrw will attempt to remove the file/directory |netrw-del|
  918. <c-h> Edit file hiding list |netrw-ctrl-h|
  919. <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
  920. <c-r> Browse using a gvim server |netrw-ctrl-r|
  921. <c-tab> Shrink/expand a netrw/explore window |netrw-c-tab|
  922. - Makes Netrw go up one directory |netrw--|
  923. a Cycles between normal display, |netrw-a|
  924. hiding (suppress display of files matching g:netrw_list_hide)
  925. and showing (display only files which match g:netrw_list_hide)
  926. cd Make browsing directory the current directory |netrw-cd|
  927. C Setting the editing window |netrw-C|
  928. d Make a directory |netrw-d|
  929. D Attempt to remove the file(s)/directory(ies) |netrw-D|
  930. gb Go to previous bookmarked directory |netrw-gb|
  931. gd Force treatment as directory |netrw-gd|
  932. gf Force treatment as file |netrw-gf|
  933. gh Quick hide/unhide of dot-files |netrw-gh|
  934. gn Make top of tree the directory below the cursor |netrw-gn|
  935. gp Change local-only file permissions |netrw-gp|
  936. i Cycle between thin, long, wide, and tree listings |netrw-i|
  937. I Toggle the displaying of the banner |netrw-I|
  938. mb Bookmark current directory |netrw-mb|
  939. mc Copy marked files to marked-file target directory |netrw-mc|
  940. md Apply diff to marked files (up to 3) |netrw-md|
  941. me Place marked files on arg list and edit them |netrw-me|
  942. mf Mark a file |netrw-mf|
  943. mF Unmark files |netrw-mF|
  944. mg Apply vimgrep to marked files |netrw-mg|
  945. mh Toggle marked file suffices' presence on hiding list |netrw-mh|
  946. mm Move marked files to marked-file target directory |netrw-mm|
  947. mp Print marked files |netrw-mp|
  948. mr Mark files using a shell-style |regexp| |netrw-mr|
  949. mt Current browsing directory becomes markfile target |netrw-mt|
  950. mT Apply ctags to marked files |netrw-mT|
  951. mu Unmark all marked files |netrw-mu|
  952. mv Apply arbitrary vim command to marked files |netrw-mv|
  953. mx Apply arbitrary shell command to marked files |netrw-mx|
  954. mX Apply arbitrary shell command to marked files en bloc|netrw-mX|
  955. mz Compress/decompress marked files |netrw-mz|
  956. o Enter the file/directory under the cursor in a new |netrw-o|
  957. browser window. A horizontal split is used.
  958. O Obtain a file specified by cursor |netrw-O|
  959. p Preview the file |netrw-p|
  960. P Browse in the previously used window |netrw-P|
  961. qb List bookmarked directories and history |netrw-qb|
  962. qf Display information on file |netrw-qf|
  963. qF Mark files using a quickfix list |netrw-qF|
  964. qL Mark files using a |location-list| |netrw-qL|
  965. r Reverse sorting order |netrw-r|
  966. R Rename the designated file(s)/directory(ies) |netrw-R|
  967. s Select sorting style: by name, time, or file size |netrw-s|
  968. S Specify suffix priority for name-sorting |netrw-S|
  969. t Enter the file/directory under the cursor in a new tab|netrw-t|
  970. u Change to recently-visited directory |netrw-u|
  971. U Change to subsequently-visited directory |netrw-U|
  972. v Enter the file/directory under the cursor in a new |netrw-v|
  973. browser window. A vertical split is used.
  974. x View file with an associated program |netrw-x|
  975. X Execute filename under cursor via |system()| |netrw-X|
  976. % Open a new file in netrw's current directory |netrw-%|
  977. *netrw-mouse* *netrw-leftmouse* *netrw-middlemouse* *netrw-rightmouse*
  978. <leftmouse> (gvim only) selects word under mouse as if a <cr>
  979. had been pressed (ie. edit file, change directory)
  980. <middlemouse> (gvim only) same as P selecting word under mouse;
  981. see |netrw-P|
  982. <rightmouse> (gvim only) delete file/directory using word under
  983. mouse
  984. <2-leftmouse> (gvim only) when:
  985. * in a netrw-selected file, AND
  986. * |g:netrw_retmap| == 1 AND
  987. * the user doesn't already have a <2-leftmouse>
  988. mapping defined before netrw is autoloaded,
  989. then a double clicked leftmouse button will return
  990. to the netrw browser window. See |g:netrw_retmap|.
  991. <s-leftmouse> (gvim only) like mf, will mark files. Dragging
  992. the shifted leftmouse will mark multiple files.
  993. (see |netrw-mf|)
  994. (to disable mouse buttons while browsing: |g:netrw_mousemaps|)
  995. *netrw-quickcom* *netrw-quickcoms*
  996. QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2
  997. :NetrwClean[!]............................................|netrw-clean|
  998. :NetrwSettings............................................|netrw-settings|
  999. :Ntree....................................................|netrw-ntree|
  1000. :Explore[!] [dir] Explore directory of current file......|netrw-explore|
  1001. :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore|
  1002. :Lexplore[!] [dir] Left Explorer Toggle...................|netrw-explore|
  1003. :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
  1004. :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
  1005. :Rexplore Return to Explorer.....................|netrw-explore|
  1006. :Sexplore[!] [dir] Split & Explore directory .............|netrw-explore|
  1007. :Texplore[!] [dir] Tab & Explore..........................|netrw-explore|
  1008. :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
  1009. BANNER DISPLAY *netrw-I*
  1010. One may toggle the displaying of the banner by pressing "I".
  1011. Also See: |g:netrw_banner|
  1012. BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2
  1013. One may easily "bookmark" the currently browsed directory by using >
  1014. mb
  1015. <
  1016. *.netrwbook*
  1017. Bookmarks are retained in between sessions of vim in a file called .netrwbook
  1018. as a |List|, which is typically stored in the first directory on the user's
  1019. 'runtimepath'; entries are kept in sorted order.
  1020. If there are marked files and/or directories, mb will add them to the bookmark
  1021. list.
  1022. *netrw-:NetrwMB*
  1023. Additionally, one may use :NetrwMB to bookmark files or directories. >
  1024. :NetrwMB[!] [files/directories]
  1025. < No bang: enters files/directories into Netrw's bookmark system
  1026. No argument and in netrw buffer:
  1027. if there are marked files : bookmark marked files
  1028. otherwise : bookmark file/directory under cursor
  1029. No argument and not in netrw buffer: bookmarks current open file
  1030. Has arguments : |glob()|s each arg and bookmarks them
  1031. With bang: deletes files/directories from Netrw's bookmark system
  1032. The :NetrwMB command is available outside of netrw buffers (once netrw has been
  1033. invoked in the session).
  1034. The file ".netrwbook" holds bookmarks when netrw (and vim) is not active. By
  1035. default, its stored on the first directory on the user's |'runtimepath'|.
  1036. Related Topics:
  1037. |netrw-gb| how to return (go) to a bookmark
  1038. |netrw-mB| how to delete bookmarks
  1039. |netrw-qb| how to list bookmarks
  1040. |g:netrw_home| controls where .netrwbook is kept
  1041. BROWSING *netrw-enter* *netrw-cr* {{{2
  1042. Browsing is simple: move the cursor onto a file or directory of interest.
  1043. Hitting the <cr> (the return key) will select the file or directory.
  1044. Directories will themselves be listed, and files will be opened using the
  1045. protocol given in the original read request.
  1046. CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that
  1047. two or more spaces delimit filenames and directory names for the long and
  1048. wide listing formats. Thus, if your filename or directory name has two or
  1049. more sequential spaces embedded in it, or any trailing spaces, then you'll
  1050. need to use the "thin" format to select it.
  1051. The |g:netrw_browse_split| option, which is zero by default, may be used to
  1052. cause the opening of files to be done in a new window or tab instead of the
  1053. default. When the option is one or two, the splitting will be taken
  1054. horizontally or vertically, respectively. When the option is set to three, a
  1055. <cr> will cause the file to appear in a new tab.
  1056. When using the gui (gvim), one may select a file by pressing the <leftmouse>
  1057. button. In addition, if
  1058. * |g:netrw_retmap| == 1 AND (its default value is 0)
  1059. * in a netrw-selected file, AND
  1060. * the user doesn't already have a <2-leftmouse> mapping defined before
  1061. netrw is loaded
  1062. then a doubly-clicked leftmouse button will return to the netrw browser
  1063. window.
  1064. Netrw attempts to speed up browsing, especially for remote browsing where one
  1065. may have to enter passwords, by keeping and re-using previously obtained
  1066. directory listing buffers. The |g:netrw_fastbrowse| variable is used to
  1067. control this behavior; one may have slow browsing (no buffer re-use), medium
  1068. speed browsing (re-use directory buffer listings only for remote directories),
  1069. and fast browsing (re-use directory buffer listings as often as possible).
  1070. The price for such re-use is that when changes are made (such as new files
  1071. are introduced into a directory), the listing may become out-of-date. One may
  1072. always refresh directory listing buffers by pressing ctrl-L (see
  1073. |netrw-ctrl-l|).
  1074. *netrw-s-cr*
  1075. Squeezing the Current Tree-Listing Directory~
  1076. When the tree listing style is enabled (see |netrw-i|) and one is using
  1077. gvim, then the <s-cr> mapping may be used to squeeze (close) the
  1078. directory currently containing the cursor.
  1079. Otherwise, one may remap a key combination of one's own choice to get
  1080. this effect: >
  1081. nmap <buffer> <silent> <nowait> YOURKEYCOMBO <Plug>NetrwTreeSqueeze
  1082. <
  1083. Put this line in $HOME/ftplugin/netrw/netrw.vim; it needs to be generated
  1084. for netrw buffers only.
  1085. Related topics:
  1086. |netrw-ctrl-r| |netrw-o| |netrw-p|
  1087. |netrw-P| |netrw-t| |netrw-v|
  1088. Associated setting variables:
  1089. |g:netrw_browse_split| |g:netrw_fastbrowse|
  1090. |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
  1091. |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_browse_reject|
  1092. |g:netrw_ssh_cmd| |g:netrw_use_noswf|
  1093. BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2
  1094. Normally one enters a file or directory using the <cr>. However, the "o" map
  1095. allows one to open a new window to hold the new directory listing or file. A
  1096. horizontal split is used. (for vertical splitting, see |netrw-v|)
  1097. Normally, the o key splits the window horizontally with the new window and
  1098. cursor at the top.
  1099. Associated setting variables: |g:netrw_alto| |g:netrw_winsize|
  1100. Related topics:
  1101. |netrw-ctrl-r| |netrw-o| |netrw-p|
  1102. |netrw-P| |netrw-t| |netrw-v|
  1103. Associated setting variables:
  1104. |g:netrw_alto| control above/below splitting
  1105. |g:netrw_winsize| control initial sizing
  1106. BROWSING WITH A NEW TAB *netrw-t* {{{2
  1107. Normally one enters a file or directory using the <cr>. The "t" map
  1108. allows one to open a new window holding the new directory listing or file in
  1109. a new tab.
  1110. If you'd like to have the new listing in a background tab, use |gT|.
  1111. Related topics:
  1112. |netrw-ctrl-r| |netrw-o| |netrw-p|
  1113. |netrw-P| |netrw-t| |netrw-v|
  1114. Associated setting variables:
  1115. |g:netrw_winsize| control initial sizing
  1116. BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2
  1117. Normally one enters a file or directory using the <cr>. However, the "v" map
  1118. allows one to open a new window to hold the new directory listing or file. A
  1119. vertical split is used. (for horizontal splitting, see |netrw-o|)
  1120. Normally, the v key splits the window vertically with the new window and
  1121. cursor at the left.
  1122. There is only one tree listing buffer; using "v" on a displayed subdirectory
  1123. will split the screen, but the same buffer will be shown twice.
  1124. Related topics:
  1125. |netrw-ctrl-r| |netrw-o| |netrw-p|
  1126. |netrw-P| |netrw-t| |netrw-v|
  1127. Associated setting variables:
  1128. |g:netrw_altv| control right/left splitting
  1129. |g:netrw_winsize| control initial sizing
  1130. BROWSING USING A GVIM SERVER *netrw-ctrl-r* {{{2
  1131. One may keep a browsing gvim separate from the gvim being used to edit.
  1132. Use the <c-r> map on a file (not a directory) in the netrw browser, and it
  1133. will use a gvim server (see |g:netrw_servername|). Subsequent use of <cr>
  1134. (see |netrw-cr|) will re-use that server for editing files.
  1135. Related topics:
  1136. |netrw-ctrl-r| |netrw-o| |netrw-p|
  1137. |netrw-P| |netrw-t| |netrw-v|
  1138. Associated setting variables:
  1139. |g:netrw_servername| : sets name of server
  1140. |g:netrw_browse_split| : controls how <cr> will open files
  1141. CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2
  1142. The "i" map cycles between the thin, long, wide, and tree listing formats.
  1143. The thin listing format gives just the files' and directories' names.
  1144. The long listing is either based on the "ls" command via ssh for remote
  1145. directories or displays the filename, file size (in bytes), and the time and
  1146. date of last modification for local directories. With the long listing
  1147. format, netrw is not able to recognize filenames which have trailing spaces.
  1148. Use the thin listing format for such files.
  1149. The wide listing format uses two or more contiguous spaces to delineate
  1150. filenames; when using that format, netrw won't be able to recognize or use
  1151. filenames which have two or more contiguous spaces embedded in the name or any
  1152. trailing spaces. The thin listing format will, however, work with such files.
  1153. The wide listing format is the most compact.
  1154. The tree listing format has a top directory followed by files and directories
  1155. preceded by one or more "|"s, which indicate the directory depth. One may
  1156. open and close directories by pressing the <cr> key while atop the directory
  1157. name.
  1158. One may make a preferred listing style your default; see |g:netrw_liststyle|.
  1159. As an example, by putting the following line in your .vimrc, >
  1160. let g:netrw_liststyle= 3
  1161. the tree style will become your default listing style.
  1162. One typical way to use the netrw tree display is to: >
  1163. vim .
  1164. (use i until a tree display shows)
  1165. navigate to a file
  1166. v (edit as desired in vertically split window)
  1167. ctrl-w h (to return to the netrw listing)
  1168. P (edit newly selected file in the previous window)
  1169. ctrl-w h (to return to the netrw listing)
  1170. P (edit newly selected file in the previous window)
  1171. ...etc...
  1172. <
  1173. Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen|
  1174. |g:netrw_timefmt| |g:netrw_list_cmd|
  1175. CHANGE FILE PERMISSION *netrw-gp* {{{2
  1176. "gp" will ask you for a new permission for the file named under the cursor.
  1177. Currently, this only works for local files.
  1178. Associated setting variables: |g:netrw_chgperm|
  1179. CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2
  1180. To change directory back to a bookmarked directory, use
  1181. {cnt}gb
  1182. Any count may be used to reference any of the bookmarks.
  1183. Note that |netrw-qb| shows both bookmarks and history; to go
  1184. to a location stored in the history see |netrw-u| and |netrw-U|.
  1185. Related Topics:
  1186. |netrw-mB| how to delete bookmarks
  1187. |netrw-mb| how to make a bookmark
  1188. |netrw-qb| how to list bookmarks
  1189. CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2
  1190. Every time you change to a new directory (new for the current session), netrw
  1191. will save the directory in a recently-visited directory history list (unless
  1192. |g:netrw_dirhistmax| is zero; by default, it holds ten entries). With the "u"
  1193. map, one can change to an earlier directory (predecessor). To do the
  1194. opposite, see |netrw-U|.
  1195. The "u" map also accepts counts to go back in the history several slots. For
  1196. your convenience, qb (see |netrw-qb|) lists the history number which may be
  1197. used in that count.
  1198. *.netrwhist*
  1199. See |g:netrw_dirhistmax| for how to control the quantity of history stack
  1200. slots. The file ".netrwhist" holds history when netrw (and vim) is not
  1201. active. By default, its stored on the first directory on the user's
  1202. |'runtimepath'|.
  1203. Related Topics:
  1204. |netrw-U| changing to a successor directory
  1205. |g:netrw_home| controls where .netrwhist is kept
  1206. CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2
  1207. With the "U" map, one can change to a later directory (successor).
  1208. This map is the opposite of the "u" map. (see |netrw-u|) Use the
  1209. qb map to list both the bookmarks and history. (see |netrw-qb|)
  1210. The "U" map also accepts counts to go forward in the history several slots.
  1211. See |g:netrw_dirhistmax| for how to control the quantity of history stack
  1212. slots.
  1213. CHANGING TREE TOP *netrw-ntree* *:Ntree* *netrw-gn* {{{2
  1214. One may specify a new tree top for tree listings using >
  1215. :Ntree [dirname]
  1216. Without a "dirname", the current line is used (and any leading depth
  1217. information is elided).
  1218. With a "dirname", the specified directory name is used.
  1219. The "gn" map will take the word below the cursor and use that for
  1220. changing the top of the tree listing.
  1221. NETRW CLEAN *netrw-clean* *:NetrwClean* {{{2
  1222. With :NetrwClean one may easily remove netrw from one's home directory;
  1223. more precisely, from the first directory on your |'runtimepath'|.
  1224. With :NetrwClean!, netrw will attempt to remove netrw from all directories on
  1225. your |'runtimepath'|. Of course, you have to have write/delete permissions
  1226. correct to do this.
  1227. With either form of the command, netrw will first ask for confirmation
  1228. that the removal is in fact what you want to do. If netrw doesn't have
  1229. permission to remove a file, it will issue an error message.
  1230. *netrw-gx*
  1231. CUSTOMIZING BROWSING WITH A SPECIAL HANDLER *netrw-x* *netrw-handler* {{{2
  1232. (also see |netrw_filehandler|)
  1233. Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
  1234. best seen with a special handler (ie. a tool provided with your computer's
  1235. operating system). Netrw allows one to invoke such special handlers by: >
  1236. * when Exploring, hit the "x" key
  1237. * when editing, hit gx with the cursor atop the special filename
  1238. < (latter not available if the |g:netrw_nogx| variable exists)
  1239. Netrw determines which special handler by the following method:
  1240. * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
  1241. view files. Examples of useful settings (place into your <.vimrc>): >
  1242. :let g:netrw_browsex_viewer= "kfmclient exec"
  1243. < or >
  1244. :let g:netrw_browsex_viewer= "xdg-open"
  1245. <
  1246. If g:netrw_browsex_viewer == '-', then netrwFileHandlers#Invoke() will be
  1247. used instead (see |netrw_filehandler|).
  1248. If the viewer you wish to use does not support handling of a remote URL
  1249. directory, set |g:netrw_browsex_support_remote| to 0.
  1250. * for Windows 32 or 64, the URL and FileProtocolHandler dlls are used.
  1251. * for Gnome (with gnome-open): gnome-open is used.
  1252. * for KDE (with kfmclient) : kfmclient is used
  1253. * for Mac OS X : open is used.
  1254. * otherwise the netrwFileHandler plugin is used.
  1255. The file's suffix is used by these various approaches to determine an
  1256. appropriate application to use to "handle" these files. Such things as
  1257. OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
  1258. *.eps) can be handled.
  1259. The gx mapping extends to all buffers; apply "gx" while atop a word and netrw
  1260. will apply a special handler to it (like "x" works when in a netrw buffer).
  1261. One may also use visual mode (see |visual-start|) to select the text that the
  1262. special handler will use. Normally gx uses expand("<cfile>") to pick up the
  1263. text under the cursor; one may change what |expand()| uses via the
  1264. |g:netrw_gx| variable (options include "<cword>", "<cWORD>"). Note that
  1265. expand("<cfile>") depends on the |'isfname'| setting. Alternatively, one may
  1266. select the text to be used by gx by making a visual selection (see
  1267. |visual-block|) and then pressing gx.
  1268. Associated setting variables:
  1269. |g:netrw_gx| control how gx picks up the text under the cursor
  1270. |g:netrw_nogx| prevent gx map while editing
  1271. |g:netrw_suppress_gx_mesg| controls gx's suppression of browser messages
  1272. *netrw_filehandler*
  1273. When |g:netrw_browsex_viewer| exists and is "-", then netrw will attempt to
  1274. handle the special file with a vim function. The "x" map applies a function
  1275. to a file, based on its extension. Of course, the handler function must exist
  1276. for it to be called!
  1277. >
  1278. Ex. mypgm.html x -> NFH_html("scp://user@host/some/path/mypgm.html")
  1279. < Users may write their own netrw File Handler functions to
  1280. support more suffixes with special handling. See
  1281. <autoload/netrwFileHandlers.vim> for examples on how to make
  1282. file handler functions. As an example: >
  1283. " NFH_suffix(filename)
  1284. fun! NFH_suffix(filename)
  1285. ..do something special with filename..
  1286. endfun
  1287. <
  1288. These functions need to be defined in some file in your .vim/plugin
  1289. (vimfiles\plugin) directory. Vim's function names may not have punctuation
  1290. characters (except for the underscore) in them. To support suffices that
  1291. contain such characters, netrw will first convert the suffix using the
  1292. following table: >
  1293. @ -> AT ! -> EXCLAMATION % -> PERCENT
  1294. : -> COLON = -> EQUAL ? -> QUESTION
  1295. , -> COMMA - -> MINUS ; -> SEMICOLON
  1296. $ -> DOLLAR + -> PLUS ~ -> TILDE
  1297. <
  1298. So, for example: >
  1299. file.rcs,v -> NFH_rcsCOMMAv()
  1300. <
  1301. If more such translations are necessary, please send me email: >
  1302. NcampObell@SdrPchip.AorgM-NOSPAM
  1303. with a request. (remove the embedded NOSPAM first)
  1304. Associated setting variable: |g:netrw_browsex_viewer|
  1305. *netrw-curdir*
  1306. DELETING BOOKMARKS *netrw-mB* {{{2
  1307. To delete a bookmark, use >
  1308. {cnt}mB
  1309. If there are marked files, then mB will remove them from the
  1310. bookmark list.
  1311. Alternatively, one may use :NetrwMB! (see |netrw-:NetrwMB|). >
  1312. :NetrwMB! [files/directories]
  1313. Related Topics:
  1314. |netrw-gb| how to return (go) to a bookmark
  1315. |netrw-mb| how to make a bookmark
  1316. |netrw-qb| how to list bookmarks
  1317. DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2
  1318. If files have not been marked with |netrw-mf|: (local marked file list)
  1319. Deleting/removing files and directories involves moving the cursor to the
  1320. file/directory to be deleted and pressing "D". Directories must be empty
  1321. first before they can be successfully removed. If the directory is a
  1322. softlink to a directory, then netrw will make two requests to remove the
  1323. directory before succeeding. Netrw will ask for confirmation before doing
  1324. the removal(s). You may select a range of lines with the "V" command
  1325. (visual selection), and then pressing "D".
  1326. If files have been marked with |netrw-mf|: (local marked file list)
  1327. Marked files (and empty directories) will be deleted; again, you'll be
  1328. asked to confirm the deletion before it actually takes place.
  1329. A further approach is to delete files which match a pattern.
  1330. * use :MF pattern (see |netrw-:MF|); then press "D".
  1331. * use mr (see |netrw-mr|) which will prompt you for pattern.
  1332. This will cause the matching files to be marked. Then,
  1333. press "D".
  1334. If your vim has 7.4 with patch#1107, then |g:netrw_localrmdir| no longer
  1335. is used to remove directories; instead, vim's |delete()| is used with
  1336. the "d" option. Please note that only empty directories may be deleted
  1337. with the "D" mapping. Regular files are deleted with |delete()|, too.
  1338. The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are
  1339. used to control the attempts to remove remote files and directories. The
  1340. g:netrw_rm_cmd is used with files, and its default value is:
  1341. g:netrw_rm_cmd: ssh HOSTNAME rm
  1342. The g:netrw_rmdir_cmd variable is used to support the removal of directories.
  1343. Its default value is:
  1344. |g:netrw_rmdir_cmd|: ssh HOSTNAME rmdir
  1345. If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
  1346. to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
  1347. |g:netrw_rmf_cmd|: ssh HOSTNAME rm -f
  1348. Related topics: |netrw-d|
  1349. Associated setting variable: |g:netrw_localrmdir| |g:netrw_rm_cmd|
  1350. |g:netrw_rmdir_cmd| |g:netrw_ssh_cmd|
  1351. *netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore*
  1352. *netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore* *netrw-lexplore*
  1353. DIRECTORY EXPLORATION COMMANDS {{{2
  1354. :[N]Explore[!] [dir]... Explore directory of current file *:Explore*
  1355. :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
  1356. :[N]Lexplore[!] [dir]... Left Explorer Toggle *:Lexplore*
  1357. :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore*
  1358. :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
  1359. :Texplore [dir]... Tab & Explore *:Texplore*
  1360. :Rexplore ... Return to/from Explorer *:Rexplore*
  1361. Used with :Explore **/pattern : (also see |netrw-starstar|)
  1362. :Nexplore............. go to next matching file *:Nexplore*
  1363. :Pexplore............. go to previous matching file *:Pexplore*
  1364. *netrw-:Explore*
  1365. :Explore will open the local-directory browser on the current file's
  1366. directory (or on directory [dir] if specified). The window will be
  1367. split only if the file has been modified and |'hidden'| is not set,
  1368. otherwise the browsing window will take over that window. Normally
  1369. the splitting is taken horizontally.
  1370. Also see: |netrw-:Rexplore|
  1371. :Explore! is like :Explore, but will use vertical splitting.
  1372. *netrw-:Hexplore*
  1373. :Hexplore [dir] does an :Explore with |:belowright| horizontal splitting.
  1374. :Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting.
  1375. *netrw-:Lexplore*
  1376. :[N]Lexplore [dir] toggles a full height Explorer window on the left hand side
  1377. of the current tab. It will open a netrw window on the current
  1378. directory if [dir] is omitted; a :Lexplore [dir] will show the
  1379. specified directory in the left-hand side browser display no matter
  1380. from which window the command is issued.
  1381. By default, :Lexplore will change an uninitialized |g:netrw_chgwin|
  1382. to 2; edits will thus preferentially be made in window#2.
  1383. The [N] specifies a |g:netrw_winsize| just for the new :Lexplore
  1384. window.
  1385. Those who like this method often also like tree style displays;
  1386. see |g:netrw_liststyle|.
  1387. :[N]Lexplore! [dir] is similar to :Lexplore, except that the full-height
  1388. Explorer window will open on the right hand side and an
  1389. uninitialized |g:netrw_chgwin| will be set to 1 (eg. edits will
  1390. preferentially occur in the leftmost window).
  1391. Also see: |netrw-C| |g:netrw_browse_split| |g:netrw_wiw|
  1392. |netrw-p| |netrw-P| |g:netrw_chgwin|
  1393. |netrw-c-tab| |g:netrw_winsize|
  1394. *netrw-:Sexplore*
  1395. :[N]Sexplore will always split the window before invoking the local-directory
  1396. browser. As with Explore, the splitting is normally done
  1397. horizontally.
  1398. :[N]Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically.
  1399. *netrw-:Texplore*
  1400. :Texplore [dir] does a |:tabnew| before generating the browser window
  1401. *netrw-:Vexplore*
  1402. :[N]Vexplore [dir] does an :Explore with |:leftabove| vertical splitting.
  1403. :[N]Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting.
  1404. The optional parameters are:
  1405. [N]: This parameter will override |g:netrw_winsize| to specify the quantity of
  1406. rows and/or columns the new explorer window should have.
  1407. Otherwise, the |g:netrw_winsize| variable, if it has been specified by the
  1408. user, is used to control the quantity of rows and/or columns new
  1409. explorer windows should have.
  1410. [dir]: By default, these explorer commands use the current file's directory.
  1411. However, one may explicitly provide a directory (path) to use instead;
  1412. ie. >
  1413. :Explore /some/path
  1414. <
  1415. *netrw-:Rexplore*
  1416. :Rexplore This command is a little different from the other Explore commands
  1417. as it doesn't necessarily open an Explorer window.
  1418. Return to Explorer~
  1419. When one edits a file using netrw which can occur, for example,
  1420. when pressing <cr> while the cursor is atop a filename in a netrw
  1421. browser window, a :Rexplore issued while editing that file will
  1422. return the display to that of the last netrw browser display in
  1423. that window.
  1424. Return from Explorer~
  1425. Conversely, when one is editing a directory, issuing a :Rexplore
  1426. will return to editing the file that was last edited in that
  1427. window.
  1428. The <2-leftmouse> map (which is only available under gvim and
  1429. cooperative terms) does the same as :Rexplore.
  1430. Also see: |g:netrw_alto| |g:netrw_altv| |g:netrw_winsize|
  1431. *netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat* *netrw-grep*
  1432. EXPLORING WITH STARS AND PATTERNS {{{2
  1433. When Explore, Sexplore, Hexplore, or Vexplore are used with one of the
  1434. following four patterns Explore generates a list of files which satisfy the
  1435. request for the local file system. These exploration patterns will not work
  1436. with remote file browsing.
  1437. */filepat files in current directory which satisfy filepat
  1438. **/filepat files in current directory or below which satisfy the
  1439. file pattern
  1440. *//pattern files in the current directory which contain the
  1441. pattern (vimgrep is used)
  1442. **//pattern files in the current directory or below which contain
  1443. the pattern (vimgrep is used)
  1444. <
  1445. The cursor will be placed on the first file in the list. One may then
  1446. continue to go to subsequent files on that list via |:Nexplore| or to
  1447. preceding files on that list with |:Pexplore|. Explore will update the
  1448. directory and place the cursor appropriately.
  1449. A plain >
  1450. :Explore
  1451. will clear the explore list.
  1452. If your console or gui produces recognizable shift-up or shift-down sequences,
  1453. then you'll likely find using shift-downarrow and shift-uparrow convenient.
  1454. They're mapped by netrw as follows:
  1455. <s-down> == Nexplore, and
  1456. <s-up> == Pexplore.
  1457. As an example, consider
  1458. >
  1459. :Explore */*.c
  1460. :Nexplore
  1461. :Nexplore
  1462. :Pexplore
  1463. <
  1464. The status line will show, on the right hand side of the status line, a
  1465. message like "Match 3 of 20".
  1466. Associated setting variables:
  1467. |g:netrw_keepdir| |g:netrw_browse_split|
  1468. |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject|
  1469. |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
  1470. |g:netrw_ftp_timelist_cmd| |g:netrw_list_cmd|
  1471. |g:netrw_liststyle|
  1472. DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2
  1473. With the cursor atop a filename, pressing "qf" will reveal the file's size
  1474. and last modification timestamp. Currently this capability is only available
  1475. for local files.
  1476. EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2
  1477. The "<ctrl-h>" map brings up a requestor allowing the user to change the
  1478. file/directory hiding list contained in |g:netrw_list_hide|. The hiding list
  1479. consists of one or more patterns delimited by commas. Files and/or
  1480. directories satisfying these patterns will either be hidden (ie. not shown) or
  1481. be the only ones displayed (see |netrw-a|).
  1482. The "gh" mapping (see |netrw-gh|) quickly alternates between the usual
  1483. hiding list and the hiding of files or directories that begin with ".".
  1484. As an example, >
  1485. let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+'
  1486. Effectively, this makes the effect of a |netrw-gh| command the initial setting.
  1487. What it means:
  1488. \(^\|\s\s\) : if the line begins with the following, -or-
  1489. two consecutive spaces are encountered
  1490. \zs : start the hiding match now
  1491. \. : if it now begins with a dot
  1492. \S\+ : and is followed by one or more non-whitespace
  1493. characters
  1494. Associated setting variables: |g:netrw_hide| |g:netrw_list_hide|
  1495. Associated topics: |netrw-a| |netrw-gh| |netrw-mh|
  1496. *netrw-sort-sequence*
  1497. EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2
  1498. When "Sorted by" is name, one may specify priority via the sorting sequence
  1499. (g:netrw_sort_sequence). The sorting sequence typically prioritizes the
  1500. name-listing by suffix, although any pattern will do. Patterns are delimited
  1501. by commas. The default sorting sequence is (all one line):
  1502. For Unix: >
  1503. '[\/]$,\<core\%(\.\d\+\)\=,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,
  1504. \.info$,\.swp$,\.bak$,\~$'
  1505. <
  1506. Otherwise: >
  1507. '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,
  1508. \.swp$,\.bak$,\~$'
  1509. <
  1510. The lone * is where all filenames not covered by one of the other patterns
  1511. will end up. One may change the sorting sequence by modifying the
  1512. g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by
  1513. using the "S" map.
  1514. Related topics: |netrw-s| |netrw-S|
  1515. Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options|
  1516. EXECUTING FILE UNDER CURSOR VIA SYSTEM() *netrw-X* {{{2
  1517. Pressing X while the cursor is atop an executable file will yield a prompt
  1518. using the filename asking for any arguments. Upon pressing a [return], netrw
  1519. will then call |system()| with that command and arguments. The result will be
  1520. displayed by |:echomsg|, and so |:messages| will repeat display of the result.
  1521. Ansi escape sequences will be stripped out.
  1522. See |cmdline-window| for directions for more on how to edit the arguments.
  1523. FORCING TREATMENT AS A FILE OR DIRECTORY *netrw-gd* *netrw-gf* {{{2
  1524. Remote symbolic links (ie. those listed via ssh or ftp) are problematic
  1525. in that it is difficult to tell whether they link to a file or to a
  1526. directory.
  1527. To force treatment as a file: use >
  1528. gf
  1529. <
  1530. To force treatment as a directory: use >
  1531. gd
  1532. <
  1533. GOING UP *netrw--* {{{2
  1534. To go up a directory, press "-" or press the <cr> when atop the ../ directory
  1535. entry in the listing.
  1536. Netrw will use the command in |g:netrw_list_cmd| to perform the directory
  1537. listing operation after changing HOSTNAME to the host specified by the
  1538. user-prpvided url. By default netrw provides the command as: >
  1539. ssh HOSTNAME ls -FLa
  1540. <
  1541. where the HOSTNAME becomes the [user@]hostname as requested by the attempt to
  1542. read. Naturally, the user may override this command with whatever is
  1543. preferred. The NetList function which implements remote browsing
  1544. expects that directories will be flagged by a trailing slash.
  1545. HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2
  1546. Netrw's browsing facility allows one to use the hiding list in one of three
  1547. ways: ignore it, hide files which match, and show only those files which
  1548. match.
  1549. If no files have been marked via |netrw-mf|:
  1550. The "a" map allows the user to cycle through the three hiding modes.
  1551. The |g:netrw_list_hide| variable holds a comma delimited list of patterns
  1552. based on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list.
  1553. (also see |netrw-ctrl-h|) To set the hiding list, use the <c-h> map. As an
  1554. example, to hide files which begin with a ".", one may use the <c-h> map to
  1555. set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*'
  1556. in one's <.vimrc>). One may then use the "a" key to show all files, hide
  1557. matching files, or to show only the matching files.
  1558. Example: \.[ch]$
  1559. This hiding list command will hide/show all *.c and *.h files.
  1560. Example: \.c$,\.h$
  1561. This hiding list command will also hide/show all *.c and *.h
  1562. files.
  1563. Don't forget to use the "a" map to select the mode (normal/hiding/show) you
  1564. want!
  1565. If files have been marked using |netrw-mf|, then this command will:
  1566. if showing all files or non-hidden files:
  1567. modify the g:netrw_list_hide list by appending the marked files to it
  1568. and showing only non-hidden files.
  1569. else if showing hidden files only:
  1570. modify the g:netrw_list_hide list by removing the marked files from it
  1571. and showing only non-hidden files.
  1572. endif
  1573. *netrw-gh* *netrw-hide*
  1574. As a quick shortcut, one may press >
  1575. gh
  1576. to toggle between hiding files which begin with a period (dot) and not hiding
  1577. them.
  1578. Associated setting variables: |g:netrw_list_hide| |g:netrw_hide|
  1579. Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh|
  1580. *netrw-gitignore*
  1581. Netrw provides a helper function 'netrw_gitignore#Hide()' that, when used with
  1582. |g:netrw_list_hide| automatically hides all git-ignored files.
  1583. 'netrw_gitignore#Hide' searches for patterns in the following files: >
  1584. './.gitignore'
  1585. './.git/info/exclude'
  1586. global gitignore file: `git config --global core.excludesfile`
  1587. system gitignore file: `git config --system core.excludesfile`
  1588. <
  1589. Files that do not exist, are ignored.
  1590. Git-ignore patterns are taken from existing files, and converted to patterns for
  1591. hiding files. For example, if you had '*.log' in your '.gitignore' file, it
  1592. would be converted to '.*\.log'.
  1593. To use this function, simply assign its output to |g:netrw_list_hide| option. >
  1594. Example: let g:netrw_list_hide= netrw_gitignore#Hide()
  1595. Git-ignored files are hidden in Netrw.
  1596. Example: let g:netrw_list_hide= netrw_gitignore#Hide('my_gitignore_file')
  1597. Function can take additional files with git-ignore patterns.
  1598. Example: let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$'
  1599. Combining 'netrw_gitignore#Hide' with custom patterns.
  1600. <
  1601. IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2
  1602. Especially with the remote directory browser, constantly entering the password
  1603. is tedious.
  1604. For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength
  1605. tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip
  1606. for setting up no-password ssh and scp and discusses associated security
  1607. issues. It used to be available at http://hacks.oreilly.com/pub/h/66 ,
  1608. but apparently that address is now being redirected to some "hackzine".
  1609. I'll attempt a summary based on that article and on a communication from
  1610. Ben Schmidt:
  1611. 1. Generate a public/private key pair on the local machine
  1612. (ssh client): >
  1613. ssh-keygen -t rsa
  1614. (saving the file in ~/.ssh/id_rsa as prompted)
  1615. <
  1616. 2. Just hit the <CR> when asked for passphrase (twice) for no
  1617. passphrase. If you do use a passphrase, you will also need to use
  1618. ssh-agent so you only have to type the passphrase once per session.
  1619. If you don't use a passphrase, simply logging onto your local
  1620. computer or getting access to the keyfile in any way will suffice
  1621. to access any ssh servers which have that key authorized for login.
  1622. 3. This creates two files: >
  1623. ~/.ssh/id_rsa
  1624. ~/.ssh/id_rsa.pub
  1625. <
  1626. 4. On the target machine (ssh server): >
  1627. cd
  1628. mkdir -p .ssh
  1629. chmod 0700 .ssh
  1630. <
  1631. 5. On your local machine (ssh client): (one line) >
  1632. ssh {serverhostname}
  1633. cat '>>' '~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub
  1634. <
  1635. or, for OpenSSH, (one line) >
  1636. ssh {serverhostname}
  1637. cat '>>' '~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub
  1638. <
  1639. You can test it out with >
  1640. ssh {serverhostname}
  1641. and you should be log onto the server machine without further need to type
  1642. anything.
  1643. If you decided to use a passphrase, do: >
  1644. ssh-agent $SHELL
  1645. ssh-add
  1646. ssh {serverhostname}
  1647. You will be prompted for your key passphrase when you use ssh-add, but not
  1648. subsequently when you use ssh. For use with vim, you can use >
  1649. ssh-agent vim
  1650. and, when next within vim, use >
  1651. :!ssh-add
  1652. Alternatively, you can apply ssh-agent to the terminal you're planning on
  1653. running vim in: >
  1654. ssh-agent xterm &
  1655. and do ssh-add whenever you need.
  1656. For Windows, folks on the vim mailing list have mentioned that Pageant helps
  1657. with avoiding the constant need to enter the password.
  1658. Kingston Fung wrote about another way to avoid constantly needing to enter
  1659. passwords:
  1660. In order to avoid the need to type in the password for scp each time, you
  1661. provide a hack in the docs to set up a non password ssh account. I found a
  1662. better way to do that: I can use a regular ssh account which uses a
  1663. password to access the material without the need to key-in the password
  1664. each time. It's good for security and convenience. I tried ssh public key
  1665. authorization + ssh-agent, implementing this, and it works! Here are two
  1666. links with instructions:
  1667. http://www.ibm.com/developerworks/library/l-keyc2/
  1668. http://sial.org/howto/openssh/publickey-auth/
  1669. Ssh hints:
  1670. Thomer Gil has provided a hint on how to speed up netrw+ssh:
  1671. http://thomer.com/howtos/netrw_ssh.html
  1672. Alex Young has several hints on speeding ssh up:
  1673. http://usevim.com/2012/03/16/editing-remote-files/
  1674. LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2
  1675. Pressing "qb" (query bookmarks) will list both the bookmarked directories and
  1676. directory traversal history.
  1677. Related Topics:
  1678. |netrw-gb| how to return (go) to a bookmark
  1679. |netrw-mb| how to make a bookmark
  1680. |netrw-mB| how to delete bookmarks
  1681. |netrw-u| change to a predecessor directory via the history stack
  1682. |netrw-U| change to a successor directory via the history stack
  1683. MAKING A NEW DIRECTORY *netrw-d* {{{2
  1684. With the "d" map one may make a new directory either remotely (which depends
  1685. on the global variable g:netrw_mkdir_cmd) or locally (which depends on the
  1686. global variable g:netrw_localmkdir). Netrw will issue a request for the new
  1687. directory's name. A bare <CR> at that point will abort the making of the
  1688. directory. Attempts to make a local directory that already exists (as either
  1689. a file or a directory) will be detected, reported on, and ignored.
  1690. Related topics: |netrw-D|
  1691. Associated setting variables: |g:netrw_localmkdir| |g:netrw_mkdir_cmd|
  1692. |g:netrw_remote_mkdir| |netrw-%|
  1693. MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-cd* {{{2
  1694. By default, |g:netrw_keepdir| is 1. This setting means that the current
  1695. directory will not track the browsing directory. (done for backwards
  1696. compatibility with v6's file explorer).
  1697. Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory
  1698. track netrw's browsing directory.
  1699. However, given the default setting for g:netrw_keepdir of 1 where netrw
  1700. maintains its own separate notion of the current directory, in order to make
  1701. the two directories the same, use the "cd" map (type cd). That map will
  1702. set Vim's notion of the current directory to netrw's current browsing
  1703. directory.
  1704. |netrw-cd| : This map's name was changed from "c" to cd (see |netrw-cd|).
  1705. This change was done to allow for |netrw-cb| and |netrw-cB| maps.
  1706. Associated setting variable: |g:netrw_keepdir|
  1707. MARKING FILES *netrw-:MF* *netrw-mf* {{{2
  1708. (also see |netrw-mr|)
  1709. Netrw provides several ways to mark files:
  1710. * One may mark files with the cursor atop a filename and
  1711. then pressing "mf".
  1712. * With gvim, in addition one may mark files with
  1713. <s-leftmouse>. (see |netrw-mouse|)
  1714. * One may use the :MF command, which takes a list of
  1715. files (for local directories, the list may include
  1716. wildcards -- see |glob()|) >
  1717. :MF *.c
  1718. <
  1719. (Note that :MF uses |<f-args>| to break the line
  1720. at spaces)
  1721. * Mark files using the |argument-list| (|netrw-mA|)
  1722. * Mark files based upon a |location-list| (|netrw-qL|)
  1723. * Mark files based upon the quickfix list (|netrw-qF|)
  1724. (|quickfix-error-lists|)
  1725. The following netrw maps make use of marked files:
  1726. |netrw-a| Hide marked files/directories
  1727. |netrw-D| Delete marked files/directories
  1728. |netrw-ma| Move marked files' names to |arglist|
  1729. |netrw-mA| Move |arglist| filenames to marked file list
  1730. |netrw-mb| Append marked files to bookmarks
  1731. |netrw-mB| Delete marked files from bookmarks
  1732. |netrw-mc| Copy marked files to target
  1733. |netrw-md| Apply vimdiff to marked files
  1734. |netrw-me| Edit marked files
  1735. |netrw-mF| Unmark marked files
  1736. |netrw-mg| Apply vimgrep to marked files
  1737. |netrw-mm| Move marked files to target
  1738. |netrw-mp| Print marked files
  1739. |netrw-ms| Netrw will source marked files
  1740. |netrw-mt| Set target for |netrw-mm| and |netrw-mc|
  1741. |netrw-mT| Generate tags using marked files
  1742. |netrw-mv| Apply vim command to marked files
  1743. |netrw-mx| Apply shell command to marked files
  1744. |netrw-mX| Apply shell command to marked files, en bloc
  1745. |netrw-mz| Compress/Decompress marked files
  1746. |netrw-O| Obtain marked files
  1747. |netrw-R| Rename marked files
  1748. One may unmark files one at a time the same way one marks them; ie. place
  1749. the cursor atop a marked file and press "mf". This process also works
  1750. with <s-leftmouse> using gvim. One may unmark all files by pressing
  1751. "mu" (see |netrw-mu|).
  1752. Marked files are highlighted using the "netrwMarkFile" highlighting group,
  1753. which by default is linked to "Identifier" (see Identifier under
  1754. |group-name|). You may change the highlighting group by putting something
  1755. like >
  1756. highlight clear netrwMarkFile
  1757. hi link netrwMarkFile ..whatever..
  1758. <
  1759. into $HOME/.vim/after/syntax/netrw.vim .
  1760. If the mouse is enabled and works with your vim, you may use <s-leftmouse> to
  1761. mark one or more files. You may mark multiple files by dragging the shifted
  1762. leftmouse. (see |netrw-mouse|)
  1763. *markfilelist* *global_markfilelist* *local_markfilelist*
  1764. All marked files are entered onto the global marked file list; there is only
  1765. one such list. In addition, every netrw buffer also has its own buffer-local
  1766. marked file list; since netrw buffers are associated with specific
  1767. directories, this means that each directory has its own local marked file
  1768. list. The various commands which operate on marked files use one or the other
  1769. of the marked file lists.
  1770. Known Problem: if one is using tree mode (|g:netrw_liststyle|) and several
  1771. directories have files with the same name, then marking such a file will
  1772. result in all such files being highlighted as if they were all marked. The
  1773. |markfilelist|, however, will only have the selected file in it. This problem
  1774. is unlikely to be fixed.
  1775. UNMARKING FILES *netrw-mF* {{{2
  1776. (also see |netrw-mf|, |netrw-mu|)
  1777. The "mF" command will unmark all files in the current buffer. One may also use
  1778. mf (|netrw-mf|) on a specific, already marked, file to unmark just that file.
  1779. MARKING FILES BY LOCATION LIST *netrw-qL* {{{2
  1780. (also see |netrw-mf|)
  1781. One may convert |location-list|s into a marked file list using "qL".
  1782. You may then proceed with commands such as me (|netrw-me|) to edit them.
  1783. MARKING FILES BY QUICKFIX LIST *netrw-qF* {{{2
  1784. (also see |netrw-mf|)
  1785. One may convert |quickfix-error-lists| into a marked file list using "qF".
  1786. You may then proceed with commands such as me (|netrw-me|) to edit them.
  1787. Quickfix error lists are generated, for example, by calls to |:vimgrep|.
  1788. MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
  1789. (also see |netrw-mf|)
  1790. One may also mark files by pressing "mr"; netrw will then issue a prompt,
  1791. "Enter regexp: ". You may then enter a shell-style regular expression such
  1792. as *.c$ (see |glob()|). For remote systems, glob() doesn't work -- so netrw
  1793. converts "*" into ".*" (see |regexp|) and marks files based on that. In the
  1794. future I may make it possible to use |regexp|s instead of glob()-style
  1795. expressions (yet-another-option).
  1796. See |cmdline-window| for directions on more on how to edit the regular
  1797. expression.
  1798. MARKED FILES, ARBITRARY VIM COMMAND *netrw-mv* {{{2
  1799. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1800. (uses the local marked-file list)
  1801. The "mv" map causes netrw to execute an arbitrary vim command on each file on
  1802. the local marked file list, individually:
  1803. * 1split
  1804. * sil! keepalt e file
  1805. * run vim command
  1806. * sil! keepalt wq!
  1807. A prompt, "Enter vim command: ", will be issued to elicit the vim command you
  1808. wish used. See |cmdline-window| for directions for more on how to edit the
  1809. command.
  1810. MARKED FILES, ARBITRARY SHELL COMMAND *netrw-mx* {{{2
  1811. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1812. (uses the local marked-file list)
  1813. Upon activation of the "mx" map, netrw will query the user for some (external)
  1814. command to be applied to all marked files. All "%"s in the command will be
  1815. substituted with the name of each marked file in turn. If no "%"s are in the
  1816. command, then the command will be followed by a space and a marked filename.
  1817. Example:
  1818. (mark files)
  1819. mx
  1820. Enter command: cat
  1821. The result is a series of shell commands:
  1822. cat 'file1'
  1823. cat 'file2'
  1824. ...
  1825. MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOC *netrw-mX* {{{2
  1826. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1827. (uses the global marked-file list)
  1828. Upon activation of the 'mX' map, netrw will query the user for some (external)
  1829. command to be applied to all marked files on the global marked file list. The
  1830. "en bloc" means that one command will be executed on all the files at once: >
  1831. command files
  1832. This approach is useful, for example, to select files and make a tarball: >
  1833. (mark files)
  1834. mX
  1835. Enter command: tar cf mynewtarball.tar
  1836. <
  1837. The command that will be run with this example:
  1838. tar cf mynewtarball.tar 'file1' 'file2' ...
  1839. MARKED FILES: ARGUMENT LIST *netrw-ma* *netrw-mA*
  1840. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1841. (uses the global marked-file list)
  1842. Using ma, one moves filenames from the marked file list to the argument list.
  1843. Using mA, one moves filenames from the argument list to the marked file list.
  1844. See Also: |netrw-cb| |netrw-cB| |netrw-qF| |argument-list| |:args|
  1845. MARKED FILES: BUFFER LIST *netrw-cb* *netrw-cB*
  1846. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1847. (uses the global marked-file list)
  1848. Using cb, one moves filenames from the marked file list to the buffer list.
  1849. Using cB, one copies filenames from the buffer list to the marked file list.
  1850. See Also: |netrw-ma| |netrw-mA| |netrw-qF| |buffer-list| |:buffers|
  1851. MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2
  1852. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1853. (uses the local marked file list)
  1854. If any marked files are compressed, then "mz" will decompress them.
  1855. If any marked files are decompressed, then "mz" will compress them
  1856. using the command specified by |g:netrw_compress|; by default,
  1857. that's "gzip".
  1858. For decompression, netrw uses a |Dictionary| of suffices and their
  1859. associated decompressing utilities; see |g:netrw_decompress|.
  1860. Remember that one can mark multiple files by regular expression
  1861. (see |netrw-mr|); this is particularly useful to facilitate compressing and
  1862. decompressing a large number of files.
  1863. Associated setting variables: |g:netrw_compress| |g:netrw_decompress|
  1864. MARKED FILES: COPYING *netrw-mc* {{{2
  1865. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1866. (Uses the global marked file list)
  1867. Select a target directory with mt (|netrw-mt|). Then change directory,
  1868. select file(s) (see |netrw-mf|), and press "mc". The copy is done
  1869. from the current window (where one does the mf) to the target.
  1870. If one does not have a target directory set with |netrw-mt|, then netrw
  1871. will query you for a directory to copy to.
  1872. One may also copy directories and their contents (local only) to a target
  1873. directory.
  1874. Associated setting variables:
  1875. |g:netrw_localcopycmd| |g:netrw_localcopycmdopt|
  1876. |g:netrw_localcopydircmd| |g:netrw_localcopydircmdopt|
  1877. |g:netrw_ssh_cmd|
  1878. MARKED FILES: DIFF *netrw-md* {{{2
  1879. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1880. (uses the global marked file list)
  1881. Use vimdiff to visualize difference between selected files (two or
  1882. three may be selected for this). Uses the global marked file list.
  1883. MARKED FILES: EDITING *netrw-me* {{{2
  1884. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1885. (uses the global marked file list)
  1886. The "me" command will place the marked files on the |arglist| and commence
  1887. editing them. One may return the to explorer window with |:Rexplore|.
  1888. (use |:n| and |:p| to edit next and previous files in the arglist)
  1889. MARKED FILES: GREP *netrw-mg* {{{2
  1890. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1891. (uses the global marked file list)
  1892. The "mg" command will apply |:vimgrep| to the marked files.
  1893. The command will ask for the requested pattern; one may then enter: >
  1894. /pattern/[g][j]
  1895. ! /pattern/[g][j]
  1896. pattern
  1897. <
  1898. With /pattern/, editing will start with the first item on the |quickfix| list
  1899. that vimgrep sets up (see |:copen|, |:cnext|, |:cprevious|, |:cclose|). The |:vimgrep|
  1900. command is in use, so without 'g' each line is added to quickfix list only
  1901. once; with 'g' every match is included.
  1902. With /pattern/j, "mg" will winnow the current marked file list to just those
  1903. marked files also possessing the specified pattern. Thus, one may use >
  1904. mr ...file-pattern...
  1905. mg /pattern/j
  1906. <
  1907. to have a marked file list satisfying the file-pattern but also restricted to
  1908. files containing some desired pattern.
  1909. MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2
  1910. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1911. (uses the local marked file list)
  1912. The "mh" command extracts the suffices of the marked files and toggles their
  1913. presence on the hiding list. Please note that marking the same suffix
  1914. this way multiple times will result in the suffix's presence being toggled
  1915. for each file (so an even quantity of marked files having the same suffix
  1916. is the same as not having bothered to select them at all).
  1917. Related topics: |netrw-a| |g:netrw_list_hide|
  1918. MARKED FILES: MOVING *netrw-mm* {{{2
  1919. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1920. (uses the global marked file list)
  1921. WARNING: moving files is more dangerous than copying them.
  1922. A file being moved is first copied and then deleted; if the
  1923. copy operation fails and the delete succeeds, you will lose
  1924. the file. Either try things out with unimportant files
  1925. first or do the copy and then delete yourself using mc and D.
  1926. Use at your own risk!
  1927. Select a target directory with mt (|netrw-mt|). Then change directory,
  1928. select file(s) (see |netrw-mf|), and press "mm". The move is done
  1929. from the current window (where one does the mf) to the target.
  1930. Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|
  1931. MARKED FILES: PRINTING *netrw-mp* {{{2
  1932. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1933. (uses the local marked file list)
  1934. When "mp" is used, netrw will apply the |:hardcopy| command to marked files.
  1935. What netrw does is open each file in a one-line window, execute hardcopy, then
  1936. close the one-line window.
  1937. MARKED FILES: SOURCING *netrw-ms* {{{2
  1938. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1939. (uses the local marked file list)
  1940. With "ms", netrw will source the marked files (using vim's |:source| command)
  1941. MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2
  1942. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1943. Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
  1944. * If the cursor is atop a file name, then the netrw window's currently
  1945. displayed directory is used for the copy/move-to target.
  1946. * Also, if the cursor is in the banner, then the netrw window's currently
  1947. displayed directory is used for the copy/move-to target.
  1948. Unless the target already is the current directory. In which case,
  1949. typing "mf" clears the target.
  1950. * However, if the cursor is atop a directory name, then that directory is
  1951. used for the copy/move-to target
  1952. * One may use the :MT [directory] command to set the target *netrw-:MT*
  1953. This command uses |<q-args>|, so spaces in the directory name are
  1954. permitted without escaping.
  1955. * With mouse-enabled vim or with gvim, one may select a target by using
  1956. <c-leftmouse>
  1957. There is only one copy/move-to target at a time in a vim session; ie. the
  1958. target is a script variable (see |s:var|) and is shared between all netrw
  1959. windows (in an instance of vim).
  1960. When using menus and gvim, netrw provides a "Targets" entry which allows one
  1961. to pick a target from the list of bookmarks and history.
  1962. Related topics:
  1963. Marking Files......................................|netrw-mf|
  1964. Marking Files by Regular Expression................|netrw-mr|
  1965. Marked Files: Target Directory Using Bookmarks.....|netrw-Tb|
  1966. Marked Files: Target Directory Using History.......|netrw-Th|
  1967. MARKED FILES: TAGGING *netrw-mT* {{{2
  1968. (See |netrw-mf| and |netrw-mr| for how to mark files)
  1969. (uses the global marked file list)
  1970. The "mT" mapping will apply the command in |g:netrw_ctags| (by default, it is
  1971. "ctags") to marked files. For remote browsing, in order to create a tags file
  1972. netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for
  1973. this to work on remote systems. For your local system, see |ctags| on how to
  1974. get a version. I myself use hdrtags, currently available at
  1975. http://www.drchip.org/astronaut/src/index.html , and have >
  1976. let g:netrw_ctags= "hdrtag"
  1977. <
  1978. in my <.vimrc>.
  1979. When a remote set of files are tagged, the resulting tags file is "obtained";
  1980. ie. a copy is transferred to the local system's directory. The now local tags
  1981. file is then modified so that one may use it through the network. The
  1982. modification made concerns the names of the files in the tags; each filename is
  1983. preceded by the netrw-compatible URL used to obtain it. When one subsequently
  1984. uses one of the go to tag actions (|tags|), the URL will be used by netrw to
  1985. edit the desired file and go to the tag.
  1986. Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd|
  1987. MARKED FILES: TARGET DIRECTORY USING BOOKMARKS *netrw-Tb* {{{2
  1988. Sets the marked file copy/move-to target.
  1989. The |netrw-qb| map will give you a list of bookmarks (and history).
  1990. One may choose one of the bookmarks to become your marked file
  1991. target by using [count]Tb (default count: 1).
  1992. Related topics:
  1993. Copying files to target............................|netrw-mc|
  1994. Listing Bookmarks and History......................|netrw-qb|
  1995. Marked Files: Setting The Target Directory.........|netrw-mt|
  1996. Marked Files: Target Directory Using History.......|netrw-Th|
  1997. Marking Files......................................|netrw-mf|
  1998. Marking Files by Regular Expression................|netrw-mr|
  1999. Moving files to target.............................|netrw-mm|
  2000. MARKED FILES: TARGET DIRECTORY USING HISTORY *netrw-Th* {{{2
  2001. Sets the marked file copy/move-to target.
  2002. The |netrw-qb| map will give you a list of history (and bookmarks).
  2003. One may choose one of the history entries to become your marked file
  2004. target by using [count]Th (default count: 0; ie. the current directory).
  2005. Related topics:
  2006. Copying files to target............................|netrw-mc|
  2007. Listing Bookmarks and History......................|netrw-qb|
  2008. Marked Files: Setting The Target Directory.........|netrw-mt|
  2009. Marked Files: Target Directory Using Bookmarks.....|netrw-Tb|
  2010. Marking Files......................................|netrw-mf|
  2011. Marking Files by Regular Expression................|netrw-mr|
  2012. Moving files to target.............................|netrw-mm|
  2013. MARKED FILES: UNMARKING *netrw-mu* {{{2
  2014. (See |netrw-mf|, |netrw-mF|)
  2015. The "mu" mapping will unmark all currently marked files. This command differs
  2016. from "mF" as the latter only unmarks files in the current directory whereas
  2017. "mu" will unmark global and all buffer-local marked files.
  2018. (see |netrw-mF|)
  2019. *netrw-browser-settings*
  2020. NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2
  2021. (if you're interested in the netrw file transfer settings, see |netrw-options|
  2022. and |netrw-protocol|)
  2023. The <netrw.vim> browser provides settings in the form of variables which
  2024. you may modify; by placing these settings in your <.vimrc>, you may customize
  2025. your browsing preferences. (see also: |netrw-settings|)
  2026. >
  2027. --- -----------
  2028. Var Explanation
  2029. --- -----------
  2030. < *g:netrw_altfile* some like |CTRL-^| to return to the last
  2031. edited file. Choose that by setting this
  2032. parameter to 1.
  2033. Others like |CTRL-^| to return to the
  2034. netrw browsing buffer. Choose that by setting
  2035. this parameter to 0.
  2036. default: =0
  2037. *g:netrw_alto* change from above splitting to below splitting
  2038. by setting this variable (see |netrw-o|)
  2039. default: =&sb (see |'sb'|)
  2040. *g:netrw_altv* change from left splitting to right splitting
  2041. by setting this variable (see |netrw-v|)
  2042. default: =&spr (see |'spr'|)
  2043. *g:netrw_banner* enable/suppress the banner
  2044. =0: suppress the banner
  2045. =1: banner is enabled (default)
  2046. *g:netrw_bannerbackslash* if this variable exists and is not zero, the
  2047. banner will be displayed with backslashes
  2048. rather than forward slashes.
  2049. *g:netrw_browse_split* when browsing, <cr> will open the file by:
  2050. =0: re-using the same window (default)
  2051. =1: horizontally splitting the window first
  2052. =2: vertically splitting the window first
  2053. =3: open file in new tab
  2054. =4: act like "P" (ie. open previous window)
  2055. Note that |g:netrw_preview| may be used
  2056. to get vertical splitting instead of
  2057. horizontal splitting.
  2058. =[servername,tab-number,window-number]
  2059. Given a |List| such as this, a remote server
  2060. named by the "servername" will be used for
  2061. editing. It will also use the specified tab
  2062. and window numbers to perform editing
  2063. (see |clientserver|, |netrw-ctrl-r|)
  2064. This option does not affect the production of
  2065. |:Lexplore| windows.
  2066. Related topics:
  2067. |g:netrw_alto| |g:netrw_altv|
  2068. |netrw-C| |netrw-cr|
  2069. |netrw-ctrl-r|
  2070. *g:netrw_browsex_viewer* specify user's preference for a viewer: >
  2071. "kfmclient exec"
  2072. "gnome-open"
  2073. < If >
  2074. "-"
  2075. < is used, then netrwFileHandler() will look for
  2076. a script/function to handle the given
  2077. extension. (see |netrw_filehandler|).
  2078. *g:netrw_browsex_support_remote*
  2079. specify if the specified viewer supports a
  2080. remote URL. (see |netrw-handler|).
  2081. *g:netrw_chgperm* Unix/Linux: "chmod PERM FILENAME"
  2082. Windows: "cacls FILENAME /e /p PERM"
  2083. Used to change access permission for a file.
  2084. *g:netrw_clipboard* =1
  2085. By default, netrw will attempt to insure that
  2086. the clipboard's values will remain unchanged.
  2087. However, some users report that they have
  2088. speed problems with this; consequently, this
  2089. option, when set to zero, lets such users
  2090. prevent netrw from saving and restoring the
  2091. clipboard (the latter is done only as needed).
  2092. That means that if the clipboard is changed
  2093. (inadvertently) by normal netrw operation that
  2094. it will not be restored to its prior state.
  2095. *g:netrw_compress* ="gzip"
  2096. Will compress marked files with this
  2097. command
  2098. *g:Netrw_corehandler* Allows one to specify something additional
  2099. to do when handling <core> files via netrw's
  2100. browser's "x" command (see |netrw-x|). If
  2101. present, g:Netrw_corehandler specifies
  2102. either one or more function references
  2103. (see |Funcref|). (the capital g:Netrw...
  2104. is required its holding a function reference)
  2105. *g:netrw_ctags* ="ctags"
  2106. The default external program used to create
  2107. tags
  2108. *g:netrw_cursor* = 2 (default)
  2109. This option controls the use of the
  2110. |'cursorline'| (cul) and |'cursorcolumn'|
  2111. (cuc) settings by netrw:
  2112. Value Thin-Long-Tree Wide
  2113. =0 u-cul u-cuc u-cul u-cuc
  2114. =1 u-cul u-cuc cul u-cuc
  2115. =2 cul u-cuc cul u-cuc
  2116. =3 cul u-cuc cul cuc
  2117. =4 cul cuc cul cuc
  2118. =5 U-cul U-cuc U-cul U-cuc
  2119. =6 U-cul U-cuc cul U-cuc
  2120. =7 cul U-cuc cul U-cuc
  2121. =8 cul U-cuc cul cuc
  2122. Where
  2123. u-cul : user's |'cursorline'| initial setting used
  2124. u-cuc : user's |'cursorcolumn'| initial setting used
  2125. U-cul : user's |'cursorline'| current setting used
  2126. U-cuc : user's |'cursorcolumn'| current setting used
  2127. cul : |'cursorline'| will be locally set
  2128. cuc : |'cursorcolumn'| will be locally set
  2129. The "initial setting" means the values of
  2130. the |'cuc'| and |'cul'| settings in effect when
  2131. netrw last saw |g:netrw_cursor| >= 5 or when
  2132. netrw was initially run.
  2133. *g:netrw_decompress* = { ".gz" : "gunzip" ,
  2134. ".bz2" : "bunzip2" ,
  2135. ".zip" : "unzip" ,
  2136. ".tar" : "tar -xf"}
  2137. A dictionary mapping suffices to
  2138. decompression programs.
  2139. *g:netrw_dirhistmax* =10: controls maximum quantity of past
  2140. history. May be zero to suppress
  2141. history.
  2142. (related: |netrw-qb| |netrw-u| |netrw-U|)
  2143. *g:netrw_dynamic_maxfilenamelen* =32: enables dynamic determination of
  2144. |g:netrw_maxfilenamelen|, which affects
  2145. local file long listing.
  2146. *g:netrw_errorlvl* =0: error levels greater than or equal to
  2147. this are permitted to be displayed
  2148. 0: notes
  2149. 1: warnings
  2150. 2: errors
  2151. *g:netrw_fastbrowse* =0: slow speed directory browsing;
  2152. never re-uses directory listings;
  2153. always obtains directory listings.
  2154. =1: medium speed directory browsing;
  2155. re-use directory listings only
  2156. when remote directory browsing.
  2157. (default value)
  2158. =2: fast directory browsing;
  2159. only obtains directory listings when the
  2160. directory hasn't been seen before
  2161. (or |netrw-ctrl-l| is used).
  2162. Fast browsing retains old directory listing
  2163. buffers so that they don't need to be
  2164. re-acquired. This feature is especially
  2165. important for remote browsing. However, if
  2166. a file is introduced or deleted into or from
  2167. such directories, the old directory buffer
  2168. becomes out-of-date. One may always refresh
  2169. such a directory listing with |netrw-ctrl-l|.
  2170. This option gives the user the choice of
  2171. trading off accuracy (ie. up-to-date listing)
  2172. versus speed.
  2173. *g:netrw_ffkeep* (default: doesn't exist)
  2174. If this variable exists and is zero, then
  2175. netrw will not do a save and restore for
  2176. |'fileformat'|.
  2177. *g:netrw_fname_escape* =' ?&;%'
  2178. Used on filenames before remote reading/writing
  2179. *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
  2180. that can show up as "directories" and "files"
  2181. in the listing. This pattern is used to
  2182. remove such embedded messages. By default its
  2183. value is:
  2184. '^total\s\+\d\+$\|
  2185. ^Trying\s\+\d\+.*$\|
  2186. ^KERBEROS_V\d rejected\|
  2187. ^Security extensions not\|
  2188. No such file\|
  2189. : connect to address [0-9a-fA-F:]*
  2190. : No route to host$'
  2191. *g:netrw_ftp_list_cmd* options for passing along to ftp for directory
  2192. listing. Defaults:
  2193. unix or g:netrw_cygwin set: : "ls -lF"
  2194. otherwise "dir"
  2195. *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory
  2196. listing, sorted by size of file.
  2197. Defaults:
  2198. unix or g:netrw_cygwin set: : "ls -slF"
  2199. otherwise "dir"
  2200. *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory
  2201. listing, sorted by time of last modification.
  2202. Defaults:
  2203. unix or g:netrw_cygwin set: : "ls -tlF"
  2204. otherwise "dir"
  2205. *g:netrw_glob_escape* ='[]*?`{~$' (unix)
  2206. ='[]*?`{$' (windows
  2207. These characters in directory names are
  2208. escaped before applying glob()
  2209. *g:netrw_gx* ="<cfile>"
  2210. This option controls how gx (|netrw-gx|) picks
  2211. up the text under the cursor. See |expand()|
  2212. for possibilities.
  2213. *g:netrw_hide* Controlled by the "a" map (see |netrw-a|)
  2214. =0 : show all
  2215. =1 : show not-hidden files
  2216. =2 : show hidden files only
  2217. default: =1
  2218. *g:netrw_home* The home directory for where bookmarks and
  2219. history are saved (as .netrwbook and
  2220. .netrwhist).
  2221. Netrw uses |expand()| on the string.
  2222. default: stdpath("data") (see |stdpath()|)
  2223. *g:netrw_keepdir* =1 (default) keep current directory immune from
  2224. the browsing directory.
  2225. =0 keep the current directory the same as the
  2226. browsing directory.
  2227. The current browsing directory is contained in
  2228. b:netrw_curdir (also see |netrw-cd|)
  2229. *g:netrw_keepj* ="keepj" (default) netrw attempts to keep the
  2230. |:jumps| table unaffected.
  2231. ="" netrw will not use |:keepjumps| with
  2232. exceptions only for the
  2233. saving/restoration of position.
  2234. *g:netrw_list_cmd* command for listing remote directories
  2235. default: (if ssh is executable)
  2236. "ssh HOSTNAME ls -FLa"
  2237. *g:netrw_list_cmd_options* If this variable exists, then its contents are
  2238. appended to the g:netrw_list_cmd. For
  2239. example, use "2>/dev/null" to get rid of banner
  2240. messages on unix systems.
  2241. *g:netrw_liststyle* Set the default listing style:
  2242. = 0: thin listing (one file per line)
  2243. = 1: long listing (one file per line with time
  2244. stamp information and file size)
  2245. = 2: wide listing (multiple files in columns)
  2246. = 3: tree style listing
  2247. *g:netrw_list_hide* comma-separated pattern list for hiding files
  2248. Patterns are regular expressions (see |regexp|)
  2249. There's some special support for git-ignore
  2250. files: you may add the output from the helper
  2251. function 'netrw_gitignore#Hide() automatically
  2252. hiding all gitignored files.
  2253. For more details see |netrw-gitignore|.
  2254. Examples:
  2255. let g:netrw_list_hide= '.*\.swp$'
  2256. let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$'
  2257. default: ""
  2258. *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin
  2259. =expand("$COMSPEC") Windows
  2260. Copies marked files (|netrw-mf|) to target
  2261. directory (|netrw-mt|, |netrw-mc|)
  2262. *g:netrw_localcopycmdopt* ='' Linux/Unix/MacOS/Cygwin
  2263. =' \c copy' Windows
  2264. Options for the |g:netrw_localcopycmd|
  2265. *g:netrw_localcopydircmd* ="cp" Linux/Unix/MacOS/Cygwin
  2266. =expand("$COMSPEC") Windows
  2267. Copies directories to target directory.
  2268. (|netrw-mc|, |netrw-mt|)
  2269. *g:netrw_localcopydircmdopt* =" -R" Linux/Unix/MacOS/Cygwin
  2270. =" /c xcopy /e /c /h/ /i /k" Windows
  2271. Options for |g:netrw_localcopydircmd|
  2272. *g:netrw_localmkdir* ="mkdir" Linux/Unix/MacOS/Cygwin
  2273. =expand("$COMSPEC") Windows
  2274. command for making a local directory
  2275. *g:netrw_localmkdiropt* ="" Linux/Unix/MacOS/Cygwin
  2276. =" /c mkdir" Windows
  2277. Options for |g:netrw_localmkdir|
  2278. *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin
  2279. =expand("$COMSPEC") Windows
  2280. Moves marked files (|netrw-mf|) to target
  2281. directory (|netrw-mt|, |netrw-mm|)
  2282. *g:netrw_localmovecmdopt* ="" Linux/Unix/MacOS/Cygwin
  2283. =" /c move" Windows
  2284. Options for |g:netrw_localmovecmd|
  2285. *g:netrw_localrmdir* ="rmdir" Linux/Unix/MacOS/Cygwin
  2286. =expand("$COMSPEC") Windows
  2287. Remove directory command (rmdir)
  2288. This variable is only used if your vim is
  2289. earlier than 7.4 or if your vim doesn't
  2290. have patch#1107. Otherwise, |delete()|
  2291. is used with the "d" option.
  2292. *g:netrw_localrmdiropt* ="" Linux/Unix/MacOS/Cygwin
  2293. =" /c rmdir" Windows
  2294. Options for |g:netrw_localrmdir|
  2295. *g:netrw_maxfilenamelen* =32 by default, selected so as to make long
  2296. listings fit on 80 column displays.
  2297. If your screen is wider, and you have file
  2298. or directory names longer than 32 bytes,
  2299. you may set this option to keep listings
  2300. columnar.
  2301. *g:netrw_mkdir_cmd* command for making a remote directory
  2302. via ssh (also see |g:netrw_remote_mkdir|)
  2303. default: "ssh USEPORT HOSTNAME mkdir"
  2304. *g:netrw_mousemaps* =1 (default) enables mouse buttons while
  2305. browsing to:
  2306. leftmouse : open file/directory
  2307. shift-leftmouse : mark file
  2308. middlemouse : same as P
  2309. rightmouse : remove file/directory
  2310. =0: disables mouse maps
  2311. *g:netrw_nobeval* doesn't exist (default)
  2312. If this variable exists, then balloon
  2313. evaluation will be suppressed
  2314. (see |'ballooneval'|)
  2315. *g:netrw_sizestyle* not defined: actual bytes (default)
  2316. ="b" : actual bytes (default)
  2317. ="h" : human-readable (ex. 5k, 4m, 3g)
  2318. uses 1000 base
  2319. ="H" : human-readable (ex. 5K, 4M, 3G)
  2320. uses 1024 base
  2321. The long listing (|netrw-i|) and query-file
  2322. maps (|netrw-qf|) will display file size
  2323. using the specified style.
  2324. *g:netrw_usetab* if this variable exists and is non-zero, then
  2325. the <tab> map supporting shrinking/expanding a
  2326. Lexplore or netrw window will be enabled.
  2327. (see |netrw-c-tab|)
  2328. *g:netrw_remote_mkdir* command for making a remote directory
  2329. via ftp (also see |g:netrw_mkdir_cmd|)
  2330. default: "mkdir"
  2331. *g:netrw_retmap* if it exists and is set to one, then:
  2332. * if in a netrw-selected file, AND
  2333. * no normal-mode <2-leftmouse> mapping exists,
  2334. then the <2-leftmouse> will be mapped for easy
  2335. return to the netrw browser window.
  2336. example: click once to select and open a file,
  2337. double-click to return.
  2338. Note that one may instead choose to:
  2339. * let g:netrw_retmap= 1, AND
  2340. * nmap <silent> YourChoice <Plug>NetrwReturn
  2341. and have another mapping instead of
  2342. <2-leftmouse> to invoke the return.
  2343. You may also use the |:Rexplore| command to do
  2344. the same thing.
  2345. default: =0
  2346. *g:netrw_rm_cmd* command for removing remote files
  2347. default: "ssh USEPORT HOSTNAME rm"
  2348. *g:netrw_rmdir_cmd* command for removing remote directories
  2349. default: "ssh USEPORT HOSTNAME rmdir"
  2350. *g:netrw_rmf_cmd* command for removing remote softlinks
  2351. default: "ssh USEPORT HOSTNAME rm -f"
  2352. *g:netrw_servername* use this variable to provide a name for
  2353. |netrw-ctrl-r| to use for its server.
  2354. default: "NETRWSERVER"
  2355. *g:netrw_sort_by* sort by "name", "time", "size", or
  2356. "exten".
  2357. default: "name"
  2358. *g:netrw_sort_direction* sorting direction: "normal" or "reverse"
  2359. default: "normal"
  2360. *g:netrw_sort_options* sorting is done using |:sort|; this
  2361. variable's value is appended to the
  2362. sort command. Thus one may ignore case,
  2363. for example, with the following in your
  2364. .vimrc: >
  2365. let g:netrw_sort_options="i"
  2366. < default: ""
  2367. *g:netrw_sort_sequence* when sorting by name, first sort by the
  2368. comma-separated pattern sequence. Note that
  2369. any filigree added to indicate filetypes
  2370. should be accounted for in your pattern.
  2371. default: '[\/]$,*,\.bak$,\.o$,\.h$,
  2372. \.info$,\.swp$,\.obj$'
  2373. *g:netrw_special_syntax* If true, then certain files will be shown
  2374. using special syntax in the browser:
  2375. netrwBak : *.bak
  2376. netrwCompress: *.gz *.bz2 *.Z *.zip
  2377. netrwCoreDump: core.\d\+
  2378. netrwData : *.dat
  2379. netrwDoc : *.doc,*.txt,*.pdf,
  2380. *.pdf,*.docx
  2381. netrwHdr : *.h
  2382. netrwLex : *.l *.lex
  2383. netrwLib : *.a *.so *.lib *.dll
  2384. netrwMakefile: [mM]akefile *.mak
  2385. netrwObj : *.o *.obj
  2386. netrwPix : *.bmp,*.fit,*.fits,*.gif,
  2387. *.jpg,*.jpeg,*.pcx,*.ppc
  2388. *.pgm,*.png,*.psd,*.rgb
  2389. *.tif,*.xbm,*.xcf
  2390. netrwTags : tags ANmenu ANtags
  2391. netrwTilde : *
  2392. netrwTmp : tmp* *tmp
  2393. netrwYacc : *.y
  2394. In addition, those groups mentioned in
  2395. |'suffixes'| are also added to the special
  2396. file highlighting group.
  2397. These syntax highlighting groups are linked
  2398. to netrwGray or Folded by default
  2399. (see |hl-Folded|), but one may put lines like >
  2400. hi link netrwCompress Visual
  2401. < into one's <.vimrc> to use one's own
  2402. preferences. Alternatively, one may
  2403. put such specifications into >
  2404. .vim/after/syntax/netrw.vim.
  2405. < The netrwGray highlighting is set up by
  2406. netrw when >
  2407. * netrwGray has not been previously
  2408. defined
  2409. * the gui is running
  2410. < As an example, I myself use a dark-background
  2411. colorscheme with the following in
  2412. .vim/after/syntax/netrw.vim: >
  2413. hi netrwCompress term=NONE cterm=NONE gui=NONE ctermfg=10 guifg=green ctermbg=0 guibg=black
  2414. hi netrwData term=NONE cterm=NONE gui=NONE ctermfg=9 guifg=blue ctermbg=0 guibg=black
  2415. hi netrwHdr term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1
  2416. hi netrwLex term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1
  2417. hi netrwYacc term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1
  2418. hi netrwLib term=NONE cterm=NONE gui=NONE ctermfg=14 guifg=yellow
  2419. hi netrwObj term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red
  2420. hi netrwTilde term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red
  2421. hi netrwTmp term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red
  2422. hi netrwTags term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red
  2423. hi netrwDoc term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=yellow2 guibg=Blue3
  2424. hi netrwSymLink term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=grey60
  2425. <
  2426. *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines,
  2427. messages, banners, and whatnot that one doesn't
  2428. want masquerading as "directories" and "files".
  2429. Use this pattern to remove such embedded
  2430. messages. By default its value is:
  2431. '^total\s\+\d\+$'
  2432. *g:netrw_ssh_cmd* One may specify an executable command
  2433. to use instead of ssh for remote actions
  2434. such as listing, file removal, etc.
  2435. default: ssh
  2436. *g:netrw_suppress_gx_mesg* =1 : browsers sometimes produce messages
  2437. which are normally unwanted intermixed
  2438. with the page.
  2439. However, when using links, for example,
  2440. those messages are what the browser produces.
  2441. By setting this option to 0, netrw will not
  2442. suppress browser messages.
  2443. *g:netrw_tmpfile_escape* =' &;'
  2444. escape() is applied to all temporary files
  2445. to escape these characters.
  2446. *g:netrw_timefmt* specify format string to vim's strftime().
  2447. The default, "%c", is "the preferred date
  2448. and time representation for the current
  2449. locale" according to my manpage entry for
  2450. strftime(); however, not all are satisfied
  2451. with it. Some alternatives:
  2452. "%a %d %b %Y %T",
  2453. " %a %Y-%m-%d %I-%M-%S %p"
  2454. default: "%c"
  2455. *g:netrw_use_noswf* netrw normally avoids writing swapfiles
  2456. for browser buffers. However, under some
  2457. systems this apparently is causing nasty
  2458. ml_get errors to appear; if you're getting
  2459. ml_get errors, try putting
  2460. let g:netrw_use_noswf= 0
  2461. in your .vimrc.
  2462. default: 1
  2463. *g:netrw_winsize* specify initial size of new windows made with
  2464. "o" (see |netrw-o|), "v" (see |netrw-v|),
  2465. |:Hexplore| or |:Vexplore|. The g:netrw_winsize
  2466. is an integer describing the percentage of the
  2467. current netrw buffer's window to be used for
  2468. the new window.
  2469. If g:netrw_winsize is less than zero, then
  2470. the absolute value of g:netrw_winsize will be
  2471. used to specify the quantity of lines or
  2472. columns for the new window.
  2473. If g:netrw_winsize is zero, then a normal
  2474. split will be made (ie. |'equalalways'| will
  2475. take effect, for example).
  2476. default: 50 (for 50%)
  2477. *g:netrw_wiw* =1 specifies the minimum window width to use
  2478. when shrinking a netrw/Lexplore window
  2479. (see |netrw-c-tab|).
  2480. *g:netrw_xstrlen* Controls how netrw computes string lengths,
  2481. including multi-byte characters' string
  2482. length. (thanks to N Weibull, T Mechelynck)
  2483. =0: uses Vim's built-in strlen()
  2484. =1: number of codepoints (Latin a + combining
  2485. circumflex is two codepoints) (DEFAULT)
  2486. =2: number of spacing codepoints (Latin a +
  2487. combining circumflex is one spacing
  2488. codepoint; a hard tab is one; wide and
  2489. narrow CJK are one each; etc.)
  2490. =3: virtual length (counting tabs as anything
  2491. between 1 and |'tabstop'|, wide CJK as 2
  2492. rather than 1, Arabic alif as zero when
  2493. immediately preceded by lam, one
  2494. otherwise, etc)
  2495. *g:NetrwTopLvlMenu* This variable specifies the top level
  2496. menu name; by default, it's "Netrw.". If
  2497. you wish to change this, do so in your
  2498. .vimrc.
  2499. NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* {{{2
  2500. Netrw has been designed to handle user options by saving them, setting the
  2501. options to something that's compatible with netrw's needs, and then restoring
  2502. them. However, the autochdir option: >
  2503. :set acd
  2504. is problematic. Autochdir sets the current directory to that containing the
  2505. file you edit; this apparently also applies to directories. In other words,
  2506. autochdir sets the current directory to that containing the "file" (even if
  2507. that "file" is itself a directory).
  2508. NETRW SETTINGS WINDOW *netrw-settings-window* {{{2
  2509. With the NetrwSettings.vim plugin, >
  2510. :NetrwSettings
  2511. will bring up a window with the many variables that netrw uses for its
  2512. settings. You may change any of their values; when you save the file, the
  2513. settings therein will be used. One may also press "?" on any of the lines for
  2514. help on what each of the variables do.
  2515. (also see: |netrw-browser-var| |netrw-protocol| |netrw-variables|)
  2516. ==============================================================================
  2517. OBTAINING A FILE *netrw-obtain* *netrw-O* {{{2
  2518. If there are no marked files:
  2519. When browsing a remote directory, one may obtain a file under the cursor
  2520. (ie. get a copy on your local machine, but not edit it) by pressing the O
  2521. key.
  2522. If there are marked files:
  2523. The marked files will be obtained (ie. a copy will be transferred to your
  2524. local machine, but not set up for editing).
  2525. Only ftp and scp are supported for this operation (but since these two are
  2526. available for browsing, that shouldn't be a problem). The status bar will
  2527. then show, on its right hand side, a message like "Obtaining filename". The
  2528. statusline will be restored after the transfer is complete.
  2529. Netrw can also "obtain" a file using the local browser. Netrw's display
  2530. of a directory is not necessarily the same as Vim's "current directory",
  2531. unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select
  2532. a file using the local browser (by putting the cursor on it) and pressing
  2533. "O" will then "obtain" the file; ie. copy it to Vim's current directory.
  2534. Related topics:
  2535. * To see what the current directory is, use |:pwd|
  2536. * To make the currently browsed directory the current directory, see
  2537. |netrw-cd|
  2538. * To automatically make the currently browsed directory the current
  2539. directory, see |g:netrw_keepdir|.
  2540. *netrw-newfile* *netrw-createfile*
  2541. OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%* {{{2
  2542. To open a new file in netrw's current directory, press "%". This map
  2543. will query the user for a new filename; an empty file by that name will
  2544. be placed in the netrw's current directory (ie. b:netrw_curdir).
  2545. If Lexplore (|netrw-:Lexplore|) is in use, the new file will be generated
  2546. in the |g:netrw_chgwin| window.
  2547. Related topics: |netrw-d|
  2548. PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2
  2549. One may use a preview window by using the "p" key when the cursor is atop the
  2550. desired filename to be previewed. The display will then split to show both
  2551. the browser (where the cursor will remain) and the file (see |:pedit|). By
  2552. default, the split will be taken horizontally; one may use vertical splitting
  2553. if one has set |g:netrw_preview| first.
  2554. An interesting set of netrw settings is: >
  2555. let g:netrw_preview = 1
  2556. let g:netrw_liststyle = 3
  2557. let g:netrw_winsize = 30
  2558. These will:
  2559. 1. Make vertical splitting the default for previewing files
  2560. 2. Make the default listing style "tree"
  2561. 3. When a vertical preview window is opened, the directory listing
  2562. will use only 30% of the columns available; the rest of the window
  2563. is used for the preview window.
  2564. Related: if you like this idea, you may also find :Lexplore
  2565. (|netrw-:Lexplore|) or |g:netrw_chgwin| of interest
  2566. Also see: |g:netrw_chgwin| |netrw-P| |'previewwindow'| |CTRL-W_z| |:pclose|
  2567. PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2
  2568. To edit a file or directory under the cursor in the previously used (last
  2569. accessed) window (see :he |CTRL-W_p|), press a "P". If there's only one
  2570. window, then the one window will be horizontally split (by default).
  2571. If there's more than one window, the previous window will be re-used on
  2572. the selected file/directory. If the previous window's associated buffer
  2573. has been modified, and there's only one window with that buffer, then
  2574. the user will be asked if they wish to save the buffer first (yes, no, or
  2575. cancel).
  2576. Related Actions |netrw-cr| |netrw-o| |netrw-t| |netrw-v|
  2577. Associated setting variables:
  2578. |g:netrw_alto| control above/below splitting
  2579. |g:netrw_altv| control right/left splitting
  2580. |g:netrw_preview| control horizontal vs vertical splitting
  2581. |g:netrw_winsize| control initial sizing
  2582. Also see: |g:netrw_chgwin| |netrw-p|
  2583. REFRESHING THE LISTING *netrw-refresh* *netrw-ctrl-l* *netrw-ctrl_l* {{{2
  2584. To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
  2585. hit the <cr> when atop the ./ directory entry in the listing. One may also
  2586. refresh a local directory by using ":e .".
  2587. REVERSING SORTING ORDER *netrw-r* *netrw-reverse* {{{2
  2588. One may toggle between normal and reverse sorting order by pressing the
  2589. "r" key.
  2590. Related topics: |netrw-s|
  2591. Associated setting variable: |g:netrw_sort_direction|
  2592. RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2
  2593. If there are no marked files: (see |netrw-mf|)
  2594. Renaming files and directories involves moving the cursor to the
  2595. file/directory to be moved (renamed) and pressing "R". You will then be
  2596. queried for what you want the file/directory to be renamed to. You may
  2597. select a range of lines with the "V" command (visual selection), and then
  2598. press "R"; you will be queried for each file as to what you want it
  2599. renamed to.
  2600. If there are marked files: (see |netrw-mf|)
  2601. Marked files will be renamed (moved). You will be queried as above in
  2602. order to specify where you want the file/directory to be moved.
  2603. If you answer a renaming query with a "s/frompattern/topattern/", then
  2604. subsequent files on the marked file list will be renamed by taking each
  2605. name, applying that substitute, and renaming each file to the result.
  2606. As an example : >
  2607. mr [query: reply with *.c]
  2608. R [query: reply with s/^\(.*\)\.c$/\1.cpp/]
  2609. <
  2610. This example will mark all *.c files and then rename them to *.cpp
  2611. files. Netrw will protect you from overwriting local files without
  2612. confirmation, but not remote ones.
  2613. The ctrl-X character has special meaning for renaming files: >
  2614. <c-x> : a single ctrl-x tells netrw to ignore the portion of the response
  2615. lying between the last '/' and the ctrl-x.
  2616. <c-x><c-x> : a pair of contiguous ctrl-x's tells netrw to ignore any
  2617. portion of the string preceding the double ctrl-x's.
  2618. <
  2619. WARNING:~
  2620. Note that moving files is a dangerous operation; copies are safer. That's
  2621. because a "move" for remote files is actually a copy + delete -- and if
  2622. the copy fails and the delete succeeds you may lose the file.
  2623. Use at your own risk.
  2624. The *g:netrw_rename_cmd* variable is used to implement remote renaming. By
  2625. default its value is: >
  2626. ssh HOSTNAME mv
  2627. <
  2628. One may rename a block of files and directories by selecting them with
  2629. V (|linewise-visual|) when using thin style.
  2630. See |cmdline-editing| for more on how to edit the command line; in particular,
  2631. you'll find <ctrl-f> (initiates cmdline window editing) and <ctrl-c> (uses the
  2632. command line under the cursor) useful in conjunction with the R command.
  2633. SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2
  2634. One may select the sorting style by name, time, or (file) size. The "s" map
  2635. allows one to circulate amongst the three choices; the directory listing will
  2636. automatically be refreshed to reflect the selected style.
  2637. Related topics: |netrw-r| |netrw-S|
  2638. Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
  2639. SETTING EDITING WINDOW *netrw-editwindow* *netrw-C* *netrw-:NetrwC* {{{2
  2640. One may select a netrw window for editing with the "C" mapping, using the
  2641. :NetrwC [win#] command, or by setting |g:netrw_chgwin| to the selected window
  2642. number. Subsequent selection of a file to edit (|netrw-cr|) will use that
  2643. window.
  2644. * C : by itself, will select the current window holding a netrw buffer
  2645. for subsequent editing via |netrw-cr|. The C mapping is only available
  2646. while in netrw buffers.
  2647. * [count]C : the count will be used as the window number to be used
  2648. for subsequent editing via |netrw-cr|.
  2649. * :NetrwC will set |g:netrw_chgwin| to the current window
  2650. * :NetrwC win# will set |g:netrw_chgwin| to the specified window
  2651. number
  2652. Using >
  2653. let g:netrw_chgwin= -1
  2654. will restore the default editing behavior
  2655. (ie. subsequent editing will use the current window).
  2656. Related topics: |netrw-cr| |g:netrw_browse_split|
  2657. Associated setting variables: |g:netrw_chgwin|
  2658. SHRINKING OR EXPANDING A NETRW OR LEXPLORE WINDOW *netrw-c-tab* {{{2
  2659. The <c-tab> key will toggle a netrw or |:Lexplore| window's width,
  2660. but only if |g:netrw_usetab| exists and is non-zero (and, of course,
  2661. only if your terminal supports differentiating <c-tab> from a plain
  2662. <tab>).
  2663. * If the current window is a netrw window, toggle its width
  2664. (between |g:netrw_wiw| and its original width)
  2665. * Else if there is a |:Lexplore| window in the current tab, toggle
  2666. its width
  2667. * Else bring up a |:Lexplore| window
  2668. If |g:netrw_usetab| exists and is zero, or if there is a pre-existing mapping
  2669. for <c-tab>, then the <c-tab> will not be mapped. One may map something other
  2670. than a <c-tab>, too: (but you'll still need to have had |g:netrw_usetab| set). >
  2671. nmap <unique> (whatever) <Plug>NetrwShrink
  2672. <
  2673. Related topics: |:Lexplore|
  2674. Associated setting variable: |g:netrw_usetab|
  2675. USER SPECIFIED MAPS *netrw-usermaps* {{{1
  2676. One may make customized user maps. Specify a variable, |g:Netrw_UserMaps|,
  2677. to hold a |List| of lists of keymap strings and function names: >
  2678. [["keymap-sequence","ExampleUserMapFunc"],...]
  2679. <
  2680. When netrw is setting up maps for a netrw buffer, if |g:Netrw_UserMaps|
  2681. exists, then the internal function netrw#UserMaps(islocal) is called.
  2682. This function goes through all the entries in the |g:Netrw_UserMaps| list:
  2683. * sets up maps: >
  2684. nno <buffer> <silent> KEYMAP-SEQUENCE
  2685. :call s:UserMaps(islocal,"ExampleUserMapFunc")
  2686. < * refreshes if result from that function call is the string
  2687. "refresh"
  2688. * if the result string is not "", then that string will be
  2689. executed (:exe result)
  2690. * if the result is a List, then the above two actions on results
  2691. will be taken for every string in the result List
  2692. The user function is passed one argument; it resembles >
  2693. fun! ExampleUserMapFunc(islocal)
  2694. <
  2695. where a:islocal is 1 if its a local-directory system call or 0 when
  2696. remote-directory system call.
  2697. *netrw-call* *netrw-expose* *netrw-modify*
  2698. Use netrw#Expose("varname") to access netrw-internal (script-local)
  2699. variables.
  2700. Use netrw#Modify("varname",newvalue) to change netrw-internal variables.
  2701. Use netrw#Call("funcname"[,args]) to call a netrw-internal function with
  2702. specified arguments.
  2703. Example: Get a copy of netrw's marked file list: >
  2704. let netrwmarkfilelist= netrw#Expose("netrwmarkfilelist")
  2705. <
  2706. Example: Modify the value of netrw's marked file list: >
  2707. call netrw#Modify("netrwmarkfilelist",[])
  2708. <
  2709. Example: Clear netrw's marked file list via a mapping on gu >
  2710. " ExampleUserMap: {{{2
  2711. fun! ExampleUserMap(islocal)
  2712. call netrw#Modify("netrwmarkfilelist",[])
  2713. call netrw#Modify('netrwmarkfilemtch_{bufnr("%")}',"")
  2714. let retval= ["refresh"]
  2715. return retval
  2716. endfun
  2717. let g:Netrw_UserMaps= [["gu","ExampleUserMap"]]
  2718. <
  2719. 10. Problems and Fixes *netrw-problems* {{{1
  2720. (This section is likely to grow as I get feedback)
  2721. (also see |netrw-debug|)
  2722. *netrw-p1*
  2723. P1. I use windows 95, and my ftp dumps four blank lines at the {{{2
  2724. end of every read.
  2725. See |netrw-fixup|, and put the following into your
  2726. <.vimrc> file:
  2727. let g:netrw_win95ftp= 1
  2728. *netrw-p2*
  2729. P2. I use Windows, and my network browsing with ftp doesn't sort by {{{2
  2730. time or size! -or- The remote system is a Windows server; why
  2731. don't I get sorts by time or size?
  2732. Windows' ftp has a minimal support for ls (ie. it doesn't
  2733. accept sorting options). It doesn't support the -F which
  2734. gives an explanatory character (ABC/ for "ABC is a directory").
  2735. Netrw then uses "dir" to get both its thin and long listings.
  2736. If you think your ftp does support a full-up ls, put the
  2737. following into your <.vimrc>: >
  2738. let g:netrw_ftp_list_cmd = "ls -lF"
  2739. let g:netrw_ftp_timelist_cmd= "ls -tlF"
  2740. let g:netrw_ftp_sizelist_cmd= "ls -slF"
  2741. <
  2742. Alternatively, if you have cygwin on your Windows box, put
  2743. into your <.vimrc>: >
  2744. let g:netrw_cygwin= 1
  2745. <
  2746. This problem also occurs when the remote system is Windows.
  2747. In this situation, the various g:netrw_ftp_[time|size]list_cmds
  2748. are as shown above, but the remote system will not correctly
  2749. modify its listing behavior.
  2750. *netrw-p3*
  2751. P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw {{{2
  2752. used ssh! That wasn't what I asked for...
  2753. Netrw has two methods for browsing remote directories: ssh
  2754. and ftp. Unless you specify ftp specifically, ssh is used.
  2755. When it comes time to do download a file (not just a directory
  2756. listing), netrw will use the given protocol to do so.
  2757. *netrw-p4*
  2758. P4. I would like long listings to be the default. {{{2
  2759. Put the following statement into your |vimrc|: >
  2760. let g:netrw_liststyle= 1
  2761. <
  2762. Check out |netrw-browser-var| for more customizations that
  2763. you can set.
  2764. *netrw-p5*
  2765. P5. My times come up oddly in local browsing {{{2
  2766. Does your system's strftime() accept the "%c" to yield dates
  2767. such as "Sun Apr 27 11:49:23 1997"? If not, do a
  2768. "man strftime" and find out what option should be used. Then
  2769. put it into your |vimrc|: >
  2770. let g:netrw_timefmt= "%X" (where X is the option)
  2771. <
  2772. *netrw-p6*
  2773. P6. I want my current directory to track my browsing. {{{2
  2774. How do I do that?
  2775. Put the following line in your |vimrc|:
  2776. >
  2777. let g:netrw_keepdir= 0
  2778. <
  2779. *netrw-p7*
  2780. P7. I use Chinese (or other non-ascii) characters in my filenames, {{{2
  2781. and netrw (Explore, Sexplore, Hexplore, etc) doesn't display them!
  2782. (taken from an answer provided by Wu Yongwei on the vim
  2783. mailing list)
  2784. I now see the problem. Your code page is not 936, right? Vim
  2785. seems only able to open files with names that are valid in the
  2786. current code page, as are many other applications that do not
  2787. use the Unicode version of Windows APIs. This is an OS-related
  2788. issue. You should not have such problems when the system
  2789. locale uses UTF-8, such as modern Linux distros.
  2790. (...it is one more reason to recommend that people use utf-8!)
  2791. *netrw-p8*
  2792. P8. I'm getting "ssh is not executable on your system" -- what do I {{{2
  2793. do?
  2794. (Dudley Fox) Most people I know use putty for windows ssh. It
  2795. is a free ssh/telnet application. You can read more about it
  2796. here:
  2797. http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also:
  2798. (Marlin Unruh) This program also works for me. It's a single
  2799. executable, so he/she can copy it into the Windows\System32
  2800. folder and create a shortcut to it.
  2801. (Dudley Fox) You might also wish to consider plink, as it
  2802. sounds most similar to what you are looking for. plink is an
  2803. application in the putty suite.
  2804. http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink
  2805. (Vissale Neang) Maybe you can try OpenSSH for windows, which
  2806. can be obtained from:
  2807. http://sshwindows.sourceforge.net/
  2808. It doesn't need the full Cygwin package.
  2809. (Antoine Mechelynck) For individual Unix-like programs needed
  2810. for work in a native-Windows environment, I recommend getting
  2811. them from the GnuWin32 project on sourceforge if it has them:
  2812. http://gnuwin32.sourceforge.net/
  2813. Unlike Cygwin, which sets up a Unix-like virtual machine on
  2814. top of Windows, GnuWin32 is a rewrite of Unix utilities with
  2815. Windows system calls, and its programs works quite well in the
  2816. cmd.exe "Dos box".
  2817. (dave) Download WinSCP and use that to connect to the server.
  2818. In Preferences > Editors, set gvim as your editor:
  2819. - Click "Add..."
  2820. - Set External Editor (adjust path as needed, include
  2821. the quotes and !.! at the end):
  2822. "c:\Program Files\Vim\vim82\gvim.exe" !.!
  2823. - Check that the filetype in the box below is
  2824. {asterisk}.{asterisk} (all files), or whatever types
  2825. you want (cec: change {asterisk} to * ; I had to
  2826. write it that way because otherwise the helptags
  2827. system thinks it's a tag)
  2828. - Make sure it's at the top of the listbox (click it,
  2829. then click "Up" if it's not)
  2830. If using the Norton Commander style, you just have to hit <F4>
  2831. to edit a file in a local copy of gvim.
  2832. (Vit Gottwald) How to generate public/private key and save
  2833. public key it on server: >
  2834. http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey-gettingready
  2835. (8.3 Getting ready for public key authentication)
  2836. <
  2837. How to use a private key with "pscp": >
  2838. http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter5.html
  2839. (5.2.4 Using public key authentication with PSCP)
  2840. <
  2841. (Ben Schmidt) I find the ssh included with cwRsync is
  2842. brilliant, and install cwRsync or cwRsyncServer on most
  2843. Windows systems I come across these days. I guess COPSSH,
  2844. packed by the same person, is probably even better for use as
  2845. just ssh on Windows, and probably includes sftp, etc. which I
  2846. suspect the cwRsync doesn't, though it might
  2847. (cec) To make proper use of these suggestions above, you will
  2848. need to modify the following user-settable variables in your
  2849. .vimrc:
  2850. |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd|
  2851. |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd|
  2852. The first one (|g:netrw_ssh_cmd|) is the most important; most
  2853. of the others will use the string in g:netrw_ssh_cmd by
  2854. default.
  2855. *netrw-p9* *netrw-ml_get*
  2856. P9. I'm browsing, changing directory, and bang! ml_get errors {{{2
  2857. appear and I have to kill vim. Any way around this?
  2858. Normally netrw attempts to avoid writing swapfiles for
  2859. its temporary directory buffers. However, on some systems
  2860. this attempt appears to be causing ml_get errors to
  2861. appear. Please try setting |g:netrw_use_noswf| to 0
  2862. in your <.vimrc>: >
  2863. let g:netrw_use_noswf= 0
  2864. <
  2865. *netrw-p10*
  2866. P10. I'm being pestered with "[something] is a directory" and {{{2
  2867. "Press ENTER or type command to continue" prompts...
  2868. The "[something] is a directory" prompt is issued by Vim,
  2869. not by netrw, and there appears to be no way to work around
  2870. it. Coupled with the default cmdheight of 1, this message
  2871. causes the "Press ENTER..." prompt. So: read |hit-enter|;
  2872. I also suggest that you set your |'cmdheight'| to 2 (or more) in
  2873. your <.vimrc> file.
  2874. *netrw-p11*
  2875. P11. I want to have two windows; a thin one on the left and my {{{2
  2876. editing window on the right. How may I accomplish this?
  2877. You probably want netrw running as in a side window. If so, you
  2878. will likely find that ":[N]Lexplore" does what you want. The
  2879. optional "[N]" allows you to select the quantity of columns you
  2880. wish the |:Lexplore|r window to start with (see |g:netrw_winsize|
  2881. for how this parameter works).
  2882. Previous solution:
  2883. * Put the following line in your <.vimrc>:
  2884. let g:netrw_altv = 1
  2885. * Edit the current directory: :e .
  2886. * Select some file, press v
  2887. * Resize the windows as you wish (see |CTRL-W_<| and
  2888. |CTRL-W_>|). If you're using gvim, you can drag
  2889. the separating bar with your mouse.
  2890. * When you want a new file, use ctrl-w h to go back to the
  2891. netrw browser, select a file, then press P (see |CTRL-W_h|
  2892. and |netrw-P|). If you're using gvim, you can press
  2893. <leftmouse> in the browser window and then press the
  2894. <middlemouse> to select the file.
  2895. *netrw-p12*
  2896. P12. My directory isn't sorting correctly, or unwanted letters are {{{2
  2897. appearing in the listed filenames, or things aren't lining
  2898. up properly in the wide listing, ...
  2899. This may be due to an encoding problem. I myself usually use
  2900. utf-8, but really only use ascii (ie. bytes from 32-126).
  2901. Multibyte encodings use two (or more) bytes per character.
  2902. You may need to change |g:netrw_sepchr| and/or |g:netrw_xstrlen|.
  2903. *netrw-p13*
  2904. P13. I'm a Windows + putty + ssh user, and when I attempt to {{{2
  2905. browse, the directories are missing trailing "/"s so netrw treats
  2906. them as file transfers instead of as attempts to browse
  2907. subdirectories. How may I fix this?
  2908. (mikeyao) If you want to use vim via ssh and putty under Windows,
  2909. try combining the use of pscp/psftp with plink. pscp/psftp will
  2910. be used to connect and plink will be used to execute commands on
  2911. the server, for example: list files and directory using 'ls'.
  2912. These are the settings I use to do this:
  2913. >
  2914. " list files, it's the key setting, if you haven't set,
  2915. " you will get a blank buffer
  2916. let g:netrw_list_cmd = "plink HOSTNAME ls -Fa"
  2917. " if you haven't add putty directory in system path, you should
  2918. " specify scp/sftp command. For examples:
  2919. "let g:netrw_sftp_cmd = "d:\\dev\\putty\\PSFTP.exe"
  2920. "let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe"
  2921. <
  2922. *netrw-p14*
  2923. P14. I would like to speed up writes using Nwrite and scp/ssh {{{2
  2924. style connections. How? (Thomer M. Gil)
  2925. Try using ssh's ControlMaster and ControlPath (see the ssh_config
  2926. man page) to share multiple ssh connections over a single network
  2927. connection. That cuts out the cryptographic handshake on each
  2928. file write, sometimes speeding it up by an order of magnitude.
  2929. (see http://thomer.com/howtos/netrw_ssh.html)
  2930. (included by permission)
  2931. Add the following to your ~/.ssh/config: >
  2932. # you change "*" to the hostname you care about
  2933. Host *
  2934. ControlMaster auto
  2935. ControlPath /tmp/%r@%h:%p
  2936. < Then create an ssh connection to the host and leave it running: >
  2937. ssh -N host.domain.com
  2938. < Now remotely open a file with Vim's Netrw and enjoy the
  2939. zippiness: >
  2940. vim scp://host.domain.com//home/user/.bashrc
  2941. <
  2942. *netrw-p15*
  2943. P15. How may I use a double-click instead of netrw's usual single {{{2
  2944. click to open a file or directory? (Ben Fritz)
  2945. First, disable netrw's mapping with >
  2946. let g:netrw_mousemaps= 0
  2947. < and then create a netrw buffer only mapping in
  2948. $HOME/.vim/after/ftplugin/netrw.vim: >
  2949. nmap <buffer> <2-leftmouse> <CR>
  2950. < Note that setting g:netrw_mousemaps to zero will turn off
  2951. all netrw's mouse mappings, not just the <leftmouse> one.
  2952. (see |g:netrw_mousemaps|)
  2953. *netrw-p16*
  2954. P16. When editing remote files (ex. :e ftp://hostname/path/file), {{{2
  2955. under Windows I get an |E303| message complaining that its unable
  2956. to open a swap file.
  2957. (romainl) It looks like you are starting Vim from a protected
  2958. directory. Start netrw from your $HOME or other writable
  2959. directory.
  2960. *netrw-p17*
  2961. P17. Netrw is closing buffers on its own. {{{2
  2962. What steps will reproduce the problem?
  2963. 1. :Explore, navigate directories, open a file
  2964. 2. :Explore, open another file
  2965. 3. Buffer opened in step 1 will be closed. o
  2966. What is the expected output? What do you see instead?
  2967. I expect both buffers to exist, but only the last one does.
  2968. (Lance) Problem is caused by "set autochdir" in .vimrc.
  2969. (drchip) I am able to duplicate this problem with |'acd'| set.
  2970. It appears that the buffers are not exactly closed;
  2971. a ":ls!" will show them (although ":ls" does not).
  2972. *netrw-P18*
  2973. P18. How to locally edit a file that's only available via {{{2
  2974. another server accessible via ssh?
  2975. See http://stackoverflow.com/questions/12469645/
  2976. "Using Vim to Remotely Edit A File on ServerB Only
  2977. Accessible From ServerA"
  2978. *netrw-P19*
  2979. P19. How do I get numbering on in directory listings? {{{2
  2980. With |g:netrw_bufsettings|, you can control netrw's buffer
  2981. settings; try putting >
  2982. let g:netrw_bufsettings="noma nomod nu nobl nowrap ro nornu"
  2983. < in your .vimrc. If you'd like to have relative numbering
  2984. instead, try >
  2985. let g:netrw_bufsettings="noma nomod nonu nobl nowrap ro rnu"
  2986. <
  2987. *netrw-P20*
  2988. P20. How may I have gvim start up showing a directory listing? {{{2
  2989. Try putting the following code snippet into your .vimrc: >
  2990. augroup VimStartup
  2991. au!
  2992. au VimEnter * if expand("%") == "" && argc() == 0 &&
  2993. \ (v:servername =~ 'GVIM\d*' || v:servername == "")
  2994. \ | e . | endif
  2995. augroup END
  2996. < You may use Lexplore instead of "e" if you're so inclined.
  2997. This snippet assumes that you have client-server enabled
  2998. (ie. a "huge" vim version).
  2999. *netrw-P21*
  3000. P21. I've made a directory (or file) with an accented character, {{{2
  3001. but netrw isn't letting me enter that directory/read that file:
  3002. Its likely that the shell or o/s is using a different encoding
  3003. than you have vim (netrw) using. A patch to vim supporting
  3004. "systemencoding" may address this issue in the future; for
  3005. now, just have netrw use the proper encoding. For example: >
  3006. au FileType netrw set enc=latin1
  3007. <
  3008. *netrw-P22*
  3009. P22. I get an error message when I try to copy or move a file: {{{2
  3010. **error** (netrw) tried using g:netrw_localcopycmd<cp>; it doesn't work!
  3011. What's wrong?
  3012. Netrw uses several system level commands to do things (see
  3013. |g:netrw_localcopycmd|, |g:netrw_localmovecmd|,
  3014. |g:netrw_localrmdir|, |g:netrw_mkdir_cmd|).
  3015. You may need to adjust the default commands for one or more of
  3016. these commands by setting them properly in your .vimrc. Another
  3017. source of difficulty is that these commands use vim's local
  3018. directory, which may not be the same as the browsing directory
  3019. shown by netrw (see |g:netrw_keepdir|).
  3020. ==============================================================================
  3021. 11. Debugging Netrw Itself *netrw-debug* {{{1
  3022. Step 1: check that the problem you've encountered hasn't already been resolved
  3023. by obtaining a copy of the latest (often developmental) netrw at:
  3024. http://www.drchip.org/astronaut/vim/index.html#NETRW
  3025. The <netrw.vim> script is typically installed on systems as something like:
  3026. >
  3027. /usr/local/share/vim/vim8x/plugin/netrwPlugin.vim
  3028. /usr/local/share/vim/vim8x/autoload/netrw.vim
  3029. (see output of :echo &rtp)
  3030. <
  3031. which is loaded automatically at startup (assuming :set nocp). If you
  3032. installed a new netrw, then it will be located at >
  3033. $HOME/.vim/plugin/netrwPlugin.vim
  3034. $HOME/.vim/autoload/netrw.vim
  3035. <
  3036. Step 2: assuming that you've installed the latest version of netrw,
  3037. check that your problem is really due to netrw. Create a file
  3038. called netrw.vimrc with the following contents: >
  3039. set nocp
  3040. so $HOME/.vim/plugin/netrwPlugin.vim
  3041. <
  3042. Then run netrw as follows: >
  3043. vim -u netrw.vimrc --noplugins -i NONE [some path here]
  3044. <
  3045. Perform whatever netrw commands you need to, and check that the problem is
  3046. still present. This procedure sidesteps any issues due to personal .vimrc
  3047. settings, .viminfo file, and other plugins. If the problem does not appear,
  3048. then you need to determine which setting in your .vimrc is causing the
  3049. conflict with netrw or which plugin(s) is/are involved.
  3050. Step 3: If the problem still is present, then get a debugging trace from
  3051. netrw:
  3052. 1. Get the <Decho.vim> script, available as:
  3053. http://www.drchip.org/astronaut/vim/index.html#DECHO
  3054. or
  3055. http://vim.sourceforge.net/scripts/script.php?script_id=120
  3056. Decho.vim is provided as a "vimball". You
  3057. should edit the Decho.vba.gz file and source it in: >
  3058. vim Decho.vba.gz
  3059. :so %
  3060. :q
  3061. <
  3062. 2. To turn on debug tracing in netrw, then edit the <netrw.vim>
  3063. file by typing: >
  3064. vim netrw.vim
  3065. :DechoOn
  3066. :wq
  3067. <
  3068. To restore to normal non-debugging behavior, re-edit <netrw.vim>
  3069. and type >
  3070. vim netrw.vim
  3071. :DechoOff
  3072. :wq
  3073. <
  3074. This command, provided by <Decho.vim>, will comment out all
  3075. Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()).
  3076. 3. Then bring up vim and attempt to evoke the problem by doing a
  3077. transfer or doing some browsing. A set of messages should appear
  3078. concerning the steps that <netrw.vim> took in attempting to
  3079. read/write your file over the network in a separate tab or
  3080. server vim window.
  3081. Change the netrw.vimrc file to include the Decho plugin: >
  3082. set nocp
  3083. so $HOME/.vim/plugin/Decho.vim
  3084. so $HOME/.vim/plugin/netrwPlugin.vim
  3085. <
  3086. You should continue to run vim with >
  3087. vim -u netrw.vimrc --noplugins -i NONE [some path here]
  3088. <
  3089. to avoid entanglements with options and other plugins.
  3090. To save the file: under linux, the output will be in a separate
  3091. remote server window; in it, just save the file with >
  3092. :w! DBG
  3093. < Under a vim that doesn't support clientserver, your debugging
  3094. output will appear in another tab: >
  3095. :tabnext
  3096. :set bt=
  3097. :w! DBG
  3098. <
  3099. Furthermore, it'd be helpful if you would type >
  3100. :Dsep <command>
  3101. < where <command> is the command you're about to type next,
  3102. thereby making it easier to associate which part of the
  3103. debugging trace is due to which command.
  3104. Please send that information to <netrw.vim>'s maintainer along
  3105. with the o/s you're using and the vim version that you're using
  3106. (see |:version|) (remove the embedded NOSPAM first) >
  3107. NcampObell@SdrPchip.AorgM-NOSPAM
  3108. <
  3109. ==============================================================================
  3110. 12. History *netrw-history* {{{1
  3111. v171: Oct 09, 2020 * included code in s:NetrwOptionsSafe()
  3112. to allow |'bh'| to be set to delete when
  3113. rather than hide when g:netrw_fastbrowse
  3114. was zero.
  3115. * Installed |g:netrw_clipboard| setting
  3116. * Installed option bypass for |'guioptions'|
  3117. a/A settings
  3118. * Changed popup_beval() to popup_atcursor()
  3119. in netrw#ErrorMsg (lacygoill). Apparently
  3120. popup_beval doesn't reliably close the
  3121. popup when the mouse is moved.
  3122. * VimEnter() now using win_execute to examine
  3123. buffers for an attempt to open a directory.
  3124. Avoids issues with popups/terminal from
  3125. command line. (lacygoill)
  3126. Jun 28, 2021 * (zeertzjq) provided a patch for use of
  3127. xmap,xno instead of vmap,vno in
  3128. netrwPlugin.vim. Avoids entanglement with
  3129. select mode.
  3130. Jul 14, 2021 * Fixed problem addressed by tst976; opening
  3131. a file using tree mode, going up a
  3132. directory, and opening a file there was
  3133. opening the file in the wrong directory.
  3134. Jul 28, 2021 * (Ingo Karkat) provided a patch fixing an
  3135. E488 error with netrwPlugin.vim
  3136. (occurred for vim versions < 8.02)
  3137. v170: Mar 11, 2020 * (reported by Reiner Herrmann) netrw+tree
  3138. would not hide with the ^\..* pattern
  3139. correctly.
  3140. * (Marcin Szamotulski) NetrwOptionRestore
  3141. did not restore options correctly that
  3142. had a single quote in the option string.
  3143. Apr 13, 2020 * implemented error handling via popup
  3144. windows (see popup_beval())
  3145. Apr 30, 2020 * (reported by Manatsu Takahashi) while
  3146. using Lexplore, a modified file could
  3147. be overwritten. Sol'n: will not overwrite,
  3148. but will emit an |E37| (although one cannot
  3149. add an ! to override)
  3150. Jun 07, 2020 * (reported by Jo Totland) repeatedly invoking
  3151. :Lexplore and quitting it left unused
  3152. hidden buffers. Netrw will now set netrw
  3153. buffers created by :Lexplore to |'bh'|=wipe.
  3154. v169: Dec 20, 2019 * (reported by amkarthik) that netrw's x
  3155. (|netrw-x|) would throw an error when
  3156. attempting to open a local directory.
  3157. v168: Dec 12, 2019 * scp timeout error message not reported,
  3158. hopefully now fixed (Shane Xb Qian)
  3159. v167: Nov 29, 2019 * netrw does a save&restore on @* and @+.
  3160. That causes problems with the clipboard.
  3161. Now restores occurs only if @* or @+ have
  3162. been changed.
  3163. * netrw will change @* or @+ less often.
  3164. Never if I happen to have caught all the
  3165. operations that modify the unnamed
  3166. register (which also writes @*).
  3167. * Modified hiding behavior so that "s"
  3168. will not ignore hiding.
  3169. v166: Nov 06, 2019 * Removed a space from a nmap for "-"
  3170. * Numerous debugging statement changes
  3171. v163: Dec 05, 2017 * (Cristi Balan) reported that a setting ('sel')
  3172. was left changed
  3173. * (Holger Mitschke) reported a problem with
  3174. saving and restoring history. Fixed.
  3175. * Hopefully I fixed a nasty bug that caused a
  3176. file rename to wipe out a buffer that it
  3177. should not have wiped out.
  3178. * (Holger Mitschke) amended this help file
  3179. with additional |g:netrw_special_syntax|
  3180. items
  3181. * Prioritized wget over curl for
  3182. g:netrw_http_cmd
  3183. v162: Sep 19, 2016 * (haya14busa) pointed out two syntax errors
  3184. with a patch; these are now fixed.
  3185. Oct 26, 2016 * I started using mate-terminal and found that
  3186. x and gx (|netrw-x| and |netrw-gx|) were no
  3187. longer working. Fixed (using atril when
  3188. $DESKTOP_SESSION is "mate").
  3189. Nov 04, 2016 * (Martin Vuille) pointed out that @+ was
  3190. being restored with keepregstar rather than
  3191. keepregplus.
  3192. Nov 09, 2016 * Broke apart the command from the options,
  3193. mostly for Windows. Introduced new netrw
  3194. settings: |g:netrw_localcopycmdopt|
  3195. |g:netrw_localcopydircmdopt| |g:netrw_localmkdiropt|
  3196. |g:netrw_localmovecmdopt| |g:netrw_localrmdiropt|
  3197. Nov 21, 2016 * (mattn) provided a patch for preview; swapped
  3198. winwidth() with winheight()
  3199. Nov 22, 2016 * (glacambre) reported that files containing
  3200. spaces weren't being obtained properly via
  3201. scp. Fix: apparently using single quotes
  3202. such as with 'file name' wasn't enough; the
  3203. spaces inside the quotes also had to be
  3204. escaped (ie. 'file\ name').
  3205. * Also fixed obtain (|netrw-O|) to be able to
  3206. obtain files with spaces in their names
  3207. Dec 20, 2016 * (xc1427) Reported that using "I" (|netrw-I|)
  3208. when atop "Hiding" in the banner also caused
  3209. the active-banner hiding control to occur
  3210. Jan 03, 2017 * (Enno Nagel) reported that attempting to
  3211. apply netrw to a directory that was without
  3212. read permission caused a syntax error.
  3213. Jan 13, 2017 * (Ingo Karkat) provided a patch which makes
  3214. using netrw#Call() better. Now returns
  3215. value of internal routines return, for example.
  3216. Jan 13, 2017 * (Ingo Karkat) changed netrw#FileUrlRead to
  3217. use |:edit| instead of |:read|. I also
  3218. changed the routine name to netrw#FileUrlEdit.
  3219. Jan 16, 2017 * (Sayem) reported a problem where :Lexplore
  3220. could generate a new listing buffer and
  3221. window instead of toggling the netrw display.
  3222. Unfortunately, the directions for eliciting
  3223. the problem weren't complete, so I may or
  3224. may not have fixed that issue.
  3225. Feb 06, 2017 * Implemented cb and cB. Changed "c" to "cd".
  3226. (see |netrw-cb|, |netrw-cB|, and |netrw-cd|)
  3227. Mar 21, 2017 * previously, netrw would specify (safe) settings
  3228. even when the setting was already safe for
  3229. netrw. Netrw now attempts to leave such
  3230. already-netrw-safe settings alone.
  3231. (affects s:NetrwOptionRestore() and
  3232. s:NetrwSafeOptions(); also introduced
  3233. s:NetrwRestoreSetting())
  3234. Jun 26, 2017 * (Christian Brabandt) provided a patch to
  3235. allow curl to follow redirects (ie. -L
  3236. option)
  3237. Jun 26, 2017 * (Callum Howard) reported a problem with
  3238. :Lexpore not removing the Lexplore window
  3239. after a change-directory
  3240. Aug 30, 2017 * (Ingo Karkat) one cannot switch to the
  3241. previously edited file (e.g. with CTRL-^)
  3242. after editing a file:// URL. Patch to
  3243. have a "keepalt" included.
  3244. Oct 17, 2017 * (Adam Faryna) reported that gn (|netrw-gn|)
  3245. did not work on directories in the current
  3246. tree
  3247. v157: Apr 20, 2016 * (Nicola) had set up a "nmap <expr> ..." with
  3248. a function that returned a 0 while silently
  3249. invoking a shell command. The shell command
  3250. activated a ShellCmdPost event which in turn
  3251. called s:LocalBrowseRefresh(). That looks
  3252. over all netrw buffers for changes needing
  3253. refreshes. However, inside a |:map-<expr>|,
  3254. tab and window changes are disallowed. Fixed.
  3255. (affects netrw's s:LocalBrowseRefresh())
  3256. * |g:netrw_localrmdir| not used any more, but
  3257. the relevant patch that causes |delete()| to
  3258. take over was #1107 (not #1109).
  3259. * |expand()| is now used on |g:netrw_home|;
  3260. consequently, g:netrw_home may now use
  3261. environment variables
  3262. * s:NetrwLeftmouse and s:NetrwCLeftmouse will
  3263. return without doing anything if invoked
  3264. when inside a non-netrw window
  3265. Jun 15, 2016 * gx now calls netrw#GX() which returns
  3266. the word under the cursor. The new
  3267. wrinkle: if one is in a netrw buffer,
  3268. then netrw's s:NetrwGetWord().
  3269. Jun 22, 2016 * Netrw was executing all its associated
  3270. Filetype commands silently; I'm going
  3271. to try doing that "noisily" and see if
  3272. folks have a problem with that.
  3273. Aug 12, 2016 * Changed order of tool selection for
  3274. handling http://... viewing.
  3275. (Nikolay Aleksandrovich Pavlov)
  3276. Aug 21, 2016 * Included hiding/showing/all for tree
  3277. listings
  3278. * Fixed refresh (^L) for tree listings
  3279. v156: Feb 18, 2016 * Changed =~ to =~# where appropriate
  3280. Feb 23, 2016 * s:ComposePath(base,subdir) now uses
  3281. fnameescape() on the base portion
  3282. Mar 01, 2016 * (gt_macki) reported where :Explore would
  3283. make file unlisted. Fixed (tst943)
  3284. Apr 04, 2016 * (reported by John Little) netrw normally
  3285. suppresses browser messages, but sometimes
  3286. those "messages" are what is wanted.
  3287. See |g:netrw_suppress_gx_mesg|
  3288. Apr 06, 2016 * (reported by Carlos Pita) deleting a remote
  3289. file was giving an error message. Fixed.
  3290. Apr 08, 2016 * (Charles Cooper) had a problem with an
  3291. undefined b:netrw_curdir. He also provided
  3292. a fix.
  3293. Apr 20, 2016 * Changed s:NetrwGetBuffer(); now uses
  3294. dictionaries. Also fixed the "No Name"
  3295. buffer problem.
  3296. v155: Oct 29, 2015 * (Timur Fayzrakhmanov) reported that netrw's
  3297. mapping of ctrl-l was not allowing refresh of
  3298. other windows when it was done in a netrw
  3299. window.
  3300. Nov 05, 2015 * Improved s:TreeSqueezeDir() to use search()
  3301. instead of a loop
  3302. * NetrwBrowse() will return line to
  3303. w:netrw_bannercnt if cursor ended up in
  3304. banner
  3305. Nov 16, 2015 * Added a <Plug>NetrwTreeSqueeze (|netrw-s-cr|)
  3306. Nov 17, 2015 * Commented out imaps -- perhaps someone can
  3307. tell me how they're useful and should be
  3308. retained?
  3309. Nov 20, 2015 * Added |netrw-ma| and |netrw-mA| support
  3310. Nov 20, 2015 * gx (|netrw-gx|) on a URL downloaded the
  3311. file in addition to simply bringing up the
  3312. URL in a browser. Fixed.
  3313. Nov 23, 2015 * Added |g:netrw_sizestyle| support
  3314. Nov 27, 2015 * Inserted a lot of <c-u>s into various netrw
  3315. maps.
  3316. Jan 05, 2016 * |netrw-qL| implemented to mark files based
  3317. upon |location-list|s; similar to |netrw-qF|.
  3318. Jan 19, 2016 * using - call delete(directoryname,"d") -
  3319. instead of using g:netrw_localrmdir if
  3320. v7.4 + patch#1107 is available
  3321. Jan 28, 2016 * changed to using |winsaveview()| and
  3322. |winrestview()|
  3323. Jan 28, 2016 * s:NetrwTreePath() now does a save and
  3324. restore of view
  3325. Feb 08, 2016 * Fixed a tree-listing problem with remote
  3326. directories
  3327. v154: Feb 26, 2015 * (Yuri Kanivetsky) reported a situation where
  3328. a file was not treated properly as a file
  3329. due to g:netrw_keepdir == 1
  3330. Mar 25, 2015 * (requested by Ben Friz) one may now sort by
  3331. extension
  3332. Mar 28, 2015 * (requested by Matt Brooks) netrw has a lot
  3333. of buffer-local mappings; however, some
  3334. plugins (such as vim-surround) set up
  3335. conflicting mappings that cause vim to wait.
  3336. The "<nowait>" modifier has been included
  3337. with most of netrw's mappings to avoid that
  3338. delay.
  3339. Jun 26, 2015 * |netrw-gn| mapping implemted
  3340. * :Ntree NotADir resulted in having
  3341. the tree listing expand in the error messages
  3342. window. Fixed.
  3343. Jun 29, 2015 * Attempting to delete a file remotely caused
  3344. an error with "keepsol" mentioned; fixed.
  3345. Jul 08, 2015 * Several changes to keep the |:jumps| table
  3346. correct when working with
  3347. |g:netrw_fastbrowse| set to 2
  3348. * wide listing with accented characters fixed
  3349. (using %-S instead of %-s with a |printf()|
  3350. Jul 13, 2015 * (Daniel Hahler) CheckIfKde() could be true
  3351. but kfmclient not installed. Changed order
  3352. in netrw#BrowseX(): checks if kde and
  3353. kfmclient, then will use xdg-open on a unix
  3354. system (if xdg-open is executable)
  3355. Aug 11, 2015 * (McDonnell) tree listing mode wouldn't
  3356. select a file in a open subdirectory.
  3357. * (McDonnell) when multiple subdirectories
  3358. were concurrently open in tree listing
  3359. mode, a ctrl-L wouldn't refresh properly.
  3360. * The netrw:target menu showed duplicate
  3361. entries
  3362. Oct 13, 2015 * (mattn) provided an exception to handle
  3363. windows with shellslash set but no shell
  3364. Oct 23, 2015 * if g:netrw_usetab and <c-tab> now used
  3365. to control whether NetrwShrink is used
  3366. (see |netrw-c-tab|)
  3367. v153: May 13, 2014 * added another |g:netrw_ffkeep| usage {{{2
  3368. May 14, 2014 * changed s:PerformListing() so that it
  3369. always sets ft=netrw for netrw buffers
  3370. (ie. even when syntax highlighting is
  3371. off, not available, etc)
  3372. May 16, 2014 * introduced the |netrw-ctrl-r| functionality
  3373. May 17, 2014 * introduced the |netrw-:NetrwMB| functionality
  3374. * mb and mB (|netrw-mb|, |netrw-mB|) will
  3375. add/remove marked files from bookmark list
  3376. May 20, 2014 * (Enno Nagel) reported that :Lex <dirname>
  3377. wasn't working. Fixed.
  3378. May 26, 2014 * restored test to prevent leftmouse window
  3379. resizing from causing refresh.
  3380. (see s:NetrwLeftmouse())
  3381. * fixed problem where a refresh caused cursor
  3382. to go just under the banner instead of
  3383. staying put
  3384. May 28, 2014 * (László Bimba) provided a patch for opening
  3385. the |:Lexplore| window 100% high, optionally
  3386. on the right, and will work with remote
  3387. files.
  3388. May 29, 2014 * implemented :NetrwC (see |netrw-:NetrwC|)
  3389. Jun 01, 2014 * Removed some "silent"s from commands used
  3390. to implemented scp://... and pscp://...
  3391. directory listing. Permits request for
  3392. password to appear.
  3393. Jun 05, 2014 * (Enno Nagel) reported that user maps "/"
  3394. caused problems with "b" and "w", which
  3395. are mapped (for wide listings only) to
  3396. skip over files rather than just words.
  3397. Jun 10, 2014 * |g:netrw_gx| introduced to allow users to
  3398. override default "<cfile>" with the gx
  3399. (|netrw-gx|) map
  3400. Jun 11, 2014 * gx (|netrw-gx|), with |'autowrite'| set,
  3401. will write modified files. s:NetrwBrowseX()
  3402. will now save, turn off, and restore the
  3403. |'autowrite'| setting.
  3404. Jun 13, 2014 * added visual map for gx use
  3405. Jun 15, 2014 * (Enno Nagel) reported that with having hls
  3406. set and wide listing style in use, that the
  3407. b and w maps caused unwanted highlighting.
  3408. Jul 05, 2014 * |netrw-mv| and |netrw-mX| commands included
  3409. Jul 09, 2014 * |g:netrw_keepj| included, allowing optional
  3410. keepj
  3411. Jul 09, 2014 * fixing bugs due to previous update
  3412. Jul 21, 2014 * (Bruno Sutic) provided an updated
  3413. netrw_gitignore.vim
  3414. Jul 30, 2014 * (Yavuz Yetim) reported that editing two
  3415. remote files of the same name caused the
  3416. second instance to have a "temporary"
  3417. name. Fixed: now they use the same buffer.
  3418. Sep 18, 2014 * (Yasuhiro Matsumoto) provided a patch which
  3419. allows scp and windows local paths to work.
  3420. Oct 07, 2014 * gx (see |netrw-gx|) when atop a directory,
  3421. will now do |gf| instead
  3422. Nov 06, 2014 * For cygwin: cygstart will be available for
  3423. netrw#BrowseX() to use if its executable.
  3424. Nov 07, 2014 * Began support for file://... urls. Will use
  3425. |g:netrw_file_cmd| (typically elinks or links)
  3426. Dec 02, 2014 * began work on having mc (|netrw-mc|) copy
  3427. directories. Works for linux machines,
  3428. cygwin+vim, but not for windows+gvim.
  3429. Dec 02, 2014 * in tree mode, netrw was not opening
  3430. directories via symbolic links.
  3431. Dec 02, 2014 * added resolved link information to
  3432. thin and tree modes
  3433. Dec 30, 2014 * (issue#231) |:ls| was not showing
  3434. remote-file buffers reliably. Fixed.
  3435. v152: Apr 08, 2014 * uses the |'noswapfile'| option (requires {{{2
  3436. vim 7.4 with patch 213)
  3437. * (Enno Nagel) turn |'rnu'| off in netrw
  3438. buffers.
  3439. * (Quinn Strahl) suggested that netrw
  3440. allow regular window splitting to occur,
  3441. thereby allowing |'equalalways'| to take
  3442. effect.
  3443. * (qingtian zhao) normally, netrw will
  3444. save and restore the |'fileformat'|;
  3445. however, sometimes that isn't wanted
  3446. Apr 14, 2014 * whenever netrw marks a buffer as ro,
  3447. it will also mark it as nomod.
  3448. Apr 16, 2014 * sftp protocol now supported by
  3449. netrw#Obtain(); this means that one
  3450. may use "mc" to copy a remote file
  3451. to a local file using sftp, and that
  3452. the |netrw-O| command can obtain remote
  3453. files via sftp.
  3454. * added [count]C support (see |netrw-C|)
  3455. Apr 18, 2014 * when |g:netrw_chgwin| is one more than
  3456. the last window, then vertically split
  3457. the last window and use it as the
  3458. chgwin window.
  3459. May 09, 2014 * SavePosn was "saving filename under cursor"
  3460. from a non-netrw window when using :Rex.
  3461. v151: Jan 22, 2014 * extended :Rexplore to return to buffer {{{2
  3462. prior to Explore or editing a directory
  3463. * (Ken Takata) netrw gave error when
  3464. clipboard was disabled. Sol'n: Placed
  3465. several if has("clipboard") tests in.
  3466. * Fixed ftp://X@Y@Z// problem; X@Y now
  3467. part of user id, and only Z is part of
  3468. hostname.
  3469. * (A Loumiotis) reported that completion
  3470. using a directory name containing spaces
  3471. did not work. Fixed with a retry in
  3472. netrw#Explore() which removes the
  3473. backslashes vim inserted.
  3474. Feb 26, 2014 * :Rexplore now records the current file
  3475. using w:netrw_rexfile when returning via
  3476. |:Rexplore|
  3477. Mar 08, 2014 * (David Kotchan) provided some patches
  3478. allowing netrw to work properly with
  3479. windows shares.
  3480. * Multiple one-liner help messages available
  3481. by pressing <cr> while atop the "Quick
  3482. Help" line
  3483. * worked on ShellCmdPost, FocusGained event
  3484. handling.
  3485. * |:Lexplore| path: will be used to update
  3486. a left-side netrw browsing directory.
  3487. Mar 12, 2014 * |netrw-s-cr|: use <s-cr> to close
  3488. tree directory implemented
  3489. Mar 13, 2014 * (Tony Mechylynck) reported that using
  3490. the browser with ftp on a directory,
  3491. and selecting a gzipped txt file, that
  3492. an E19 occurred (which was issued by
  3493. gzip.vim). Fixed.
  3494. Mar 14, 2014 * Implemented :MF and :MT (see |netrw-:MF|
  3495. and |netrw-:MT|, respectively)
  3496. Mar 17, 2014 * |:Ntree| [dir] wasn't working properly; fixed
  3497. Mar 18, 2014 * Changed all uses of set to setl
  3498. Mar 18, 2014 * Commented the netrw_btkeep line in
  3499. s:NetrwOptionSave(); the effect is that
  3500. netrw buffers will remain as |'bt'|=nofile.
  3501. This should prevent swapfiles being created
  3502. for netrw buffers.
  3503. Mar 20, 2014 * Changed all uses of lcd to use s:NetrwLcd()
  3504. instead. Consistent error handling results
  3505. and it also handles Window's shares
  3506. * Fixed |netrw-d| command when applied with ftp
  3507. * https: support included for netrw#NetRead()
  3508. v150: Jul 12, 2013 * removed a "keepalt" to allow ":e #" to {{{2
  3509. return to the netrw directory listing
  3510. Jul 13, 2013 * (Jonas Diemer) suggested changing
  3511. a <cWORD> to <cfile>.
  3512. Jul 21, 2013 * (Yuri Kanivetsky) reported that netrw's
  3513. use of mkdir did not produce directories
  3514. following the user's umask.
  3515. Aug 27, 2013 * introduced |g:netrw_altfile| option
  3516. Sep 05, 2013 * s:Strlen() now uses |strdisplaywidth()|
  3517. when available, by default
  3518. Sep 12, 2013 * (Selyano Baldo) reported that netrw wasn't
  3519. opening some directories properly from the
  3520. command line.
  3521. Nov 09, 2013 * |:Lexplore| introduced
  3522. * (Ondrej Platek) reported an issue with
  3523. netrw's trees (P15). Fixed.
  3524. * (Jorge Solis) reported that "t" in
  3525. tree mode caused netrw to forget its
  3526. line position.
  3527. Dec 05, 2013 * Added <s-leftmouse> file marking
  3528. (see |netrw-mf|)
  3529. Dec 05, 2013 * (Yasuhiro Matsumoto) Explore should use
  3530. strlen() instead s:Strlen() when handling
  3531. multibyte chars with strpart()
  3532. (ie. strpart() is byte oriented, not
  3533. display-width oriented).
  3534. Dec 09, 2013 * (Ken Takata) Provided a patch; File sizes
  3535. and a portion of timestamps were wrongly
  3536. highlighted with the directory color when
  3537. setting `:let g:netrw_liststyle=1` on Windows.
  3538. * (Paul Domaskis) noted that sometimes
  3539. cursorline was activating in non-netrw
  3540. windows. All but one setting of cursorline
  3541. was done via setl; there was one that was
  3542. overlooked. Fixed.
  3543. Dec 24, 2013 * (esquifit) asked that netrw allow the
  3544. /cygdrive prefix be a user-alterable
  3545. parameter.
  3546. Jan 02, 2014 * Fixed a problem with netrw-based ballon
  3547. evaluation (ie. netrw#NetrwBaloonHelp()
  3548. not having been loaded error messages)
  3549. Jan 03, 2014 * Fixed a problem with tree listings
  3550. * New command installed: |:Ntree|
  3551. Jan 06, 2014 * (Ivan Brennan) reported a problem with
  3552. |netrw-P|. Fixed.
  3553. Jan 06, 2014 * Fixed a problem with |netrw-P| when the
  3554. modified file was to be abandoned.
  3555. Jan 15, 2014 * (Matteo Cavalleri) reported that when the
  3556. banner is suppressed and tree listing is
  3557. used, a blank line was left at the top of
  3558. the display. Fixed.
  3559. Jan 20, 2014 * (Gideon Go) reported that, in tree listing
  3560. style, with a previous window open, that
  3561. the wrong directory was being used to open
  3562. a file. Fixed. (P21)
  3563. v149: Apr 18, 2013 * in wide listing format, now have maps for {{{2
  3564. w and b to move to next/previous file
  3565. Apr 26, 2013 * one may now copy files in the same
  3566. directory; netrw will issue requests for
  3567. what names the files should be copied under
  3568. Apr 29, 2013 * Trying Benzinger's problem again. Seems
  3569. that commenting out the BufEnter and
  3570. installing VimEnter (only) works. Weird
  3571. problem! (tree listing, vim -O Dir1 Dir2)
  3572. May 01, 2013 * :Explore ftp://... wasn't working. Fixed.
  3573. May 02, 2013 * introduced |g:netrw_bannerbackslash| as
  3574. requested by Paul Domaskis.
  3575. Jul 03, 2013 * Explore now avoids splitting when a buffer
  3576. will be hidden.
  3577. v148: Apr 16, 2013 * changed Netrw's Style menu to allow direct {{{2
  3578. choice of listing style, hiding style, and
  3579. sorting style
  3580. ==============================================================================
  3581. 13. Todo *netrw-todo* {{{1
  3582. 07/29/09 : banner :|g:netrw_banner| can be used to suppress the
  3583. suppression banner. This feature is new and experimental,
  3584. so its in the process of being debugged.
  3585. 09/04/09 : "gp" : See if it can be made to work for remote systems.
  3586. : See if it can be made to work with marked files.
  3587. ==============================================================================
  3588. 14. Credits *netrw-credits* {{{1
  3589. Vim editor by Bram Moolenaar (Thanks, Bram!)
  3590. dav support by C Campbell
  3591. fetch support by Bram Moolenaar and C Campbell
  3592. ftp support by C Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
  3593. http support by Bram Moolenaar <bram@moolenaar.net>
  3594. rcp
  3595. rsync support by C Campbell (suggested by Erik Warendorph)
  3596. scp support by raf <raf@comdyn.com.au>
  3597. sftp support by C Campbell
  3598. inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell
  3599. Jérôme Augé -- also using new buffer method with ftp+.netrc
  3600. Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use,
  3601. fetch,...
  3602. Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution
  3603. Erik Warendorph -- for several suggestions (g:netrw_..._cmd
  3604. variables, rsync etc)
  3605. Doug Claar -- modifications to test for success with ftp
  3606. operation
  3607. ==============================================================================
  3608. Modelines: {{{1
  3609. vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker