1 *pi_netrw.txt* For Vim version 7.1. Last change: 2008 Mar 28
3 -----------------------------------------------------
4 NETRW REFERENCE MANUAL by Charles E. Campbell, Jr.
5 -----------------------------------------------------
8 *dav* *http* *network* *Nwrite* *netrw-file*
9 *fetch* *netrw* *Nread* *rcp* *scp*
10 *ftp* *netrw.vim* *Nsource* *rsync* *sftp*
12 ==============================================================================
13 1. Contents *netrw-contents* {{{1
15 1. Contents.............................................|netrw-contents|
16 2. Starting With Netrw..................................|netrw-start|
17 3. Netrw Reference......................................|netrw-ref|
18 EXTERNAL APPLICATIONS AND PROTOCOLS................|netrw-externapp|
19 READING............................................|netrw-read|
20 WRITING............................................|netrw-write|
21 DIRECTORY LISTING..................................|netrw-dirlist|
22 CHANGING THE USERID AND PASSWORD...................|netrw-chgup|
23 VARIABLES AND SETTINGS.............................|netrw-variables|
24 PATHS..............................................|netrw-path|
25 4. Network-Oriented File Transfer.......................|netrw-xfer|
26 NETRC..............................................|netrw-netrc|
27 PASSWORD...........................................|netrw-passwd|
28 5. Activation...........................................|netrw-activate|
29 6. Transparent File Editing.............................|netrw-transparent|
30 7. Ex Commands..........................................|netrw-ex|
31 8. Variables and Options................................|netrw-var|
32 9. Browsing.............................................|netrw-browse|
33 Introduction To Browsing...........................|netrw-browse-intro|
34 Quick Reference: Maps..............................|netrw-browse-maps|
35 Quick Reference: Commands..........................|netrw-browse-cmds|
36 Bookmarking A Directory............................|netrw-mb|
37 Browsing...........................................|netrw-cr|
38 Browsing With A Horizontally Split Window..........|netrw-o|
39 Browsing With A New Tab............................|netrw-t|
40 Browsing With A Vertically Split Window............|netrw-v|
41 Change Listing Style...............................|netrw-i|
42 Changing To A Bookmarked Directory.................|netrw-gb|
43 Changing To A Predecessor Directory................|netrw-u|
44 Changing To A Successor Directory..................|netrw-U|
45 Customizing Browsing With A User Function..........|netrw-x|
46 Deleting Files Or Directories......................|netrw-D|
47 Directory Exploring Commands.......................|netrw-explore|
48 Exploring With Stars and Patterns..................|netrw-star|
49 Displaying Information About File..................|netrw-qf|
50 Edit File Or Directory Hiding List.................|netrw-ctrl-h|
51 Editing The Sorting Sequence.......................|netrw-S|
52 Going Up...........................................|netrw--|
53 Hiding Files Or Directories........................|netrw-a|
54 Improving Browsing.................................|netrw-ssh-hack|
55 Listing Bookmarks And History......................|netrw-qb|
56 Making A New Directory.............................|netrw-d|
57 Making The Browsing Directory The Current Directory|netrw-c|
58 Marked Files: Compression And Decompression........|netrw-mz|
59 Marked Files: Printing.............................|netrw-mp|
60 Marked Files: Tagging..............................|netrw-mT|
61 Marked Files: Unmarking............................|netrw-mu|
62 Marking Files......................................|netrw-mf|
63 Marking Files By Regular Expression................|netrw-mr|
64 Netrw Browser Variables............................|netrw-browser-var|
65 Netrw Browsing And Option Incompatibilities........|netrw-incompatible|
66 Netrw Settings.....................................|netrw-settings|
67 Obtaining A File...................................|netrw-O|
68 Preview Window.....................................|netrw-p|
69 Previous Window....................................|netrw-P|
70 Refreshing The Listing.............................|netrw-ctrl-l|
71 Renaming Files Or Directories......................|netrw-move|
72 Reversing Sorting Order............................|netrw-r|
73 Selecting Sorting Style............................|netrw-s|
74 10. Problems and Fixes...................................|netrw-problems|
75 11. Debugging Netrw Itself...............................|netrw-debug|
76 12. History..............................................|netrw-history|
77 13. Credits..............................................|netrw-credits|
79 {Vi does not have any of this}
81 ==============================================================================
82 2. Starting With Netrw *netrw-start* {{{1
84 Netrw makes reading files, writing files, browsing over a network, and
85 browsing locally easy! First, make sure that you have plugins enabled, so
86 you'll need to have at least the following in your <.vimrc>:
87 (or see |netrw-activate|) >
89 set nocp " 'compatible' is not set
90 filetype plugin on " plugins are enabled
92 (see |'cp'| and |:filetype-plugin-on|)
94 Netrw supports "transparent" editing of files on other machines using urls
95 (see |netrw-transparent|). As an example of this, let's assume you have an
96 account on some other machine; if you can use scp, try: >
98 vim scp://hostname/path/to/file
100 Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|!
102 So, what if you have ftp, not ssh/scp? That's easy, too; try >
104 vim ftp://hostname/path/to/file
106 Want to make ftp simpler to use? See if your ftp supports a file called
107 <.netrc> -- typically it goes in your home directory, has read/write
108 permissions for only the user to read (ie. not group, world, other, etc),
109 and has lines resembling >
111 machine HOSTNAME login USERID password "PASSWORD"
112 machine HOSTNAME login USERID password "PASSWORD"
114 default login USERID password "PASSWORD"
116 Now about browsing -- when you just want to look around before editing a
117 file. For browsing on your current host, just "edit" a directory: >
120 vim /home/userid/path
122 For browsing on a remote host, "edit" a directory (but make sure that
123 the directory name is followed by a "/"): >
126 vim ftp://hostname/path/to/dir/
128 See |netrw-browse| for more!
130 There are more protocols supported by netrw just than scp and ftp, too: see the
131 next section, |netrw-externapp|, for how to use these external applications.
133 If you want to use plugins, but for some reason don't wish to use netrw, then
134 you need to avoid loading both the plugin and the autoload portions of netrw.
135 You may do so by placing the following two lines in your <.vimrc>: >
137 :let g:loaded_netrw = 1
138 :let g:loaded_netrwPlugin = 1
141 ==============================================================================
142 3. Netrw Reference *netrw-ref* {{{1
144 Netrw supports several protocols in addition to scp and ftp mentioned
145 in |netrw-start|. These include dav, fetch, http,... well, just look
146 at the list in |netrw-externapp|. Each protocol is associated with a
147 variable which holds the default command supporting that protocol.
149 EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2
151 Protocol Variable Default Value
152 -------- ---------------- -------------
153 dav: *g:netrw_dav_cmd* = "cadaver"
154 fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available
155 ftp: *g:netrw_ftp_cmd* = "ftp"
156 http: *g:netrw_http_cmd* = "curl -o" if curl is available
157 http: g:netrw_http_cmd = "wget -q -O" elseif wget is available
158 http: g:netrw_http_cmd = "fetch -o" elseif fetch is available
159 rcp: *g:netrw_rcp_cmd* = "rcp"
160 rsync: *g:netrw_rsync_cmd* = "rsync -a"
161 scp: *g:netrw_scp_cmd* = "scp -q"
162 sftp: *g:netrw_sftp_cmd* = "sftp"
164 READING *netrw-read* *netrw-nread* {{{2
166 Generally, one may just use the url notation with a normal editing
169 :e ftp://[user@]machine/path
171 Netrw also provides the Nread command:
174 :Nread "machine:path" uses rcp
175 :Nread "machine path" uses ftp w/ <.netrc>
176 :Nread "machine id password path" uses ftp
177 :Nread "dav://machine[:port]/path" uses cadaver
178 :Nread "fetch://[user@]machine/path" uses fetch
179 :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
180 :Nread "http://[user@]machine/path" uses http uses wget
181 :Nread "rcp://[user@]machine/path" uses rcp
182 :Nread "rsync://[user@]machine[:port]/path" uses rsync
183 :Nread "scp://[user@]machine[[:#]port]/path" uses scp
184 :Nread "sftp://[user@]machine/path" uses sftp
186 WRITING *netrw-write* *netrw-nwrite* {{{2
188 One may just use the url notation with a normal file writing
191 :w ftp://[user@]machine/path
193 Netrw also provides the Nwrite command:
196 :Nwrite "machine:path" uses rcp
197 :Nwrite "machine path" uses ftp w/ <.netrc>
198 :Nwrite "machine id password path" uses ftp
199 :Nwrite "dav://machine[:port]/path" uses cadaver
200 :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
201 :Nwrite "rcp://[user@]machine/path" uses rcp
202 :Nwrite "rsync://[user@]machine[:port]/path" uses rsync
203 :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp
204 :Nwrite "sftp://[user@]machine/path" uses sftp
207 SOURCING *netrw-source* {{{2
209 One may just use the url notation with the normal file sourcing
212 :so ftp://[user@]machine/path
214 Netrw also provides the Nsource command:
217 :Nsource "dav://machine[:port]/path" uses cadaver
218 :Nsource "fetch://[user@]machine/path" uses fetch
219 :Nsource "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
220 :Nsource "http://[user@]machine/path" uses http uses wget
221 :Nsource "rcp://[user@]machine/path" uses rcp
222 :Nsource "rsync://[user@]machine[:port]/path" uses rsync
223 :Nsource "scp://[user@]machine[[:#]port]/path" uses scp
224 :Nsource "sftp://[user@]machine/path" uses sftp
226 DIRECTORY LISTING *netrw-dirlist* {{{2
228 One may browse a directory to get a listing by simply attempting to
229 edit the directory: >
231 :e scp://[user]@hostname/path/
232 :e ftp://[user]@hostname/path/
234 For remote directories (ie. those using scp or ftp), that trailing
235 "/" is necessary (it tells netrw that its to treat it as a directory
236 to browse instead of a file to download).
238 However, the Nread command can also be used to accomplish this:
240 :Nread [protocol]://[user]@hostname/path/
242 *netrw-login* *netrw-password*
243 CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2
245 Attempts to use ftp will prompt you for a user-id and a password.
246 These will be saved in global variables g:netrw_uid and
247 s:netrw_passwd; subsequent uses of ftp will re-use those two items to
248 simplify the further use of ftp. However, if you need to use a
249 different user id and/or password, you'll want to call NetUserPass()
250 first. To work around the need to enter passwords, check if your ftp
251 supports a <.netrc> file in your home directory. Also see
252 |netrw-passwd| (and if you're using ssh/scp hoping to figure out how
253 to not need to use passwords, look at |netrw-ssh-hack|).
255 :NetUserPass [uid [password]] -- prompts as needed
256 :call NetUserPass() -- prompts for uid and password
257 :call NetUserPass("uid") -- prompts for password
258 :call NetUserPass("uid","password") -- sets global uid and password
260 NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2
261 (also see: |netrw-browser-var| |netrw-protocol| |netrw-settings| |netrw-var|)
263 Netrw provides a lot of variables which allow you to customize netrw to your
264 preferences. One way to look at them is via the command :NetrwSettings (see
265 |netrw-settings|) which will display your current netrw settings. Most such
266 settings are described below, in |netrw-browser-options|, and in
269 *b:netrw_lastfile* last file Network-read/written retained on a per-buffer
270 basis (supports plain :Nw )
272 *g:netrw_ftp* if it doesn't exist, use default ftp
273 =0 use default ftp (uid password)
274 =1 use alternate ftp method (user uid password)
275 If you're having trouble with ftp, try changing the
276 value of this variable to see if the alternate ftp
277 method works for your setup.
279 *g:netrw_extracmd* default: doesn't exist
280 If this variable exists, then any string it contains
281 will be placed into the commands set to your ftp
282 client. As an example:
285 *g:netrw_ftpmode* ="binary" (default)
288 *g:netrw_ignorenetrc* =0 (default for linux, cygwin)
289 =1 If you have a <.netrc> file but it doesn't work and
290 you want it ignored, then set this variable as
291 shown. (default for Windows + cmd.exe)
293 *g:netrw_menu* =0 disable netrw's menu
294 =1 (default) netrw's menu enabled
296 *g:netrw_nogx* if this variable exists, then the "gx" map will not
297 be available (see |netrw-gx|)
299 *g:netrw_uid* (ftp) user-id, retained on a per-session basis
300 *s:netrw_passwd* (ftp) password, retained on a per-session basis
302 *g:netrw_preview* =0 (default) preview window shown in a horizontally
304 =1 preview window shown in a vertically split window.
305 Also affects the "previous window" (see |netrw-P|) in
308 *g:netrw_shq* = "'" for Unix/Linux systems (ie. a single quote)
309 = "'" for Windows + cygwin systems (ie. a single quote)
310 = '"' for Windows systems, not using cygwin
312 Controls the quoting character used during scp and ftp
315 *g:netrw_scpport* = "-P" : option to use to set port for scp
316 *g:netrw_sshport* = "-p" : option to use to set port for ssh
318 *g:netrw_silent* =0 : transfers done normally
319 =1 : transfers done silently
321 *g:netrw_use_errorwindow* =1 : messages from netrw will use a separate one
322 line window. This window provides reliable
323 delivery of messages. (default)
324 =0 : messages from netrw will use echoerr ;
325 messages don't always seem to show up this
326 way, but one doesn't have to quit the window.
328 *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank
329 lines that o/s's ftp "provides" on transfers
330 =0 force normal ftp behavior (no trailing line removal)
332 *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also
333 permits network browsing to use ls with time and
334 size sorting (default if windows)
335 =0 assume Windows' scp accepts windows-style paths
336 Network browsing uses dir instead of ls
337 This option is ignored if you're using unix
339 *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP
340 =1 use WinNT's rcp in binary mode (default)
342 PATHS *netrw-path* {{{2
344 Paths to files are generally user-directory relative for most protocols.
345 It is possible that some protocol will make paths relative to some
346 associated directory, however.
348 example: vim scp://user@host/somefile
349 example: vim scp://user@host/subdir1/subdir2/somefile
351 where "somefile" is in the "user"'s home directory. If you wish to get a
352 file using root-relative paths, use the full path:
354 example: vim scp://user@host//somefile
355 example: vim scp://user@host//subdir1/subdir2/somefile
358 ==============================================================================
359 4. Network-Oriented File Transfer *netrw-xfer* {{{1
361 Network-oriented file transfer under Vim is implemented by a VimL-based script
362 (<netrw.vim>) using plugin techniques. It currently supports both reading and
363 writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch,
364 dav/cadaver, rsync, or sftp.
366 http is currently supported read-only via use of wget or fetch.
368 <netrw.vim> is a standard plugin which acts as glue between Vim and the
369 various file transfer programs. It uses autocommand events (BufReadCmd,
370 FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. >
372 ex. vim ftp://hostname/path/to/file
374 The characters preceding the colon specify the protocol to use; in the
375 example, it's ftp. The <netrw.vim> script then formulates a command or a
376 series of commands (typically ftp) which it issues to an external program
377 (ftp, scp, etc) which does the actual file transfer/protocol. Files are read
378 from/written to a temporary file (under Unix/Linux, /tmp/...) which the
379 <netrw.vim> script will clean up.
381 *netrw-putty* *netrw-pscp* *netrw-psftp*
382 One may modify any protocol's implementing external application by setting a
383 variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
384 "scp -q"). As an example, consider using PuTTY: >
386 let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch'
387 let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"'
389 See |netrw-p8| for more about putty, pscp, psftp, etc.
391 Ftp, an old protocol, seems to be blessed by numerous implementations.
392 Unfortunately, some implementations are noisy (ie., add junk to the end of the
393 file). Thus, concerned users may decide to write a NetReadFixup() function
394 that will clean up after reading with their ftp. Some Unix systems (ie.,
395 FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is
396 not noisy and more convenient, actually, for <netrw.vim> to use.
397 Consequently, if "fetch" is executable, it will be used to do reads for
398 ftp://... (and http://...) . See |netrw-var| for more about this.
400 For rcp, scp, sftp, and http, one may use network-oriented file transfers
403 vim rcp://[user@]machine/path
404 vim scp://[user@]machine/path
406 If your ftp supports <.netrc>, then it too can be just as transparently used
407 if the needed triad of machine name, user id, and password are present in
408 that file. Your ftp must be able to use the <.netrc> file on its own, however.
410 vim ftp://[user@]machine[[:#]portnumber]/path
412 However, ftp will often need to query the user for the userid and password.
413 The latter will be done "silently"; ie. asterisks will show up instead of
414 the actually-typed-in password. Netrw will retain the userid and password
415 for subsequent read/writes from the most recent transfer so subsequent
416 transfers (read/write) to or from that machine will take place without
417 additional prompting.
420 +=================================+============================+============+
421 | Reading | Writing | Uses |
422 +=================================+============================+============+
424 | dav://host/path | | cadaver |
425 | :Nread dav://host/path | :Nwrite dav://host/path | cadaver |
426 +---------------------------------+----------------------------+------------+
428 | fetch://[user@]host/path | | |
429 | fetch://[user@]host:http/path | Not Available | fetch |
430 | :Nread fetch://[user@]host/path| | |
431 +---------------------------------+----------------------------+------------+
433 | file:///* | file:///* | |
434 | file://localhost/* | file://localhost/* | |
435 +---------------------------------+----------------------------+------------+
436 | FTP: (*3) | (*3) | |
437 | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) |
438 | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc |
439 | :Nread host path | :Nwrite host path | ftp+.netrc |
440 | :Nread host uid pass path | :Nwrite host uid pass path | ftp |
441 +---------------------------------+----------------------------+------------+
442 | HTTP: wget is executable: (*4) | | |
443 | http://[user@]host/path | Not Available | wget |
444 +---------------------------------+----------------------------+------------+
445 | HTTP: fetch is executable (*4) | | |
446 | http://[user@]host/path | Not Available | fetch |
447 +---------------------------------+----------------------------+------------+
449 | rcp://[user@]host/path | rcp://[user@]host/path | rcp |
450 +---------------------------------+----------------------------+------------+
452 | rsync://[user@]host/path | rsync://[user@]host/path | rsync |
453 | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync |
454 | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp |
455 +---------------------------------+----------------------------+------------+
457 | scp://[user@]host/path | scp://[user@]host/path | scp |
458 | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) |
459 +---------------------------------+----------------------------+------------+
461 | sftp://[user@]host/path | sftp://[user@]host/path | sftp |
462 | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) |
463 +=================================+============================+============+
465 (*1) For an absolute path use scp://machine//path.
467 (*2) if <.netrc> is present, it is assumed that it will
468 work with your ftp client. Otherwise the script will
469 prompt for user-id and password.
471 (*3) for ftp, "machine" may be machine#port or machine:port
472 if a different port is needed than the standard ftp port
474 (*4) for http:..., if wget is available it will be used. Otherwise,
475 if fetch is available it will be used.
477 Both the :Nread and the :Nwrite ex-commands can accept multiple filenames.
482 The <.netrc> file, typically located in your home directory, contains lines
483 therein which map a hostname (machine name) to the user id and password you
484 prefer to use with it.
486 The typical syntax for lines in a <.netrc> file is given as shown below.
487 Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't.
489 machine {full machine name} login {user-id} password "{password}"
490 default login {user-id} password "{password}"
492 Your ftp client must handle the use of <.netrc> on its own, but if the
493 <.netrc> file exists, an ftp transfer will not ask for the user-id or
497 Since this file contains passwords, make very sure nobody else can
498 read this file! Most programs will refuse to use a .netrc that is
499 readable for others. Don't forget that the system administrator can
500 still read the file! Ie. for Linux/Unix: chmod 600 .netrc
503 PASSWORD *netrw-passwd*
505 The script attempts to get passwords for ftp invisibly using |inputsecret()|,
506 a built-in Vim function. See |netrw-uidpass| for how to change the password
507 after one has set it.
509 Unfortunately there doesn't appear to be a way for netrw to feed a password to
510 scp. Thus every transfer via scp will require re-entry of the password.
511 However, |netrw-ssh-hack| can help with this problem.
514 ==============================================================================
515 5. Activation *netrw-activate* {{{1
517 Network-oriented file transfers are available by default whenever Vim's
518 |'nocompatible'| mode is enabled. Netrw's script files reside in your
519 system's plugin, autoload, and syntax directories; just the
520 plugin/netrwPlugin.vim script is sourced automatically whenever you bring up
521 vim. The main script in autoload/netrw.vim is only loaded when you actually
522 use netrw. I suggest that, at a minimum, you have at least the following in
523 your <.vimrc> customization file: >
527 filetype plugin indent on
531 ==============================================================================
532 6. Transparent File Editing *netrw-transparent* {{{1
534 Transparent file transfers occur whenever a regular file read or write
535 (invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd|
536 events) is made. Thus one may read, write, or source files across networks
537 just as easily as if they were local files! >
539 vim ftp://[user@]machine/path
543 See |netrw-activate| for more on how to encourage your vim to use plugins
547 ==============================================================================
548 7. Ex Commands *netrw-ex* {{{1
550 The usual read/write commands are supported. There are also a few
551 additional commands available. Often you won't need to use Nwrite or
552 Nread as shown in |netrw-transparent| (ie. simply use >
556 instead, as appropriate) -- see |netrw-urls|. In the explanations
557 below, a {netfile} is an url to a remote file.
559 :[range]Nw[rite] Write the specified lines to the current
560 file as specified in b:netrw_lastfile.
562 :[range]Nw[rite] {netfile} [{netfile}]...
563 Write the specified lines to the {netfile}.
565 :Nr[ead] Read the specified lines into the current
566 buffer from the file specified in
569 :Nr[ead] {netfile} {netfile}...
570 Read the {netfile} after the current line.
573 Source the {netfile}.
574 To start up vim using a remote .vimrc, one may use
575 the following (all on one line) (tnx to Antoine Mechelynck) >
577 --cmd "runtime plugin/netrwPlugin.vim"
578 --cmd "source scp://HOSTNAME/.vimrc"
581 If g:netrw_uid and s:netrw_passwd don't exist,
582 this function will query the user for them.
584 :call NetUserPass("userid")
585 This call will set the g:netrw_uid and, if
586 the password doesn't exist, will query the user for it.
588 :call NetUserPass("userid","passwd")
589 This call will set both the g:netrw_uid and s:netrw_passwd.
590 The user-id and password are used by ftp transfers. One may
591 effectively remove the user-id and password by using empty
594 :NetrwSettings This command is described in |netrw-settings| -- used to
595 display netrw settings and change netrw behavior.
598 ==============================================================================
599 8. Variables and Options *netrw-options* *netrw-var* {{{1
601 (if you're interested in the netrw browser settings, see: |netrw-browser-var|)
603 The <netrw.vim> script provides several variables which act as options to
604 affect <netrw.vim>'s file transfer behavior. These variables typically may be
605 set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|)
613 -------------- -----------------------------------------------
615 b:netrw_col Holds current cursor position (during NetWrite)
616 g:netrw_cygwin =1 assume scp under windows is from cygwin
618 =0 assume scp under windows accepts windows
619 style paths (default/else)
620 g:netrw_ftp =0 use default ftp (uid password)
621 g:netrw_ftpmode ="binary" (default)
622 ="ascii" (your choice)
623 g:netrw_ignorenetrc =1 (default)
624 if you have a <.netrc> file but you don't
625 want it used, then set this variable. Its
626 mere existence is enough to cause <.netrc>
628 b:netrw_lastfile Holds latest method/machine/path.
629 b:netrw_line Holds current line number (during NetWrite)
630 g:netrw_passwd Holds current password for ftp.
631 g:netrw_silent =0 transfers done normally
632 =1 transfers done silently
633 g:netrw_uid Holds current user-id for ftp.
634 =1 use alternate ftp (user uid password)
635 (see |netrw-options|)
636 g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
637 =1 use WinNT/2K/XP's rcp, binary mode
638 g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc
639 =1 use default method to do ftp >
640 -----------------------------------------------------------------------
642 The script will also make use of the following variables internally, albeit
649 -------- ------------------------------------
651 g:netrw_method Index indicating rcp/ftp+.netrc/ftp
652 g:netrw_machine Holds machine name parsed from input
653 g:netrw_fname Holds filename being accessed >
654 ------------------------------------------------------------
658 Netrw supports a number of protocols. These protocols are invoked using the
659 variables listed below, and may be modified by the user.
661 ------------------------
662 Protocol Control Options
663 ------------------------
664 Option Type Setting Meaning
665 --------- -------- -------------- ---------------------------
667 netrw_ftp variable =doesn't exist userid set by "user userid"
668 =0 userid set by "user userid"
669 =1 userid set by "userid"
670 NetReadFixup function =doesn't exist no change
671 =exists Allows user to have files
672 read via ftp automatically
673 transformed however they wish
675 g:netrw_dav_cmd variable ="cadaver"
676 g:netrw_fetch_cmd variable ="fetch -o" if fetch is available
677 g:netrw_ftp_cmd variable ="ftp"
678 g:netrw_http_cmd variable ="fetch -o" if fetch is available
679 g:netrw_http_cmd variable ="wget -O" else if wget is available
680 g:netrw_list_cmd variable ="ssh USEPORT HOSTNAME ls -Fa"
681 g:netrw_rcp_cmd variable ="rcp"
682 g:netrw_rsync_cmd variable ="rsync -a"
683 g:netrw_scp_cmd variable ="scp -q"
684 g:netrw_sftp_cmd variable ="sftp" >
685 -------------------------------------------------------------------------
689 The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|)
690 specify the external program to use handle the ftp protocol. They may
691 include command line options (such as -p for passive mode).
693 Browsing is supported by using the |g:netrw_list_cmd|; the substring
694 "HOSTNAME" will be changed via substitution with whatever the current request
697 Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's
698 that give trouble . In order to best understand how to use these options if
699 ftp is giving you troubles, a bit of discussion is provided on how netrw does
702 For ftp, netrw typically builds up lines of one of the following formats in a
705 IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1
706 ---------------------------------- ------------------------------
708 open machine [port] open machine [port]
709 user userid password userid password
710 [g:netrw_ftpmode] password
711 [g:netrw_extracmd] [g:netrw_ftpmode]
712 get filename tempfile [g:netrw_extracmd]
713 get filename tempfile >
714 ---------------------------------------------------------------------
716 The |g:netrw_ftpmode| and |g:netrw_extracmd| are optional.
718 Netrw then executes the lines above by use of a filter:
720 :%! {g:netrw_ftp_cmd} -i [-n]
723 g:netrw_ftp_cmd is usually "ftp",
724 -i tells ftp not to be interactive
725 -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>)
727 If <.netrc> exists it will be used to avoid having to query the user for
728 userid and password. The transferred file is put into a temporary file.
729 The temporary file is then read into the main editing session window that
730 requested it and the temporary file deleted.
732 If your ftp doesn't accept the "user" command and immediately just demands a
733 userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
736 To handle the SSL certificate dialog for untrusted servers, one may pull
737 down the certificate and place it into /usr/ssl/cert.pem. This operation
738 renders the server treatment as "trusted".
740 *netrw-fixup* *netreadfixup*
741 If your ftp for whatever reason generates unwanted lines (such as AUTH
742 messages) you may write a NetReadFixup(tmpfile) function:
744 function! NetReadFixup(method,line1,line2)
745 " a:line1: first new line in current file
746 " a:line2: last new line in current file
747 if a:method == 1 "rcp
748 elseif a:method == 2 "ftp + <.netrc>
749 elseif a:method == 3 "ftp + machine,uid,password,filename
750 elseif a:method == 4 "scp
751 elseif a:method == 5 "http/wget
752 elseif a:method == 6 "dav/cadaver
753 elseif a:method == 7 "rsync
754 elseif a:method == 8 "fetch
755 elseif a:method == 9 "sftp
760 The NetReadFixup() function will be called if it exists and thus allows you to
761 customize your reading process. As a further example, <netrw.vim> contains
762 just such a function to handle Windows 95 ftp. For whatever reason, Windows
763 95's ftp dumps four blank lines at the end of a transfer, and so it is
764 desirable to automate their removal. Here's some code taken from <netrw.vim>
767 if has("win95") && g:netrw_win95ftp
768 fun! NetReadFixup(method, line1, line2)
769 if method == 3 " ftp (no <.netrc>)
770 let fourblanklines= line2 - 3
771 silent fourblanklines.",".line2."g/^\s*/d"
777 ==============================================================================
778 9. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1
779 *netrw-browser* *netrw-dir* *netrw-list*
781 INTRODUCTION TO BROWSING *netrw-browse-intro* {{{2
783 Netrw supports the browsing of directories on your local system and on remote
784 hosts; browsing includes listing files and directories, entering directories,
785 editing files therein, deleting files/directories, making new directories,
786 moving (renaming) files and directories, copying files and directories, etc.
787 One may mark files and execute any system command on them! The Netrw browser
788 generally implements the previous explorer's maps and commands for remote
789 directories, although details (such as pertinent global variable names)
790 necessarily differ. To browse a directory, simply "edit" it! >
794 vim c:\your\directory\
796 (Related topics: |netrw-cr| |netrw-o| |netrw-p| |netrw-P| |netrw-t|
797 |netrw-mf| |netrw-mx| |netrw-D| |netrw-R| |netrw-v| )
799 The Netrw remote file and directory browser handles two protocols: ssh and
800 ftp. The protocol in the url, if it is ftp, will cause netrw also to use ftp
801 in its remote browsing. Specifying any other protocol will cause it to be
802 used for file transfers; but the ssh protocol will be used to do remote
805 To use Netrw's remote directory browser, simply attempt to read a "file" with
806 a trailing slash and it will be interpreted as a request to list a directory:
808 vim [protocol]://[user@]hostname/path/
810 where [protocol] is typically scp or ftp. As an example, try: >
812 vim ftp://ftp.home.vim.org/pub/vim/
814 For local directories, the trailing slash is not required. Again, because its
815 easy to miss: to browse remote directories, the url must terminate with a
818 If you'd like to avoid entering the password repeatedly for remote directory
819 listings with ssh or scp, see |netrw-ssh-hack|. To avoid password entry with
820 ftp, see |netrw-netrc| (if your ftp supports it).
822 There are several things you can do to affect the browser's display of files:
824 * To change the listing style, press the "i" key (|netrw-i|).
825 Currently there are four styles: thin, long, wide, and tree.
827 * To hide files (don't want to see those xyz~ files anymore?) see
830 * Press s to sort files by name, time, or size.
832 See |netrw-browse-cmds| for all the things you can do with netrw!
835 QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
837 --- ----------------- ----
838 Map Quick Explanation Link
839 --- ----------------- ----
840 < <F1> Causes Netrw to issue help
841 <cr> Netrw will enter the directory or read the file |netrw-cr|
842 <del> Netrw will attempt to remove the file/directory |netrw-del|
843 - Makes Netrw go up one directory |netrw--|
844 a Toggles between normal display, |netrw-a|
845 hiding (suppress display of files matching g:netrw_list_hide)
846 showing (display only files which match g:netrw_list_hide)
847 c Make browsing directory the current directory |netrw-c|
848 d Make a directory |netrw-d|
849 D Attempt to remove the file(s)/directory(ies) |netrw-D|
850 gb Go to previous bookmarked directory |netrw-gb|
851 gi Display information on file |netrw-qf|
852 <c-h> Edit file hiding list |netrw-ctrl-h|
853 i Cycle between thin, long, wide, and tree listings |netrw-i|
854 <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
855 mb Bookmark current directory |netrw-mb|
856 mc Copy marked files to marked-file target directory |netrw-mc|
857 md Apply diff to marked files (up to 3) |netrw-md|
858 me Place marked files on arg list and edit them |netrw-me|
859 mf Mark a file |netrw-mf|
860 mh Toggle marked file suffices' presence on hiding list |netrw-mh|
861 mm Move marked files to marked-file target directory |netrw-mm|
862 mp Print marked files |netrw-mp|
863 mr Mark files satisfying a |regexp| |netrw-mr|
864 mt Current browsing directory becomes markfile target |netrw-mt|
865 mT Apply ctags to marked files |netrw-mT|
866 mu Unmark all marked files |netrw-mu|
867 mx Apply arbitrary shell command to marked files |netrw-mx|
868 mz Compress/decompress marked files |netrw-mz|
869 o Enter the file/directory under the cursor in a new |netrw-o|
870 browser window. A horizontal split is used.
871 O Obtain a file specified by cursor |netrw-O|
872 p Preview the file |netrw-p|
873 P Browse in the previously used window |netrw-P|
874 q List bookmarked directories and history |netrw-qb|
875 r Reverse sorting order |netrw-r|
876 R Rename the designed file(s)/directory(ies) |netrw-R|
877 s Select sorting style: by name, time, or file size |netrw-s|
878 S Specify suffix priority for name-sorting |netrw-S|
879 t Enter the file/directory under the cursor in a new tab|netrw-t|
880 u Change to recently-visited directory |netrw-u|
881 U Change to subsequently-visited directory |netrw-U|
882 v Enter the file/directory under the cursor in a new |netrw-v|
883 browser window. A vertical split is used.
884 x View file with an associated program |netrw-x|
886 <leftmouse> (gvim only) selects word under mouse as if a <cr>
887 had been pressed (ie. edit file, change directory)
888 <middlemouse> (gvim only) same as P selecting word under mouse;
890 <rightmouse> (gvim only) delete file/directory using word under
892 <2-leftmouse> (gvim only) when:
893 * in a netrw-selected file, AND
894 * |g:netrw_retmap| == 1 AND
895 * the user doesn't already have a <2-leftmouse> mapping
896 defined before netrw is autoloaded,
897 then a double clicked leftmouse button will return
898 to the netrw browser window.
899 <s-leftmouse> (gvim only) like mf, will mark files
901 QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2
902 :NetrwClean[!] ...........................................|netrw-clean|
903 :NetrwSettings ...........................................|netrw-settings|
904 :Explore[!] [dir] Explore directory of current file......|netrw-explore|
905 :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore|
906 :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
907 :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
908 :Rexplore Return to Explorer.....................|netrw-explore|
909 :Sexplore[!] [dir] Split & Explore directory .............|netrw-explore|
910 :Texplore[!] [dir] Tab & Explore..........................|netrw-explore|
911 :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
913 BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2
914 One may easily "bookmark" a directory by using >
918 Any count may be used. One may use viminfo's "!" option to retain bookmarks
919 between vim sessions. See |netrw-gb| for how to return to a bookmark and
920 |netrw-qb| for how to list them.
923 BROWSING *netrw-cr* {{{2
925 Browsing is simple: move the cursor onto a file or directory of interest.
926 Hitting the <cr> (the return key) will select the file or directory.
927 Directories will themselves be listed, and files will be opened using the
928 protocol given in the original read request.
930 CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that
931 two or more spaces delimit filenames and directory names for the long and
932 wide listing formats. Thus, if your filename or directory name has two or
933 more sequential spaces embedded in it, or any trailing spaces, then you'll
934 need to use the "thin" format to select it.
936 The |g:netrw_browse_split| option, which is zero by default, may be used to
937 cause the opening of files to be done in a new window or tab instead of the
938 default. When the option is one or two, the splitting will be taken
939 horizontally or vertically, respectively. When the option is set to three, a
940 <cr> will cause the file to appear in a new tab.
943 When using the gui (gvim) one may select a file by pressing the <leftmouse>
944 button. In addtion, if
946 *|g:netrw_retmap| == 1 AND (its default value is 0)
947 * in a netrw-selected file, AND
948 * the user doesn't already have a <2-leftmouse> mapping defined before
951 then a doubly-clicked leftmouse button will return to the netrw browser
954 Netrw attempts to speed up browsing, especially for remote browsing where one
955 may have to enter passwords, by keeping and re-using previously obtained
956 directory listing buffers. The |g:netrw_fastbrowse| variable is used to
957 control this behavior; one may have slow browsing (no buffer re-use), medium
958 speed browsing (re-use directory buffer listings only for remote directories),
959 and fast browsing (re-use directory buffer listings as often as possible).
960 The price for such re-use is that when changes are made (such as new files
961 are introduced into a directory), the listing may become out-of-date. One may
962 always refresh directory listing buffers by pressing ctrl-L (see
966 Related topics: |netrw-o| |netrw-p| |netrw-P| |netrw-t| |netrw-v|
967 Associated setting variables: |g:netrw_browse_split| |g:netrw_fastbrowse|
968 |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
969 |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_cmd|
970 |g:netrw_ssh_browse_reject| |g:netrw_use_noswf|
973 BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2
975 Normally one enters a file or directory using the <cr>. However, the "o" map
976 allows one to open a new window to hold the new directory listing or file. A
977 horizontal split is used. (for vertical splitting, see |netrw-v|)
979 Normally, the o key splits the window horizontally with the new window and
980 cursor at the top. To change to splitting the window horizontally with the
981 new window and cursor at the bottom, have
985 in your <.vimrc>. (also see |netrw-t| |netrw-v|)
987 There is only one tree listing buffer; using "o" on a displayed subdirectory
988 will split the screen, but the same buffer will be shown twice.
990 Associated setting variables: |g:netrw_alto| |g:netrw_winsize|
993 BROWSING WITH A NEW TAB *netrw-t* {{{2
995 Normally one enters a file or directory using the <cr>. The "t" map
996 allows one to open a new window hold the new directory listing or file in a
997 new tab. (also see: |netrw-o| |netrw-v|)
1000 BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2
1002 Normally one enters a file or directory using the <cr>. However, the "v" map
1003 allows one to open a new window to hold the new directory listing or file. A
1004 vertical split is used. (for horizontal splitting, see |netrw-o|)
1006 Normally, the v key splits the window vertically with the new window and
1007 cursor at the left. To change to splitting the window vertically with the new
1008 window and cursor at the right, have
1010 let g:netrw_altv = 1
1012 in your <.vimrc>. (also see: |netrw-o| |netrw-t|)
1014 There is only one tree listing buffer; using "v" on a displayed subdirectory
1015 will split the screen, but the same buffer will be shown twice.
1017 Associated setting variable: |g:netrw_altv| |g:netrw_winsize|
1019 CHANGE LISTING STYLE *netrw-i* {{{2
1021 The "i" map cycles between the thin, long, wide, and tree listing formats.
1023 The short listing format gives just the files' and directories' names.
1025 The long listing is either based on the "ls" command via ssh for remote
1026 directories or displays the filename, file size (in bytes), and the time and
1027 date of last modification for local directories. With the long listing
1028 format, netrw is not able to recognize filenames which have trailing spaces.
1029 Use the thin listing format for such files.
1031 The wide listing format uses two or more contiguous spaces to delineate
1032 filenames; when using that format, netrw won't be able to recognize or use
1033 filenames which have two or more contiguous spaces embedded in the name or any
1034 trailing spaces. The thin listing format will, however, work with such files.
1035 This listing format is the most compact.
1037 The tree listing format has a top directory followed by files and directories
1038 preceded by a "|". One may open and close directories by pressing the <cr>
1039 key while atop the directory name. There is only one tree listing buffer;
1040 hence, using "v" or "o" on a subdirectory will only show the same buffer,
1043 Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen|
1044 |g:netrw_timefmt| |g:netrw_list_cmd|
1047 CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2
1049 To change directory back to a bookmarked directory, use
1053 Any count may be used to reference any of the bookmarks. See |netrw-mb| on
1054 how to bookmark a directory and |netrw-qb| on how to list bookmarks.
1057 CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2
1059 Every time you change to a new directory (new for the current session),
1060 netrw will save the directory in a recently-visited directory history
1061 list (unless g:netrw_dirhistmax is zero; by default, it's ten). With the
1062 "u" map, one can change to an earlier directory (predecessor). To do
1063 the opposite, see |netrw-U|.
1066 CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2
1068 With the "U" map, one can change to a later directory (successor).
1069 This map is the opposite of the "u" map. (see |netrw-u|) Use the
1070 q map to list both the bookmarks and history. (see |netrw-qb|)
1073 NETRW CLEAN *netrw-clean* *:NetrwClean*
1075 With :NetrwClean one may easily remove netrw from one's home directory;
1076 more precisely, from the first directory on your |'runtimepath'|.
1078 With :NetrwClean!, netrw will remove netrw from all directories on your
1081 With either form of the command, netrw will first ask for confirmation
1082 that the removal is in fact what you want to do. If netrw doesn't have
1083 permission to remove a file, it will issue an error message.
1086 CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler* {{{2
1087 (also see |netrw_filehandler|)
1089 Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
1090 best seen with a special handler (ie. a tool provided with your computer).
1091 Netrw allows one to invoke such special handlers by: >
1093 * when Exploring, hit the "x" key
1094 * when editing, hit gx with the cursor atop the special filename
1095 < (not available if the |g:netrw_nogx| variable exists)
1097 Netrw determines which special handler by the following method:
1099 * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
1100 view files. Examples of useful settings (place into your <.vimrc>): >
1102 :let g:netrw_browsex_viewer= "kfmclient exec"
1104 :let g:netrw_browsex_viewer= "gnome-open"
1106 If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
1107 invoked first (see |netrw_filehandler|).
1109 * for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
1110 * for Gnome (with gnome-open): gnome-open is used.
1111 * for KDE (with kfmclient) : kfmclient is used.
1112 * for Mac OS X : open is used.
1113 * otherwise the netrwFileHandler plugin is used.
1115 The file's suffix is used by these various approaches to determine an
1116 appropriate application to use to "handle" these files. Such things as
1117 OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
1118 *.eps) can be handled.
1122 The "x" map applies a function to a file, based on its extension. Of course,
1123 the handler function must exist for it to be called!
1126 NFH_html("scp://user@host/some/path/mypgm.html")
1128 Users may write their own netrw File Handler functions to support more
1129 suffixes with special handling. See <plugin/netrwFileHandlers.vim> for
1130 examples on how to make file handler functions. As an example: >
1132 " NFH_suffix(filename)
1133 fun! NFH_suffix(filename)
1134 ..do something special with filename..
1137 These functions need to be defined in some file in your .vim/plugin
1138 (vimfiles\plugin) directory. Vim's function names may not have punctuation
1139 characters (except for the underscore) in them. To support suffices that
1140 contain such characters, netrw will first convert the suffix using the
1143 @ -> AT ! -> EXCLAMATION % -> PERCENT
1144 : -> COLON = -> EQUAL ? -> QUESTION
1145 , -> COMMA - -> MINUS ; -> SEMICOLON
1146 $ -> DOLLAR + -> PLUS ~ -> TILDE
1150 file.rcs,v -> NFH_rcsCOMMAv()
1152 If more such translations are necessary, please send me email: >
1153 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
1156 Associated setting variable: |g:netrw_browsex_viewer|
1159 DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2
1161 If files have not been marked with |netrw-mf|: (local marked file list)
1163 Deleting/removing files and directories involves moving the cursor to the
1164 file/directory to be deleted and pressing "D". Directories must be empty
1165 first before they can be successfully removed. If the directory is a
1166 softlink to a directory, then netrw will make two requests to remove the
1167 directory before succeeding. Netrw will ask for confirmation before doing
1168 the removal(s). You may select a range of lines with the "V" command
1169 (visual selection), and then pressing "D".
1171 If files have been marked with |netrw-mf|: (local marked file list)
1173 Marked files (and empty directories) will be deleted; again, you'll be
1174 asked to confirm the deletion before it actually takes place.
1176 The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are
1177 used to control the attempts to remove files and directories. The
1178 g:netrw_rm_cmd is used with files, and its default value is:
1180 g:netrw_rm_cmd: ssh HOSTNAME rm
1182 The g:netrw_rmdir_cmd variable is used to support the removal of directories.
1183 Its default value is:
1185 g:netrw_rmdir_cmd: ssh HOSTNAME rmdir
1187 If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
1188 to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
1190 g:netrw_rmf_cmd: ssh HOSTNAME rm -f
1192 Associated setting variable: |g:netrw_local_rmdir| |g:netrw_rm_cmd|
1193 |g:netrw_rmdir_cmd| |g:netrw_ssh_cmd|
1196 *netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore*
1197 *netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore*
1198 DIRECTORY EXPLORATION COMMANDS {{{2
1200 :Explore[!] [dir]... Explore directory of current file *:Explore*
1201 :Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
1202 :Rexplore ... Return to Explorer *:Rexplore*
1203 :Sexplore[!] [dir]... Split&Explore directory of current file *:Sexplore*
1204 :Texplore [dir]... Tab & Explore *:Texplore*
1205 :Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
1207 Used with :Explore **/pattern : (also see |netrw-starstar|)
1208 :Nexplore............. go to next matching file *:Nexplore*
1209 :Pexplore............. go to previous matching file *:Pexplore*
1211 :Explore will open the local-directory browser on the current file's
1212 directory (or on directory [dir] if specified). The window will be
1213 split only if the file has been modified, otherwise the browsing
1214 window will take over that window. Normally the splitting is taken
1216 :Explore! is like :Explore, but will use vertical splitting.
1217 :Sexplore will always split the window before invoking the local-directory
1218 browser. As with Explore, the splitting is normally done
1220 :Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically.
1221 :Hexplore [dir] does an :Explore with |:belowright| horizontal splitting.
1222 :Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting.
1223 :Vexplore [dir] does an :Explore with |:leftabove| vertical splitting.
1224 :Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting.
1225 :Texplore [dir] does a tabnew before generating the browser window
1227 By default, these commands use the current file's directory. However, one
1228 may explicitly provide a directory (path) to use.
1230 The |g:netrw_winsize| variable also is used, if specified by the user, to
1231 size Hexplore and Vexplore windows.
1233 :Rexplore This command is a little different from the others. When one
1234 edits a file, for example by pressing <cr> when atop a file in
1235 a netrw browser window, :Rexplore will return the display to
1236 that of the last netrw browser window. Its a command version
1237 of <2-leftmouse> (which is only available under gvim and
1241 *netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat*
1242 EXPLORING WITH STARS AND PATTERNS
1244 When Explore, Sexplore, Hexplore, or Vexplore are used with one of the
1245 following four styles, Explore generates a list of files which satisfy
1248 */filepat files in current directory which satisfy filepat
1249 **/filepat files in current directory or below which satisfy the
1251 *//pattern files in the current directory which contain the
1252 pattern (vimgrep is used)
1253 **//pattern files in the current directory or below which contain
1254 the pattern (vimgrep is used)
1256 The cursor will be placed on the first file in the list. One may then
1257 continue to go to subsequent files on that list via |:Nexplore| or to
1258 preceding files on that list with |:Pexplore|. Explore will update the
1259 directory and place the cursor appropriately.
1263 will clear the explore list.
1265 If your console or gui produces recognizable shift-up or shift-down sequences,
1266 then you'll likely find using shift-downarrow and shift-uparrow convenient.
1267 They're mapped by netrw:
1269 <s-down> == Nexplore, and
1272 As an example, consider
1279 The status line will show, on the right hand side of the status line, a
1280 message like "Match 3 of 20".
1282 Associated setting variables: |g:netrw_keepdir| |g:netrw_browse_split|
1283 |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject|
1284 |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
1285 |g:netrw_ftp_timelist_cmd| |g:netrw_list_cmd|
1289 DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2
1291 With the cursor atop a filename, pressing "qf" will reveal the file's size
1292 and last modification timestamp. Currently this capability is only available
1296 EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2
1298 The "<ctrl-h>" map brings up a requestor allowing the user to change the
1299 file/directory hiding list. The hiding list consists of one or more patterns
1300 delimited by commas. Files and/or directories satisfying these patterns will
1301 either be hidden (ie. not shown) or be the only ones displayed (see
1304 Associated setting variable: |g:netrw_hide|
1307 EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2
1309 When "Sorted by" is name, one may specify priority via the sorting sequence
1310 (g:netrw_sort_sequence). The sorting sequence typically prioritizes the
1311 name-listing by suffix, although any pattern will do. Patterns are delimited
1312 by commas. The default sorting sequence is (all one line):
1314 '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,
1317 The lone * is where all filenames not covered by one of the other patterns
1318 will end up. One may change the sorting sequence by modifying the
1319 g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by
1322 Related topics: |g:netrw-s| |g:netrw-S|
1323 Associated setting variable: |g:netrw_sort_sequence|
1326 GOING UP *netrw--* {{{2
1328 To go up a directory, press "-" or press the <cr> when atop the ../ directory
1329 entry in the listing.
1331 Netrw will use the command in |g:netrw_list_cmd| to perform the directory
1332 listing operation after changing HOSTNAME to the host specified by the
1333 user-provided url. By default netrw provides the command as:
1335 ssh HOSTNAME ls -FLa
1337 where the HOSTNAME becomes the [user@]hostname as requested by the attempt to
1338 read. Naturally, the user may override this command with whatever is
1339 preferred. The NetList function which implements remote browsing
1340 expects that directories will be flagged by a trailing slash.
1343 HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2
1345 Netrw's browsing facility allows one to use the hiding list in one of three
1346 ways: ignore it, hide files which match, and show only those files which
1349 If no files have been marked via |netrw-mf|:
1351 The "a" map allows the user to cycle through the three hiding modes.
1353 The |g:netrw_list_hide| variable holds a comma delimited list of patterns
1354 based on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list.
1355 (also see |netrw-ctrl-h|) To set the hiding list, use the <c-h> map. As an
1356 example, to hide files which begin with a ".", one may use the <c-h> map to
1357 set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*'
1358 in one's <.vimrc>). One may then use the "a" key to show all files, hide
1359 matching files, or to show only the matching files.
1362 This hiding list command will hide/show all *.c and *.h files.
1365 This hiding list command will also hide/show all *.c and *.h
1368 Don't forget to use the "a" map to select the mode (normal/hiding/show) you
1371 If files have been marked using |netrw-mf|, then this command will:
1373 if showing all files or non-hidden files:
1374 modify the g:netrw_list_hide list by appending the marked files to it
1375 and showing only non-hidden files.
1377 else if showing hidden files only:
1378 modify the g:netrw_list_hide list by removing the marked files from it
1379 and showing only non-hidden files.
1383 As a quick shortcut, one may press >
1385 to toggle between hiding files which begin with a period (dot) or not.
1387 Associated setting variable: |g:netrw_list_hide|
1390 IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2
1392 Especially with the remote directory browser, constantly entering the password
1395 For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength
1396 tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip
1397 for setting up no-password ssh and scp and discusses associated security
1398 issues. It used to be available at http://hacks.oreilly.com/pub/h/66 ,
1399 but apparently that address is now being redirected to some "hackzine".
1400 I'll attempt a summary:
1402 1. Generate a public/private key pair on the ssh server:
1404 (saving the file in ~/.ssh/id_rsa is ok)
1405 2. Just hit the <CR> when asked for passphrase (twice).
1406 3. This creates two files:
1413 scp {serverhostname}:.ssh/id_rsa.pub .
1414 cat id_rsa.pub >> .ssh/authorized_keys2
1416 For Windows, folks on the vim mailing list have mentioned that Pageant helps
1417 with avoiding the constant need to enter the password.
1419 Kingston Fung wrote about another way to avoid constantly needing to enter
1422 In order to avoid the need to type in the password for scp each time, you
1423 provide a hack in the docs to set up a non password ssh account. I found a
1424 better way to do that: I can use a regular ssh account which uses a
1425 password to access the material without the need to key-in the password
1426 each time. It's good for security and convenience. I tried ssh public key
1427 authorization + ssh-agent, implementing this, and it works! Here are two
1428 links with instructions:
1430 http://www.ibm.com/developerworks/library/l-keyc2/
1431 http://sial.org/howto/openssh/publickey-auth/
1434 LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2
1436 Pressing "qb" (query bookmarks) will list the bookmarked directories and
1437 directory traversal history (query).
1439 (see |netrw-mb|, |netrw-gb|, |netrw-u|, and |netrw-U|)
1442 MAKING A NEW DIRECTORY *netrw-d* {{{2
1444 With the "d" map one may make a new directory either remotely (which depends
1445 on the global variable g:netrw_mkdir_cmd) or locally (which depends on the
1446 global variable g:netrw_local_mkdir). Netrw will issue a request for the new
1447 directory's name. A bare <CR> at that point will abort the making of the
1448 directory. Attempts to make a local directory that already exists (as either
1449 a file or a directory) will be detected, reported on, and ignored.
1451 Associated setting variable: |g:netrw_local_mkdir| |g:netrw_mkdir_cmd|
1454 MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* {{{2
1456 By default, |g:netrw_keepdir| is 1. This setting means that the current
1457 directory will not track the browsing directory.
1459 Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory to
1460 track netrw's browsing directory.
1462 However, given the default setting for g:netrw_keepdir of 1 where netrw
1463 maintains its own separate notion of the current directory, in order to make
1464 the two directories the same, use the "c" map (just type c). That map will
1465 set Vim's notion of the current directory to netrw's current browsing
1468 Associated setting variable: |g:netrw_keepdir|
1471 MARKED FILES: ARBITRARY COMMAND *netrw-mx* {{{2
1472 (See |netrw-mf| and |netrw-mr| for how to mark files)
1473 (uses the local marked-file list)
1475 Upon activation of the "mx" map, netrw will query the user for some command to
1476 be applied to all marked files. All %s in the command will be substituted
1477 with the name of a marked file. If no %s are in the command, then the command
1478 will be followed by a space and a marked filename.
1481 MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2
1482 (See |netrw-mf| and |netrw-mr| for how to mark files)
1483 (uses the local marked file list)
1485 If any marked files are compressed, then "mz" will decompress them.
1486 If any marked files are decompressed, then "mz" will compress them
1487 using the command specified by |g:netrw_compress|; by default,
1490 For decompression, netrw provides a |Dictionary| of suffices and their
1491 associated decompressing utilities; see |g:netrw_decompress|.
1493 Associated setting variables: |g:netrw_compress| |g:netrw_decompress|
1495 MARKED FILES: COPYING *netrw-mc* {{{2
1496 (See |netrw-mf| and |netrw-mr| for how to mark files)
1497 (Uses the global marked file list)
1499 Select a target directory with mt (|netrw-mt|). Then change directory,
1500 select file(s) (see |netrw-mf|), and press "mc".
1502 Associated setting variable: |g:netrw_localcopycmd| |g:netrw_ssh_cmd|
1504 MARKED FILES: DIFF *netrw-md* {{{2
1505 (See |netrw-mf| and |netrw-mr| for how to mark files)
1506 (uses the global marked file list)
1508 Use |vimdiff| to visualize difference between selected files (two or
1509 three may be selected for this). Uses the global marked file list.
1511 MARKED FILES: EDITING *netrw-me* {{{2
1512 (See |netrw-mf| and |netrw-mr| for how to mark files)
1513 (uses the global marked file list)
1515 This command will place the marked files on the |arglist| and commence
1516 editing them. One may return the to explorer window with |:Rexplore|.
1518 MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2
1519 (See |netrw-mf| and |netrw-mr| for how to mark files)
1520 (uses the local marked file list)
1522 This command extracts the suffices of the marked files and toggles their
1523 presence on the hiding list. Please note that marking the same suffix
1524 this way multiple times will result in the suffix's presence being toggled
1525 for each file (so an even quantity of marked files having the same suffix
1526 is the same as not having bothered to select them at all).
1528 Related topics: |netrw-a| |g:netrw_list_hide|
1530 MARKED FILES: MOVING *netrw-mm* {{{2
1531 (See |netrw-mf| and |netrw-mr| for how to mark files)
1532 (uses the global marked file list)
1534 Select a target directory with mT (|netrw-mt|). Then change directory,
1535 select file(s) (see |netrw-mf|), and press "mm".
1537 Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|
1539 MARKED FILES: PRINTING *netrw-mp* {{{2
1540 (See |netrw-mf| and |netrw-mr| for how to mark files)
1541 (uses the local marked file list)
1543 Netrw will apply the |:hardcopy| command to marked files. What it does
1544 is open each file in a one-line window, execute hardcopy, then close the
1548 MARKED FILES: SOURCING *netrw-ms* {{{2
1549 (See |netrw-mf| and |netrw-mr| for how to mark files)
1550 (uses the local marked file list)
1552 Netrw will source the marked files (using vim's |:source| command)
1555 MARKED FILES: TAGGING *netrw-mT* {{{2
1556 (See |netrw-mf| and |netrw-mr| for how to mark files)
1557 (uses the global marked file list)
1559 The "mt" mapping will apply the command in |g:netrw_ctags| (by default, its
1560 "ctags") to marked files. For remote browsing, in order to create a tags file
1561 netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for
1562 this to work on remote systems. For your local system, see |ctags| on how to
1563 get a version. I myself use hdrtags, currently available at
1564 http://mysite.verizon.net/astronaut/src/index.html , and have >
1566 let g:netrw_ctags= "hdrtag"
1570 When a remote set of files are tagged, the resulting tags file is "obtained";
1571 ie. a copy is transferred to the local system's directory. The local tags
1572 file is then modified so that one may use it through the network. The
1573 modification is concerns the names of the files in the tags; each filename is
1574 preceded by the netrw-compatible url used to obtain it. When one subsequently
1575 uses one of the go to tag actions (|tags|), the url will be used by netrw to
1576 edit the desired file and go to the tag.
1578 Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd|
1581 MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2
1582 (See |netrw-mf| and |netrw-mr| for how to mark files)
1584 Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
1586 * if the cursor is atop a file name, then the netrw window's currently
1587 displayed directory is used for the copy/move-to target.
1589 * also, if the cursor is in the banner, then the netrw window's currently
1590 displayed directory is used for the copy/move-to target.
1592 * however, if the cursor is atop a directory name, then that directory is
1593 used for the copy/move-to target
1595 There is only one copy/move-to target per vim session; ie. the target is a
1596 script variable (see |s:var|) and is shared between all netrw windows (in an
1599 MARKED FILES: UNMARKING *netrw-mu* {{{2
1600 (See |netrw-mf| and |netrw-mr| for how to mark files)
1602 The "mu" mapping will unmark all currently marked files.
1605 MARKING FILES *netrw-mf* {{{2
1606 (also see |netrw-mr|)
1608 One may mark files with the cursor atop a filename and then pressing "mf".
1609 With gvim, one may also mark files with <s-leftmouse>. The following netrw
1610 maps make use of marked files:
1612 |netrw-a| Hide marked files/directories
1613 |netrw-D| Delete marked files/directories
1614 |netrw-mc| Copy marked files to target
1615 |netrw-md| Apply vimdiff to marked files
1616 |netrw-me| Edit marked files
1617 |netrw-mm| Move marked files
1618 |netrw-mp| Print marked files
1619 |netrw-mt| Set target for |netrw-mm| and |netrw-mc|
1620 |netrw-mT| Generate tags using marked files
1621 |netrw-mx| Apply shell command to marked files
1622 |netrw-mz| Compress/Decompress marked files
1623 |netrw-O| Obtain marked files
1624 |netrw-R| Rename marked files
1626 One may unmark files one at a time the same way one marks them; ie. place
1627 the cursor atop a marked file and press "mf". This process also works
1628 with <s-leftmouse> using gvim. One may unmark all files by pressing
1629 "mu" (see |netrw-mu|).
1631 *markfilelist* *global_markfilelist* *local_markfilelist*
1632 All marked files are entered onto the global marked file list; there is only
1633 one such list. In addition, every netrw buffer also has its own local marked
1634 file list; since netrw buffers are associated with specific directories, this
1635 means that each directory has its own local marked file list. The various
1636 commands which operate on marked files use one or the other of the marked file
1640 MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
1641 (also see |netrw-mf|)
1643 One may also mark files by pressing "mr"; netrw will then issue a prompt,
1644 "Enter regexp: ". You may then enter a regular expression such as \.c$ .
1645 All files in the current directory will then be marked. Note that the
1646 regular expressions are vim-style |regexp| ones, not shell ones. So
1647 entering *.c probably isn't what you want!
1650 NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2
1652 (if you're interestd in the netrw file transfer settings, see |netrw-options|)
1654 The <netrw.vim> browser provides settings in the form of variables which
1655 you may modify; by placing these settings in your <.vimrc>, you may customize
1656 your browsing preferences. (see also: |netrw-settings|)
1661 < *g:netrw_alto* change from above splitting to below splitting
1662 by setting this variable (see |netrw-o|)
1663 default: =&sb (see |'sb'|)
1665 *g:netrw_altv* change from left splitting to right splitting
1666 by setting this variable (see |netrw-v|)
1667 default: =&spr (see |'spr'|)
1669 *g:netrw_browse_split* when browsing, <cr> will open the file by:
1670 =0: re-using the same window
1671 =1: horizontally splitting the window first
1672 =2: vertically splitting the window first
1673 =3: open file in new tab
1674 =4: act like "P" (ie. open previous window)
1676 *g:netrw_browsex_viewer* specify user's preference for a viewer: >
1681 < is used, then netrwFileHandler() will look for
1682 a script/function to handle the given
1683 extension. (see |netrw_filehandler|).
1685 *g:netrw_cd_escape* ="[]#*$%'\" ?`!&();<>\\"
1686 This option is used to escape directory names
1687 before changing directory to them.
1689 *g:netrw_compress* ="gzip"
1690 Will compress marked files with this
1693 *g:netrw_decompress* = { ".gz" : "gunzip" ,
1694 ".bz2" : "bunzip2" ,
1697 A dictionary mapping suffices to
1698 decompression programs.
1700 *g:netrw_fastbrowse* =0: slow speed browsing, never re-use
1701 directory listings; always obtain
1703 =1: medium speed browsing, re-use directory
1704 listings only when remote browsing.
1706 =2: fast browsing, only obtains directory
1707 listings when the directory hasn't been
1708 seen before (or |netrw-ctrl-l| is used).
1709 Fast browsing retains old directory listing
1710 buffers so that they don't need to be
1711 re-acquired. This feature is especially
1712 important for remote browsing. However, if
1713 a file is introduced or deleted into or from
1714 such directories, the old directory buffer
1715 becomes out-of-date. One may always refresh
1716 such a directory listing with |netrw-ctrl-l|.
1717 This option gives the choice of the trade-off
1718 between accuracy and speed to the user.
1720 *g:netrw_fname_escape* =' ?&;%'
1721 Used on filenames before remote reading/writing
1723 *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
1724 that can show up as "directories" and "files"
1725 in the listing. This pattern is used to
1726 remove such embedded messages. By default its
1729 ^Trying\s\+\d\+.*$\|
1730 ^KERBEROS_V\d rejected\|
1731 ^Security extensions not\|
1733 : connect to address [0-9a-fA-F:]*
1734 : No route to host$'
1736 *g:netrw_ftp_list_cmd* options for passing along to ftp for directory
1738 unix or g:netrw_cygwin set: : "ls -lF"
1742 *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory
1743 listing, sorted by size of file.
1745 unix or g:netrw_cygwin set: : "ls -slF"
1748 *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory
1749 listing, sorted by time of last modification.
1751 unix or g:netrw_cygwin set: : "ls -tlF"
1754 *g:netrw_glob_escape* ='[]*?`{~$'
1755 These characters in directory names are
1756 escaped before applying glob()
1758 *g:netrw_hide* if true, the hiding list is used
1761 *g:netrw_keepdir* =1 (default) keep current directory immune from
1762 the browsing directory.
1763 =0 keep the current directory the same as the
1765 The current browsing directory is contained in
1766 b:netrw_curdir (also see |netrw-c|)
1768 *g:netrw_list_cmd* command for listing remote directories
1769 default: (if ssh is executable)
1770 "ssh HOSTNAME ls -FLa"
1772 *g:netrw_liststyle* Set the default listing style:
1773 = 0: thin listing (one file per line)
1774 = 1: long listing (one file per line with time
1775 stamp information and file size)
1776 = 2: wide listing (multiple files in columns)
1777 = 3: tree style listing
1778 *g:netrw_list_hide* comma separated pattern list for hiding files
1779 Patterns are regular expressions (see |regexp|)
1780 Example: let g:netrw_list_hide= '.*\.swp$'
1783 *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin
1785 Copies marked files (|netrw-mf|) to target
1786 directory (|netrw-mt|, |netrw-mc|)
1788 *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin
1790 Moves marked files (|netrw-mf|) to target
1791 directory (|netrw-mt|, |netrw-mm|)
1793 *g:netrw_local_mkdir* command for making a local directory
1796 *g:netrw_local_rmdir* remove directory command (rmdir)
1799 *g:netrw_maxfilenamelen* =32 by default, selected so as to make long
1800 listings fit on 80 column displays.
1801 If your screen is wider, and you have file
1802 or directory names longer than 32 bytes,
1803 you may set this option to keep listings
1806 *g:netrw_mkdir_cmd* command for making a remote directory
1807 default: "ssh USEPORT HOSTNAME mkdir"
1809 *g:netrw_retmap* if it exists and is set to one, then
1810 <2-leftmouse> will be mapped for easy
1811 return to the netrw browser window.
1812 (example: click once to select and open
1813 a file, double-click to return)
1816 *g:netrw_rm_cmd* command for removing files
1817 default: "ssh USEPORT HOSTNAME rm"
1819 *g:netrw_rmdir_cmd* command for removing directories
1820 default: "ssh USEPORT HOSTNAME rmdir"
1822 *g:netrw_rmf_cmd* command for removing softlinks
1823 default: "ssh USEPORT HOSTNAME rm -f"
1825 *g:netrw_sort_by* sort by "name", "time", or "size"
1828 *g:netrw_sort_direction* sorting direction: "normal" or "reverse"
1831 *g:netrw_sort_sequence* when sorting by name, first sort by the
1832 comma-separated pattern sequence
1833 default: '[\/]$,*,\.bak$,\.o$,\.h$,
1834 \.info$,\.swp$,\.obj$'
1836 *g:netrw_special_syntax* If true, then certain files will be shown
1837 in special syntax in the browser:
1840 netrwCompress: *.gz *.bz2 *.Z *.zip
1843 netrwLib : *.a *.so *.lib *.dll
1844 netrwMakefile: [mM]akefile *.mak
1845 netrwObj : *.o *.obj
1846 netrwTags : tags ANmenu ANtags
1848 netrwTmp : tmp* *tmp
1850 These syntax highlighting groups are linked
1851 to Folded or DiffChange by default
1852 (see |hl-Folded| and |hl-DiffChange|), but
1853 one may put lines like >
1854 hi link netrwCompress Visual
1855 < into one's <.vimrc> to use one's own
1858 *g:netrw_ssh_cmd* One may specify an executable command
1859 to use instead of ssh for remote actions
1860 such as listing, file removal, etc.
1863 *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines,
1864 messages, banners, and whatnot that one doesn't
1865 want masquerading as "directories" and "files".
1866 Use this pattern to remove such embedded
1867 messages. By default its value is:
1871 *g:netrw_tmpfile_escape* =' &;'
1872 escape() is applied to all temporary files
1873 to escape these characters.
1875 *g:netrw_timefmt* specify format string to vim's strftime().
1876 The default, "%c", is "the preferred date
1877 and time representation for the current
1878 locale" according to my manpage entry for
1879 strftime(); however, not all are satisfied
1880 with it. Some alternatives:
1882 " %a %Y-%m-%d %I-%M-%S %p"
1885 *g:netrw_use_noswf* netrw normally avoids writing swapfiles
1886 for browser buffers. However, under some
1887 systems this apparently is causing nasty
1888 ml_get errors to appear; if you're getting
1889 ml_get errors, try putting
1890 let g:netrw_use_noswf= 0
1893 *g:netrw_winsize* specify initial size of new windows made with
1894 "o" (see |netrw-o|), "v" (see |netrw-v|),
1895 |:Hexplore| or |:Vexplore|.
1898 *g:NetrwTopLvlMenu* This variable specifies the top level
1899 menu name; by default, it's "Netrw.". If
1900 you wish to change this, do so in your
1903 NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* {{{2
1905 Netrw has been designed to handle user options by saving them, setting the
1906 options to something that's compatible with netrw's needs, and then restoring
1907 them. However, the autochdir option: >
1909 is problematical. Autochdir sets the current directory to that containing the
1910 file you edit; this apparently also applies to directories. In other words,
1911 autochdir sets the current directory to that containing the "file" (even if
1912 that "file" is itself a directory).
1914 NETRW SETTINGS *netrw-settings* {{{2
1916 With the NetrwSettings.vim plugin, >
1918 will bring up a window with the many variables that netrw uses for its
1919 settings. You may change any of their values; when you save the file, the
1920 settings therein will be used. One may also press "?" on any of the lines for
1921 help on what each of the variables do.
1923 (also see: |netrw-browser-var| |netrw-protocol| |netrw-var| |netrw-variables|)
1926 ==============================================================================
1927 OBTAINING A FILE *netrw-O* {{{2
1929 If there are no marked files:
1931 When browsing a remote directory, one may obtain a file under the cursor
1932 (ie. get a copy on your local machine, but not edit it) by pressing the O
1935 If there are marked files:
1937 The marked files will be obtained (ie. a copy will be transferred to your
1938 local machine, but not set up for editing).
1940 Only ftp and scp are supported for this operation (but since these two are
1941 available for browsing, that shouldn't be a problem). The status bar will
1942 then show, on its right hand side, a message like "Obtaining filename". The
1943 statusline will be restored after the transfer is complete.
1945 Netrw can also "obtain" a file using the local browser. Netrw's display
1946 of a directory is not necessarily the same as Vim's "current directory",
1947 unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select
1948 a file using the local browser (by putting the cursor on it) and pressing
1949 "O" will then "obtain" the file; ie. copy it to Vim's current directory.
1952 * To see what the current directory is, use |:pwd|
1953 * To make the currently browsed directory the current directory, see |netrw-c|
1954 * To automatically make the currently browsed directory the current
1955 directory, see |g:netrw_keepdir|.
1958 PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2
1960 One may use a preview window by using the "p" key when the cursor is atop the
1961 desired filename to be previewed. The display will then split to show both
1962 the browser (where the cursor will remain) and the file (see |:pedit|).
1963 By default, the split will be taken horizontally; one may use vertical
1964 splitting if one has set |g:netrw_preview| first.
1967 PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2
1969 To edit a file or directory in the previously used window (see :he |CTRL-W_P|),
1970 press a "P". If there's only one window, then the one window will be
1971 horizontally split (above/below splitting is controlled by |g:netrw_alto|,
1972 and its initial size is controlled by |g:netrw_winsize|).
1974 If there's more than one window, the previous window will be re-used on
1975 the selected file/directory. If the previous window's associated buffer
1976 has been modified, and there's only one window with that buffer, then
1977 the user will be asked if s/he wishes to save the buffer first (yes,
1981 REFRESHING THE LISTING *netrw-ctrl-l* *netrw-ctrl_l* {{{2
1983 To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
1984 hit the <cr> when atop the ./ directory entry in the listing. One may also
1985 refresh a local directory by using ":e .".
1988 RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2
1990 If there are no marked files: (see |netrw-mf|)
1992 Renaming/moving files and directories involves moving the cursor to the
1993 file/directory to be moved (renamed) and pressing "R". You will then be
1994 queried for where you want the file/directory to be moved. You may select
1995 a range of lines with the "V" command (visual selection), and then
1998 If there are marked files: (see |netrw-mf|)
2000 Marked files will be renamed (moved). You will be queried as above in
2001 order to specify where you want the file/directory to be moved.
2003 The g:netrw_rename_cmd variable is used to implement renaming. By default its
2008 One may rename a block of files and directories by selecting them with
2009 the V (|linewise-visual|).
2012 REVERSING SORTING ORDER *netrw-r* *netrw-reverse* {{{2
2014 One may toggle between normal and reverse sorting order by pressing the
2017 Related topics: |g:netrw-s|
2018 Associated setting variable: |g:netrw_sort_direction|
2021 SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2
2023 One may select the sorting style by name, time, or (file) size. The "s" map
2024 allows one to circulate amongst the three choices; the directory listing will
2025 automatically be refreshed to reflect the selected style.
2027 Related topics: |g:netrw-r| |g:netrw-S|
2028 Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
2031 10. Problems and Fixes *netrw-problems* {{{1
2033 (This section is likely to grow as I get feedback)
2034 (also see |netrw-debug|)
2036 P1. I use windows 95, and my ftp dumps four blank lines at the
2039 See |netrw-fixup|, and put the following into your
2042 let g:netrw_win95ftp= 1
2045 P2. I use Windows, and my network browsing with ftp doesn't sort by
2046 time or size! -or- The remote system is a Windows server; why
2047 don't I get sorts by time or size?
2049 Windows' ftp has a minimal support for ls (ie. it doesn't
2050 accept sorting options). It doesn't support the -F which
2051 gives an explanatory character (ABC/ for "ABC is a directory").
2052 Netrw then uses "dir" to get both its short and long listings.
2053 If you think your ftp does support a full-up ls, put the
2054 following into your <.vimrc>: >
2056 let g:netrw_ftp_list_cmd = "ls -lF"
2057 let g:netrw_ftp_timelist_cmd= "ls -tlF"
2058 let g:netrw_ftp_sizelist_cmd= "ls -slF"
2060 Alternatively, if you have cygwin on your Windows box, put
2061 into your <.vimrc>: >
2063 let g:netrw_cygwin= 1
2065 This problem also occurs when the remote system is Windows.
2066 In this situation, the various g:netrw_ftp_[time|size]list_cmds
2067 are as shown above, but the remote system will not correctly
2068 modify its listing behavior.
2072 P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw
2073 used ssh! That wasn't what I asked for...
2075 Netrw has two methods for browsing remote directories: ssh
2076 and ftp. Unless you specify ftp specifically, ssh is used.
2077 When it comes time to do download a file (not just a directory
2078 listing), netrw will use the given protocol to do so.
2081 P4. I would like long listings to be the default.
2083 Put the following statement into your |.vimrc|: >
2085 let g:netrw_liststyle= 1
2087 Check out |netrw-browser-var| for more customizations that
2091 P5. My times come up oddly in local browsing
2093 Does your system's strftime() accept the "%c" to yield dates
2094 such as "Sun Apr 27 11:49:23 1997"? If not, do a "man strftime"
2095 and find out what option should be used. Then put it into
2098 let g:netrw_timefmt= "%X" (where X is the option)
2101 P6. I want my current directory to track my browsing.
2104 Put the following line in your |.vimrc|:
2106 let g:netrw_keepdir= 0
2109 P7. I use Chinese (or other non-ascii) characters in my filenames, and
2110 netrw (Explore, Sexplore, Hexplore, etc) doesn't display them!
2112 (taken from an answer provided by Wu Yongwei on the vim
2114 I now see the problem. You code page is not 936, right? Vim
2115 seems only able to open files with names that are valid in the
2116 current code page, as are many other applications that do not
2117 use the Unicode version of Windows APIs. This is an OS-related
2118 issue. You should not have such problems when the system
2119 locale uses UTF-8, such as modern Linux distros.
2121 (...it is one more reason to recommend that people use utf-8!)
2124 P8. I'm getting "ssh is not executable on your system" -- what do I
2127 (Dudley Fox) Most people I know use putty for windows ssh. It
2128 is a free ssh/telnet application. You can read more about it
2131 http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also:
2133 (Marlin Unruh) This program also works for me. It's a single
2134 executable, so he/she can copy it into the Windows\System32
2135 folder and create a shortcut to it.
2137 (Dudley Fox) You might also wish to consider plink, as it
2138 sounds most similar to what you are looking for. plink is an
2139 application in the putty suite.
2141 http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink
2143 (Vissale Neang) Maybe you can try OpenSSH for windows, which
2144 can be obtained from:
2146 http://sshwindows.sourceforge.net/
2148 It doesn't need the full Cygwin package.
2150 (Antoine Mechelynck) For individual Unix-like programs needed
2151 for work in a native-Windows environment, I recommend getting
2152 them from the GnuWin32 project on sourceforge if it has them:
2154 http://gnuwin32.sourceforge.net/
2156 Unlike Cygwin, which sets up a Unix-like virtual machine on
2157 top of Windows, GnuWin32 is a rewrite of Unix utilities with
2158 Windows system calls, and its programs works quite well in the
2161 (dave) Download WinSCP and use that to connect to the server.
2162 In Preferences > Editors, set gvim as your editor:
2165 - Set External Editor (adjust path as needed, include
2166 the quotes and !.! at the end):
2167 "c:\Program Files\Vim\vim70\gvim.exe" !.!
2168 - Check that the filetype in the box below is
2169 {asterisk}.{asterisk} (all files), or whatever types
2170 you want (cec: change {asterisk} to * ; I had to
2171 write it that way because otherwise the helptags
2172 system thinks it's a tag)
2173 - Make sure it's at the top of the listbox (click it,
2174 then click "Up" if it's not)
2175 If using the Norton Commander style, you just have to hit <F4>
2176 to edit a file in a local copy of gvim.
2178 (Vit Gottwald) How to generate public/private key and save
2179 public key it on server: >
2180 http://www.tartarus.org/~simon/puttydoc/Chapter8.html#pubkey-gettingready
2181 8.3 Getting ready for public key authentication
2183 How to use a private key with 'pscp': >
2185 http://www.tartarus.org/~simon/puttydoc/Chapter5.html
2186 5.2.4 Using public key authentication with PSCP
2188 (Ben Schmidt) I find the ssh included with cwRsync is
2189 brilliant, and install cwRsync or cwRsyncServer on most
2190 Windows systems I come across these days. I guess COPSSH,
2191 packed by the same person, is probably even better for use as
2192 just ssh on Windows, and probably includes sftp, etc. which I
2193 suspect the cwRsync doesn't, though it might
2195 (cec) To make proper use of these suggestions above, you will
2196 need to modify the following user-settable variables in your
2199 |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd|
2200 |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd|
2202 The first one (|g:netrw_ssh_cmd|) is the most important; most
2203 of the others will use the string in g:netrw_ssh_cmd by
2205 *netrw-p9* *netrw-ml_get*
2206 P9. I'm browsing, changing directory, and bang! ml_get errors
2207 appear and I have to kill vim. Any way around this?
2209 Normally netrw attempts to avoid writing swapfiles for
2210 its temporary directory buffers. However, on some systems
2211 this attempt appears to be causing ml_get errors to
2212 appear. Please try setting |g:netrw_use_noswf| to 0
2214 let g:netrw_use_noswf= 0
2217 P10. I'm being pestered with "[something] is a directory" and
2218 "Press ENTER or type command to continue" prompts...
2220 The "[something] is a directory" prompt is issued by Vim,
2221 not by netrw, and there appears to be no way to work around
2222 it. Coupled with the default cmdheight of 1, this message
2223 causes the "Press ENTER..." prompt. So: read |hit-enter|;
2224 I also suggest that you set your |'cmdheight'| to 2 (or more) in
2228 P11. I want to have two windows; a thin one on the left and my editing
2229 window on the right. How can I do this?
2231 * Put the following line in your <.vimrc>:
2232 let g:netrw_altv = 1
2233 * Edit the current directory: :e .
2234 * Select some file, press v
2235 * Resize the windows as you wish (see |ctrl-w_<| and
2236 |ctrl-w_>|). If you're using gvim, you can drag
2237 the separating bar with your mouse.
2238 * When you want a new file, use ctrl-w h to go back to the
2239 netrw browser, select a file, then press P (see |ctrl-w_h|
2240 and |netrw-P|). If you're using gvim, you can press
2241 <leftmouse> in the browser window and then press the
2242 <middlemouse> to select the file.
2244 ==============================================================================
2245 11. Debugging Netrw Itself *netrw-debug* {{{1
2247 The <netrw.vim> script is typically available as:
2249 /usr/local/share/vim/vim6x/plugin/netrwPlugin.vim
2250 /usr/local/share/vim/vim6x/autoload/netrw.vim
2252 /usr/local/share/vim/vim7x/plugin/netrwPlugin.vim
2253 /usr/local/share/vim/vim7x/autoload/netrw.vim
2255 which is loaded automatically at startup (assuming :set nocp).
2257 1. Get the <Decho.vim> script, available as:
2259 http://mysite.verizon.net/astronaut/vim/index.html#DECHO
2261 http://vim.sourceforge.net/scripts/script.php?script_id=120
2263 It now comes as a "vimball"; if you're using vim 7.0 or earlier,
2264 you'll need to update vimball, too. See
2265 http://mysite.verizon.net/astronaut/vim/index.html#VIMBALL
2267 2. Edit the <netrw.vim> file by typing: >
2273 To restore to normal non-debugging behavior, re-edit <netrw.vim>
2280 This command, provided by <Decho.vim>, will comment out all
2281 Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()).
2283 3. Then bring up vim and attempt to evoke the problem by doing a
2284 transfer or doing some browsing. A set of messages should appear
2285 concerning the steps that <netrw.vim> took in attempting to
2286 read/write your file over the network in a separate tab.
2288 To save the file, use >
2292 < Please send that information to <netrw.vim>'s maintainer, >
2293 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
2295 ==============================================================================
2296 12. History *netrw-history* {{{1
2298 v123: Feb 27, 2008 * Marked files now keeps a "global" marked file
2299 list. The global marked file list is used to
2300 support tag processing and vimdiff'ing
2301 (|netrw-md| |netrw-mt|)
2302 * Been insuring that mm and mc works with various
2303 combinations of local and remote directories
2304 * (Stefan Bittner) http://.../ should always have
2305 filetype "html" -- fixed.
2306 * (Stefan Bittner) a "?" in a http://.../ request
2307 wasn't being handled correctly. Fixed by
2308 removing ? from default |g:netrw_tmpfile_escape|.
2309 * (Nico Weber) % codes in http://.../ requests
2310 weren't being handled correctly. Fixed by
2311 including % in default |g:netrw_fname_escape|.
2312 * (Stefan Bittner) attempts to update Buffers.Refresh
2313 were failing because locale use changed the menu
2314 names. I implemented a workaround.
2315 v122: Feb 12, 2008 * bugfix - first sorting sequence match now has
2317 Feb 14, 2008 * bugfix - sorting sequence was effectively ignoring
2318 sequencing priority of anything following '*'
2319 * toggling a marked file was showing incorrect list
2320 (list was correct, but displayed matches weren't)
2321 * |g:netrw_special_syntax| implemented
2322 v121: Feb 11, 2008 * Bram M reported that :e file ... :e . would not
2323 retain the alternate file. Fixed -- I hope!
2324 * bugfix -- apparently v120 broke an explicit
2326 v120: Jan 21, 2008 * |netrw-mt| changed to allow for target selection
2327 based on whether or not word under cursor is a
2328 directory or file, or if cursor is in banner
2330 * |netrw-mh| included (hiding by marked-file suffix)
2331 * functions moved about a bit (improved
2333 * executable files now displayed with trailing (*)
2334 * symbolically linked files now displayed with
2336 * Somewhen, s:NetrwMarkFileMove() got damaged. Its
2337 now restored (missing an endif, for example).
2338 * |netrw-mu| implemented (unmarking marked files)
2339 * many bugs have been removed from the marked file
2340 system (tnx to Mark S. for feedback)
2341 * |netrw-ms| implemented (sourcing marked files)
2342 * fixed use of P with tree listing style
2343 * multiple tree listing now supported
2345 * changed q -> qb (query bookmarks)
2346 * implemented |netrw-qf|
2347 * Explore now has four special list-generation
2348 modes: */filepat **/filepat
2349 *//pattern **//pattern
2350 * gh (|netrw-gh|) is a shortcut for toggling the
2351 hiding of files and directories beginning with a
2353 v119: Jan 10, 2008 * When g:netrw_keepdir is false,
2354 NetrwOptionsRestore() had a problem
2356 Jan 11, 2008 * Netrw now shows symbolic links with a trailing
2357 "@" and special highlighting.
2358 Jan 15, 2008 * Changed g:netrw_noretmap -> |g:netrw_retmap|.
2359 Changed: disabled by default at Bram's
2361 v118: Jan 02, 2008 * Fixed a problem with Windows;
2362 :Explore c:/path/ would not work,
2363 but :Explore c:/path would.
2364 * Fixed a bug in s:NetrwOptionRestore() - lcd's
2365 argument wasn't being properly escaped so it
2366 wouldn't handle spaces in directory names.
2368 v117: Jan 02, 2008 * Fixed a problem with P; had to include
2369 a b:netrw_curdir bypass (Bram Moolenaar)
2370 v116: Nov 27, 2007 * netrw#LocalBrowseCheck() has &ft=="netrw"
2371 check to prevent doing a directory listing
2372 (was getting unexpected directory refreshes
2373 in the middle of some function calls)
2374 * NetrwOptionRestore moved after e! filename
2375 in order to retain user options for editing
2376 in s:NetrwBrowseChgDir()
2377 Dec 12, 2007 * Bug fix -- netrw does a better job of retaining
2378 user options when editing files under the aegis
2380 v115: Oct 04, 2007 * Erik Remmelzwaal pointed out that the use of
2381 shellslash in s:GetTempfile() was incorrect
2382 Oct 11, 2007 * Tracked down and eliminated a bug with editing
2383 remote *.tar.gz and *.tar.bz2 files
2384 Oct 11, 2007 * g:netrw_localmovecmd wasn't being initialized
2385 properly, and g:netrw_localcopycmd was being
2387 Oct 12, 2007 * Placed all :Rexplore and <2-leftmouse> setup
2388 in a new support function (s:SetRexDir()).
2389 Oct 15, 2007 * new: g:netrw_browse_split == 4; means <cr>
2390 based selection will use previous window
2391 Oct 20, 2007 * also checks on |'shellxquote'| to set g:netrw_shq
2392 Oct 24, 2007 * Explore handles path/**/filename
2393 Oct 27, 2007 * sourcing remote files often didn't work with ftp,
2394 turns out that b:netrw_method was undefined, so
2395 s:SaveBufVars and s:RestoreBufVars() fixed it.
2396 v114: Sep 28, 2007 * mT, the map that invokes tags, has been improved
2397 to support use of remote tags files.
2398 Oct 02, 2007 * changed Netrw menu to use more submenus
2399 v113: Sep 07, 2007 * worked out why the cursor position wasn't being
2400 saved and restored as intended after doing such
2401 things as deleting and renaming files.
2402 Sep 11, 2007 * Fixed bug which effectively disabled <c-l> and
2404 Sep 18, 2007 * there used to be one NetrwOptionRestore() call at
2405 the end of the s:NetrwBrowseChgDir() function;
2406 they're now at the end of every if..elseif..else
2407 block. The edit-a-file one is not quite at the end
2408 of its block; instead, its just before the edit.
2409 Restores user options, then this new placement
2410 allows ftplugins, autocmds, etc to change settings
2411 (ex. ftplugin/cpp.vim sets cindent).
2412 Sep 19, 2007 * changed all strlen() calls to use s:Strlen(), a
2413 function which handles utf-8 wide characters
2415 Sep 20, 2007 * (Nico Weber) the "x" command has been extended
2416 to Mac's OS/X (macunix); it now uses open to
2417 handle |netrw-x| browsing with special files.
2418 Sep 22, 2007 * Added |g:netrw_noretmap| to netrw at Tony M's
2420 * Included path to NetrwRemoteRmFile()
2421 v112: Aug 18, 2007 * added mx (|netrw-mx|) for executing arbitrary
2422 commands on marked files
2423 Aug 22, 2007 * more option save/restore work for
2424 s:NetrwBrowseChgDir(); s:NetrwOptionSave()
2425 and s:NetrwOptionRestore() now take a parameter
2426 specifying the type of variables to be used for
2427 saving and restoring (either "w:" or "s:")
2428 Sep 04, 2007 * added the :NetrwClean[!] command
2429 v111: Jul 25, 2007 * using Windows but not using Cygwin, netrw does a
2430 "file bufname" where the bufname uses /s
2431 instead of \s; Vim "fixes" it by changing the
2432 bufname to use \s anyway. This meant that
2433 NetrwGetBuffer() didn't find the appropriately
2434 named buffer, and so would generate a new
2435 buffer listing; hence the cursor would appear
2436 to have been moved when doing a preview.
2437 * added <2-leftmouse> map to return to netrw's
2439 Aug 16, 2007 * added the mark-file system, including
2440 maps for mf mp mt mz and mu. Modifications
2441 made to maps for a D O and R to support
2443 v110: May 10, 2007 * added [ and ] maps to NetrwTreeListing
2444 May 25, 2007 * |g:netrw_preview| included
2445 May 29, 2007 * modifed netrw#NetBrowseX to consistently use
2446 |g:netrw_shq| instead of hardcoded quotes,
2447 and modified the snippet that sets up redir
2448 so Windows machines use "nul" instead of
2450 Jun 01, 2007 * fixed bug -- NetGetBuffer() wasn't always
2451 recognizing a buffer name match when it should,
2452 thus resulting in [Scratch] buffers.
2453 Jun 04, 2007 * Gary Johnson found a bugfix for the "c" mapping
2454 when the directory is to be made current but
2455 the name contains spaces.
2456 v109: Mar 26, 2007 * if a directory name includes a "$" character,
2457 Explore() will use expand() in an attempt to
2459 May 07, 2007 * g:netrw_use_errorwindow now allows one to
2460 have error messages go to a reliable window
2461 or to use a less reliable but recallable
2463 May 07, 2007 * g:netrw_scpport and g:netrw_sshport support
2464 use of -P and -p, respectively, to set port
2466 v108: Jan 03, 2007 * included preview map (|netrw-p|), supporting
2468 * netrw can now source remote files
2469 Jan 26, 2007 * Colton Jamieson noted that remote directory
2470 browsing did not support alternate port
2471 selection. This feature has now been extended
2472 to apply to all remote browsing commands via ssh.
2473 (list, remove/delete, rename)
2474 Jan 31, 2007 * Luis Florit reported that @* was an invalid
2475 register. The @* register is now only saved and
2476 restored if |'guioptions'| contains "a".
2477 Feb 02, 2007 * Fixed a bug that cropped up when writing files
2478 via scp using cygwin
2479 Feb 08, 2007 * tree listing mode managed to stop working again;
2481 Feb 15, 2007 * Guido Van Hoecke reported that netrw didn't
2482 handle browsing well with M$ ftp servers. He even
2483 set up a temporary account for me to test with
2484 (thanks!). Netrw now can browse M$ ftp servers.
2485 v107: Oct 12, 2006 * bypassed the autowrite option
2486 Oct 24, 2006 * handles automatic decompression of *.gz and *.bz2
2488 Nov 03, 2006 * Explore will highlight matching files when
2489 **/pattern is used (and if the |'hls'| option
2491 Nov 09, 2006 * a debugging line, when enabled, was inadvertently
2492 bringing up help instead of simply reporting on
2494 Nov 21, 2006 * tree listing improved (cursor remains put)
2495 Nov 27, 2006 * fixed b:netrw_curdir bug when repeated "i"s were
2497 Dec 15, 2006 * considerable qty of changes, mostly to share more
2498 code between local and remote browsing. Includes
2499 support for tree-style listing for both remote
2501 Dec 15, 2006 * Included Peter Bengtsson's modifications to
2503 v106: Sep 21, 2006 * removed old v:version<700 code as netrw now
2505 * worked around a bug where register * was
2506 overwritten during local browsing
2507 v104: Sep 05, 2006 * as suggested by Rodolfo Borges, :Explore and
2508 variants will position the cursor on the file
2509 just having been edited
2510 * changed default |g:netrw_sort_sequence| order
2511 * changed b, Nb to simply mb (see |netrw-mb|)
2512 * changed B, NB to simply gb (see |netrw-gb|)
2513 * tree listing style (see |g:netrw_liststyle|)
2514 * attempts to retain the alternate file
2515 v103: Jul 26, 2006 * used Yakov Lerner's tip#1289 to improve netrw
2516 error message display
2517 * wide listings didn't handle files with backslashes
2518 in their names properly. A symptom was an
2519 inability to open files.
2520 Aug 09, 2006 * included "t" mapping for opening tabbed windows,
2521 both for remote and local browsing
2522 * changed netrw_longlist to netrw_liststyle
2523 Aug 15, 2006 * fixed one of the NB maps
2524 Aug 22, 2006 * changed *Explore commands to use -nargs=* instead
2525 of -nargs=?. Allows both -complete=dir _and_ the
2526 starstar arguments to work (-nargs=? seems to
2527 require one or the other).
2528 Aug 23, 2006 * copied all w:.. variables across splits to
2530 Aug 25, 2006 * when g:netrw_browsex_viewer was '-'
2531 (see |g:netrw_browsex_viewer|) it wasn't causing
2532 netrwFileHandlers#Invoke() to be called as it
2533 was expected to. (tnx Steve Dugaro)
2534 Aug 29, 2006 * changed NetBrowseX() to use "setlocal ... noswf"
2535 instead of "set ... noswf" (tnx Benji Fisher)
2536 Aug 31, 2006 * tabs and fastbrowse<=1 didn't work together.
2537 v102: Jun 15, 2006 * chgd netrwPlugin to call netrw#LocalBrowseCheck()
2538 * bugfix: g:netrw_keepdir==0 had stopped working
2539 Jul 06, 2006 * bugfix: NetOptionSave/Restore now saves/restores
2540 the unnamed register (|registers|)
2541 Jul 07, 2006 * |g:netrw_menu| support included
2542 Jul 13, 2006 * :Texplore command implemented
2543 Jul 17, 2006 * NetSplit and (Local|Net)BrowseChgDir() were both
2544 splitting windows. This affected o, v, and
2545 g:netrw_browse_split.
2546 Jul 20, 2006 * works around wildignore setting (was causing
2547 netrw's local browser not to list wildignore'd
2549 Jul 24, 2006 * <leftmouse> acts as a <cr> for selecting a file
2550 <rightmouse> acts as a <del> for deleting a file
2551 v100: May 14, 2006 * when using Windows and shell==cmd.exe, the
2552 default for g:netrw_ignorenetrc is now 1
2553 * bugfix: unwanted ^Ms now removed
2554 (affected shell==cmd.exe - Windows)
2555 * added Bookmarks and History to the menu
2556 * an error message about non-existing
2557 w:netrw_longlist was appearing during attempts to
2559 * g:netrw_shq now available to make netrw use
2560 specified style of quotes for commands
2561 May 29, 2006 * user NFH_*() functions were inadvertently being
2563 * fixed a Windows non-cygwin ftp handling problem.
2564 * hiding pattern candidate separators included some
2565 characters it shouldn't have (tnx to Osei Poku)
2566 Jun 01, 2006 * for browsing, netrw was supposed to use "dir"
2567 instead of "ls -lF" when using
2568 ftp+non-cygwin+windows. Fixed.
2569 * an inadvertently left-in-place debugging statement
2570 was preventing use of the "x" key with browsing.
2571 Jun 05, 2006 * g:netrw_nogx available to prevent making the gx
2572 map (see |g:netrw_nogx|)
2573 * bugfix, Explore wouldn't change directory
2574 properly (vim ., :Explore subdirname)
2575 Jun 06, 2006 * moved history to 2nd line in Netrw menu
2576 * fixed delete for unix-based systems
2577 Jun 07, 2006 * x key now works for windows-noncygwin-ftp
2578 Jun 08, 2006 * Explore */pat and **//pat now wraps
2579 v99: May 09, 2006 * g:netrw_browse_split=3 for opening files in new
2581 May 12, 2006 * deletes temporary file at end of NetRead()
2582 * visual mode based Obtain implemented
2583 * added -complete=dir to the various Explore
2585 v98: May 02, 2006 * the "p" key didn't work properly when the browsing
2586 directory name had spaces in it.
2587 v97: May 01, 2006 * exists("&acd") now used to determine if
2588 the 'acd' option exists
2589 * "obtain" now works again under Windows
2590 v96: * bugfix - the |'acd'| option is not always defined
2591 but is now bypassed only when it is
2592 v95: * bugfix - Hiding mode worked correctly (don't show
2593 any file matching any of the g:netrw_hide
2594 patterns), but showing mode was showing only those
2595 files that didn't match any of the g:netrw_hide
2596 patterns. Instead, it now shows all files that
2597 match any of the g:netrw_hide patterns (the
2598 difference between a logical and and logical or).
2599 v94: * bugfix - a Decho() had a missing quote; only
2600 affects things when debugging was enabled.
2601 v93: * bugfix - removed FocusGained event from causing a
2602 slow-browser refresh for Windows
2603 v92: * :Explore **//pattern implemented
2604 (**/filepattern was already taken)
2605 v91: * :Explore */pattern implemented
2606 * |'acd'| option bypassed
2607 v90: * mark ', as suggested by Yegappan Lakshmanan, used
2608 to help guarantee entry into the jump list when
2610 * <s-down> and <s-up> are no longer defined until a
2611 :Explore **/pattern is used (if the user already
2612 has a map for them). They will be defined for new
2613 browser windows from that point forward.
2614 v89: * A <s-down>, <s-up>, :Nexplore, or a :Pexplore
2615 without having first done an :Explore **/pattern
2616 (see |netrw-starstar|) caused
2617 a lot of unhelpful error messages to appear
2618 v88: * moved DrChip.Netrw menu to Netrw. Now has
2619 priority 80 by default.
2620 g:NetrwTopLvlMenu == "Netrw" and can be changed
2621 by the user to suit. The priority is given by
2622 g:NetrwMenuPriority.
2623 * Changed filetype for browser displays from
2625 v87: * bug fix -- menus were partially disappearing
2626 v85: * bug fix -- missing an endif
2627 * bug fix -- handles spaces in names and directories
2628 when using ftp-based browsing
2629 v83: * disabled stop-acd handling; the change in directory
2630 handling may allow acd to be used again.
2631 * D was refusing to delete remote files/directories
2632 in wide listing mode.
2633 v81: * FocusGained also used to refresh/wipe local browser
2635 * (bugfix) netrw was leaving [Scratch] buffers behind
2636 when the user had the "hidden" option set. The
2637 'hidden' option is now bypassed.
2638 v80: * ShellCmdPost event used in conjunction with
2639 g:netrw_fastbrowse to refresh/wipe local browser
2641 v79: * directories are now displayed with nowrap
2642 * (bugfix) if the column width was smaller than the
2643 largest file's name, then netrw would hang when
2644 using wide-listing mode - fixed
2645 * g:netrw_fastbrowse introduced
2646 v78: * progress has been made on allowing spaces inside
2647 directory names for remote work (reading, writing,
2649 v77: * Mikolaj Machowski fixed a bug in a substitute cmd
2650 * g:netrw_browsex_viewer implemented
2651 * Mikolaj Machowski pointed out that gnome-open is
2652 often executable under KDE systems, although it is
2653 effectively not functional. NetBrowseX now looks
2654 for "kicker" as a running process to determine if
2655 KDE is actually running.
2656 * Explorer's O functionality was inadvertently left
2657 out. Netrw now does the same thing, but with the
2659 * added g:netrw_browse_split option
2660 * fixed a bug where the directory contained a "." but
2661 the file didn't (was treating the dirname from "."
2662 onwards as a suffix)
2663 v76: * "directory is missing" error message now restores
2665 v75: * file://... now conforms to RFC2396 (thanks to
2667 * if the binary option is set, then NetWrite() will
2668 only write the whole file (line numbers don't make
2669 sense with this). Supports writing of tar and zip
2671 v74: * bugfix (vim, then :Explore) now works
2672 * ctrl-L keeps cursor at same screen location (both
2673 local and remote browsing)
2674 * netrw now can read remote zip and tar files
2675 * Obtain now uses WinXP ftp+.netrc successfully
2676 v73: * bugfix -- scp://host/path/file was getting named
2678 * netrw detects use of earlier-than-7.0 version of
2679 vim and issues a pertinent error message.
2680 * netrwSettings.vim is now uses autoloading. Only
2681 <netrwPlugin.vim> is needed as a pure plugin
2682 (ie. always loaded).
2683 v72: * bugfix -- formerly, one could prevent the loading
2684 of netrw by "let g:loaded_netrw=1"; when
2685 autoloading became supported, this feature was
2686 lost. It is now restored.
2687 v71: * bugfix -- made some "set nomodifiable"s into
2688 setlocal variants (allows :e somenewfile to be
2689 modifiable as usual)
2690 * NetrwSettings calls a netrw function, thereby
2691 assuring that netrw has loaded. However, if netrw
2692 does not load for whatever reason, then
2693 NetrwSettings will now issue a warning message.
2694 * For what reason I don't recall, when wget and fetch
2695 are both not present, and an attempt to read a
2696 http://... url is made, netrw exited. It now only
2698 * When ch=1, on the second and subsequent uses of
2699 browsing Netrw would issue a blank line to clear
2700 the echo'd messages. This caused an annoying
2701 "Hit-Enter" prompt; now a blank line message
2702 is echo'd only if &ch>1.
2703 v70: * when using |netrw-O|, the "Obtaining filename"
2704 message is now shown using |hl-User9|. If User9
2705 has not been defined, netrw itself will define it.
2706 v69: * Bugfix: win95/98 machines were experiencing a
2707 "E121: Undefined variable: g:netrw_win95ftp"
2709 v68: * double-click-leftmouse selects word under mouse
2710 v67: * Passwords which contain blanks will now be
2711 surrounded by double-quotes automatically (Yongwei)
2712 v66: * Netrw now seems to work with a few more Windows
2714 * O now obtains a file: remote browsing
2715 file -> local copy, locally browsing
2716 file -> current directory (see :pwd)
2717 * i now cycles between thin, long, and wide listing
2719 * NB and Nb are maps that are always available;
2720 corresponding B and b maps are only available when
2721 not using wide listing in order to allow them to
2723 v65: * Browser functions now use NetOptionSave/Restore; in
2724 particular, netrw now works around the report
2726 v64: * Bugfix - browsing a "/" directory (Unix) yielded
2727 buffers named "[Scratch]" instead of "/"
2728 * Bugfix - remote browsing with ftp was omitting
2730 v63: * netrw now takes advantage of autoload (needs 7.0)
2731 * Bugfix - using r (to reverse sort) working again
2732 v62: * Bugfix - spaces allowed again in directory names
2733 with g:netrw_keepdir=0. In fact, I've tested netrw
2734 with most ANSI punctuation marks for directory
2736 * Bugfix - NetrwSettings gave errors when
2737 g:netrw_silent had not be set.
2738 v61: * Document upgrade -- netrw variable-based settings
2739 all should have tags. Supports NetrwSettings cmd.
2740 * Several important variables are window-oriented.
2741 Netrw has to transfer these across a window split.
2742 See s:BufWinVars() and s:UseBufWinVars().
2743 v60: * When using the i map to switch between long and
2744 short listings, netrw will now keep cursor on same
2746 * "Match # of #" now uses status line
2747 * :Explore **/*.c will now work from a
2748 non-netrw-browser window
2749 * :Explore **/patterns can now be run in separate
2751 * active banner (hit <cr> will cause various things
2753 v59: * bugfix -- another keepalt work-around installed
2755 * "Match # of #" for Explore **/pattern matches
2756 v58: * Explore and relatives can now handle
2757 **/somefilepattern (v7)
2758 * Nexplore and Pexplore introduced (v7). shift-down
2759 and shift-up cursor keys will invoke Nexplore and
2760 Pexplore, respectively.
2761 * bug fixed with o and v
2762 * autochdir only worked around for vim when it has
2763 been compiled with either
2764 |+netbeans_intg| or |+sun_workshop|
2765 * Under Windows, all directories and files were
2766 being preceded with a "/" when local browsing.
2768 * When: syntax highlighting is off, laststatus=2, and
2769 remote browsing is used, sometimes the laststatus
2770 highlighting bleeds into the entire display. Work
2771 around - do an extra redraw in that case.
2772 * Bugfix: when g:netrw_keepdir=0, due to re-use of
2773 buffers, netrw didn't change the directory when it
2775 * Bugfix: D and R commands work again
2776 v57: * Explore and relatives can now handle RO files
2777 * reverse sort restored with vim7's sort command
2778 * g:netrw_keepdir now being used to keep the current
2779 directory unchanged as intended (sense change)
2780 * vim 6.3 still supported
2781 v56: * LocalBrowse now saves autochdir setting, unsets it,
2782 and restores it before returning.
2783 * using vim's rename() instead of system +
2784 local_rename variable
2785 * avoids changing directory when g:netrw_keepdir is
2787 v55: * -bar used with :Explore :Sexplore etc to allow
2788 multiple commands to be separated by |s
2789 * browser listings now use the "nowrap" option
2790 * browser: some unuseful error messages now
2792 v54: * For backwards compatibility, Explore and Sexplore
2793 have been implemented. In addition, Hexplore and
2794 Vexplore commands are available, too.
2795 * <amatch> used instead of <afile> in the
2796 transparency support (BufReadCmd, FileReadCmd,
2798 * ***netrw*** prepended to various error messages
2800 * g:netrw_port used instead of b:netrw_port for scp
2801 * any leading [:#] is removed from port numbers
2802 v53: * backslashes as well as slashes placed in various
2803 patterns (ex. g:netrw_sort_sequence) to better
2805 v52: * nonumber'ing now set for browsing buffers
2806 * when the hiding list hid all files, error messages
2808 * when browsing, swf is set, but directory is not
2809 set, when netrw was attempting to restore options,
2810 vim wanted to save a swapfile to a local directory
2811 using an url-style path. Fixed
2812 v51: * cygwin detection now automated
2813 (using windows and &shell is bash)
2814 * customizable browser "file" rejection patterns
2816 * :[range]w url now supported (ie. netrw uses a
2818 * error messages have a "Press <cr> to continue" to
2819 allow them to be seen
2820 * directory browser displays no longer bother the
2822 * u/U commands to go up and down the history stack
2823 * history stack may be saved with viminfo with it's
2825 * bugfixes associated with unwanted [No Files]
2827 v50: * directories now displayed using buftype=nofile;
2828 should keep the directory names as-is
2829 * attempts to remove empty "[No File]" buffers
2830 leftover from :file ..name.. commands
2831 * bugfix: a "caps-lock" editing difficulty left in
2833 * syntax highlighting for "Showing:" the hiding list
2835 * bookmarks can now be retained if "!" is in the
2837 v49: * will use ftp for http://.../ browsing
2838 v48: * One may use ftp to do remote host file browsing
2839 * (windows and !cygwin) remote browsing with ftp can
2840 now use the "dir" command internally to provide
2842 * g:netrw_keepdir now allows one to keep the initial
2843 current directory as the current directory
2844 (normally the local file browser makes the
2845 currently viewed directory the current directory)
2846 * g:netrw_alto and g:netrw_altv now support
2847 alternate placement of windows started with o or v
2848 * Nread ? and Nwrite ? now uses echomsg (instead of
2849 echo) so :messages can repeat showing the help
2850 * bugfix: avoids problems with partial matches of
2851 directory names to prior buffers with longer names
2852 * one can suppress error messages with g:netrw_quiet
2854 * instead of <Leader>h for editing hiding list one
2855 may edit the sorting sequence with the S map, which
2856 now allows confirmation of deletion with
2857 [y(es) n(o) a(ll) q(uit)]
2858 * the "x" map now handles special file viewing with:
2859 (windows) rundll32 url.dll (gnome) gnome-open (kde)
2860 kfmclient If none of these are on the executable
2861 path, then netrwFileHandlers.vim is used.
2862 * directory bookmarking during both local and remote
2863 browsing implemented
2864 * one may view all, use the hiding list to suppress,
2865 or use the hiding list to show-only remote and
2866 local file/directory listings
2867 * improved unusual file and directory name handling
2868 preview window support
2869 v47: * now handles local browsing.
2870 v46: * now handles remote browsing
2871 * g:netrw_silent (if 1) will cause all transfers to
2873 v45: * made the [user@]hostname:path form a bit more
2874 restrictive to better handle errors in using
2875 protocols (e.g. scp:usr@host:file was being
2876 recognized as an rcp request)
2877 v44: * changed from "rsync -a" to just "rsync"
2878 * somehow an editing error messed up the test to
2879 recognize use of the fetch method for NetRead.
2880 * more debugging statements included
2881 v43: * moved "Explanation" comments to <pi_netrw.txt> help
2882 file as "Network Reference" (|netrw-ref|)
2883 * <netrw.vim> now uses Dfunc() Decho() and Dret() for
2885 * removed superfluous NetRestorePosn() calls
2886 v42: * now does BufReadPre and BufReadPost events on
2887 file:///* and file://localhost/*
2888 v41: * installed file:///* and file://localhost/* handling
2889 v40: * prevents redraw when a protocol error occurs so
2890 that the user may see it
2892 v38: * Now uses NetRestorePosn() calls with Nread/Nwrite
2894 * Temporary files now removed via bwipe! instead of
2895 bwipe (thanks to Dave Roberts)
2896 v37: * Claar's modifications which test if ftp is
2897 successful, otherwise give an error message
2898 * After a read, the alternate file was pointing to
2899 the temp file. The temp file buffer is now wiped
2901 * removed silent from transfer methods so user can
2902 see what's happening
2905 ==============================================================================
2906 12. Credits *netrw-credits* {{{1
2908 Vim editor by Bram Moolenaar (Thanks, Bram!)
2909 dav support by C Campbell
2910 fetch support by Bram Moolenaar and C Campbell
2911 ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM>
2912 http support by Bram Moolenaar <bram@moolenaar.net>
2914 rsync support by C Campbell (suggested by Erik Warendorph)
2915 scp support by raf <raf@comdyn.com.au>
2916 sftp support by C Campbell
2918 inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell
2920 Jérôme Augé -- also using new buffer method with ftp+.netrc
2921 Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use,
2923 Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution
2924 Erik Warendorph -- for several suggestions (g:netrw_..._cmd
2925 variables, rsync etc)
2926 Doug Claar -- modifications to test for success with ftp
2929 ==============================================================================
2931 vim:tw=78:ts=8:ft=help:norl:fdm=marker