pi_netrw.txt 176 KB

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