netrw.txtpi_netrw.txt ------------------------------------------------ NETRW REFERENCE MANUAL by Charles E. Campbell ------------------------------------------------Original Author: Charles E. CampbellCopyright: Copyright (C) 2017 CharlesE Campbellnetrw-copyrightThe VIM LICENSE applies to the files in this package, includingnetrw.vim, netrw.txt, and syntax/netrw.vim.Like anything else that's free,netrw.vim and itsassociated files are provided *asis* and comes with no warranty ofany kind, either expressed or implied. No guarantees ofmerchantability. No guarantees of suitability for any purpose. Byusing this plugin, you agree that in no event will thecopyrightholder be liable for any damages resulting from the use of thissoftware. Useat your own risk! For bug reports, seebugs.netrwdavftpnetrw-filercpscpdavshttpnetrw.vimrsyncsftpfetchnetwork==============================================================================1.Contentsnetrw-contents {{{11. Contents..............................................netrw-contents2. Starting With Netrw...................................netrw-start3. Netrw Reference.......................................netrw-ref EXTERNAL APPLICATIONS AND PROTOCOLS.................netrw-externapp READING.............................................netrw-read WRITING.............................................netrw-write SOURCING............................................netrw-source DIRECTORY LISTING...................................netrw-dirlist CHANGING THE USERID AND PASSWORD....................netrw-chgup VARIABLES AND SETTINGS..............................netrw-variables PATHS...............................................netrw-path4. Network-Oriented File Transfer........................netrw-xfer NETRC...............................................netrw-netrc PASSWORD............................................netrw-passwd5. Activation............................................netrw-activate6. Transparent Remote File Editing.......................netrw-transparent7.Ex Commands...........................................netrw-ex8. Variables and Options.................................netrw-variables9. Browsing..............................................netrw-browse Introduction To Browsing............................netrw-intro-browse Quick Reference: Maps...............................netrw-browse-maps Quick Reference: Commands...........................netrw-browse-cmds Banner Display......................................netrw-I BookmarkingA Directory.............................netrw-mb Browsing............................................netrw-cr Squeezing the Current Tree-Listing Directory........netrw-s-cr Browsing WithA Horizontally Split Window...........netrw-o Browsing WithA New Tab.............................netrw-t Browsing WithA Vertically Split Window.............netrw-v Change Listing Style (thin wide long tree)..........netrw-i Changing ToA Bookmarked Directory..................netrw-gb Quick hide/unhide of dot-files......................netrw-gh Changing local-only File Permission.................netrw-gp Changing ToA Predecessor Directory.................netrw-u Changing ToA Successor Directory...................netrw-U Deleting Bookmarks..................................netrw-mB Deleting Files Or Directories.......................netrw-D Directory Exploring Commands........................netrw-explore Exploring With Stars and Patterns...................netrw-star Displaying Information About File...................netrw-qf Edit File Or Directory Hiding List..................netrw-ctrl-h Editing The Sorting Sequence........................netrw-S Forcing treatmentasa file or directory............netrw-gdnetrw-gf Going Up............................................netrw-- Hiding Files Or Directories.........................netrw-a Improving Browsing..................................netrw-ssh-hack Listing Bookmarks And History.......................netrw-qb MakingA New Directory..............................netrw-d Making The Browsing Directory The Current Directory.netrw-cd Marking Files.......................................netrw-mf Unmarking Files.....................................netrw-mF Marking Files By Location List......................netrw-qL Marking Files By QuickFix List......................netrw-qF Marking Files By Regular Expression.................netrw-mr Marked Files: Arbitrary Shell Command...............netrw-mx Marked Files: Arbitrary Shell Command, En Bloc......netrw-mX Marked Files: Arbitrary Vim Command.................netrw-mv Marked Files: Argument List.........................netrw-manetrw-mA Marked Files: Buffer List...........................netrw-cbnetrw-cB Marked Files: Compression And Decompression.........netrw-mz Marked Files: Copying...............................netrw-mc Marked Files: Diff..................................netrw-md Marked Files: Editing...............................netrw-me Marked Files: Grep..................................netrw-mg Marked Files: Hiding and Unhiding by Suffix.........netrw-mh Marked Files: Moving................................netrw-mm Marked Files: Sourcing..............................netrw-ms Marked Files: Setting the Target Directory..........netrw-mt Marked Files: Tagging...............................netrw-mT Marked Files: Target Directory Using Bookmarks......netrw-Tb Marked Files: Target Directory Using History........netrw-Th Marked Files: Unmarking.............................netrw-mu Netrw Browser Variables.............................netrw-browser-var Netrw Browsing And Option Incompatibilities.........netrw-incompatible ObtainingA File....................................netrw-O Preview Window......................................netrw-p Previous Window.....................................netrw-P Refreshing The Listing..............................netrw-ctrl-l Reversing Sorting Order.............................netrw-r Renaming Files Or Directories.......................netrw-R Selecting Sorting Style.............................netrw-s Setting Editing Window..............................netrw-C10. Problems and Fixes....................................netrw-problems11. Credits...............................................netrw-credits==============================================================================2. Starting With Netrwnetrw-start {{{1Netrw makes reading files,writing files, browsing overa network, andlocal browsing easy! First, make sure that you have plugins enabled, soyou'll need to haveat least the following in your <.vimrc>:(or seenetrw-activate)set nocp " 'compatible' is not setfiletype plugin on " plugins are enabled(see'cp' and:filetype-plugin-on)Netrw supports "transparent" editing of files on other machines using urls(seenetrw-transparent). As an example of this, let's assume you have anaccount on some other machine; if you can use scp, try:vim scp://hostname/path/to/fileWant to make ssh/scp easier to use? Check outnetrw-ssh-hack!So, what if you have ftp, not ssh/scp? That's easy, too; tryvim ftp://hostname/path/to/fileWant to makeftp simpler to use? See if yourftp supportsa file called<.netrc>-- typicallyit goes in yourhome directory, has read/writepermissions for only the user to read (ie. not group, world, other, etc),and has lines resemblingmachine HOSTNAME login USERID password "PASSWORD"machine HOSTNAME login USERID password "PASSWORD"...default login USERID password "PASSWORD"Windows'ftp doesn't support .netrc; however, one may have in one's .vimrc: let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\MyUserName\MACHINE'Netrw will substitute the host's machine name for "MACHINE" from the URLitisattempting to open, and so one may specifyuseridpasswordfor each site ina separate file: c:\Users\MyUserName\MachineName.Now about browsing-- when you just want to look around before editingafile. For browsing on your current host, just "edit"a directory:vim .vim /home/userid/pathFor browsing ona remote host, "edit"a directory (but make sure thatthe directory nameis followed bya "/"):vim scp://hostname/vim ftp://hostname/path/to/dir/Seenetrw-browse for more!There are more protocols supported bynetrw than justscp and ftp, too: see thenext section,netrw-externapp, on how to use these external applications withnetrw and vim.PREVENTING LOADINGnetrw-noloadIf you want to use plugins, but for some reason don't wish to use netrw, thenyou need to avoid loading both theplugin and theautoload portions of netrw.You maydo so by placing the following two lines in your <.vimrc>::let g:loaded_netrw = 1:let g:loaded_netrwPlugin = 1==============================================================================3. Netrw Referencenetrw-ref {{{1 Netrw supports several protocols in addition toscp andftpas mentioned innetrw-start. These include dav, fetch, http,... well, just lookat thelist innetrw-externapp. Each protocolis associated witha variable which holds the default command supporting that protocol.EXTERNAL APPLICATIONS AND PROTOCOLSnetrw-externapp {{{2Protocol Variable Default Value-------- ---------------- ------------- dav:g:netrw_dav_cmd= "cadaver" if cadaveris executable dav:g:netrw_dav_cmd= "curl-o" elseif curlis available fetch:g:netrw_fetch_cmd= "fetch-o" iffetchis available ftp:g:netrw_ftp_cmd= "ftp" http:g:netrw_http_cmd= "elinks" if elinksis available http:g:netrw_http_cmd= "links" elseif linksis available http:g:netrw_http_cmd= "curl" elseif curlis available http:g:netrw_http_cmd= "wget" elseif wgetis available http:g:netrw_http_cmd= "fetch" elseiffetchis available http:g:netrw_http_put_cmd= "curl-T" rcp:g:netrw_rcp_cmd= "rcp" rsync:g:netrw_rsync_cmd= "rsync" (seeg:netrw_rsync_sep) scp:g:netrw_scp_cmd= "scp-q" sftp:g:netrw_sftp_cmd= "sftp" file:g:netrw_file_cmd= "elinks" or "links"g:netrw_http_xcmd: the optionstring for http://... protocols arespecified via this variable and may be independently overridden. Bydefault, the option arguments for the http-handling commands are: elinks : "-source >" links : "-dump >" curl : "-L -o" wget : "-q -O" fetch : "-o"For example, if your system has elinks, and you'd rather see thepage using an attemptat rendering the text, you may wish to havelet g:netrw_http_xcmd= "-dump >"in your .vimrc.g:netrw_http_put_cmd: this optionspecifies both the executable andany needed options. This command doesa PUT operation to the url.READINGnetrw-readnetrw-nread {{{2Generally, one may just use the URLnotation witha normal editingcommand, suchas:e ftp://[user@]machine/pathNetrw also provides the Nread command::Nread?givehelp:Nread "machine:path"usesrcp:Nread "machine path"usesftp w/ <.netrc>:Nread "machine id password path"usesftp:Nread "dav://machine[:port]/path"uses cadaver:Nread "fetch://[user@]machine/path"usesfetch:Nread "ftp://[user@]machine[[:#]port]/path"usesftp w/ <.netrc>:Nread "http://[user@]machine/path"useshttp uses wget:Nread "rcp://[user@]machine/path"usesrcp:Nread "rsync://[user@]machine[:port]/path"usesrsync:Nread "scp://[user@]machine[[:#]port]/path"usesscp:Nread "sftp://[user@]machine/path"usessftpWRITINGnetrw-writenetrw-nwrite {{{2One may just use the URLnotation witha normal filewritingcommand, suchas:w ftp://[user@]machine/pathNetrw also provides the Nwrite command::Nwrite?givehelp:Nwrite "machine:path"usesrcp:Nwrite "machine path"usesftp w/ <.netrc>:Nwrite "machine id password path"usesftp:Nwrite "dav://machine[:port]/path"uses cadaver:Nwrite "ftp://[user@]machine[[:#]port]/path"usesftp w/ <.netrc>:Nwrite "rcp://[user@]machine/path"usesrcp:Nwrite "rsync://[user@]machine[:port]/path"usesrsync:Nwrite "scp://[user@]machine[[:#]port]/path"usesscp:Nwrite "sftp://[user@]machine/path"usessftphttp: not supported!SOURCINGnetrw-source {{{2One may just use the URLnotation with the normal file sourcingcommand, suchas:so ftp://[user@]machine/pathNetrw also provides the Nsource command::Nsource?givehelp:Nsource "dav://machine[:port]/path"uses cadaver:Nsource "fetch://[user@]machine/path"usesfetch:Nsource "ftp://[user@]machine[[:#]port]/path"usesftp w/ <.netrc>:Nsource "http://[user@]machine/path"useshttp uses wget:Nsource "rcp://[user@]machine/path"usesrcp:Nsource "rsync://[user@]machine[:port]/path"usesrsync:Nsource "scp://[user@]machine[[:#]port]/path"usesscp:Nsource "sftp://[user@]machine/path"usessftpDIRECTORY LISTINGnetrw-trailingslashnetrw-dirlist {{{2One may browsea directory to geta listing by simply attempting toedit the directory::e scp://[user]@hostname/path/:e ftp://[user]@hostname/path/For remote directory listings (ie. those usingscp or ftp), thattrailing "/"is necessary (the slash tellsnetrw to treat the argumentasa directory to browse instead ofasa file to download).The Nread command may also be used to accomplish this (again, thattrailing slashis necessary)::Nread [protocol]://[user]@hostname/path/netrw-loginnetrw-passwordCHANGING USERID AND PASSWORDnetrw-chgupnetrw-userpass {{{2Attempts to useftp will prompt you fora user-id anda password.These will be saved in globalvariablesg:netrw_uid ands:netrw_passwd; subsequent use offtp will re-use those two strings,thereby simplifying use of ftp. However, if you need to useadifferent user id and/or password, you'll want to callNetUserPass()first. To work around the need to enter passwords, check if yourftpsupportsa <.netrc> file in yourhome directory. Also seenetrw-passwd (and if you're using ssh/scp hoping to figure out howto not need to use passwords for scp, lookatnetrw-ssh-hack).:NetUserPass [uid[password]]-- promptsas needed:callNetUserPass()-- prompts for uid and password:call NetUserPass("uid")-- prompts for password:call NetUserPass("uid","password")-- sets global uid and password(Related topics:ftpnetrw-userpassnetrw-start)NETRW VARIABLES AND SETTINGSnetrw-variables {{{2 (Also see:netrw-browser-var:netrw browser optionvariablesnetrw-protocol: file transfer protocol optionvariablesnetrw-settings: additional file transferoptionsnetrw-browser-options: theseoptions affect browsing directories)Netrw providesa lot ofvariables which allow you to customizenetrw to yourpreferences. Most such settings are described below, innetrw-browser-options, and innetrw-externapp:b:netrw_lastfile last file Network-read/written retained onaper-buffer basis (supports plain:Nw)g:netrw_bufsettings the settings thatnetrwbuffers have(default) noma nomod nonu nowrap ro noblg:netrw_chgwinspecifiesawindow number where subsequent file editswill take place. (also seenetrw-C)(default) -1g:Netrw_funcrefspecifiesa function (or functions) to be called whennetrw editsa file. The fileis first edited, andthen the functionreference(Funcref)is called.This variable may also holdaList of Funcrefs.(default) not defined. (the capital in g:Netrw...is required by its holdinga function reference) Example: place in .vimrc; affects all file opening fun! MyFuncRef() endfun let g:Netrw_funcref= function("MyFuncRef")g:Netrw_UserMapsspecifiesa function orList offunctions which canbe used to set up user-specified maps and functionality.Seenetrw-usermapsg:netrw_ftp ifit doesn't exist, use defaultftp=0 use defaultftp (uid password)=1 use alternateftpmethod (user uid password) If you're having trouble with ftp, trychanging the value of this variable to see if the alternateftpmethod works for your setup.g:netrw_ftp_options Chosen by default, theseoptions are supposed to turn interactive prompting off and to restrainftp from attempting auto-login upon initial connection. However,it appears that not allftp implementations support this (ex. ncftp).="-i-n"g:netrw_ftpextracmd default: doesn't existIf this variable exists, then anystringit containswill be placed into the commands set to yourftpclient. As an example:="passive"g:netrw_ftpmode="binary" (default)="ascii"g:netrw_ignorenetrc =0 (default for linux, cygwin)=1 If you havea <.netrc> file butit doesn't work and you wantit ignored, then set this variableas shown. (default for Windows+ cmd.exe)g:netrw_menu =0 disable netrw's menu=1 (default) netrw's menu enabledg:netrw_uid (ftp) user-id, retained ona per-vim-session basiss:netrw_passwd (ftp) password, retained ona per-vim-session basisg:netrw_preview =0 (default) previewwindow shown ina horizontally splitwindow=1 previewwindow shown ina vertically split window. Also affects the "previouswindow" (seenetrw-P) in the same way.Theg:netrw_alto variable may be used to provideadditional splitting control:g:netrw_previewg:netrw_alto result00:aboveleft0 1:belowright 10:topleft 1 1:botrightTocontrol sizing, seeg:netrw_winsizeg:netrw_scpport= "-P": option to use to set port forscpg:netrw_sshport= "-p": option to use to set port for sshg:netrw_sepchr =\0xff=\0x01 for enc== euc-jp (and perhapsit should be for others, too, please let me know) Separates priority codes from filenames internally. Seenetrw-p12.g:netrw_silent =0: transfers done normally=1: transfers done silentlyg:netrw_cygwin =1 assumescp underwindowsis from cygwin. Also permitsnetwork browsing to use ls with time and sizesorting (default if windows)=0 assume Windows'scp accepts windows-style paths Network browsing uses dir instead of ls This optionis ignored if you're usingunixg:netrw_use_nt_rcp =0 don't use thercp of WinNT, Win2000 and WinXP=1 use WinNT'srcp in binary mode (default)PATHSnetrw-path {{{2Paths to files are generally user-directory relative for most protocols.Itis possible that some protocol will make paths relative to someassociated directory, however.example: vim scp://user@host/somefileexample: vim scp://user@host/subdir1/subdir2/somefilewhere "somefile"is in the "user"'shome directory. If you wish to getafile using root-relative paths, use the full path:example: vim scp://user@host//somefileexample: vim scp://user@host//subdir1/subdir2/somefile==============================================================================4. Network-Oriented File Transfernetrw-xfer {{{1Network-oriented file transfer under Vimis implemented bya Vimscript(<netrw.vim>) usingplugin techniques. It currently supports both reading andwriting across networks using rcp, scp,ftp or ftp+<.netrc>, scp, fetch,dav/cadaver, rsync, or sftp.httpis currently supported read-only via use of wget or fetch.<netrw.vim>isa standardplugin which actsas glue between Vim and thevarious file transfer programs. It usesautocommand events (BufReadCmd,FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames.ex. vim ftp://hostname/path/to/fileThe characters preceding the colon specify the protocol to use; in theexample, it's ftp. The <netrw.vim>script then formulatesa command oraseries of commands (typically ftp) whichit issues to an external program(ftp, scp, etc) which does the actual file transfer/protocol. Files are readfrom/written toa temporary file (under Unix/Linux, /tmp/...) which the<netrw.vim>script will clean up.Now,aword about Jan Minář's "FTPUser Name and Password Disclosure"; first,ftpis nota secure protocol.User names and passwords are transmitted "inthe clear" over the internet; any snooper tool can pick these up; thisis notanetrw thing, thisisaftp thing. If you're concerned about this, pleasetry to usescp orsftp instead.Netrw re-uses the user id and password during the same vim session and so longas the remote hostname remains the same.Jan seems to bea bit confused about hownetrw handles ftp; normally multiplecommands are performed ina "ftp session", and he seems to feel that theuid/password should only be retained over oneftp session. However,netrwdoes everyftp operation ina separate "ftp session"; so remembering theuid/password for just one "ftp session" would be the sameas not rememberingthe uid/passwordat all. IMHO this would rapidly grow tiresomeas onebrowsed remote directories, for example.On the other hand, thanksgo to Jan M. for pointing out the manyvulnerabilities thatnetrw (and vim itself) had had in handling "crafted"filenames. Theshellescape() andfnameescape()functions were written inresponse byBramMoolenaar to handle these sort of problems, andnetrw hasbeen modified to use them. Still, my advice is, if the "filename" looks likea vim command that you aren't comfortable with having executed, don't open it.netrw-puttynetrw-pscpnetrw-psftpOne may modify any protocol's implementing external application by settingavariable (ex.scp uses the variable g:netrw_scp_cmd, whichis defaulted to"scp-q"). As an example, consider using PuTTY:let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch'let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"'(note:it has been reported thatwindows 7 with putty v0.6's "-batch" option doesn't work, so its best to leaveit off for that system)Seenetrw-p8 for more about putty, pscp, psftp, etc.Ftp, an old protocol, seems to be blessed by numerous implementations.Unfortunately, some implementations are noisy (ie., add junk to theend of thefile). Thus, concerned users may decide to writea NetReadFixup() functionthat will clean up after reading with their ftp. SomeUnix systems (ie.,FreeBSD) providea utility called "fetch" which uses theftp protocol butisnot noisy and more convenient, actually, for <netrw.vim> to use.Consequently, if "fetch"is available (ie. executable),it may be preferableto useit for ftp://... based transfers.For rcp, scp, sftp, and http, one may use network-oriented file transferstransparently; ie.vim rcp://[user@]machine/pathvim scp://[user@]machine/pathIf yourftp supports <.netrc>, thenit too can be transparently usedif the needed triad of machine name, user id, and password are present inthat file. Yourftpmust be able to use the <.netrc> file on its own, however.vim ftp://[user@]machine[[:#]portnumber]/pathWindows provides anftp (typically c:\Windows\System32\ftp.exe) which usesan option, -s:filename (filename can and probably should bea full path)which containsftp commands which will be automatically run wheneverftpstarts. You may use this feature to entera user and password for one site:useridpasswordnetrw-windows-netrcnetrw-windows-sIfg:netrw_ftp_cmd contains -s:[path/]MACHINE, then (on Windows machinesonly)netrw will substitute the current machine name requested forftpconnections for MACHINE. Hence one can have multiple machine.ftp filescontaining login and password for ftp. Example: let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE' vim ftp://myhost.somewhere.net/will usea fileC:\Users\Myself\myhost.ftpOften,ftp will need to query the user for the userid and password.The latter will be done "silently"; ie. asterisks will show up instead ofthe actually-typed-in password. Netrw will retain the userid and passwordfor subsequent read/writes from the most recent transfer so subsequenttransfers (read/write) to or from that machine will take place withoutadditional prompting.netrw-urls +=================================+============================+============+ | Reading | Writing | Uses | +=================================+============================+============+ | DAV: | | | | dav://host/path | | cadaver | |:Nread dav://host/path |:Nwrite dav://host/path | cadaver | +---------------------------------+----------------------------+------------+ | DAV+ SSL: | | | | davs://host/path | | cadaver | |:Nread davs://host/path |:Nwrite davs://host/path | cadaver | +---------------------------------+----------------------------+------------+ | FETCH: | | | | fetch://[user@]host/path | | | | fetch://[user@]host:http/path | Not Available |fetch | |:Nread fetch://[user@]host/path| | | +---------------------------------+----------------------------+------------+ | FILE: | | | | file:///* | file:///* | | | file://localhost/* | file://localhost/* | | +---------------------------------+----------------------------+------------+ | FTP:(*3) |(*3) | | |ftp://[user@]host/path |ftp://[user@]host/path |ftp(*2) | |:Nreadftp://host/path |:Nwriteftp://host/path | ftp+.netrc | |:Nread host path |:Nwrite host path | ftp+.netrc | |:Nread host uid pass path |:Nwrite host uid pass path |ftp | +---------------------------------+----------------------------+------------+ | HTTP: wgetis executable:(*4) | | | |http://[user@]host/path | Not Available | wget | +---------------------------------+----------------------------+------------+ | HTTP:fetchis executable(*4) | | | |http://[user@]host/path | Not Available |fetch | +---------------------------------+----------------------------+------------+ | RCP: | | | | rcp://[user@]host/path | rcp://[user@]host/path |rcp | +---------------------------------+----------------------------+------------+ | RSYNC: | | | | rsync://[user@]host/path | rsync://[user@]host/path |rsync | |:Nread rsync://host/path |:Nwrite rsync://host/path |rsync | |:Nread rcp://host/path |:Nwrite rcp://host/path |rcp | +---------------------------------+----------------------------+------------+ | SCP: | | | | scp://[user@]host/path | scp://[user@]host/path |scp | |:Nread scp://host/path |:Nwrite scp://host/path |scp(*1) | +---------------------------------+----------------------------+------------+ | SFTP: | | | | sftp://[user@]host/path | sftp://[user@]host/path |sftp | |:Nread sftp://host/path |:Nwrite sftp://host/path |sftp(*1) | +=================================+============================+============+(*1) For an absolute path use scp://machine//path.(*2) if <.netrc>is present,itis assumed thatit willwork with yourftp client. Otherwise thescript willprompt for user-id and password.(*3) for ftp, "machine" may be machine#port or machine:portifa different portis needed than the standardftp port(*4) for http:..., if wgetis availableit will be used. Otherwise,iffetchis availableit will be used.Both the:Nread and the:Nwrite ex-commands can accept multiple filenames.NETRCnetrw-netrcThe <.netrc> file, typically located in yourhome directory, contains linestherein which mapa hostname (machine name) to the user id and password youprefer to use with it.The typicalsyntax for lines ina <.netrc> fileis givenas shown below.Ftp underUnix usually supports <.netrc>;ftp under Windows usually doesn't.machine {full machine name} login {user-id} password "{password}"default login {user-id} password "{password}"Yourftp clientmust handle the use of <.netrc> on its own, but if the<.netrc> file exists, anftp transfer will not ask for the user-id orpassword.Note:Since this file contains passwords, make very sure nobody else canread this file! Most programs will refuse to usea .netrc thatisreadable for others. Don't forget that the system administrator canstill read the file! Ie. for Linux/Unix:chmod 600 .netrcEven though Windows'ftp clients typicallydo not support .netrc,netrw hasa work-around: seenetrw-windows-s.PASSWORDnetrw-passwdThescript attempts to get passwords forftp invisibly usinginputsecret(),a built-in Vim function. Seenetrw-userpass for how to change the passwordafter one has set it.Unfortunately there doesn't appear to bea way fornetrw to feeda password toscp. Thus every transfer viascp will require re-entry of the password.However,netrw-ssh-hack canhelp with this problem.==============================================================================5. Activationnetrw-activate {{{1Network-oriented file transfers are available by default whenever Vim's'nocompatible' modeis enabled. Netrw'sscript files reside in yoursystem's plugin, autoload, andsyntax directories; just theplugin/netrwPlugin.vimscriptis sourced automatically whenever you bring upvim. The mainscript in autoload/netrw.vimis only loaded when you actuallyuse netrw.I suggest that,ata minimum, you haveat least the following inyour <.vimrc> customization file:set nocpif version >= 600 filetype plugin indent onendifBy also including the following lines in your .vimrc, one may havenetrwimmediately activate when using [g]vim without any filenames, showing thecurrent directory:" Augroup VimStartup:augroup VimStartup au! au VimEnter * if expand("%") == "" | e . | endifaugroup END==============================================================================6. Transparent Remote File Editingnetrw-transparent {{{1Transparent file transfers occur whenevera regular file read or write(invoked via an:autocmd forBufReadCmd,BufWriteCmd, orSourceCmdevents)is made. Thus one may read, write, or source files across networksjustas easilyas if they were local files!vim ftp://[user@]machine/path...:wqSeenetrw-activate for more on how to encourage your vim to use pluginssuchas netrw.For password-free use of scp:, seenetrw-ssh-hack.==============================================================================7.Ex Commandsnetrw-ex {{{1The usual read/write commands are supported. There are alsoa fewadditional commands available. Often you won't need to use Nwrite orNreadas shown innetrw-transparent (ie. simply use :e URL :r URL :w URLinstead,as appropriate)-- seenetrw-urls. In the explanationsbelow,a{netfile}isa URL toa remote file.:Nwrite:Nw:[range]Nw[rite]Write the specified lines to the currentfileas specified in b:netrw_lastfile.(related:netrw-nwrite):[range]Nw[rite]{netfile} [{netfile}]...Write the specified lines to the{netfile}.:Nread:Nr:Nr[ead]Read the lines from the file specified inb:netrw_lastfileinto the current buffer. (related:netrw-nread):Nr[ead]{netfile}{netfile}...Read the{netfile} after the current line.:Nsource:Ns:Ns[ource]{netfile}Source the{netfile}.To start up vim usinga remote .vimrc, one may usethe following (all on one line) (tnx to Antoine Mechelynck)vim -u NORC -N --cmd "runtime plugin/netrwPlugin.vim" --cmd "source scp://HOSTNAME/.vimrc" (related:netrw-source):callNetUserPass()NetUserPass()Ifg:netrw_uid ands:netrw_passwd don't exist,this function will query the user for them.(related:netrw-userpass):call NetUserPass("userid")This call will set theg:netrw_uid and, ifthe password doesn't exist, will query the user for it.(related:netrw-userpass):call NetUserPass("userid","passwd")This call will set both theg:netrw_uid and s:netrw_passwd.The user-id and password are used byftp transfers. One mayeffectively remove the user-id and password by using emptystrings (ie. "").(related:netrw-userpass)==============================================================================8. Variables and Optionsnetrw-varnetrw-settings {{{1(also see:netrw-optionsnetrw-variablesnetrw-protocolnetrw-browser-settingsnetrw-browser-options)The <netrw.vim>script provides severalvariables which actasoptions toaffect <netrw.vim>'s file transfer behavior. Thesevariables typically may beset in the user's <.vimrc> file: (see alsonetrw-settingsnetrw-protocol)netrw-options ------------- Netrw Options -------------OptionMeaning------------------------------------------------------------- b:netrw_col Holds current cursor position (during NetWrite)g:netrw_cygwin =1 assumescp underwindowsis from cygwin (default/windows) =0 assumescp underwindows acceptswindows style paths (default/else)g:netrw_ftp =0 use defaultftp (uid password)g:netrw_ftpmode="binary" (default)="ascii" (your choice)g:netrw_ignorenetrc =1 (default) if you havea <.netrc> file but you don't wantit used, then set this variable. Its mere existenceis enough to cause <.netrc> to be ignored.b:netrw_lastfile Holds latest method/machine/path. b:netrw_line Holds current line number (during NetWrite)g:netrw_silent =0 transfers done normally =1 transfers done silentlyg:netrw_uid Holds current user-id for ftp.g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP'srcp (default) =1 use WinNT/2K/XP's rcp, binary mode-----------------------------------------------------------------------<netrw-internal-variablesThescript will also make use of the followingvariables internally, albeittemporarily. ------------------- Temporary Variables -------------------VariableMeaning--------------------------------------------b:netrw_methodIndex indicating rcp/ftp+.netrc/ftpw:netrw_method(sameas b:netrw_method)g:netrw_machineHolds machine name parsed from inputb:netrw_fnameHolds filename being accessed------------------------------------------------------------netrw-protocolNetrw supportsa number of protocols. These protocols are invoked using thevariables listed below, and may be modified by the user. ------------------------ Protocol Control Options ------------------------ Option Type Setting Meaning --------- -------- -------------- --------------------------- netrw_ftp variable =doesn't exist userid set by "user userid" =0 userid set by "user userid" =1 userid set by "userid" NetReadFixup function =doesn't exist no change =exists Allows user to have files read viaftp automatically transformed however they wish by NetReadFixup()g:netrw_dav_cmd var="cadaver" if cadaveris executableg:netrw_dav_cmd var="curl-o" elseif curlis executableg:netrw_fetch_cmd var="fetch-o" iffetchis availableg:netrw_ftp_cmd var="ftp"g:netrw_http_cmd var="fetch-o" iffetchis availableg:netrw_http_cmd var="wget-O" else if wgetis availableg:netrw_http_put_cmd var="curl-T"g:netrw_list_cmd var="ssh USEPORT HOSTNAME ls -Fa"g:netrw_rcp_cmd var="rcp"g:netrw_rsync_cmd var="rsync"g:netrw_rsync_sep var="/" used to separate the hostname from the file specg:netrw_scp_cmd var="scp-q"g:netrw_sftp_cmd var="sftp" -------------------------------------------------------------------------netrw-ftpThe g:netrw_..._cmdoptions(g:netrw_ftp_cmd andg:netrw_sftp_cmd)specify the external program to use handle theftp protocol. They mayinclude command lineoptions (suchas-p for passive mode). Example:let g:netrw_ftp_cmd= "ftp -p"Browsingis supported by using theg:netrw_list_cmd; thesubstring"HOSTNAME" will be changed via substitution with whatever the current requestis fora hostname.Twooptions(g:netrw_ftp andnetrw-fixup) bothhelp with certain ftp'sthat give trouble. In order to best understand how to use theseoptions ifftpis giving you troubles,a bit of discussionis provided on hownetrw doesftp reads.For ftp,netrw typically builds up lines of one of the following formats inatemporary file: IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1 ---------------------------------- ------------------------------ open machine[port] open machine[port] user userid password userid password [g:netrw_ftpmode] password [g:netrw_ftpextracmd] [g:netrw_ftpmode] get filenametempfile [g:netrw_extracmd] get filenametempfile ---------------------------------------------------------------------Theg:netrw_ftpmode andg:netrw_ftpextracmd are optional.Netrw then executes the lines above by use ofa filter::%! {g:netrw_ftp_cmd} -i [-n]whereg:netrw_ftp_cmdis usually "ftp",-i tellsftp not to be interactive-n means don't use netrc andis used for Method #3 (ftp w/o <.netrc>)If <.netrc> existsit will be used to avoid having to query the user foruserid and password. The transferred fileisput intoa temporary file.The temporary fileis then read into the main editing sessionwindow thatrequestedit and the temporary file deleted.If yourftp doesn't accept the "user" command and immediately just demandsauserid, then try putting "let netrw_ftp=1" in your <.vimrc>.netrw-cadaverTo handle the SSL certificatedialog for untrusted servers, one may pulldown the certificate and placeit into /usr/ssl/cert.pem. This operationrenders the server treatmentas "trusted".netrw-fixupnetreadfixupIf yourftp for whatever reason generates unwanted lines (suchas AUTHmessages) you may writea NetReadFixup() function: function! NetReadFixup(method,line1,line2) " a:line1: first new line in current file " a:line2: last new line in current file if a:method == 1 "rcp elseif a:method == 2 "ftp + <.netrc> elseif a:method == 3 "ftp + machine,uid,password,filename elseif a:method == 4 "scp elseif a:method == 5 "http/wget elseif a:method == 6 "dav/cadaver elseif a:method == 7 "rsync elseif a:method == 8 "fetch elseif a:method == 9 "sftp else " complain endif endfunctionThe NetReadFixup() function will be called ifit exists and thus allows you tocustomize your reading process.(Related topics:ftpnetrw-userpassnetrw-start)==============================================================================9. Browsingnetrw-browsingnetrw-browsenetrw-help {{{1netrw-browsernetrw-dirnetrw-listINTRODUCTION TO BROWSINGnetrw-intro-browse {{{2(Quick References:netrw-quickmapsnetrw-quickcoms)Netrw supports the browsing of directories on your local system and on remotehosts; browsing includes listing files and directories, entering directories,editing files therein,deleting files/directories, making new directories,moving (renaming) files and directories,copying files and directories, etc.One maymark files and execute any system command on them! The Netrw browsergenerallyimplements the previous explorer's maps and commands for remotedirectories, although details (suchas pertinent global variable names)necessarily differ. To browsea directory, simply "edit" it!vim /your/directory/vim .vim c:\your\directory\(Related topics:netrw-crnetrw-onetrw-pnetrw-Pnetrw-tnetrw-mfnetrw-mxnetrw-Dnetrw-Rnetrw-v)The Netrw remote file and directory browser handles two protocols: ssh andftp. The protocol in the url, ifitis ftp, will causenetrw also to useftpin its remote browsing. Specifying any other protocol will causeit to beused for file transfers; but the ssh protocol will be used todo remotebrowsing.To use Netrw's remote directory browser, simply attempt to reada "file" witha trailing slash andit will be interpretedasa request tolista directory:vim [protocol]://[user@]hostname/path/where[protocol]is typicallyscp or ftp. As an example, try:vim ftp://ftp.home.vim.org/pub/vim/For local directories, the trailing slashis not required. Again, because it'seasy to miss: to browse remote directories, the URLmust terminate withaslash!If you'd like to avoid entering the password repeatedly for remote directorylistings with ssh or scp, seenetrw-ssh-hack. To avoid password entry withftp, seenetrw-netrc (if yourftp supports it).There are several things you cando to affect the browser's display of files:* To change the listing style, press the "i" key(netrw-i). Currently there are four styles: thin, long, wide, and tree. To make that change "permanent", seeg:netrw_liststyle.* To hide files (don't want to see those xyz~ files anymore?) seenetrw-ctrl-h.* Presss to sort files by name, time, or size.Seenetrw-browse-cmds for all the things you cando with netrw!netrw-getftypenetrw-filigreenetrw-ftypeThegetftype() functionis used to appenda bit of filigree to indicatefiletype to locally listed files:directory:/executable: *fifo: |links:@sockets:=The filigree also affects theg:netrw_sort_sequence.QUICK HELPnetrw-quickhelp {{{2 (Use ctrl-] to select a topic)Intro to Browsing...............................netrw-intro-browse Quick Reference: Maps.........................netrw-quickmap Quick Reference: Commands.....................netrw-browse-cmdsHiding Edit hiding list..............................netrw-ctrl-h Hiding Files or Directories...................netrw-a Hiding/Unhiding by suffix.....................netrw-mh Hiding dot-files.............................netrw-ghListing StyleSelect listing style (thin/long/wide/tree)....netrw-i Associated setting variable...................g:netrw_liststyle Shell command used to perform listing.........g:netrw_list_cmd Quick file info...............................netrw-qfSorted bySelectsorting style (name/time/size).........netrw-s Editing thesorting sequence..................netrw-S Sorting options...............................g:netrw_sort_options Associated setting variable...................g:netrw_sort_sequence Reversesorting order.........................netrw-rnetrw-quickmapnetrw-quickmapsQUICK REFERENCE: MAPSnetrw-browse-maps {{{2 ------------------------ MapQuick ExplanationLink ------------------------<F1>Causes Netrw to issuehelp<cr>Netrw will enter the directory or read the filenetrw-cr<del>Netrw will attempt to remove the file/directorynetrw-del<c-h>Edit file hidinglistnetrw-ctrl-h<c-l>Causes Netrw to refresh the directory listingnetrw-ctrl-l<c-r>Browse usingagvim servernetrw-ctrl-r<c-tab> Shrink/expanda netrw/explorewindownetrw-c-tab-Makes Netrwgo up one directorynetrw--aCycles between normal display,netrw-ahiding (suppress display of files matching g:netrw_list_hide)and showing (display only files which match g:netrw_list_hide) cdMake browsing directory the current directorynetrw-cdCSetting the editingwindownetrw-CdMakea directorynetrw-dDAttempt to remove the file(s)/directory(ies)netrw-D gbGo to previous bookmarked directorynetrw-gbgdForce treatmentas directorynetrw-gdgfForce treatmentas filenetrw-gfghQuick hide/unhide of dot-filesnetrw-ghgnMake top of tree the directory below the cursornetrw-gngpChange local-only file permissionsnetrw-gpiCycle between thin, long, wide, and tree listingsnetrw-iIToggle the displaying of the bannernetrw-I mbBookmark current directorynetrw-mb mcCopy marked files to marked-file target directorynetrw-mc mdApplydiff to marked files (up to 3)netrw-md mePlace marked files on arglist and edit themnetrw-me mfMarka filenetrw-mf mFUnmark filesnetrw-mF mgApply vimgrep to marked filesnetrw-mg mhToggle marked file suffices' presence on hidinglistnetrw-mh mmMove marked files to marked-file target directorynetrw-mm mrMark files usinga shell-styleregexpnetrw-mr mtCurrent browsing directory becomes markfile targetnetrw-mt mTApplyctags to marked filesnetrw-mT muUnmark all marked filesnetrw-mu mvApply arbitrary vim command to marked filesnetrw-mv mxApply arbitrary shell command to marked filesnetrw-mx mXApply arbitrary shell command to marked files en blocnetrw-mX mzCompress/decompress marked filesnetrw-mzoEnter the file/directory under the cursor ina newnetrw-obrowser window.A horizontal splitis used.OObtaina file specified by cursornetrw-OpPreview the filenetrw-pPBrowse in the previously usedwindownetrw-P qbList bookmarked directories andhistorynetrw-qb qfDisplay information on filenetrw-qf qFMark files usingaquickfixlistnetrw-qF qLMark files usingalocation-listnetrw-qLrReversesorting ordernetrw-rRRename the designated file(s)/directory(ies)netrw-RsSelectsorting style: by name, time, or file sizenetrw-sSSpecify suffix priority for name-sortingnetrw-StEnter the file/directory under the cursor ina newtabnetrw-tuChange to recently-visited directorynetrw-uUChange to subsequently-visited directorynetrw-UvEnter the file/directory under the cursor ina newnetrw-vbrowser window.A vertical splitis used.xView file with an associated program:OpenXExecute filename under cursor viasystem()netrw-X%Opena new file in netrw's current directorynetrw-%netrw-mousenetrw-leftmousenetrw-middlemousenetrw-rightmouse<leftmouse>(gvim only) selectsword under mouseas ifa<cr>had been pressed (ie. edit file, change directory)<middlemouse>(gvim only) sameasP selectingword under mouse;seenetrw-P<rightmouse>(gvim only) delete file/directory usingword undermouse<2-leftmouse>(gvim only) when: * ina netrw-selected file, AND *g:netrw_retmap== 1 AND * the user doesn't already havea<2-leftmouse>mapping defined beforenetrwis autoloaded,thena double clicked leftmouse button will returnto thenetrw browser window. Seeg:netrw_retmap.<s-leftmouse>(gvim only) like mf, willmark files. Draggingthe shifted leftmouse willmark multiple files.(seenetrw-mf)(to disable mouse buttons while browsing:g:netrw_mousemaps)netrw-quickcomnetrw-quickcomsQUICK REFERENCE: COMMANDSnetrw-explore-cmdsnetrw-browse-cmds {{{2 :Ntree....................................................netrw-ntree :Explore[!][dir] Explore directory of current file......netrw-explore :Hexplore[!][dir] Horizontal Split& Explore.............netrw-explore :Lexplore[!][dir] Left Explorer Toggle...................netrw-explore :Nexplore[!][dir] Vertical Split& Explore...............netrw-explore :Pexplore[!][dir] Vertical Split& Explore...............netrw-explore:Rexplore Return to Explorer.....................netrw-explore :Sexplore[!][dir] Split& Explore directory .............netrw-explore :Texplore[!][dir]Tab& Explore..........................netrw-explore :Vexplore[!][dir] Vertical Split& Explore...............netrw-exploreBANNER DISPLAYnetrw-IOne maytoggle the displaying of the banner by pressing "I".Also See:g:netrw_bannerBOOKMARKING A DIRECTORYnetrw-mbnetrw-bookmarknetrw-bookmarks {{{2One may easily "bookmark" the currently browsed directory by usingmb.netrwbookBookmarks are retained in between sessions of vim ina file called.netrwbookasaList, whichis typically stored in the first directory on the user's'runtimepath'; entries are kept in sorted order.If there are marked files and/or directories, mb will add them to thebookmarklist.netrw-:NetrwMBAdditionally, one may use :NetrwMB tobookmark files or directories.:NetrwMB[!] [files/directories] No bang: enters files/directories into Netrw'sbookmark system No argument and innetrw buffer: if there are marked files:bookmark marked files otherwise:bookmark file/directory under cursor No argument and not innetrw buffer: bookmarks current open file Has arguments:glob()s each arg and bookmarks them With bang: deletes files/directories from Netrw'sbookmark systemThe :NetrwMB commandis available outside ofnetrwbuffers (oncenetrw has beeninvoked in the session).The file ".netrwbook" holds bookmarks whennetrw (and vim)is not active. Bydefault, its stored on the first directory on the user's'runtimepath'.Related Topics:netrw-gb how to return (go) toabookmarknetrw-mB how to delete bookmarksnetrw-qb how tolist bookmarksg:netrw_home controls where.netrwbookis keptBROWSINGnetrw-enternetrw-cr {{{2Browsingis simple: move the cursor ontoa file or directory of interest.Hitting the<cr> (the return key) will select the file or directory.Directories will themselves be listed, and files will be opened using theprotocol given in the original read request. CAVEAT: There are four forms of listing (seenetrw-i). Netrw assumes that two or more spaces delimit filenames and directory names for the long and wide listing formats. Thus, if your filename or directory name has two or more sequential spaces embedded in it, or any trailing spaces, then you'll need to use the "thin" format to select it.Theg:netrw_browse_split option, whichis zero by default, may be used tocause the opening of files to be done ina newwindow ortab instead of thedefault. When the optionis one or two, the splitting will be takenhorizontally or vertically, respectively. When the optionis set to three,a<cr> will cause the file to appear ina new tab.When using thegui (gvim), one may selecta file by pressing the<leftmouse>button. In addition, if *g:netrw_retmap== 1 AND (its default valueis 0) * ina netrw-selected file, AND * the user doesn't already havea<2-leftmouse>mapping defined beforenetrwis loadedthena doubly-clicked leftmouse button will return to thenetrw browserwindow.Netrw attempts to speed up browsing, especially for remote browsing where onemay have to enter passwords, by keeping and re-using previously obtaineddirectory listing buffers. Theg:netrw_fastbrowse variableis used tocontrol this behavior; one may have slow browsing (no buffer re-use), mediumspeed browsing (re-use directory buffer listings only for remote directories),and fast browsing (re-use directory buffer listingsas oftenas possible).The price for such re-useis that when changes are made (suchas new filesare introduced intoa directory), the listing may become out-of-date. One mayalways refresh directory listingbuffers by pressing ctrl-L (seenetrw-ctrl-l).netrw-s-crSqueezing the Current Tree-Listing DirectoryWhen the tree listing styleis enabled (seenetrw-i) and oneis usinggvim, then the<s-cr>mapping may be used to squeeze (close) thedirectory currently containing the cursor.Otherwise, one may remapa key combination of one's own choice to getthis effect: nmap <buffer> <silent> <nowait> YOURKEYCOMBO <Plug>NetrwTreeSqueezePut this line in $HOME/ftplugin/netrw/netrw.vim;it needs to be generatedfornetrwbuffers only.Related topics:netrw-ctrl-rnetrw-onetrw-pnetrw-Pnetrw-tnetrw-vAssociated setting variables:g:netrw_browse_splitg:netrw_fastbrowseg:netrw_ftp_list_cmdg:netrw_ftp_sizelist_cmdg:netrw_ftp_timelist_cmdg:netrw_ssh_browse_rejectg:netrw_ssh_cmdg:netrw_use_noswfBROWSING WITH A HORIZONTALLY SPLIT WINDOWnetrw-onetrw-horiz {{{2Normally one entersa file or directory using the<cr>. However, the "o" mapallows one to opena newwindow to hold the new directory listing or file.Ahorizontal splitis used. (for vertical splitting, seenetrw-v)Normally, theo key splits thewindow horizontally with the newwindow andcursorat the top.Associated setting variables:g:netrw_altog:netrw_winsizeRelated topics:netrw-ctrl-rnetrw-onetrw-pnetrw-Pnetrw-tnetrw-vAssociated setting variables:g:netrw_altocontrol above/below splittingg:netrw_winsizecontrol initial sizingBROWSING WITH A NEW TABnetrw-t {{{2Normally one entersa file or directory using the<cr>. The "t" mapallows one to opena newwindow holding the new directory listing or file ina new tab.If you'd like to have the new listing ina background tab, usegT.Related topics:netrw-ctrl-rnetrw-onetrw-pnetrw-Pnetrw-tnetrw-vAssociated setting variables:g:netrw_winsizecontrol initial sizingBROWSING WITH A VERTICALLY SPLIT WINDOWnetrw-v {{{2Normally one entersa file or directory using the<cr>. However, the "v" mapallows one to opena newwindow to hold the new directory listing or file.Avertical splitis used. (for horizontal splitting, seenetrw-o)Normally, thev key splits thewindow vertically with the newwindow andcursorat the left.Thereis only one tree listing buffer; using "v" ona displayed subdirectorywill split the screen, but the same buffer will be shown twice.Related topics:netrw-ctrl-rnetrw-onetrw-pnetrw-Pnetrw-tnetrw-vAssociated setting variables:g:netrw_altvcontrol right/left splittingg:netrw_winsizecontrol initial sizingBROWSING USING A GVIM SERVERnetrw-ctrl-r {{{2One may keepa browsinggvim separate from thegvim being used to edit.Use the<c-r> map ona file (nota directory) in thenetrw browser, anditwill useagvim server (seeg:netrw_servername). Subsequent use of<cr>(seenetrw-cr) will re-use that server for editing files.Related topics:netrw-ctrl-rnetrw-onetrw-pnetrw-Pnetrw-tnetrw-vAssociated setting variables:g:netrw_servername: sets name of serverg:netrw_browse_split: controls how<cr> will open filesCHANGE LISTING STYLE (THIN LONG WIDE TREE)netrw-i {{{2The "i" map cycles between the thin, long, wide, and tree listing formats.The thin listing format gives just the files' and directories' names.The long listingis either based on the "ls" command via ssh for remotedirectories or displays the filename, file size (in bytes), and the time anddate of last modification for local directories. With the long listingformat,netrwis not able to recognize filenames which have trailing spaces.Use the thin listing format for such files.The wide listing format uses two or more contiguous spaces to delineatefilenames; when using that format,netrw won't be able to recognize or usefilenames which have two or more contiguous spaces embedded in the name or anytrailing spaces. The thin listing format will, however, work with such files.The wide listing formatis the most compact.The tree listing format hasa top directory followed by files and directoriespreceded by one or more "|"s, which indicate the directory depth. One mayopen and close directories by pressing the<cr> key while atop the directoryname.One may makea preferred listing style your default; seeg:netrw_liststyle.As an example, by putting the following line in your .vimrc,let g:netrw_liststyle= 3the tree style will become your default listing style.One typical way to use thenetrw tree displayis to:vim .(use i until a tree display shows)navigate to a filev (edit as desired in vertically split window)ctrl-w h (to return to the netrw listing)P (edit newly selected file in the previous window)ctrl-w h (to return to the netrw listing)P (edit newly selected file in the previous window)...etc...Associated setting variables:g:netrw_liststyleg:netrw_maxfilenameleng:netrw_timefmtg:netrw_list_cmdCHANGE FILE PERMISSIONnetrw-gp {{{2"gp" will ask you fora new permission for the file named under the cursor.Currently, this only works for local files.Associated setting variables:g:netrw_chgpermCHANGING TO A BOOKMARKED DIRECTORYnetrw-gb {{{2To change directory back toa bookmarked directory, use{cnt}gbAnycount may be used toreference any of the bookmarks.Note thatnetrw-qb shows both bookmarks and history; togotoa location stored in thehistory seenetrw-u andnetrw-U.Related Topics:netrw-mB how to delete bookmarksnetrw-mb how to makeabookmarknetrw-qb how tolist bookmarksCHANGING TO A PREDECESSOR DIRECTORYnetrw-unetrw-updir {{{2Every time you change toa new directory (new for the current session),netrwwill save the directory ina recently-visited directoryhistorylist (unlessg:netrw_dirhistmaxis zero; by default,it holds ten entries). With the "u"map, one can change to an earlier directory (predecessor). Todo theopposite, seenetrw-U.The "u" map also accepts counts togo back in thehistory several slots. Foryour convenience, qb (seenetrw-qb) lists thehistory number which may beused in that count..netrwhistSeeg:netrw_dirhistmax for how tocontrol the quantity ofhistory stackslots. The file ".netrwhist" holdshistory whennetrw (and vim)is notactive. By default, its stored on the first directory on the user's'runtimepath'.Related Topics:netrw-Uchanging toa successor directoryg:netrw_home controls where.netrwhistis keptCHANGING TO A SUCCESSOR DIRECTORYnetrw-Unetrw-downdir {{{2With the "U" map, one can change toa later directory (successor).This mapis the opposite of the "u" map. (seenetrw-u) Use theqb map tolist both the bookmarks and history. (seenetrw-qb)The "U" map also accepts counts togo forward in thehistory several slots.Seeg:netrw_dirhistmax for how tocontrol the quantity ofhistory stackslots.CHANGING TREE TOPnetrw-ntree:Ntreenetrw-gn {{{2One may specifya new tree top for tree listings using:Ntree [dirname]Withouta "dirname", the current lineis used (and any leading depthinformationis elided).Witha "dirname", the specified directory nameis used.The "gn" map will take theword below the cursor and use that forchanging the top of the tree listing.netrw-curdirDELETING BOOKMARKSnetrw-mB {{{2To deletea bookmark, use{cnt}mBIf there are marked files, then mB will remove them from thebookmark list.Alternatively, one may use :NetrwMB! (seenetrw-:NetrwMB).:NetrwMB! [files/directories]Related Topics:netrw-gb how to return (go) toabookmarknetrw-mb how to makeabookmarknetrw-qb how tolist bookmarksDELETING FILES OR DIRECTORIESnetrw-deletenetrw-Dnetrw-del {{{2If files have not been marked withnetrw-mf: (local marked file list) Deleting/removing files and directories involves moving the cursor to the file/directory to be deleted and pressing "D". Directoriesmust be empty first before they can be successfully removed. If the directoryisa softlink toa directory, thennetrw will make two requests to remove the directory before succeeding. Netrw will ask for confirmation before doing the removal(s). You may selecta range of lines with the "V" command (visual selection), and then pressing "D".If files have been marked withnetrw-mf: (local marked file list) Marked files (and empty directories) will be deleted; again, you'll be asked to confirm the deletion beforeit actually takes place.A further approachis to delete files which matcha pattern. * use :MFpattern (seenetrw-:MF); then press "D". * use mr (seenetrw-mr) which will prompt you for pattern. This will cause the matching files to be marked. Then, press "D".Pleasenote that only empty directories may be deleted with the "D" mapping.Regular files are deleted withdelete(), too.Theg:netrw_rm_cmd,g:netrw_rmf_cmd, andg:netrw_rmdir_cmdvariables areused tocontrol the attempts to remove remote files and directories. Theg:netrw_rm_cmdis used with files, and its default value is:g:netrw_rm_cmd: ssh HOSTNAME rmTheg:netrw_rmdir_cmd variableis used to support the removal of directories.Its default value is:g:netrw_rmdir_cmd: ssh HOSTNAME rmdirIf removinga directory fails with g:netrw_rmdir_cmd,netrw then will attemptto removeit again using theg:netrw_rmf_cmd variable. Its default value is:g:netrw_rmf_cmd: ssh HOSTNAME rm-fRelated topics:netrw-dAssociated setting variable:g:netrw_rm_cmdg:netrw_ssh_cmdnetrw-explorenetrw-hexplorenetrw-nexplorenetrw-pexplorenetrw-rexplorenetrw-sexplorenetrw-texplorenetrw-vexplorenetrw-lexploreDIRECTORY EXPLORATION COMMANDS {{{2 :[N]Explore[!][dir]... Explore directory of current file:Explore :[N]Hexplore[!][dir]... Horizontal Split& Explore:Hexplore :[N]Lexplore[!][dir]... Left Explorer Toggle:Lexplore :[N]Sexplore[!][dir]... Split&Explore current file's directory:Sexplore :[N]Vexplore[!][dir]... Vertical Split& Explore:Vexplore:Texplore[dir]...Tab& Explore:Texplore:Rexplore... Return to/from Explorer:Rexplore Used with:Explore **/pattern: (also seenetrw-starstar) :Nexplore.............go to next matching file:Nexplore :Pexplore.............go to previous matching file:Pexplorenetrw-:Explore:Explore will open the local-directory browser on the current file's directory (or on directory[dir] if specified). Thewindow will be split only if the file has been modified and'hidden'is not set, otherwise the browsingwindow will take over that window. Normally the splittingis taken horizontally. Also see:netrw-:Rexplore:Explore!is like :Explore, but will use vertical splitting.netrw-:Hexplore:Hexplore[dir] does an:Explore with:belowright horizontal splitting.:Hexplore![dir] does an:Explore with:aboveleft horizontal splitting.netrw-:Lexplore:[N]Lexplore[dir] togglesa full height Explorerwindow on the left hand side of the current tab. It will openanetrwwindow on the current directory if[dir]is omitted;a:Lexplore[dir] will show the specified directory in the left-hand side browser display no matter from whichwindow the commandis issued. By default,:Lexplore will change an uninitializedg:netrw_chgwin to 2; edits will thus preferentially be made in window#2. The [N]specifiesag:netrw_winsize just for the new:Lexplore window. That means that if [N]<0: useN columns for the Lexplorewindow if [N]=0:a normal splitis made if [N]>0: useN% of the currentwindow will be used for the newwindow Those who like thismethod often also like tree style displays; seeg:netrw_liststyle.:[N]Lexplore![dir]is similar to :Lexplore, except that the full-height Explorerwindow will open on the right hand side and an uninitializedg:netrw_chgwin will be set to 1 (eg. edits will preferentially occur in the leftmost window). Also see:netrw-Cg:netrw_browse_splitg:netrw_wiwnetrw-pnetrw-Pg:netrw_chgwinnetrw-c-tabg:netrw_winsizenetrw-:Sexplore:[N]Sexplore will always split thewindow before invoking the local-directory browser. As with Explore, the splittingis normally done horizontally.:[N]Sexplore![dir]is like :Sexplore, but the splitting will be done vertically.netrw-:Texplore:Texplore[dir] doesa:tabnew before generating the browserwindownetrw-:Vexplore:[N]Vexplore[dir] does an:Explore with:leftabove vertical splitting.:[N]Vexplore![dir] does an:Explore with:rightbelow vertical splitting.The optional parameters are: [N]: This parameter will overrideg:netrw_winsize to specify the quantity of rows and/or columns the new explorerwindow should have. Otherwise, theg:netrw_winsize variable, ifit has been specified by the user,is used tocontrol the quantity of rows and/or columns new explorerwindows should have.[dir]: By default, these explorer commands use the current file's directory. However, one may explicitly providea directory (path) to use instead;ie.:Explore /some/pathnetrw-:Rexplore:Rexplore This commandisa little different from the other Explore commandsasit doesn't necessarily open an Explorer window. Return to Explorer When one editsa file usingnetrw which can occur, for example, when pressing<cr> while the cursoris atopa filename inanetrw browser window,a:Rexplore issued while editing that file will return the display to that of the lastnetrw browser display in that window. Return from Explorer Conversely, when oneis editinga directory, issuinga:Rexplore will return to editing the file that was last edited in that window. The<2-leftmouse> map (whichis only available undergvim and cooperative terms) does the sameas :Rexplore.Also see:g:netrw_altog:netrw_altvg:netrw_winsizenetrw-starnetrw-starpatnetrw-starstarnetrw-starstarpatnetrw-grepEXPLORING WITH STARS AND PATTERNS {{{2When Explore, Sexplore, Hexplore, or Vexplore are used with one of thefollowing four patterns Explore generatesalist of files which satisfy therequest for the local file system. These exploration patterns will not workwith remote file browsing. */filepatfiles in current directory which satisfy filepat **/filepatfiles in current directory or below which satisfy thefilepattern *//patternfiles in the current directory which contain thepattern (vimgrepis used) **//patternfiles in the current directory or below which containthepattern (vimgrepis used)<The cursor will be placed on the first file in the list. One may thencontinue togo to subsequent files on thatlist via:Nexplore or topreceding files on thatlist with:Pexplore. Explore will update thedirectory and place the cursor appropriately.A plain:Explorewill clear the explore list.If your console orgui produces recognizable shift-up or shift-down sequences,then you'll likely find using shift-downarrow and shift-uparrow convenient.They're mapped bynetrwas follows:<s-down>== Nexplore, and<s-up>== Pexplore.As an example, consider:Explore */*.c:Nexplore:Nexplore:PexploreThe status line will show, on the right hand side of the status line,amessage like "Match 3 of 20".Associated setting variables:g:netrw_keepdirg:netrw_browse_splitg:netrw_fastbrowseg:netrw_ftp_browse_rejectg:netrw_ftp_list_cmdg:netrw_ftp_sizelist_cmdg:netrw_ftp_timelist_cmdg:netrw_list_cmdg:netrw_liststyleDISPLAYING INFORMATION ABOUT FILEnetrw-qf {{{2With the cursor atopa filename, pressing "qf" will reveal the file's sizeand last modification timestamp. Currently this capabilityis only availablefor local files.EDIT FILE OR DIRECTORY HIDING LISTnetrw-ctrl-hnetrw-edithide {{{2The "<ctrl-h>" map brings upa requestor allowing the user to change thefile/directory hidinglist contained ing:netrw_list_hide. The hidinglistconsists of one or more patterns delimited by commas. Files and/ordirectories satisfying these patterns will either be hidden (ie. not shown) orbe the only ones displayed (seenetrw-a).The "gh"mapping (seenetrw-gh) quickly alternates between the usualhidinglist and the hiding of files or directories that begin with ".".As an example,let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+'Effectively, this makes the effect ofanetrw-gh command the initial setting.Whatit means:\(^\|\s\s\): if the line begins with the following, -or- two consecutive spaces are encountered\zs: start the hiding match now\.: ifit now begins witha dot\S\+: andis followed by one or more non-whitespace charactersAssociated setting variables:g:netrw_hideg:netrw_list_hideAssociated topics:netrw-anetrw-ghnetrw-mhnetrw-sort-sequenceEDITING THE SORTING SEQUENCEnetrw-Snetrw-sortsequence {{{2When "Sorted by"is name, one may specify priority via thesorting sequence(g:netrw_sort_sequence). Thesorting sequence typically prioritizes thename-listing by suffix, although anypattern will do. Patterns are delimitedby commas. The defaultsorting sequenceis (all one line):For Unix:'[\/]$,\<core\%(\.\d\+\)\=,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$'Otherwise:'[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$'The lone *is where all filenames not covered by one of the other patternswillend up. One may change thesorting sequence by modifying theg:netrw_sort_sequence variable (either manually or in your <.vimrc>) or byusing the "S" map.Related topics:netrw-snetrw-SAssociated setting variables:g:netrw_sort_sequenceg:netrw_sort_optionsEXECUTING FILE UNDER CURSOR VIA SYSTEM()netrw-X {{{2PressingX while the cursoris atop an executable file will yielda promptusing the filename asking for any arguments. Upon pressinga[return],netrwwill then callsystem() with that command and arguments. The result will bedisplayed by:echomsg, and so:messages will repeat display of the result.Ansiescape sequences will be stripped out.Seecmdline-window for directions for more on how to edit the arguments.FORCING TREATMENT AS A FILE OR DIRECTORYnetrw-gdnetrw-gf {{{2Remote symbolic links (ie. those listed via ssh or ftp) are problematicin thatitis difficult to tell whether they link toa file or toadirectory.To force treatmentasa file: usegfTo force treatmentasa directory: usegdGOING UPnetrw-- {{{2Togo upa directory, press "-" or press the<cr> when atop the ../ directoryentry in the listing.Netrw will use the command ing:netrw_list_cmd to perform the directorylisting operation afterchanging HOSTNAME to the host specified by theuser-prpvided url. By defaultnetrw provides the command as:ssh HOSTNAME ls -FLawhere the HOSTNAME becomes the [user@]hostnameas requested by the attempt toread. Naturally, the user may override this command with whateverispreferred. The NetList function whichimplements remote browsingexpects that directories will be flagged bya trailing slash.HIDING FILES OR DIRECTORIESnetrw-anetrw-hiding {{{2Netrw's browsing facility allows one to use the hidinglist in one of threeways: ignore it, hide files which match, and show only those files whichmatch.If no files have been marked vianetrw-mf:The "a" map allows the user to cycle through the three hiding modes.Theg:netrw_list_hide variable holdsa comma delimitedlist of patternsbased on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list.(also seenetrw-ctrl-h) To set the hiding list, use the<c-h> map. As anexample, to hide files which begin witha ".", one may use the<c-h> map toset the hidinglist to '^\..*' (or one mayput let g:netrw_list_hide= '^\..*'in one's <.vimrc>). One may then use the "a" key to show all files, hidematching files, or to show only the matching files.Example: \.[ch]$This hidinglist command will hide/show all *.c and *.h files.Example: \.c$,\.h$This hidinglist command will also hide/show all *.c and *.hfiles.Don't forget to use the "a" map to select the mode (normal/hiding/show) youwant!If files have been marked usingnetrw-mf, then this command will: if showing all files or non-hidden files: modify theg:netrw_list_hidelist by appending the marked files toit and showing only non-hidden files. else if showing hidden files only: modify theg:netrw_list_hidelist by removing the marked files fromit and showing only non-hidden files. endifnetrw-ghnetrw-hideAsa quick shortcut, one may pressghtotoggle between hiding files which begin witha period (dot) and not hidingthem.Associated setting variables:g:netrw_list_hideg:netrw_hideAssociated topics:netrw-anetrw-ctrl-hnetrw-mhnetrw-gitignoreNetrw providesa helper function 'netrw_gitignore#Hide()' that, when used withg:netrw_list_hide automatically hides all git-ignored files.'netrw_gitignore#Hide' searches for patterns in the following files:'./.gitignore''./.git/info/exclude'global gitignore file: `git config --global core.excludesfile`system gitignore file: `git config --system core.excludesfile`Files thatdo not exist, are ignored.Git-ignore patterns are taken from existing files, and converted to patterns forhiding files. For example, if you had'*.log' in your '.gitignore' file,itwould be converted to'.*\.log'.To use this function, simply assign its output tog:netrw_list_hide option.Example: let g:netrw_list_hide= netrw_gitignore#Hide()Git-ignored files are hidden in Netrw.Example: let g:netrw_list_hide= netrw_gitignore#Hide('my_gitignore_file')Function can take additional files with git-ignore patterns.Example: let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$'Combining 'netrw_gitignore#Hide' with custom patterns.IMPROVING BROWSINGnetrw-listhacknetrw-ssh-hack {{{2Especially with the remote directory browser, constantly entering the passwordis tedious.For Linux/Unix systems, thebook "Linux Server Hacks- 100 industrial strengthtips& tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) givesa tipfor setting up no-password ssh andscp and discusses associated securityissues. It used to be availableathttp://hacks.oreilly.com/pub/h/66,but apparently that addressis now being redirected to some "hackzine".I'll attempta summary based on that article and ona communication fromBen Schmidt:1. Generatea public/private key pair on the local machine (ssh client):ssh-keygen -t rsa(saving the file in ~/.ssh/id_rsa as prompted)2. Just hit the<CR> when asked for passphrase (twice) for no passphrase. If youdo usea passphrase, you will also need to use ssh-agent so you only have to type the passphrase once per session. If you don't usea passphrase, simply logging onto your local computer or getting access to the keyfile in any way will suffice to access any ssh servers which have that key authorized for login.3. This creates two files:~/.ssh/id_rsa~/.ssh/id_rsa.pub4. On the target machine (ssh server):cdmkdir -p .sshchmod 0700 .ssh5. On your local machine (ssh client): (one line)ssh {serverhostname} cat '>>' '~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub or, for OpenSSH, (one line)ssh {serverhostname} cat '>>' '~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pubYou can testit out withssh {serverhostname}and you should be log onto the server machine without further need to typeanything.If you decided to usea passphrase, do:ssh-agent $SHELLssh-addssh {serverhostname}You will be prompted for your key passphrase when you use ssh-add, but notsubsequently when you use ssh. For use with vim, you can usessh-agent vimand, when next within vim, use:!ssh-addAlternatively, you can apply ssh-agent to theterminal you're planning onrunning vim in:ssh-agent xterm &anddo ssh-add whenever you need.For Windows, folks on the vim mailinglist have mentioned that Pageant helpswith avoiding the constant need to enter the password.Kingston Fung wrote about another way to avoid constantly needing to enterpasswords: In order to avoid the need to type in the password forscp each time, you providea hack in the docs to set upa non password ssh account.I founda better way todo that:I can usea regular ssh account which usesa password to access the material without the need to key-in the password each time. It's good for security and convenience.I tried ssh public key authorization+ ssh-agent, implementing this, andit works! Ssh hints:Thomer Gil has provideda hint on how to speed up netrw+ssh:http://thomer.com/howtos/netrw_ssh.htmlLISTING BOOKMARKS AND HISTORYnetrw-qbnetrw-listbookmark {{{2Pressing "qb" (query bookmarks) willlist both the bookmarked directories anddirectory traversal history.Related Topics:netrw-gb how to return (go) toabookmarknetrw-mb how to makeabookmarknetrw-mB how to delete bookmarksnetrw-u change toa predecessor directory via thehistory stacknetrw-U change toa successor directory via thehistory stackMAKING A NEW DIRECTORYnetrw-d {{{2With the "d" map one may makea new directory either remotely (which dependson the global variable g:netrw_mkdir_cmd) or locally (which depends on theglobal variable g:netrw_localmkdir). Netrw will issuea request for the newdirectory's name.A bare<CR>at that point will abort the making of thedirectory. Attempts to makea local directory that already exists (as eithera file ora directory) will be detected, reported on, and ignored.Related topics:netrw-DAssociated setting variables:g:netrw_localmkdirg:netrw_mkdir_cmdg:netrw_remote_mkdirnetrw-%MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORYnetrw-cd {{{2By default,g:netrw_keepdiris 1. This setting means that the currentdirectory will not track the browsing directory. (done for backwardscompatibility with v6's file explorer).Settingg:netrw_keepdir to0 tellsnetrw to make vim's current directorytrack netrw's browsing directory.However, given the default setting forg:netrw_keepdir of 1 wherenetrwmaintains its own separate notion of the current directory, in order to makethe two directories the same, use the "cd" map (type cd). That map willset Vim's notion of the current directory to netrw's current browsingdirectory.netrw-cd: This map's name was changed from "c" to cd (seenetrw-cd). This change was done to allow fornetrw-cb andnetrw-cB maps.Associated setting variable:g:netrw_keepdirMARKING FILESnetrw-:MFnetrw-mf {{{2(also seenetrw-mr)Netrw provides several ways tomark files:* One maymark files with the cursor atopa filename and then pressing "mf".* With gvim, in addition one maymark files with<s-leftmouse>. (seenetrw-mouse)* One may use the :MF command, which takesalist of files (for local directories, thelist may includewildcards-- seeglob()):MF *.c (Note that :MF uses<f-args> to break the lineat spaces)*Mark files using theargument-list(netrw-mA)*Mark files based uponalocation-list(netrw-qL)*Mark files based upon thequickfixlist(netrw-qF)(quickfix-error-lists)The followingnetrw maps make use of marked files:netrw-a Hide marked files/directoriesnetrw-D Delete marked files/directoriesnetrw-ma Move marked files' names toarglistnetrw-mA Movearglist filenames to marked filelistnetrw-mb Append marked files to bookmarksnetrw-mB Delete marked files from bookmarksnetrw-mc Copy marked files to targetnetrw-md Applyvimdiff to marked filesnetrw-me Edit marked filesnetrw-mF Unmark marked filesnetrw-mg Apply vimgrep to marked filesnetrw-mm Move marked files to targetnetrw-ms Netrw will source marked filesnetrw-mt Set target fornetrw-mm andnetrw-mcnetrw-mT Generatetags using marked filesnetrw-mv Apply vim command to marked filesnetrw-mx Apply shell command to marked filesnetrw-mX Apply shell command to marked files, en blocnetrw-mz Compress/Decompress marked filesnetrw-O Obtain marked filesnetrw-R Rename marked filesOne may unmark files oneata time the same way one marks them; ie. placethe cursor atopa marked file and press "mf". This process also workswith<s-leftmouse> using gvim. One may unmark all files by pressing"mu" (seenetrw-mu).Marked files are highlighted using the "netrwMarkFile" highlighting group,which by defaultis linked to "Identifier" (see Identifier undergroup-name). You may change the highlighting group by putting somethinglikehighlight clear netrwMarkFilehi link netrwMarkFile ..whatever..into $HOME/.vim/after/syntax/netrw.vim.If the mouseis enabled and works with your vim, you may use<s-leftmouse> tomark one or more files. You maymark multiple files by dragging the shiftedleftmouse. (seenetrw-mouse)markfilelistglobal_markfilelistlocal_markfilelistAll marked files are entered onto the global marked file list; thereis onlyone such list. In addition, everynetrw buffer also has its own buffer-localmarked file list; sincenetrwbuffers are associated with specificdirectories, this means that each directory has its own local marked filelist. Thevarious commands which operate on marked files use one or the otherof the marked file lists.Known Problem: if oneis using tree mode(g:netrw_liststyle) and severaldirectories have files with the same name, then marking sucha file willresult in all such files being highlightedas if they were all marked. Themarkfilelist, however, will only have the selected file in it. This problemis unlikely to be fixed.UNMARKING FILESnetrw-mF {{{2(also seenetrw-mf,netrw-mu)The "mF" command will unmark all files in the current buffer. One may also usemf(netrw-mf) ona specific, already marked, file to unmark just that file.MARKING FILES BY LOCATION LISTnetrw-qL {{{2(also seenetrw-mf)One may convertlocation-lists intoa marked filelist using "qL".You may then proceed with commands suchas me(netrw-me) to edit them.MARKING FILES BY QUICKFIX LISTnetrw-qF {{{2(also seenetrw-mf)One may convertquickfix-error-lists intoa marked filelist using "qF".You may then proceed with commands suchas me(netrw-me) to edit them.Quickfix error lists are generated, for example, by calls to:vimgrep.MARKING FILES BY REGULAR EXPRESSIONnetrw-mr {{{2(also seenetrw-mf)One may alsomark files by pressing "mr";netrw will then issuea prompt,"Enter regexp: ". You may then entera shell-style regularexpression suchas *.c$ (seeglob()). For remote systems,glob() doesn't work-- sonetrwconverts "*" into ".*" (seeregexp) and marks files based on that. In thefutureI may makeit possible to useregexps instead of glob()-styleexpressions (yet-another-option).Seecmdline-window for directions on more on how to edit the regularexpression.MARKED FILES, ARBITRARY VIM COMMANDnetrw-mv {{{2 (Seenetrw-mf andnetrw-mr for how tomark files) (uses the local marked-file list)The "mv" map causesnetrw to execute an arbitrary vim command on each file onthe local marked file list, individually:* 1split* sil! keepalte file* run vim command* sil! keepalt wq!A prompt, "Enter vim command: ", will be issued to elicit the vim command youwish used. Seecmdline-window for directions for more on how to edit thecommand.MARKED FILES, ARBITRARY SHELL COMMANDnetrw-mx {{{2 (Seenetrw-mf andnetrw-mr for how tomark files) (uses the local marked-file list)Upon activation of the "mx" map,netrw will query the user for some (external)command to be applied to all marked files. All "%"s in the command will besubstituted with the name of each marked file in turn. If no "%"s are in thecommand, then the command will be followed byaspace anda marked filename.Example:(mark files)mxEnter command: catThe resultisa series of shell commands:cat 'file1'cat 'file2'...MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOCnetrw-mX {{{2 (Seenetrw-mf andnetrw-mr for how tomark files) (uses the global marked-file list)Upon activation of the 'mX' map,netrw will query the user for some (external)command to be applied to all marked files on the global marked file list. The"en bloc" means that one command will be executed on all the filesat once:command filesThis approachis useful, for example, to select files and makea tarball:(mark files)mXEnter command: tar cf mynewtarball.tarThe command that will be run with this example:tar cf mynewtarball.tar 'file1' 'file2'...MARKED FILES: ARGUMENT LISTnetrw-manetrw-mA (Seenetrw-mf andnetrw-mr for how tomark files) (uses the global marked-file list)Using ma, one moves filenames from the marked filelist to the argument list.Using mA, one moves filenames from the argumentlist to the marked file list.See Also:netrw-cbnetrw-cBnetrw-qFargument-list:argsMARKED FILES: BUFFER LISTnetrw-cbnetrw-cB (Seenetrw-mf andnetrw-mr for how tomark files) (uses the global marked-file list)Using cb, one moves filenames from the marked filelist to the buffer list.Using cB, one copies filenames from the bufferlist to the marked file list.See Also:netrw-manetrw-mAnetrw-qFbuffer-list:buffersMARKED FILES: COMPRESSION AND DECOMPRESSIONnetrw-mz {{{2 (Seenetrw-mf andnetrw-mr for how tomark files) (uses the local marked file list)If any marked files are compressed, then "mz" will decompress them.If any marked files are decompressed, then "mz" willcompress themusing the command specified byg:netrw_compress; by default,that's "gzip".For decompression,netrw usesaDictionary of suffices and theirassociated decompressing utilities; seeg:netrw_decompress.Remember that one canmark multiple files by regularexpression(seenetrw-mr); thisis particularly useful to facilitate compressing anddecompressinga large number of files.Associated setting variables:g:netrw_compressg:netrw_decompressMARKED FILES: COPYINGnetrw-mc {{{2 (Seenetrw-mf andnetrw-mr for how tomark files) (Uses the global marked file list)Selecta target directory with mt(netrw-mt). Then change directory,select file(s) (seenetrw-mf), and press "mc". The copyis donefrom the currentwindow (where one does the mf) to the target.If one does not havea target directory set withnetrw-mt, thennetrwwill query you fora directory to copy to.One may also copy directories and their contents (local only) toa targetdirectory.Associated setting variables:g:netrw_localcopycmdg:netrw_localcopycmdoptg:netrw_localcopydircmdg:netrw_localcopydircmdoptg:netrw_ssh_cmdMARKED FILES: DIFFnetrw-md {{{2 (Seenetrw-mf andnetrw-mr for how tomark files) (uses the global marked file list)Usevimdiff to visualize difference between selected files (two orthree may be selected for this). Uses the global marked file list.MARKED FILES: EDITINGnetrw-me {{{2 (Seenetrw-mf andnetrw-mr for how tomark files) (uses the global marked file list)The "me" command will place the marked files on thearglist and commenceediting them. One may return the to explorerwindow with:Rexplore.(use:n and:p to edit next and previous files in the arglist)MARKED FILES: GREPnetrw-mg {{{2 (Seenetrw-mf andnetrw-mr for how tomark files) (uses the global marked file list)The "mg" command will apply:vimgrep to the marked files.The command will ask for the requested pattern; one may then enter:/pattern/[g][j]! /pattern/[g][j]patternWith /pattern/, editing will start with the first item on thequickfixlistthat vimgrep sets up (see:copen,:cnext,:cprevious,:cclose). The:vimgrepcommandis in use, so without 'g' each lineis added toquickfixlist onlyonce; with 'g' every matchis included.With /pattern/j, "mg" will winnow the current marked filelist to just thosemarked files also possessing the specified pattern. Thus, one may usemr ...file-pattern...mg /pattern/jto havea marked filelist satisfying thefile-pattern but also restricted tofiles containing some desired pattern.MARKED FILES: HIDING AND UNHIDING BY SUFFIXnetrw-mh {{{2 (Seenetrw-mf andnetrw-mr for how tomark files) (uses the local marked file list)The "mh" command extracts the suffices of the marked files and toggles theirpresence on the hiding list. Pleasenote that marking the same suffixthis way multiple times will result in the suffix's presence being toggledfor each file (so an even quantity of marked files having the same suffixis the sameas not having bothered to select themat all).Related topics:netrw-ag:netrw_list_hideMARKED FILES: MOVINGnetrw-mm {{{2 (Seenetrw-mf andnetrw-mr for how tomark files) (uses the global marked file list)WARNING: moving filesis more dangerous thancopying them.A file being movedis first copied and then deleted; if thecopy operation fails and the delete succeeds, you will losethe file. Either try things out with unimportant filesfirst ordo the copy and then delete yourself using mc and D.Useat your own risk!Selecta target directory with mt(netrw-mt). Then change directory,select file(s) (seenetrw-mf), and press "mm". The moveis donefrom the currentwindow (where one does the mf) to the target.Associated setting variable:g:netrw_localmovecmdg:netrw_ssh_cmdMARKED FILES: SOURCINGnetrw-ms {{{2 (Seenetrw-mf andnetrw-mr for how tomark files) (uses the local marked file list)With "ms",netrw will source the marked files (using vim's:source command)MARKED FILES: SETTING THE TARGET DIRECTORYnetrw-mt {{{2 (Seenetrw-mf andnetrw-mr for how tomark files)Set the marked file copy/move-to target (seenetrw-mc andnetrw-mm): * If the cursoris atopa file name, then thenetrw window's currently displayed directoryis used for the copy/move-to target. * Also, if the cursoris in the banner, then thenetrw window's currently displayed directoryis used for the copy/move-to target. Unless the target alreadyis the current directory. In which case, typing "mf" clears the target. * However, if the cursoris atopa directory name, then that directoryis used for the copy/move-to target * One may use the :MT[directory] command to set the targetnetrw-:MT This command uses<q-args>, so spaces in the directory name are permitted without escaping. * With mouse-enabled vim or with gvim, one may selecta target by using<c-leftmouse>Thereis only one copy/move-to targetata time ina vim session; ie. thetargetisascript variable (sees:var) andis shared between allnetrwwindows (in an instance of vim).When usingmenus and gvim,netrw providesa "Targets" entry which allows oneto picka target from thelist of bookmarks and history.Related topics: Marking Files......................................netrw-mf Marking Files by Regular Expression................netrw-mr Marked Files: Target Directory Using Bookmarks.....netrw-Tb Marked Files: Target Directory Using History.......netrw-ThMARKED FILES: TAGGINGnetrw-mT {{{2 (Seenetrw-mf andnetrw-mr for how tomark files) (uses the global marked file list)The "mT"mapping will apply the command ing:netrw_ctags (by default,itis"ctags") to marked files. For remote browsing, in order to createatags filenetrw will use ssh (seeg:netrw_ssh_cmd), and so sshmust be available forthis to work on remote systems. For your local system, seectags on how togeta version.I myself use hdrtags, currently availableathttp://www.drchip.org/astronaut/src/index.html, and havelet g:netrw_ctags= "hdrtag"in my <.vimrc>.Whena remote set of files are tagged, the resultingtags fileis "obtained";ie.a copyis transferred to the local system's directory. The now localtagsfileis then modified so that one may useit through the network. Themodification made concerns the names of the files in the tags; each filenameispreceded by the netrw-compatible URL used to obtain it. When one subsequentlyuses one of thego totag actions(tags), the URL will be used bynetrw toedit the desired file andgo to the tag.Associated setting variables:g:netrw_ctagsg:netrw_ssh_cmdMARKED FILES: TARGET DIRECTORY USING BOOKMARKSnetrw-Tb {{{2Sets the marked file copy/move-to target.Thenetrw-qb map will give youalist of bookmarks (and history).One may choose one of the bookmarks to become your marked filetarget by using[count]Tb (default count: 1).Related topics: Copying files to target............................netrw-mc Listing Bookmarks and History......................netrw-qb Marked Files: Setting The Target Directory.........netrw-mt Marked Files: Target Directory Using History.......netrw-Th Marking Files......................................netrw-mf Marking Files by Regular Expression................netrw-mr Moving files to target.............................netrw-mmMARKED FILES: TARGET DIRECTORY USING HISTORYnetrw-Th {{{2Sets the marked file copy/move-to target.Thenetrw-qb map will give youalist ofhistory (and bookmarks).One may choose one of thehistory entries to become your marked filetarget by using[count]Th (default count: 0; ie. the current directory).Related topics: Copying files to target............................netrw-mc Listing Bookmarks and History......................netrw-qb Marked Files: Setting The Target Directory.........netrw-mt Marked Files: Target Directory Using Bookmarks.....netrw-Tb Marking Files......................................netrw-mf Marking Files by Regular Expression................netrw-mr Moving files to target.............................netrw-mmMARKED FILES: UNMARKINGnetrw-mu {{{2 (Seenetrw-mf,netrw-mF)The "mu"mapping will unmark all currently marked files. This command differsfrom "mF"as the latter only unmarks files in the current directory whereas"mu" will unmark global and all buffer-local marked files.(seenetrw-mF)netrw-browser-settingsNETRW BROWSER VARIABLESnetrw-browser-optionsnetrw-browser-var {{{2(if you're interested in thenetrw file transfer settings, seenetrw-options andnetrw-protocol)The <netrw.vim> browser provides settings in the form ofvariables whichyou may modify; by placing these settings in your <.vimrc>, you may customizeyour browsing preferences. (see also:netrw-settings) -------------- VarExplanation --------------g:netrw_altfile some likeCTRL-^ to return to the lastedited file. Choose that by setting thisparameter to 1.Others likeCTRL-^ to return to thenetrw browsing buffer. Choose that by settingthis parameter to 0. default: =0g:netrw_alto change from above splitting to below splittingby setting this variable (seenetrw-o) default: =&sb (see'sb')g:netrw_altv change from left splitting to right splittingby setting this variable (seenetrw-v) default: =&spr (see'spr')g:netrw_banner enable/suppress the banner=0: suppress the banner=1: banneris enabled (default)g:netrw_bannerbackslash if this variable exists andis not zero, thebanner will be displayed with backslashesrather than forward slashes.g:netrw_browse_split when browsing,<cr> will open the file by:=0: re-using the samewindow (default)=1: horizontally splitting thewindow first=2: vertically splitting thewindow first=3: open file in newtab=4: act like "P" (ie. open previous window)Note thatg:netrw_preview may be used to get vertical splitting instead of horizontal splitting.=[servername,tab-number,window-number] GivenaList suchas this,a remote server named by the "servername" will be used for editing. It will also use the specifiedtab andwindow numbers to perform editing (seeclientserver,netrw-ctrl-r)This option does not affect the production of:Lexplore windows.Related topics:g:netrw_altog:netrw_altvnetrw-Cnetrw-crnetrw-ctrl-rg:netrw_chgperm Unix/Linux: "chmod PERM FILENAME"Windows: "cacls FILENAME /e /p PERM"Used to change access permission fora file.g:netrw_clipboard =1By default,netrw will attempt to insure thatthe clipboard's values will remain unchanged.However, some users report that they havespeed problems with this; consequently, thisoption, when set to zero, lets such userspreventnetrw from saving and restoring theclipboard (the latteris done onlyas needed).That means that if theclipboardis changed(inadvertently) by normalnetrw operation thatit will not be restored to its prior state.g:netrw_compress="gzip"Willcompress marked files with thiscommandg:Netrw_corehandler Allows one to specify something additionaltodo when handling<core> files via netrw'sbrowser's "x" command. If present,g:Netrw_corehandlerspecifies either one ormore function references (seeFuncref).(the capital g:Netrw...is required itsholdinga function reference)g:netrw_ctags="ctags"The default external program used to createtagsg:netrw_cursor= 2 (default)This option controls the use of the'cursorline' (cul) and'cursorcolumn'(cuc) settings by netrw:Value Thin-Long-Tree Wide =0 u-cul u-cuc u-cul u-cuc =1 u-cul u-cuc cul u-cuc =2 cul u-cuc cul u-cuc =3 cul u-cuc cul cuc =4 cul cuc cul cuc =5 U-cul U-cuc U-cul U-cuc =6 U-cul U-cuc cul U-cuc =7 cul U-cuc cul U-cuc =8 cul U-cuc cul cucWhere u-cul: user's'cursorline' initial setting used u-cuc: user's'cursorcolumn' initial setting used U-cul: user's'cursorline' current setting used U-cuc: user's'cursorcolumn' current setting used cul:'cursorline' will be locally set cuc:'cursorcolumn' will be locally set The "initial setting" means the values of the'cuc' and'cul' settings in effect whennetrw last sawg:netrw_cursor >= 5 or whennetrw was initially run.g:netrw_decompress={ '.lz4': 'lz4 -d', '.lzo': 'lzop -d', '.lz': 'lzip -dk', '.7z': '7za x', '.001': '7za x', '.tar.bz': 'tar -xvjf', '.tar.bz2': 'tar -xvjf', '.tbz': 'tar -xvjf', '.tbz2': 'tar -xvjf', '.tar.gz': 'tar -xvzf', '.tgz': 'tar -xvzf', '.tar.zst': 'tar --use-compress-program=unzstd -xvf', '.tzst': 'tar --use-compress-program=unzstd -xvf', '.tar': 'tar -xvf', '.zip':'unzip', '.bz': 'bunzip2 -k', '.bz2': 'bunzip2 -k', '.gz': 'gunzip -k', '.lzma': 'unlzma -T0 -k', '.xz': 'unxz -T0 -k', '.zst': 'zstd -T0 -d', '.Z': 'uncompress -k', '.rar': 'unrarx -ad', '.tar.lzma': 'tar --lzma -xvf', '.tlz': 'tar --lzma -xvf', '.tar.xz': 'tar -xvJf', '.txz': 'tar -xvJf'}A dictionarymapping suffices to decompression programs.g:netrw_dirhistmax =10: controls maximum quantity of past history. May be zero to suppress history. (related:netrw-qbnetrw-unetrw-U)g:netrw_dynamic_maxfilenamelen =32: enables dynamic determination ofg:netrw_maxfilenamelen, which affects local file long listing.g:netrw_fastbrowse =0: slow speed directory browsing; never re-uses directory listings; always obtains directory listings.=1: medium speed directory browsing; re-use directory listings only when remote directory browsing. (default value)=2: fast directory browsing; only obtains directory listings when the directory hasn't been seen before (ornetrw-ctrl-lis used).Fast browsing retains old directory listingbuffers so that they don't need to bere-acquired. This featureis especiallyimportant for remote browsing. However, ifa fileis introduced or deleted into or fromsuch directories, the old directory bufferbecomes out-of-date. One may always refreshsucha directory listing withnetrw-ctrl-l.This option gives the user the choice oftrading off accuracy (ie. up-to-date listing)versus speed.g:netrw_ffkeep (default: doesn't exist)If this variable exists andis zero, thennetrw will notdoa save and restore for'fileformat'.g:netrw_fname_escape =' ?&;%'Used on filenames before remote reading/writingg:netrw_ftp_browse_rejectftp can producea number oferrors and warningsthat can show upas "directories" and "files"in the listing. Thispatternis used toremove such embedded messages. By default itsvalue is: '^total\s\+\d\+$\| ^Trying\s\+\d\+.*$\| ^KERBEROS_V\d rejected\| ^Security extensions not\| No such file\|: connect to address [0-9a-fA-F:]*: No route to host$'g:netrw_ftp_list_cmdoptions for passing along toftp for directorylisting. Defaults:unix org:netrw_cygwin set:: "ls -lF" otherwise "dir"g:netrw_ftp_sizelist_cmdoptions for passing along toftp for directorylisting, sorted by size of file.Defaults:unix org:netrw_cygwin set:: "ls -slF" otherwise "dir"g:netrw_ftp_timelist_cmdoptions for passing along toftp for directorylisting, sorted by time of last modification.Defaults:unix org:netrw_cygwin set:: "ls -tlF" otherwise "dir"g:netrw_glob_escape ='[]*?`{~$' (unix)='[]*?`{$' (windowsThese characters in directory names areescaped before applyingglob()g:netrw_hide Controlled by the "a" map (seenetrw-a)=0: show all=1: show not-hidden files=2: show hidden files only default: =1g:netrw_home Thehome directory for where bookmarks andhistory are saved (as.netrwbook and.netrwhist).Netrw usesexpand()on the string. default: the first directory on the'runtimepath'g:netrw_keepdir =1 (default) keep current directory immune from the browsing directory.=0 keep the current directory the sameas the browsing directory.The current browsing directoryis contained inb:netrw_curdir (also seenetrw-cd)g:netrw_keepj="keepj" (default)netrw attempts to keep the:jumps table unaffected.=""netrw will not use:keepjumps with exceptions only for the saving/restoration of position.g:netrw_list_cmd command for listing remote directories default: (if sshis executable) "ssh HOSTNAME ls -FLa"g:netrw_list_cmd_options If this variable exists, then its contents areappended to the g:netrw_list_cmd. Forexample, use "2>/dev/null" to get rid of bannermessages onunix systems.g:netrw_liststyle Set the default listing style:= 0: thin listing (one file per line)= 1: long listing (one file per line with time stamp information and file size)= 2: wide listing (multiple files in columns)= 3: tree style listingg:netrw_list_hide comma-separatedpatternlist for hiding filesPatterns are regular expressions (seeregexp)There's some special support for git-ignorefiles: you may add the output from the helperfunction 'netrw_gitignore#Hide() automaticallyhiding all gitignored files.For more details seenetrw-gitignore.Examples: let g:netrw_list_hide='.*\.swp$' let g:netrw_list_hide= netrw_gitignore#Hide() ..'.*\.swp$'default: ""g:netrw_localcopycmd="cp" Linux/Unix/MacOS/Cygwin=expand("$COMSPEC") WindowsCopies marked files(netrw-mf) to targetdirectory(netrw-mt,netrw-mc)g:netrw_localcopycmdopt ='' Linux/Unix/MacOS/Cygwin=' \c copy' WindowsOptions for theg:netrw_localcopycmdg:netrw_localcopydircmd="cp" Linux/Unix/MacOS/Cygwin=expand("$COMSPEC") WindowsCopies directories to target directory.(netrw-mc,netrw-mt)g:netrw_localcopydircmdopt="-R" Linux/Unix/MacOS/Cygwin=" /c xcopy /e /c /h/ /i /k" WindowsOptions forg:netrw_localcopydircmdg:netrw_localmkdir="mkdir" Linux/Unix/MacOS/Cygwin=expand("$COMSPEC") Windows command for makinga local directoryg:netrw_localmkdiropt="" Linux/Unix/MacOS/Cygwin=" /c mkdir" WindowsOptions forg:netrw_localmkdirg:netrw_localmovecmd="mv" Linux/Unix/MacOS/Cygwin=expand("$COMSPEC") WindowsMoves marked files(netrw-mf) to targetdirectory(netrw-mt,netrw-mm)g:netrw_localmovecmdopt="" Linux/Unix/MacOS/Cygwin=" /c move" WindowsOptions forg:netrw_localmovecmdg:netrw_maxfilenamelen =32 by default, selected soas to make long listings fit on 80 column displays.If your screenis wider, and you have fileor directory names longer than 32 bytes,you may set this option to keep listingscolumnar.g:netrw_mkdir_cmd command for makinga remote directoryvia ssh (also seeg:netrw_remote_mkdir) default: "ssh USEPORT HOSTNAME mkdir"g:netrw_mousemaps =1 (default) enables mouse buttons while browsing to: leftmouse: open file/directory shift-leftmouse:mark file middlemouse: sameasP rightmouse: remove file/directory=0: disables mouse mapsg:netrw_sizestyle not defined: actual bytes (default)="b": actual bytes (default)="h": human-readable (ex. 5k, 4m, 3g) uses 1000 base="H": human-readable (ex. 5K, 4M, 3G) uses 1024 baseThe long listing(netrw-i) and query-filemaps(netrw-qf) will display file sizeusing the specified style.g:netrw_usetab if this variable exists andis non-zero, thenthe<tab> map supporting shrinking/expandingaLexplore ornetrwwindow will be enabled.(seenetrw-c-tab)g:netrw_remote_mkdir command for makinga remote directoryviaftp (also seeg:netrw_mkdir_cmd) default: "mkdir"g:netrw_retmap ifit exists andis set to one, then: * if ina netrw-selected file, AND * no normal-mode<2-leftmouse>mapping exists,then the<2-leftmouse> will be mapped foreasyreturn to thenetrw browser window. example: click once to select and opena file,double-click to return.Note that one may instead choose to: * let g:netrw_retmap= 1, AND * nmap<silent> YourChoice<Plug>NetrwReturnand have anothermapping instead of<2-leftmouse> to invoke the return.You may also use the:Rexplore command todothe same thing. default: =0g:netrw_rm_cmd command for removing remote files default: "ssh USEPORT HOSTNAME rm"g:netrw_rmdir_cmd command for removing remote directories default: "ssh USEPORT HOSTNAME rmdir"g:netrw_rmf_cmd command for removing remote softlinks default: "ssh USEPORT HOSTNAME rm-f"g:netrw_servername use this variable to providea name fornetrw-ctrl-r to use for its server. default: "NETRWSERVER"g:netrw_sort_by sort by "name", "time", "size", or"exten". default: "name"g:netrw_sort_directionsorting direction: "normal" or "reverse" default: "normal"g:netrw_sort_optionssortingis done using:sort; thisvariable's valueis appended to thesort command. Thus one may ignore case,for example, with the following in your.vimrc:let g:netrw_sort_options="i" default: ""g:netrw_sort_sequence whensorting by name, first sort by thecomma-separatedpattern sequence.Note thatany filigree added to indicatefiletypesshould be accounted for in your pattern. default: '[\/]$,*,\.bak$,\.o$,\.h$, \.info$,\.swp$,\.obj$'g:netrw_special_syntax If true, then certain files will be shownusing specialsyntax in the browser:netrwBak: *.baknetrwCompress: *.gz *.bz2 *.Z *.zipnetrwCoreDump: core.\d\+netrwData: *.datnetrwDoc: *.doc,*.txt,*.pdf, *.pdf,*.docxnetrwHdr: *.hnetrwLex: *.l *.lexnetrwLib: *.a *.so *.lib *.dllnetrwMakefile:[mM]akefile *.maknetrwObj: *.o *.objnetrwPix: *.bmp,*.fit,*.fits,*.gif, *.jpg,*.jpeg,*.pcx,*.ppc *.pgm,*.png,*.psd,*.rgb *.tif,*.xbm,*.xcfnetrwTags:tags ANmenu ANtagsnetrwTilde: *netrwTmp: tmp* *tmpnetrwYacc: *.yIn addition, those groups mentioned in'suffixes' are also added to the specialfile highlighting group. Thesesyntax highlighting groups are linkedto netrwGray or Folded by default(seehl-Folded), but one mayput lines likehi link netrwCompress Visualinto one's <.vimrc> to use one's ownpreferences. Alternatively, one mayput such specifications into.vim/after/syntax/netrw.vim. The netrwGray highlightingis set up bynetrw when* netrwGray has not been previously defined* the gui is running As an example,I myself usea dark-backgroundcolorscheme with the following in.vim/after/syntax/netrw.vim: hi netrwCompress term=NONE cterm=NONE gui=NONE ctermfg=10 guifg=green ctermbg=0 guibg=black hi netrwData term=NONE cterm=NONE gui=NONE ctermfg=9 guifg=blue ctermbg=0 guibg=black hi netrwHdr term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 hi netrwLex term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 hi netrwYacc term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 hi netrwLib term=NONE cterm=NONE gui=NONE ctermfg=14 guifg=yellow hi netrwObj term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red hi netrwTilde term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red hi netrwTmp term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red hi netrwTags term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red hi netrwDoc term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=yellow2 guibg=Blue3 hi netrwSymLink term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=grey60g:netrw_ssh_browse_reject ssh can sometimes produce unwanted lines,messages, banners, and whatnot that one doesn'twant masqueradingas "directories" and "files".Use thispattern to remove such embeddedmessages. By default its value is: '^total\s\+\d\+$'g:netrw_ssh_cmd One may specify an executable commandto use instead of ssh for remote actionssuchas listing, file removal, etc. default: sshg:netrw_tmpfile_escape =' &;'escape()is applied to all temporary filestoescape these characters.g:netrw_timefmt specify formatstring to vim's strftime().The default, "%c",is "the preferred dateand time representation for the currentlocale" according to my manpage entry forstrftime(); however, not all are satisfiedwith it. Some alternatives: "%a %d %b %Y %T", " %a %Y-%m-%d %I-%M-%S %p" default: "%c"g:netrw_use_noswfnetrw normally avoidswriting swapfilesfor browser buffers. However, under somesystems this apparentlyis causing nastyml_geterrors to appear; if you're gettingml_get errors, try putting let g:netrw_use_noswf=0in your .vimrc. default: 1g:netrw_winsize specify initial size of newwindows made with"o" (seenetrw-o), "v" (seenetrw-v),:Hexplore or:Vexplore. Theg:netrw_winsizeis an integer describing the percentage of thecurrentnetrw buffer'swindow to be used forthe new window. Ifg:netrw_winsizeisless than zero, thenthe absolute value ofg:netrw_winsize will beused to specify the quantity of lines orcolumns for the new window. Ifg:netrw_winsizeis zero, thena normalsplit will be made (ie.'equalalways' willtake effect, for example). default: 50 (for 50%)g:netrw_wiw =1specifies the minimumwindow width to usewhen shrinkinga netrw/Lexplorewindow(seenetrw-c-tab).g:netrw_xstrlen Controls hownetrw computesstring lengths,includingmulti-byte characters'stringlength. (thanks toN Weibull,T Mechelynck)=0: uses Vim's built-instrlen()=1: number of codepoints (Latina+ combining circumflexis two codepoints) (DEFAULT)=2: number of spacing codepoints (Latina+ combining circumflexis one spacing codepoint;a hardtabis one; wide and narrow CJK are one each; etc.)=3: virtual length (counting tabsas anything between 1 and'tabstop', wide CJKas 2 rather than 1,Arabic alifas zero when immediately preceded by lam, one otherwise, etc)g:NetrwTopLvlMenu This variablespecifies the top levelmenu name; by default, it's "Netrw.". Ifyou wish to change this,do so in your.vimrc.NETRW BROWSING AND OPTION INCOMPATIBILITIESnetrw-incompatible {{{2Netrw has been designed to handle useroptions by saving them, setting theoptions to something that's compatible with netrw's needs, and then restoringthem. However, the autochdir option::set acdis problematic. Autochdir sets the current directory to that containing thefile you edit; this apparently also applies to directories. In other words,autochdir sets the current directory to that containing the "file" (even ifthat "file"is itselfa directory).==============================================================================OBTAINING A FILEnetrw-obtainnetrw-O {{{2If there are no marked files: When browsinga remote directory, one may obtaina file under the cursor (ie. geta copy on your local machine, but not edit it) by pressing theO key.If there are marked files: The marked files will be obtained (ie.a copy will be transferred to your local machine, but not set up for editing).Onlyftp andscp are supported for this operation (but since these two areavailable for browsing, that shouldn't bea problem). The statusbar willthen show, on its right hand side,a message like "Obtaining filename". Thestatusline will be restored after the transferis complete.Netrw can also "obtain"a file using the local browser. Netrw's displayofa directoryis not necessarily the sameas Vim's "current directory",unlessg:netrw_keepdiris set to0 in the user's <.vimrc>. One may selecta file using the local browser (by putting the cursor on it) and pressing"O" will then "obtain" the file; ie. copyit to Vim's current directory.Related topics: * To see what the current directory is, use:pwd * To make the currently browsed directory the current directory, seenetrw-cd * To automatically make the currently browsed directory the current directory, seeg:netrw_keepdir.netrw-newfilenetrw-createfileOPEN A NEW FILE IN NETRW'S CURRENT DIRECTORYnetrw-% {{{2To opena new file in netrw's current directory, press "%". This mapwill query the user fora new filename; an empty file by that name willbe placed in the netrw's current directory (ie. b:netrw_curdir).If Lexplore(netrw-:Lexplore)is in use, the new file will be generatedin theg:netrw_chgwin window.Related topics:netrw-dPREVIEW WINDOWnetrw-pnetrw-preview {{{2One may usea previewwindow by using the "p" key when the cursoris atop thedesired filename to be previewed. The display will then split to show boththe browser (where the cursor will remain) and the file (see:pedit). Bydefault, the split will be taken horizontally; one may use vertical splittingif one has setg:netrw_preview first.An interesting set ofnetrw settings is:let g:netrw_preview = 1let g:netrw_liststyle = 3let g:netrw_winsize = 30These will:1. Make vertical splitting the default for previewing files2. Make the default listing style "tree"3. Whena vertical previewwindowis opened, the directory listing will use only 30% of the columns available; the rest of thewindowis used for the preview window.Related: if you like this idea, you may also find:Lexplore(netrw-:Lexplore) org:netrw_chgwin of interestAlso see:g:netrw_chgwinnetrw-P'previewwindow'CTRL-W_z:pclosePREVIOUS WINDOWnetrw-Pnetrw-prvwin {{{2To edita file or directory under the cursor in the previously used (lastaccessed)window (see :heCTRL-W_p), pressa "P". If there's only onewindow, then the onewindow will be horizontally split (by default).If there's more than one window, the previouswindow will be re-used onthe selected file/directory. If the previous window's associated bufferhas been modified, and there's only onewindow with that buffer, thenthe user will be asked if s/he wishes to save the buffer first (yes,no, or cancel).Related Actionsnetrw-crnetrw-onetrw-tnetrw-vAssociated setting variables:g:netrw_altocontrol above/below splittingg:netrw_altvcontrol right/left splittingg:netrw_previewcontrol horizontal vs vertical splittingg:netrw_winsizecontrol initial sizingAlso see:g:netrw_chgwinnetrw-pREFRESHING THE LISTINGnetrw-refreshnetrw-ctrl-lnetrw-ctrl_l {{{2To refresh eithera local or remote directory listing, press ctrl-l (<c-l>) orhit the<cr> when atop the ./ directory entry in the listing. One may alsorefresha local directory by using ":e.".REVERSING SORTING ORDERnetrw-rnetrw-reverse {{{2One maytoggle between normal and reversesorting order by pressing the"r" key.Related topics:netrw-sAssociated setting variable:g:netrw_sort_directionRENAMING FILES OR DIRECTORIESnetrw-movenetrw-renamenetrw-R {{{2If there are no marked files: (seenetrw-mf) Renaming files and directories involves moving the cursor to the file/directory to be moved (renamed) and pressing "R". You will then be queried for what you want the file/directory to be renamed to. You may selecta range of lines with the "V" command (visual selection), and then press "R"; you will be queried for each fileas to what you wantit renamed to.If there are marked files: (seenetrw-mf) Marked files will be renamed (moved). You will be queriedas above in order to specify where you want the file/directory to be moved. If you answera renaming query witha "s/frompattern/topattern/", then subsequent files on the marked filelist will be renamed by taking each name, applying that substitute, and renaming each file to the result. As an example:mr [query: reply with *.c]R [query: reply with s/^\(.*\)\.c$/\1.cpp/] This example willmark all *.c files and then rename them to *.cpp files. Netrw will protect you from overwriting local files without confirmation, but not remote ones. The ctrl-X character has special meaning for renaming files:<c-x> : a single ctrl-x tells netrw to ignore the portion of the response lying between the last '/' and the ctrl-x.<c-x><c-x> : a pair of contiguous ctrl-x's tells netrw to ignore any portion of the string preceding the double ctrl-x's. WARNING:Note that moving filesisa dangerous operation; copies are safer. That's becausea "move" for remote filesis actuallya copy+ delete-- and if the copy fails and the delete succeeds you may lose the file. Useat your own risk.Theg:netrw_rename_cmd variableis used to implement remote renaming. Bydefault its value is:ssh HOSTNAME mvOne may renamea block of files and directories by selecting them withV(linewise-visual) when using thin style.Seecmdline-editing for more on how to edit the command line; in particular,you'll find<ctrl-f> (initiates cmdlinewindow editing) and<ctrl-c> (uses thecommand line under the cursor) useful in conjunction with theR command.SELECTING SORTING STYLEnetrw-snetrw-sort {{{2One may select thesorting style by name, time, or (file) size. The "s" mapallows one to circulate amongst the three choices; the directory listing willautomatically be refreshed to reflect the selected style.Related topics:netrw-rnetrw-SAssociated setting variables:g:netrw_sort_byg:netrw_sort_sequenceSETTING EDITING WINDOWnetrw-editwindownetrw-Cnetrw-:NetrwC {{{2One may selectanetrwwindow for editing with the "C" mapping, using the:NetrwC [win#] command, or by settingg:netrw_chgwin to the selectedwindownumber. Subsequent selection ofa file to edit(netrw-cr) will use thatwindow.*C: by itself, will select the currentwindow holdinganetrw buffer for subsequent editing vianetrw-cr. TheCmappingis only available while innetrw buffers.*[count]C: thecount will be usedas thewindow number to be used for subsequent editing vianetrw-cr.* :NetrwC will setg:netrw_chgwin to the currentwindow* :NetrwC win# will setg:netrw_chgwin to the specifiedwindow numberUsinglet g:netrw_chgwin= -1will restore the default editing behavior(ie. subsequent editing will use the current window).Related topics:netrw-crg:netrw_browse_splitAssociated setting variables:g:netrw_chgwinSHRINKING OR EXPANDING A NETRW OR LEXPLORE WINDOWnetrw-c-tab {{{2The<c-tab> key willtoggleanetrw or:Lexplore window's width,but only ifg:netrw_usetab exists andis non-zero (and, of course,only if yourterminal supports differentiating<c-tab> froma plain<tab>). * If the currentwindowisanetrw window,toggle its width (betweeng:netrw_wiw and its original width) * Else if thereisa:Lexplorewindow in the current tab,toggle its width * Else bring upa:LexplorewindowIfg:netrw_usetab exists andis zero, or if thereisa pre-existingmappingfor<c-tab>, then the<c-tab> will not be mapped. One may map something otherthana<c-tab>, too: (but you'll still need to have hadg:netrw_usetab set).nmap <unique> (whatever)<Plug>NetrwShrinkRelated topics::LexploreAssociated setting variable:g:netrw_usetabUSER SPECIFIED MAPSnetrw-usermaps {{{1One may make customized user maps. Specifya variable,g:Netrw_UserMaps,to holdaList of lists of keymap strings and function names:[["keymap-sequence","ExampleUserMapFunc"],...]Whennetrwis setting up maps foranetrw buffer, ifg:Netrw_UserMapsexists, then the internal function netrw#UserMaps(islocal)is called.This function goes through all the entries in theg:Netrw_UserMaps list:* sets up maps:nno <buffer> <silent> KEYMAP-SEQUENCE:call s:UserMaps(islocal,"ExampleUserMapFunc")* refreshes if result from that function callis thestring "refresh"* if the resultstringis not "", then thatstring will be executed (:exe result)* if the resultisa List, then the above two actions on results will be taken for everystring in the resultListThe user functionis passed one argument;it resemblesfun! ExampleUserMapFunc(islocal)where a:islocalis 1 if itsa local-directory system call or0 whenremote-directory system call.netrw-callnetrw-exposenetrw-modifyUse netrw#Expose("varname") to access netrw-internal (script-local) variables.Use netrw#Modify("varname",newvalue) to change netrw-internal variables.Use netrw#Call("funcname"[,args]) to calla netrw-internal function with specified arguments.Example: Geta copy of netrw's marked file list:let netrwmarkfilelist= netrw#Expose("netrwmarkfilelist")Example: Modify the value of netrw's marked file list:call netrw#Modify("netrwmarkfilelist",[])Example: Clear netrw's marked filelist viaamapping ongu " ExampleUserMap: {{{2 fun! ExampleUserMap(islocal) call netrw#Modify("netrwmarkfilelist",[]) call netrw#Modify('netrwmarkfilemtch_{bufnr("%")}',"") let retval= ["refresh"] return retval endfun let g:Netrw_UserMaps= [["gu","ExampleUserMap"]]10. Problems and Fixesnetrw-problems {{{1(Thissectionis likely to growasI get feedback)netrw-p1P1.I use Windows, and mynetwork browsing withftp doesn't sort by {{{2 time or size! -or- The remote systemisa Windows server; why don'tI get sorts by time or size?Windows'ftp hasa minimal support for ls (ie.it doesn'tacceptsorting options). It doesn't support the-F whichgives an explanatory character (ABC/ for "ABCisa directory").Netrw then uses "dir" to get both its thin and long listings.If you think yourftp does supporta full-up ls,put thefollowing into your <.vimrc>:let g:netrw_ftp_list_cmd = "ls -lF"let g:netrw_ftp_timelist_cmd= "ls -tlF"let g:netrw_ftp_sizelist_cmd= "ls -slF"Alternatively, if you have cygwin on your Windows box,putinto your <.vimrc>:let g:netrw_cygwin= 1This problem also occurs when the remote systemis Windows.In this situation, thevarious g:netrw_ftp_[time|size]list_cmdsareas shown above, but the remote system will not correctlymodify its listing behavior.netrw-p2P2.I tried rcp://user@host/ (or protocol other than ftp) andnetrw {{{2 used ssh! That wasn't whatI asked for...Netrw has two methods for browsing remote directories: sshand ftp. Unless you specifyftp specifically, sshis used.Whenit comes time tododownloada file (not justa directorylisting),netrw will use the given protocol todo so.netrw-p3P3.I would like long listings to be the default. {{{2Put the following statement into your.vimrc:let g:netrw_liststyle= 1Check outnetrw-browser-var for more customizations thatyou can set.netrw-p4P4. My times come up oddly in local browsing {{{2Does your system'sstrftime() accept the "%c" to yield datessuchas "Sun Apr 27 11:49:23 1997"? If not,doa"man strftime" and find out what option should be used. Thenputit into your.vimrc:let g:netrw_timefmt= "%X" (where X is the option)netrw-p5P5.I want my current directory to track my browsing. {{{2 HowdoIdo that? Put the following line in your.vimrc:let g:netrw_keepdir= 0netrw-p6P6.I useChinese (or other non-ascii) characters in my filenames, {{{2 andnetrw (Explore, Sexplore, Hexplore, etc) doesn't display them!(taken from an answer provided by Wu Yongwei on the vimmailing list)I now see the problem. Your code pageis not 936, right? Vimseems only able to open files with names that are valid in thecurrent code page,as are many other applications thatdo notuse theUnicode version of Windows APIs. Thisis an OS-relatedissue. You should not have such problems when the systemlocale uses UTF-8, suchas modern Linux distros.(...itis one more reason to recommend that people use utf-8!)netrw-p7P7. I'm getting "sshis not executable on your system"-- whatdoI {{{2 do?(Dudley Fox) Most peopleI know use putty forwindows ssh. Itisa free ssh/telnet application. You can read more aboutithere:http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also:(Marlin Unruh) This program also works for me. It'sa singleexecutable, so he/she can copyit into the Windows\System32folder and createa shortcut to it.(Dudley Fox) You might also wish to consider plink,asitsounds most similar to what you are looking for. plinkis anapplication in the putty suite.http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink(Vissale Neang) Maybe you can try OpenSSH for windows, whichcan be obtained from:http://sshwindows.sourceforge.net/It doesn't need the full Cygwin package.(Antoine Mechelynck) For individual Unix-like programs neededfor work ina native-Windows environment,I recommend gettingthem from the GnuWin32 project on sourceforge ifit has them:http://gnuwin32.sourceforge.net/Unlike Cygwin, which sets upa Unix-like virtual machine ontop of Windows, GnuWin32isa rewrite ofUnix utilities withWindows system calls, and its programs works quite well in thecmd.exe "Dos box".(dave) Download WinSCP and use that to connect to the server.In Preferences> Editors, setgvimas your editor:- Click "Add..."- Set External Editor (adjust pathas needed, include thequotes and !.!at the end): "c:\Program Files\Vim\vim82\gvim.exe" !.!- Check that thefiletype in the box belowis{asterisk}.{asterisk} (all files), or whatever types you want (cec: change{asterisk} to *;I had to writeit that way because otherwise the helptags system thinks it'sa tag)- Make sure it'sat the top of the listbox (click it, then click "Up" if it's not)If using the Norton Commander style, you just have to hit<F4>to edita file ina local copy of gvim.(Vit Gottwald) How to generate public/private key and savepublic keyit on server: http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey-gettingready(8.3 Getting ready for public key authentication)How to usea private key with'pscp': http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter5.html(5.2.4 Using public key authentication with PSCP)(Ben Schmidt)I find the ssh included with cwRsyncisbrilliant, andinstall cwRsync or cwRsyncServer on mostWindows systemsI come across these days.I guess COPSSH,packed by the same person,is probably even better for useasjust ssh on Windows, and probably includes sftp, etc. whichIsuspect the cwRsync doesn't, thoughit might(cec) To make proper use of these suggestions above, you willneed to modify the following user-settablevariables in your.vimrc:g:netrw_ssh_cmdg:netrw_list_cmdg:netrw_mkdir_cmdg:netrw_rm_cmdg:netrw_rmdir_cmdg:netrw_rmf_cmdThe first one(g:netrw_ssh_cmd)is the most important; mostof the others will use thestring ing:netrw_ssh_cmd bydefault.netrw-p8netrw-ml_getP8. I'm browsing,changing directory, and bang! ml_geterrors {{{2 appear andI have to kill vim. Any way around this?Normallynetrw attempts to avoidwriting swapfiles forits temporary directory buffers. However, on some systemsthis attempt appears to be causing ml_geterrors toappear. Please try settingg:netrw_use_noswf to0in your <.vimrc>:let g:netrw_use_noswf= 0netrw-p9P9. I'm being pestered with "[something]isa directory" and {{{2 "Press ENTER or type command to continue" prompts...The "[something]isa directory" promptis issued by Vim,not by netrw, and there appears to be no way to work aroundit. Coupled with the default cmdheight of 1, this messagecauses the "Press ENTER..." prompt. So: readhit-enter;I also suggest that you set your'cmdheight' to 2 (or more) inyour <.vimrc> file.netrw-p10P10.I want to have two windows;a thin one on the left and my {{{2 editingwindow on the right. How mayI accomplish this? You probably wantnetrw runningas ina side window. If so, you will likely find that ":[N]Lexplore" does what you want. The optional "[N]" allows you to select the quantity of columns you wish the:Lexplorerwindow to start with (seeg:netrw_winsize for how this parameter works). Previous solution:* Put the following line in your <.vimrc>:letg:netrw_altv= 1* Edit the current directory::e.*Select some file, pressv* Resize thewindowsas you wish (seeCTRL-W_< andCTRL-W_>). If you're using gvim, you can drag the separatingbar with your mouse.* When you wanta new file, use ctrl-wh togo back to thenetrw browser, selecta file, then pressP (seeCTRL-W_h andnetrw-P). If you're using gvim, you can press<leftmouse> in the browserwindow and then press the<middlemouse> to select the file.netrw-p11P11. My directory isn'tsorting correctly, or unwanted letters are {{{2 appearing in the listed filenames, or things aren't lining up properly in the wide listing,... This may be due to an encoding problem.I myself usually use utf-8, but really only use ascii (ie. bytes from 32-126). Multibyte encodings use two (or more) bytes per character. You may need to changeg:netrw_sepchr and/org:netrw_xstrlen.netrw-p12P12. I'ma Windows+ putty+ ssh user, and whenI attempt to {{{2 browse, the directories are missing trailing "/"s sonetrw treats themas file transfers instead ofas attempts to browse subdirectories. How mayI fix this? (mikeyao) If you want to use vim via ssh and putty under Windows, try combining the use of pscp/psftp with plink. pscp/psftp will be used to connect and plink will be used to execute commands on the server, for example:list files and directory using'ls'. These are the settingsI use todo this: " list files, it's the key setting, if you haven't set, " you will get a blank buffer let g:netrw_list_cmd = "plink HOSTNAME ls -Fa" " if you haven't add putty directory in system path, you should " specify scp/sftp command. For examples: "let g:netrw_sftp_cmd = "d:\\dev\\putty\\PSFTP.exe" "let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe"netrw-p13P13.I would like to speed up writes using Nwrite and scp/ssh {{{2 style connections. How? (Thomer M. Gil) Try using ssh's ControlMaster and ControlPath (see the ssh_config man page) to share multiple ssh connections overa singlenetwork connection. That cuts out the cryptographic handshake on each file write, sometimes speedingit up by an order of magnitude. (seehttp://thomer.com/howtos/netrw_ssh.html) (included by permission) Add the following to your ~/.ssh/config: # you change "*" to the hostname you care about Host * ControlMaster auto ControlPath /tmp/%r@%h:%p Then create an ssh connection to the host and leaveit running: ssh -N host.domain.com Now remotely opena file with Vim's Netrw and enjoy the zippiness:vim scp://host.domain.com//home/user/.bashrcnetrw-p14P14. How mayI useadouble-click instead of netrw's usual single {{{2 click to opena file or directory? (Ben Fritz) First, disable netrw'smapping with let g:netrw_mousemaps= 0 and then createanetrw buffer onlymapping in $HOME/.vim/after/ftplugin/netrw.vim: nmap <buffer> <2-leftmouse> <CR>Note that settingg:netrw_mousemaps to zero will turn off all netrw's mouse mappings, not just the<leftmouse> one. (seeg:netrw_mousemaps)netrw-p15P15. When editing remote files (ex.:eftp://hostname/path/file), {{{2 under WindowsI get anE303 message complaining that its unable to opena swap file. (romainl) It looks like you arestarting Vim froma protected directory. Startnetrw from your$HOME or other writable directory.netrw-p16P16. Netrwis closingbuffers on its own. {{{2 What steps will reproduce the problem?1. :Explore, navigate directories, opena file2. :Explore, open another file3. Buffer opened in step 1 will be closed.o Whatis the expected output? Whatdo you see instead?I expect bothbuffers to exist, but only the last one does. (Lance) Problemis caused by "set autochdir" in .vimrc. (drchip)I am able to duplicate this problem with'acd' set. It appears that thebuffers are not exactly closed;a ":ls!" will show them (although ":ls" does not).netrw-P17P17. How to locally edita file that's only available via {{{2 another server accessible via ssh? Seehttp://stackoverflow.com/questions/12469645/ "Using Vim to Remotely EditA File on ServerB Only Accessible From ServerA"netrw-P18P18. HowdoI get numbering on in directory listings? {{{2Withg:netrw_bufsettings, you cancontrol netrw's buffersettings; try putting let g:netrw_bufsettings="noma nomod nu nobl nowrap ro nornu"in your .vimrc. If you'd like to have relative numberinginstead, try let g:netrw_bufsettings="noma nomod nonu nobl nowrap ro rnu"netrw-P19P19. How mayI havegvim start up showinga directory listing? {{{2Try putting the following code snippet into your .vimrc: augroup VimStartup au! au VimEnter * if expand("%") == "" && argc() == 0 && \ (v:servername =~ 'GVIM\d*' || v:servername == "") \ | e . | endif augroup ENDYou may use Lexplore instead of "e" if you're so inclined.This snippet assumes that you haveclient-server enabled(ie.a "huge" vim version).netrw-P20P20. I've madea directory (or file) with an accented character, {{{2butnetrw isn't letting me enter that directory/read that file:Its likely that the shell or o/sis usinga different encodingthan you have vim (netrw) using.A patch to vim supporting"systemencoding" may address this issue in the future; fornow, just havenetrw use the proper encoding. For example:au FileType netrw set enc=latin1netrw-P21P21.I get an error message whenI try to copy or movea file: {{{2**error** (netrw) tried using g:netrw_localcopycmd<cp>;it doesn't work! What's wrong? Netrw uses several system level commands todo things (seeg:netrw_localcopycmd,g:netrw_localmovecmd,g:netrw_mkdir_cmd). You may need to adjust the default commands for one or more of these commands by setting them properly in your .vimrc. Another source of difficultyis that these commands use vim's local directory, which may not be the sameas the browsing directory shown bynetrw (seeg:netrw_keepdir).==============================================================================11. Creditsnetrw-credits {{{1Vim editorbyBramMoolenaar (Thanks, Bram!)davsupport byC Campbellfetchsupport byBramMoolenaar andC Campbellftpsupport byC Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>httpsupport byBramMoolenaar <bram@moolenaar.net>rcprsyncsupport byC Campbell (suggested by Erik Warendorph)scpsupport by raf <raf@comdyn.com.au>sftpsupport byC Campbellinputsecret(), BufReadCmd,BufWriteCmd contributed byC CampbellJérôme Augé-- also using new buffermethod with ftp+.netrcBramMoolenaar-- obviously vim itself,:e andv:cmdarg use, fetch,...Yasuhiro Matsumoto-- pointing out undo+0r problem anda solutionErik Warendorph-- for several suggestions (g:netrw_..._cmd variables,rsync etc)Doug Claar-- modifications to test for success withftp operation==============================================================================Modelines: {{{1vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker