1 *pi_netrw.txt* For Vim version 7.2. Last change: 2009 Dec 28
3 -----------------------------------------------------
4 NETRW REFERENCE MANUAL by Charles E. Campbell, Jr.
5 -----------------------------------------------------
6 Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM>
7 (remove NOSPAM from Campbell's email first)
9 Copyright: Copyright (C) 2009 Charles E Campbell, Jr *netrw-copyright*
10 Permission is hereby granted to use and distribute this code, with
11 or without modifications, provided that this copyright notice is
12 copied with it. Like anything else that's free, netrw.vim,
13 netrwPlugin.vim, netrwFileHandlers.vim, netrwSettings.vim,
14 syntax/netrw.vim, and pi_netrw.txt are provided *as is* and comes
15 with no warranty of any kind, either expressed or implied. No
16 guarantees of merchantability. No guarantees of suitability for
17 any purpose. By using this plugin, you agree that in no event will
18 the copyright holder be liable for any damages resulting from the
22 *dav* *ftp* *netrw-file* *Nread* *rcp* *scp*
23 *davs* *http* *netrw.vim* *Nsource* *rsync* *sftp*
24 *fetch* *netrw* *network* *Nwrite*
26 ==============================================================================
27 1. Contents *netrw-contents* {{{1
29 1. Contents.............................................|netrw-contents|
30 2. Starting With Netrw..................................|netrw-start|
31 3. Netrw Reference......................................|netrw-ref|
32 EXTERNAL APPLICATIONS AND PROTOCOLS................|netrw-externapp|
33 READING............................................|netrw-read|
34 WRITING............................................|netrw-write|
35 SOURCING...........................................|netrw-source|
36 DIRECTORY LISTING..................................|netrw-dirlist|
37 CHANGING THE USERID AND PASSWORD...................|netrw-chgup|
38 VARIABLES AND SETTINGS.............................|netrw-variables|
39 PATHS..............................................|netrw-path|
40 4. Network-Oriented File Transfer.......................|netrw-xfer|
41 NETRC..............................................|netrw-netrc|
42 PASSWORD...........................................|netrw-passwd|
43 5. Activation...........................................|netrw-activate|
44 6. Transparent File Editing.............................|netrw-transparent|
45 7. Ex Commands..........................................|netrw-ex|
46 8. Variables and Options................................|netrw-var|
47 9. Browsing.............................................|netrw-browse|
48 Introduction To Browsing...........................|netrw-intro-browse|
49 Quick Reference: Maps..............................|netrw-browse-maps|
50 Quick Reference: Commands..........................|netrw-browse-cmds|
51 Bookmarking A Directory............................|netrw-mb|
52 Browsing...........................................|netrw-cr|
53 Browsing With A Horizontally Split Window..........|netrw-o|
54 Browsing With A New Tab............................|netrw-t|
55 Browsing With A Vertically Split Window............|netrw-v|
56 Change Listing Style.(thin wide long tree).........|netrw-i|
57 Changing To A Bookmarked Directory.................|netrw-gb|
58 Changing To A Predecessor Directory................|netrw-u|
59 Changing To A Successor Directory..................|netrw-U|
60 Customizing Browsing With A User Function..........|netrw-x|
61 Deleting Bookmarks.................................|netrw-mB|
62 Deleting Files Or Directories......................|netrw-D|
63 Directory Exploring Commands.......................|netrw-explore|
64 Exploring With Stars and Patterns..................|netrw-star|
65 Displaying Information About File..................|netrw-qf|
66 Edit File Or Directory Hiding List.................|netrw-ctrl-h|
67 Editing The Sorting Sequence.......................|netrw-S|
68 Going Up...........................................|netrw--|
69 Hiding Files Or Directories........................|netrw-a|
70 Improving Browsing.................................|netrw-ssh-hack|
71 Listing Bookmarks And History......................|netrw-qb|
72 Making A New Directory.............................|netrw-d|
73 Making The Browsing Directory The Current Directory|netrw-c|
74 Marking Files......................................|netrw-mf|
75 Marking Files By Regular Expression................|netrw-mr|
76 Marked Files: Arbitrary Command....................|netrw-mx|
77 Marked Files: Compression And Decompression........|netrw-mz|
78 Marked Files: Copying..............................|netrw-mc|
79 Marked Files: Diff.................................|netrw-md|
80 Marked Files: Editing..............................|netrw-me|
81 Marked Files: Grep.................................|netrw-mg|
82 Marked Files: Hiding and Unhiding by Suffix........|netrw-mh|
83 Marked Files: Moving...............................|netrw-mm|
84 Marked Files: Printing.............................|netrw-mp|
85 Marked Files: Sourcing.............................|netrw-ms|
86 Marked Files: Tagging..............................|netrw-mT|
87 Marked Files: Setting the Target Directory.........|netrw-mt|
88 Marked Files: Unmarking............................|netrw-mu|
89 Netrw Browser Variables............................|netrw-browser-var|
90 Netrw Browsing And Option Incompatibilities........|netrw-incompatible|
91 Netrw Settings.....................................|netrw-settings|
92 Obtaining A File...................................|netrw-O|
93 Preview Window.....................................|netrw-p|
94 Previous Window....................................|netrw-P|
95 Refreshing The Listing.............................|netrw-ctrl-l|
96 Renaming Files Or Directories......................|netrw-move|
97 Reversing Sorting Order............................|netrw-r|
98 Selecting Sorting Style............................|netrw-s|
99 Setting Editing Window.............................|netrw-C|
100 10. Problems and Fixes...................................|netrw-problems|
101 11. Debugging Netrw Itself...............................|netrw-debug|
102 12. History..............................................|netrw-history|
103 13. Todo.................................................|netrw-todo|
104 14. Credits..............................................|netrw-credits|
106 {Vi does not have any of this}
108 ==============================================================================
109 2. Starting With Netrw *netrw-start* {{{1
111 Netrw makes reading files, writing files, browsing over a network, and
112 local browsing easy! First, make sure that you have plugins enabled, so
113 you'll need to have at least the following in your <.vimrc>:
114 (or see |netrw-activate|) >
116 set nocp " 'compatible' is not set
117 filetype plugin on " plugins are enabled
119 (see |'cp'| and |:filetype-plugin-on|)
121 Netrw supports "transparent" editing of files on other machines using urls
122 (see |netrw-transparent|). As an example of this, let's assume you have an
123 account on some other machine; if you can use scp, try: >
125 vim scp://hostname/path/to/file
127 Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|!
129 So, what if you have ftp, not ssh/scp? That's easy, too; try >
131 vim ftp://hostname/path/to/file
133 Want to make ftp simpler to use? See if your ftp supports a file called
134 <.netrc> -- typically it goes in your home directory, has read/write
135 permissions for only the user to read (ie. not group, world, other, etc),
136 and has lines resembling >
138 machine HOSTNAME login USERID password "PASSWORD"
139 machine HOSTNAME login USERID password "PASSWORD"
141 default login USERID password "PASSWORD"
143 Now about browsing -- when you just want to look around before editing a
144 file. For browsing on your current host, just "edit" a directory: >
147 vim /home/userid/path
149 For browsing on a remote host, "edit" a directory (but make sure that
150 the directory name is followed by a "/"): >
153 vim ftp://hostname/path/to/dir/
155 See |netrw-browse| for more!
157 There are more protocols supported by netrw than just scp and ftp, too: see the
158 next section, |netrw-externapp|, on how to use these external applications with
163 If you want to use plugins, but for some reason don't wish to use netrw, then
164 you need to avoid loading both the plugin and the autoload portions of netrw.
165 You may do so by placing the following two lines in your <.vimrc>: >
167 :let g:loaded_netrw = 1
168 :let g:loaded_netrwPlugin = 1
171 ==============================================================================
172 3. Netrw Reference *netrw-ref* {{{1
174 Netrw supports several protocols in addition to scp and ftp as mentioned
175 in |netrw-start|. These include dav, fetch, http,... well, just look
176 at the list in |netrw-externapp|. Each protocol is associated with a
177 variable which holds the default command supporting that protocol.
179 EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2
181 Protocol Variable Default Value
182 -------- ---------------- -------------
183 dav: *g:netrw_dav_cmd* = "cadaver" if cadaver is executable
184 dav: g:netrw_dav_cmd = "curl -o" elseif curl is available
185 fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available
186 ftp: *g:netrw_ftp_cmd* = "ftp"
187 http: *g:netrw_http_cmd* = "elinks" if elinks is available
188 http: g:netrw_http_cmd = "links" elseif links is available
189 http: g:netrw_http_cmd = "curl" elseif curl is available
190 http: g:netrw_http_cmd = "wget" elseif wget is available
191 http: g:netrw_http_cmd = "fetch" elseif fetch is available
192 rcp: *g:netrw_rcp_cmd* = "rcp"
193 rsync: *g:netrw_rsync_cmd* = "rsync -a"
194 scp: *g:netrw_scp_cmd* = "scp -q"
195 sftp: *g:netrw_sftp_cmd* = "sftp"
197 *g:netrw_http_xcmd* : the option string for http://... protocols are
198 specified via this variable and may be independently overridden. By
199 default, the option arguments for the http-handling commands are: >
207 For example, if your system has elinks, and you'd rather see the
208 page using an attempt at rendering the text, you may wish to have >
209 let g:netrw_http_xcmd= "-dump >"
213 READING *netrw-read* *netrw-nread* {{{2
215 Generally, one may just use the url notation with a normal editing
218 :e ftp://[user@]machine/path
220 Netrw also provides the Nread command:
223 :Nread "machine:path" uses rcp
224 :Nread "machine path" uses ftp w/ <.netrc>
225 :Nread "machine id password path" uses ftp
226 :Nread "dav://machine[:port]/path" uses cadaver
227 :Nread "fetch://[user@]machine/path" uses fetch
228 :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
229 :Nread "http://[user@]machine/path" uses http uses wget
230 :Nread "rcp://[user@]machine/path" uses rcp
231 :Nread "rsync://[user@]machine[:port]/path" uses rsync
232 :Nread "scp://[user@]machine[[:#]port]/path" uses scp
233 :Nread "sftp://[user@]machine/path" uses sftp
235 WRITING *netrw-write* *netrw-nwrite* {{{2
237 One may just use the url notation with a normal file writing
240 :w ftp://[user@]machine/path
242 Netrw also provides the Nwrite command:
245 :Nwrite "machine:path" uses rcp
246 :Nwrite "machine path" uses ftp w/ <.netrc>
247 :Nwrite "machine id password path" uses ftp
248 :Nwrite "dav://machine[:port]/path" uses cadaver
249 :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
250 :Nwrite "rcp://[user@]machine/path" uses rcp
251 :Nwrite "rsync://[user@]machine[:port]/path" uses rsync
252 :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp
253 :Nwrite "sftp://[user@]machine/path" uses sftp
256 SOURCING *netrw-source* {{{2
258 One may just use the url notation with the normal file sourcing
261 :so ftp://[user@]machine/path
263 Netrw also provides the Nsource command:
266 :Nsource "dav://machine[:port]/path" uses cadaver
267 :Nsource "fetch://[user@]machine/path" uses fetch
268 :Nsource "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
269 :Nsource "http://[user@]machine/path" uses http uses wget
270 :Nsource "rcp://[user@]machine/path" uses rcp
271 :Nsource "rsync://[user@]machine[:port]/path" uses rsync
272 :Nsource "scp://[user@]machine[[:#]port]/path" uses scp
273 :Nsource "sftp://[user@]machine/path" uses sftp
275 DIRECTORY LISTING *netrw-dirlist* {{{2
277 One may browse a directory to get a listing by simply attempting to
278 edit the directory: >
280 :e scp://[user]@hostname/path/
281 :e ftp://[user]@hostname/path/
283 For remote directories (ie. those using scp or ftp), that trailing
284 "/" is necessary (the slash tells netrw to treat the argument as a
285 directory to browse instead of a file to download).
287 However, the Nread command can also be used to accomplish this:
289 :Nread [protocol]://[user]@hostname/path/
291 *netrw-login* *netrw-password*
292 CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2
294 Attempts to use ftp will prompt you for a user-id and a password.
295 These will be saved in global variables g:netrw_uid and
296 s:netrw_passwd; subsequent uses of ftp will re-use those two items to
297 simplify the further use of ftp. However, if you need to use a
298 different user id and/or password, you'll want to call NetUserPass()
299 first. To work around the need to enter passwords, check if your ftp
300 supports a <.netrc> file in your home directory. Also see
301 |netrw-passwd| (and if you're using ssh/scp hoping to figure out how
302 to not need to use passwords, look at |netrw-ssh-hack|).
304 :NetUserPass [uid [password]] -- prompts as needed
305 :call NetUserPass() -- prompts for uid and password
306 :call NetUserPass("uid") -- prompts for password
307 :call NetUserPass("uid","password") -- sets global uid and password
309 NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2
310 (also see: |netrw-browser-var| |netrw-protocol| |netrw-settings| |netrw-var|)
312 Netrw provides a lot of variables which allow you to customize netrw to your
313 preferences. One way to look at them is via the command :NetrwSettings (see
314 |netrw-settings|) which will display your current netrw settings. Most such
315 settings are described below, in |netrw-browser-options|, and in
318 *b:netrw_lastfile* last file Network-read/written retained on a
319 per-buffer basis (supports plain :Nw )
321 *g:netrw_chgwin* specifies a window number where file edits will take
322 place. (also see |netrw-C|)
323 (default) not defined
325 *g:Netrw_funcref* specifies a function to be called when netrw edits
326 a file. The file is first edited, and then the
327 function reference (|Funcref|) is called.
328 (default) not defined
330 *g:netrw_ftp* if it doesn't exist, use default ftp
331 =0 use default ftp (uid password)
332 =1 use alternate ftp method (user uid password)
333 If you're having trouble with ftp, try changing the
334 value of this variable to see if the alternate ftp
335 method works for your setup.
337 *g:netrw_ftpextracmd* default: doesn't exist
338 If this variable exists, then any string it contains
339 will be placed into the commands set to your ftp
340 client. As an example:
343 *g:netrw_ftpmode* ="binary" (default)
346 *g:netrw_ignorenetrc* =0 (default for linux, cygwin)
347 =1 If you have a <.netrc> file but it doesn't work and
348 you want it ignored, then set this variable as
349 shown. (default for Windows + cmd.exe)
351 *g:netrw_menu* =0 disable netrw's menu
352 =1 (default) netrw's menu enabled
354 *g:netrw_nogx* if this variable exists, then the "gx" map will not
355 be available (see |netrw-gx|)
357 *g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis
358 *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis
360 *g:netrw_preview* =0 (default) preview window shown in a horizontally
362 =1 preview window shown in a vertically split window.
363 Also affects the "previous window" (see |netrw-P|) in
366 *g:netrw_scpport* = "-P" : option to use to set port for scp
367 *g:netrw_sshport* = "-p" : option to use to set port for ssh
369 *g:netrw_sepchr* =\0xff
370 =\0x01 for enc == euc-jp (and perhaps it should be for
371 others, too, please let me
373 Separates priority codes from filenames internally.
376 *g:netrw_silent* =0 : transfers done normally
377 =1 : transfers done silently
379 *g:netrw_use_errorwindow* =1 : messages from netrw will use a separate one
380 line window. This window provides reliable
381 delivery of messages. (default)
382 =0 : messages from netrw will use echoerr ;
383 messages don't always seem to show up this
384 way, but one doesn't have to quit the window.
386 *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank
387 lines that o/s's ftp "provides" on transfers
388 =0 force normal ftp behavior (no trailing line removal)
390 *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also
391 permits network browsing to use ls with time and
392 size sorting (default if windows)
393 =0 assume Windows' scp accepts windows-style paths
394 Network browsing uses dir instead of ls
395 This option is ignored if you're using unix
397 *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP
398 =1 use WinNT's rcp in binary mode (default)
400 PATHS *netrw-path* {{{2
402 Paths to files are generally user-directory relative for most protocols.
403 It is possible that some protocol will make paths relative to some
404 associated directory, however.
406 example: vim scp://user@host/somefile
407 example: vim scp://user@host/subdir1/subdir2/somefile
409 where "somefile" is in the "user"'s home directory. If you wish to get a
410 file using root-relative paths, use the full path:
412 example: vim scp://user@host//somefile
413 example: vim scp://user@host//subdir1/subdir2/somefile
416 ==============================================================================
417 4. Network-Oriented File Transfer *netrw-xfer* {{{1
419 Network-oriented file transfer under Vim is implemented by a VimL-based script
420 (<netrw.vim>) using plugin techniques. It currently supports both reading and
421 writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch,
422 dav/cadaver, rsync, or sftp.
424 http is currently supported read-only via use of wget or fetch.
426 <netrw.vim> is a standard plugin which acts as glue between Vim and the
427 various file transfer programs. It uses autocommand events (BufReadCmd,
428 FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. >
430 ex. vim ftp://hostname/path/to/file
432 The characters preceding the colon specify the protocol to use; in the
433 example, it's ftp. The <netrw.vim> script then formulates a command or a
434 series of commands (typically ftp) which it issues to an external program
435 (ftp, scp, etc) which does the actual file transfer/protocol. Files are read
436 from/written to a temporary file (under Unix/Linux, /tmp/...) which the
437 <netrw.vim> script will clean up.
439 Now, a word about Jan Minář's "FTP User Name and Password Disclosure"; first,
440 ftp is not a secure protocol. User names and passwords are transmitted "in
441 the clear" over the internet; any snooper tool can pick these up; this is not
442 a netrw thing, this is a ftp thing. If you're concerned about this, please
443 try to use scp or sftp instead.
445 Netrw re-uses the user id and password during the same vim session and so long
446 as the remote hostname remains the same.
448 Jan seems to be a bit confused about how netrw handles ftp; normally multiple
449 commands are performed in a "ftp session", and he seems to feel that the
450 uid/password should only be retained over one ftp session. However, netrw
451 does every ftp operation in a separate "ftp session"; so remembering the
452 uid/password for just one "ftp session" would be the same as not remembering
453 the uid/password at all. IMHO this would rapidly grow tiresome as one
454 browsed remote directories, for example.
456 On the other hand, thanks go to Jan M. for pointing out the many
457 vulnerabilities that netrw (and vim itself) had had in handling "crafted"
458 filenames. The |shellescape()| and |fnameescape()| functions were written in
459 response by Bram Moolenaar to handle these sort of problems, and netrw has
460 been modified to use them. Still, my advice is, if the "filename" looks like
461 a vim command that you aren't comfortable with having executed, don't open it.
463 *netrw-putty* *netrw-pscp* *netrw-psftp*
464 One may modify any protocol's implementing external application by setting a
465 variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
466 "scp -q"). As an example, consider using PuTTY: >
468 let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch'
469 let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"'
471 See |netrw-p8| for more about putty, pscp, psftp, etc.
473 Ftp, an old protocol, seems to be blessed by numerous implementations.
474 Unfortunately, some implementations are noisy (ie., add junk to the end of the
475 file). Thus, concerned users may decide to write a NetReadFixup() function
476 that will clean up after reading with their ftp. Some Unix systems (ie.,
477 FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is
478 not noisy and more convenient, actually, for <netrw.vim> to use.
479 Consequently, if "fetch" is available (ie. executable), it may be preferable
480 to use it for ftp://... based transfers.
482 For rcp, scp, sftp, and http, one may use network-oriented file transfers
485 vim rcp://[user@]machine/path
486 vim scp://[user@]machine/path
488 If your ftp supports <.netrc>, then it too can be transparently used
489 if the needed triad of machine name, user id, and password are present in
490 that file. Your ftp must be able to use the <.netrc> file on its own, however.
492 vim ftp://[user@]machine[[:#]portnumber]/path
494 However, ftp will often need to query the user for the userid and password.
495 The latter will be done "silently"; ie. asterisks will show up instead of
496 the actually-typed-in password. Netrw will retain the userid and password
497 for subsequent read/writes from the most recent transfer so subsequent
498 transfers (read/write) to or from that machine will take place without
499 additional prompting.
502 +=================================+============================+============+
503 | Reading | Writing | Uses |
504 +=================================+============================+============+
506 | dav://host/path | | cadaver |
507 | :Nread dav://host/path | :Nwrite dav://host/path | cadaver |
508 +---------------------------------+----------------------------+------------+
510 | davs://host/path | | cadaver |
511 | :Nread davs://host/path | :Nwrite davs://host/path | cadaver |
512 +---------------------------------+----------------------------+------------+
514 | fetch://[user@]host/path | | |
515 | fetch://[user@]host:http/path | Not Available | fetch |
516 | :Nread fetch://[user@]host/path| | |
517 +---------------------------------+----------------------------+------------+
519 | file:///* | file:///* | |
520 | file://localhost/* | file://localhost/* | |
521 +---------------------------------+----------------------------+------------+
522 | FTP: (*3) | (*3) | |
523 | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) |
524 | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc |
525 | :Nread host path | :Nwrite host path | ftp+.netrc |
526 | :Nread host uid pass path | :Nwrite host uid pass path | ftp |
527 +---------------------------------+----------------------------+------------+
528 | HTTP: wget is executable: (*4) | | |
529 | http://[user@]host/path | Not Available | wget |
530 +---------------------------------+----------------------------+------------+
531 | HTTP: fetch is executable (*4) | | |
532 | http://[user@]host/path | Not Available | fetch |
533 +---------------------------------+----------------------------+------------+
535 | rcp://[user@]host/path | rcp://[user@]host/path | rcp |
536 +---------------------------------+----------------------------+------------+
538 | rsync://[user@]host/path | rsync://[user@]host/path | rsync |
539 | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync |
540 | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp |
541 +---------------------------------+----------------------------+------------+
543 | scp://[user@]host/path | scp://[user@]host/path | scp |
544 | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) |
545 +---------------------------------+----------------------------+------------+
547 | sftp://[user@]host/path | sftp://[user@]host/path | sftp |
548 | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) |
549 +=================================+============================+============+
551 (*1) For an absolute path use scp://machine//path.
553 (*2) if <.netrc> is present, it is assumed that it will
554 work with your ftp client. Otherwise the script will
555 prompt for user-id and password.
557 (*3) for ftp, "machine" may be machine#port or machine:port
558 if a different port is needed than the standard ftp port
560 (*4) for http:..., if wget is available it will be used. Otherwise,
561 if fetch is available it will be used.
563 Both the :Nread and the :Nwrite ex-commands can accept multiple filenames.
568 The <.netrc> file, typically located in your home directory, contains lines
569 therein which map a hostname (machine name) to the user id and password you
570 prefer to use with it.
572 The typical syntax for lines in a <.netrc> file is given as shown below.
573 Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't.
575 machine {full machine name} login {user-id} password "{password}"
576 default login {user-id} password "{password}"
578 Your ftp client must handle the use of <.netrc> on its own, but if the
579 <.netrc> file exists, an ftp transfer will not ask for the user-id or
583 Since this file contains passwords, make very sure nobody else can
584 read this file! Most programs will refuse to use a .netrc that is
585 readable for others. Don't forget that the system administrator can
586 still read the file! Ie. for Linux/Unix: chmod 600 .netrc
589 PASSWORD *netrw-passwd*
591 The script attempts to get passwords for ftp invisibly using |inputsecret()|,
592 a built-in Vim function. See |netrw-uidpass| for how to change the password
593 after one has set it.
595 Unfortunately there doesn't appear to be a way for netrw to feed a password to
596 scp. Thus every transfer via scp will require re-entry of the password.
597 However, |netrw-ssh-hack| can help with this problem.
600 ==============================================================================
601 5. Activation *netrw-activate* {{{1
603 Network-oriented file transfers are available by default whenever Vim's
604 |'nocompatible'| mode is enabled. Netrw's script files reside in your
605 system's plugin, autoload, and syntax directories; just the
606 plugin/netrwPlugin.vim script is sourced automatically whenever you bring up
607 vim. The main script in autoload/netrw.vim is only loaded when you actually
608 use netrw. I suggest that, at a minimum, you have at least the following in
609 your <.vimrc> customization file: >
613 filetype plugin indent on
617 ==============================================================================
618 6. Transparent File Editing *netrw-transparent* {{{1
620 Transparent file transfers occur whenever a regular file read or write
621 (invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd|
622 events) is made. Thus one may read, write, or source files across networks
623 just as easily as if they were local files! >
625 vim ftp://[user@]machine/path
629 See |netrw-activate| for more on how to encourage your vim to use plugins
633 ==============================================================================
634 7. Ex Commands *netrw-ex* {{{1
636 The usual read/write commands are supported. There are also a few
637 additional commands available. Often you won't need to use Nwrite or
638 Nread as shown in |netrw-transparent| (ie. simply use >
642 instead, as appropriate) -- see |netrw-urls|. In the explanations
643 below, a {netfile} is an url to a remote file.
645 :[range]Nw[rite] Write the specified lines to the current
646 file as specified in b:netrw_lastfile.
648 :[range]Nw[rite] {netfile} [{netfile}]...
649 Write the specified lines to the {netfile}.
651 :Nr[ead] Read the lines from the file specified in b:netrw_lastfile
652 into the current buffer.
654 :Nr[ead] {netfile} {netfile}...
655 Read the {netfile} after the current line.
658 Source the {netfile}.
659 To start up vim using a remote .vimrc, one may use
660 the following (all on one line) (tnx to Antoine Mechelynck) >
662 --cmd "runtime plugin/netrwPlugin.vim"
663 --cmd "source scp://HOSTNAME/.vimrc"
666 If g:netrw_uid and s:netrw_passwd don't exist,
667 this function will query the user for them.
669 :call NetUserPass("userid")
670 This call will set the g:netrw_uid and, if
671 the password doesn't exist, will query the user for it.
673 :call NetUserPass("userid","passwd")
674 This call will set both the g:netrw_uid and s:netrw_passwd.
675 The user-id and password are used by ftp transfers. One may
676 effectively remove the user-id and password by using empty
679 :NetrwSettings This command is described in |netrw-settings| -- used to
680 display netrw settings and change netrw behavior.
683 ==============================================================================
684 8. Variables and Options *netrw-options* *netrw-var* {{{1
686 (if you're interested in the netrw browser settings, see: |netrw-browser-var|)
688 The <netrw.vim> script provides several variables which act as options to
689 affect <netrw.vim>'s file transfer behavior. These variables typically may be
690 set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|)
698 -------------- -----------------------------------------------
700 b:netrw_col Holds current cursor position (during NetWrite)
701 g:netrw_cygwin =1 assume scp under windows is from cygwin
703 =0 assume scp under windows accepts windows
704 style paths (default/else)
705 g:netrw_ftp =0 use default ftp (uid password)
706 g:netrw_ftpmode ="binary" (default)
707 ="ascii" (your choice)
708 g:netrw_ignorenetrc =1 (default)
709 if you have a <.netrc> file but you don't
710 want it used, then set this variable. Its
711 mere existence is enough to cause <.netrc>
713 b:netrw_lastfile Holds latest method/machine/path.
714 b:netrw_line Holds current line number (during NetWrite)
715 g:netrw_silent =0 transfers done normally
716 =1 transfers done silently
717 g:netrw_uid Holds current user-id for ftp.
718 g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
719 =1 use WinNT/2K/XP's rcp, binary mode
720 g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc
721 =1 use default method to do ftp >
722 -----------------------------------------------------------------------
724 The script will also make use of the following variables internally, albeit
731 -------- ------------------------------------
733 b:netrw_method Index indicating rcp/ftp+.netrc/ftp
734 w:netrw_method (same as b:netrw_method)
735 g:netrw_machine Holds machine name parsed from input
736 b:netrw_fname Holds filename being accessed >
737 ------------------------------------------------------------
741 Netrw supports a number of protocols. These protocols are invoked using the
742 variables listed below, and may be modified by the user.
744 ------------------------
745 Protocol Control Options
746 ------------------------
747 Option Type Setting Meaning
748 --------- -------- -------------- ---------------------------
750 netrw_ftp variable =doesn't exist userid set by "user userid"
751 =0 userid set by "user userid"
752 =1 userid set by "userid"
753 NetReadFixup function =doesn't exist no change
754 =exists Allows user to have files
755 read via ftp automatically
756 transformed however they wish
758 g:netrw_dav_cmd variable ="cadaver" if cadaver is executable
759 g:netrw_dav_cmd variable ="curl -o" elseif curl is executable
760 g:netrw_fetch_cmd variable ="fetch -o" if fetch is available
761 g:netrw_ftp_cmd variable ="ftp"
762 g:netrw_http_cmd variable ="fetch -o" if fetch is available
763 g:netrw_http_cmd variable ="wget -O" else if wget is available
764 g:netrw_list_cmd variable ="ssh USEPORT HOSTNAME ls -Fa"
765 g:netrw_rcp_cmd variable ="rcp"
766 g:netrw_rsync_cmd variable ="rsync -a"
767 g:netrw_scp_cmd variable ="scp -q"
768 g:netrw_sftp_cmd variable ="sftp" >
769 -------------------------------------------------------------------------
773 The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|)
774 specify the external program to use handle the ftp protocol. They may
775 include command line options (such as -p for passive mode).
777 Browsing is supported by using the |g:netrw_list_cmd|; the substring
778 "HOSTNAME" will be changed via substitution with whatever the current request
781 Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's
782 that give trouble . In order to best understand how to use these options if
783 ftp is giving you troubles, a bit of discussion is provided on how netrw does
786 For ftp, netrw typically builds up lines of one of the following formats in a
789 IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1
790 ---------------------------------- ------------------------------
792 open machine [port] open machine [port]
793 user userid password userid password
794 [g:netrw_ftpmode] password
795 [g:netrw_extracmd] [g:netrw_ftpmode]
796 get filename tempfile [g:netrw_extracmd]
797 get filename tempfile >
798 ---------------------------------------------------------------------
800 The |g:netrw_ftpmode| and |g:netrw_extracmd| are optional.
802 Netrw then executes the lines above by use of a filter:
804 :%! {g:netrw_ftp_cmd} -i [-n]
807 g:netrw_ftp_cmd is usually "ftp",
808 -i tells ftp not to be interactive
809 -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>)
811 If <.netrc> exists it will be used to avoid having to query the user for
812 userid and password. The transferred file is put into a temporary file.
813 The temporary file is then read into the main editing session window that
814 requested it and the temporary file deleted.
816 If your ftp doesn't accept the "user" command and immediately just demands a
817 userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
820 To handle the SSL certificate dialog for untrusted servers, one may pull
821 down the certificate and place it into /usr/ssl/cert.pem. This operation
822 renders the server treatment as "trusted".
824 *netrw-fixup* *netreadfixup*
825 If your ftp for whatever reason generates unwanted lines (such as AUTH
826 messages) you may write a NetReadFixup() function:
828 function! NetReadFixup(method,line1,line2)
829 " a:line1: first new line in current file
830 " a:line2: last new line in current file
831 if a:method == 1 "rcp
832 elseif a:method == 2 "ftp + <.netrc>
833 elseif a:method == 3 "ftp + machine,uid,password,filename
834 elseif a:method == 4 "scp
835 elseif a:method == 5 "http/wget
836 elseif a:method == 6 "dav/cadaver
837 elseif a:method == 7 "rsync
838 elseif a:method == 8 "fetch
839 elseif a:method == 9 "sftp
844 The NetReadFixup() function will be called if it exists and thus allows you to
845 customize your reading process. As a further example, <netrw.vim> contains
846 just such a function to handle Windows 95 ftp. For whatever reason, Windows
847 95's ftp dumps four blank lines at the end of a transfer, and so it is
848 desirable to automate their removal. Here's some code taken from <netrw.vim>
851 if has("win95") && g:netrw_win95ftp
852 fun! NetReadFixup(method, line1, line2)
853 if method == 3 " ftp (no <.netrc>)
854 let fourblanklines= line2 - 3
855 silent fourblanklines.",".line2."g/^\s*/d"
861 ==============================================================================
862 9. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1
863 *netrw-browser* *netrw-dir* *netrw-list*
865 INTRODUCTION TO BROWSING *netrw-intro-browse* {{{2
866 (Quick References: |netrw-quickmaps| |netrw-quickcoms|)
868 Netrw supports the browsing of directories on your local system and on remote
869 hosts; browsing includes listing files and directories, entering directories,
870 editing files therein, deleting files/directories, making new directories,
871 moving (renaming) files and directories, copying files and directories, etc.
872 One may mark files and execute any system command on them! The Netrw browser
873 generally implements the previous explorer's maps and commands for remote
874 directories, although details (such as pertinent global variable names)
875 necessarily differ. To browse a directory, simply "edit" it! >
879 vim c:\your\directory\
881 (Related topics: |netrw-cr| |netrw-o| |netrw-p| |netrw-P| |netrw-t|
882 |netrw-mf| |netrw-mx| |netrw-D| |netrw-R| |netrw-v| )
884 The Netrw remote file and directory browser handles two protocols: ssh and
885 ftp. The protocol in the url, if it is ftp, will cause netrw also to use ftp
886 in its remote browsing. Specifying any other protocol will cause it to be
887 used for file transfers; but the ssh protocol will be used to do remote
890 To use Netrw's remote directory browser, simply attempt to read a "file" with
891 a trailing slash and it will be interpreted as a request to list a directory:
893 vim [protocol]://[user@]hostname/path/
895 where [protocol] is typically scp or ftp. As an example, try: >
897 vim ftp://ftp.home.vim.org/pub/vim/
899 For local directories, the trailing slash is not required. Again, because it's
900 easy to miss: to browse remote directories, the url must terminate with a
903 If you'd like to avoid entering the password repeatedly for remote directory
904 listings with ssh or scp, see |netrw-ssh-hack|. To avoid password entry with
905 ftp, see |netrw-netrc| (if your ftp supports it).
907 There are several things you can do to affect the browser's display of files:
909 * To change the listing style, press the "i" key (|netrw-i|).
910 Currently there are four styles: thin, long, wide, and tree.
911 To make that change "permanent", see |g:netrw_liststyle|.
913 * To hide files (don't want to see those xyz~ files anymore?) see
916 * Press s to sort files by name, time, or size.
918 See |netrw-browse-cmds| for all the things you can do with netrw!
920 *netrw-getftype* *netrw-filigree* *netrw-ftype*
921 The |getftype()| function is used to append a bit of filigree to indicate
922 filetype to locally listed files:
930 The filigree also affects the |g:netrw_sort_sequence|.
933 QUICK HELP *netrw-quickhelp* {{{2
934 (Use ctrl-] to select a topic)~
935 Intro to Browsing...............................|netrw-intro-browse|
936 Quick Reference: Maps.........................|netrw-quickmap|
937 Quick Reference: Commands.....................|netrw-browse-cmds|
939 Edit hiding list..............................|netrw-ctrl-h|
940 Hiding Files or Directories...................|netrw-a|
941 Hiding/Unhiding by suffix.....................|netrw-mh|
942 Hiding dot-files.............................|netrw-gh|
944 Select listing style (thin/long/wide/tree)....|netrw-i|
945 Associated setting variable...................|g:netrw_liststyle|
946 Shell command used to perform listing.........|g:netrw_list_cmd|
947 Quick file info...............................|netrw-qf|
949 Select sorting style (name/time/size).........|netrw-s|
950 Editing the sorting sequence..................|netrw-S|
951 Sorting options...............................|g:netrw_sort_options|
952 Associated setting variable...................|g:netrw_sort_sequence|
953 Reverse sorting order.........................|netrw-r|
956 *netrw-quickmap* *netrw-quickmaps*
957 QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
959 --- ----------------- ----
960 Map Quick Explanation Link
961 --- ----------------- ----
962 < <F1> Causes Netrw to issue help
963 <cr> Netrw will enter the directory or read the file |netrw-cr|
964 <del> Netrw will attempt to remove the file/directory |netrw-del|
965 - Makes Netrw go up one directory |netrw--|
966 a Toggles between normal display, |netrw-a|
967 hiding (suppress display of files matching g:netrw_list_hide)
968 showing (display only files which match g:netrw_list_hide)
969 c Make browsing directory the current directory |netrw-c|
970 C Setting the editing window |netrw-C|
971 d Make a directory |netrw-d|
972 D Attempt to remove the file(s)/directory(ies) |netrw-D|
973 gb Go to previous bookmarked directory |netrw-gb|
974 gh Quick hide/unhide of dot-files |netrw-gh|
975 <c-h> Edit file hiding list |netrw-ctrl-h|
976 i Cycle between thin, long, wide, and tree listings |netrw-i|
977 <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
978 mb Bookmark current directory |netrw-mb|
979 mc Copy marked files to marked-file target directory |netrw-mc|
980 md Apply diff to marked files (up to 3) |netrw-md|
981 me Place marked files on arg list and edit them |netrw-me|
982 mf Mark a file |netrw-mf|
983 mh Toggle marked file suffices' presence on hiding list |netrw-mh|
984 mm Move marked files to marked-file target directory |netrw-mm|
985 mp Print marked files |netrw-mp|
986 mr Mark files satisfying a shell-style |regexp| |netrw-mr|
987 mt Current browsing directory becomes markfile target |netrw-mt|
988 mT Apply ctags to marked files |netrw-mT|
989 mu Unmark all marked files |netrw-mu|
990 mx Apply arbitrary shell command to marked files |netrw-mx|
991 mz Compress/decompress marked files |netrw-mz|
992 o Enter the file/directory under the cursor in a new |netrw-o|
993 browser window. A horizontal split is used.
994 O Obtain a file specified by cursor |netrw-O|
995 p Preview the file |netrw-p|
996 P Browse in the previously used window |netrw-P|
997 qb List bookmarked directories and history |netrw-qb|
998 qf Display information on file |netrw-qf|
999 r Reverse sorting order |netrw-r|
1000 R Rename the designed file(s)/directory(ies) |netrw-R|
1001 s Select sorting style: by name, time, or file size |netrw-s|
1002 S Specify suffix priority for name-sorting |netrw-S|
1003 t Enter the file/directory under the cursor in a new tab|netrw-t|
1004 u Change to recently-visited directory |netrw-u|
1005 U Change to subsequently-visited directory |netrw-U|
1006 v Enter the file/directory under the cursor in a new |netrw-v|
1007 browser window. A vertical split is used.
1008 x View file with an associated program |netrw-x|
1010 % Open a new file in netrw's current directory |netrw-%|
1012 *netrw-mouse* *netrw-leftmouse* *netrw-middlemouse* *netrw-rightmouse*
1013 <leftmouse> (gvim only) selects word under mouse as if a <cr>
1014 had been pressed (ie. edit file, change directory)
1015 <middlemouse> (gvim only) same as P selecting word under mouse;
1017 <rightmouse> (gvim only) delete file/directory using word under
1019 <2-leftmouse> (gvim only) when:
1020 * in a netrw-selected file, AND
1021 * |g:netrw_retmap| == 1 AND
1022 * the user doesn't already have a <2-leftmouse> mapping
1023 defined before netrw is autoloaded,
1024 then a double clicked leftmouse button will return
1025 to the netrw browser window. See |g:netrw_retmap|.
1026 <s-leftmouse> (gvim only) like mf, will mark files
1028 *netrw-quickcom* *netrw-quickcoms*
1029 QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2
1030 :NetrwClean[!] ...........................................|netrw-clean|
1031 :NetrwSettings ...........................................|netrw-settings|
1032 :Explore[!] [dir] Explore directory of current file......|netrw-explore|
1033 :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore|
1034 :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
1035 :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
1036 :Rexplore Return to Explorer.....................|netrw-explore|
1037 :Sexplore[!] [dir] Split & Explore directory .............|netrw-explore|
1038 :Texplore[!] [dir] Tab & Explore..........................|netrw-explore|
1039 :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
1041 BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2
1043 One may easily "bookmark" a directory by using >
1047 Bookmarks are retained in between sessions in a $HOME/.netrwbook file, and are
1048 kept in sorted order.
1051 |netrw-gb| how to return (go) to a bookmark
1052 |netrw-mB| how to delete bookmarks
1053 |netrw-qb| how to list bookmarks
1056 BROWSING *netrw-cr* {{{2
1058 Browsing is simple: move the cursor onto a file or directory of interest.
1059 Hitting the <cr> (the return key) will select the file or directory.
1060 Directories will themselves be listed, and files will be opened using the
1061 protocol given in the original read request.
1063 CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that
1064 two or more spaces delimit filenames and directory names for the long and
1065 wide listing formats. Thus, if your filename or directory name has two or
1066 more sequential spaces embedded in it, or any trailing spaces, then you'll
1067 need to use the "thin" format to select it.
1069 The |g:netrw_browse_split| option, which is zero by default, may be used to
1070 cause the opening of files to be done in a new window or tab instead of the
1071 default. When the option is one or two, the splitting will be taken
1072 horizontally or vertically, respectively. When the option is set to three, a
1073 <cr> will cause the file to appear in a new tab.
1076 When using the gui (gvim), one may select a file by pressing the <leftmouse>
1077 button. In addition, if
1079 *|g:netrw_retmap| == 1 AND (its default value is 0)
1080 * in a netrw-selected file, AND
1081 * the user doesn't already have a <2-leftmouse> mapping defined before
1084 then a doubly-clicked leftmouse button will return to the netrw browser
1087 Netrw attempts to speed up browsing, especially for remote browsing where one
1088 may have to enter passwords, by keeping and re-using previously obtained
1089 directory listing buffers. The |g:netrw_fastbrowse| variable is used to
1090 control this behavior; one may have slow browsing (no buffer re-use), medium
1091 speed browsing (re-use directory buffer listings only for remote directories),
1092 and fast browsing (re-use directory buffer listings as often as possible).
1093 The price for such re-use is that when changes are made (such as new files
1094 are introduced into a directory), the listing may become out-of-date. One may
1095 always refresh directory listing buffers by pressing ctrl-L (see
1099 Related topics: |netrw-o| |netrw-p| |netrw-P| |netrw-t| |netrw-v|
1100 Associated setting variables: |g:netrw_browse_split| |g:netrw_fastbrowse|
1101 |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
1102 |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_cmd|
1103 |g:netrw_ssh_browse_reject| |g:netrw_use_noswf|
1106 BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2
1108 Normally one enters a file or directory using the <cr>. However, the "o" map
1109 allows one to open a new window to hold the new directory listing or file. A
1110 horizontal split is used. (for vertical splitting, see |netrw-v|)
1112 Normally, the o key splits the window horizontally with the new window and
1113 cursor at the top. To change to splitting the window horizontally with the
1114 new window and cursor at the bottom, have
1116 let g:netrw_alto = 1
1118 in your <.vimrc>. (also see |netrw-t| |netrw-T| |netrw-v|)
1120 Associated setting variables: |g:netrw_alto| |g:netrw_winsize|
1123 BROWSING WITH A NEW TAB *netrw-t* *netrw-T* {{{2
1125 Normally one enters a file or directory using the <cr>. The "t" map
1126 allows one to open a new window holding the new directory listing or file in
1127 a new tab. The "T" version puts the file or directory into a background tab
1130 Related actions: |netrw-o| |netrw-v|
1133 BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2
1135 Normally one enters a file or directory using the <cr>. However, the "v" map
1136 allows one to open a new window to hold the new directory listing or file. A
1137 vertical split is used. (for horizontal splitting, see |netrw-o|)
1139 Normally, the v key splits the window vertically with the new window and
1140 cursor at the left. To change to splitting the window vertically with the new
1141 window and cursor at the right, have
1143 let g:netrw_altv = 1
1145 in your <.vimrc>. (also see: |netrw-o| |netrw-t| |netrw-T|)
1147 There is only one tree listing buffer; using "v" on a displayed subdirectory
1148 will split the screen, but the same buffer will be shown twice.
1150 Associated setting variable: |g:netrw_altv| |g:netrw_winsize|
1153 CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2
1155 The "i" map cycles between the thin, long, wide, and tree listing formats.
1157 The thin listing format gives just the files' and directories' names.
1159 The long listing is either based on the "ls" command via ssh for remote
1160 directories or displays the filename, file size (in bytes), and the time and
1161 date of last modification for local directories. With the long listing
1162 format, netrw is not able to recognize filenames which have trailing spaces.
1163 Use the thin listing format for such files.
1165 The wide listing format uses two or more contiguous spaces to delineate
1166 filenames; when using that format, netrw won't be able to recognize or use
1167 filenames which have two or more contiguous spaces embedded in the name or any
1168 trailing spaces. The thin listing format will, however, work with such files.
1169 This listing format is the most compact.
1171 The tree listing format has a top directory followed by files and directories
1172 preceded by a "|". One may open and close directories by pressing the <cr>
1173 key while atop the directory name.
1175 One may make a preferred listing style your default; see |g:netrw_liststyle|.
1176 As an example, by putting the following line in your .vimrc, >
1177 let g:netrw_liststyle= 4
1178 the tree style will become your default listing style.
1180 Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen|
1181 |g:netrw_timefmt| |g:netrw_list_cmd|
1183 CHANGE FILE PERMISSION *netrw-gp* {{{2
1185 "gp" will ask you for a new permission for the file named under the cursor.
1186 Currently, this only works for local files.
1188 Associated setting variables: |g:netrw_chgperm|
1191 CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2
1193 To change directory back to a bookmarked directory, use
1197 Any count may be used to reference any of the bookmarks.
1200 |netrw-mB| how to delete bookmarks
1201 |netrw-mb| how to make a bookmark
1202 |netrw-qb| how to list bookmarks
1205 CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2
1207 Every time you change to a new directory (new for the current session),
1208 netrw will save the directory in a recently-visited directory history
1209 list (unless g:netrw_dirhistmax is zero; by default, it's ten). With the
1210 "u" map, one can change to an earlier directory (predecessor). To do
1211 the opposite, see |netrw-U|.
1214 CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2
1216 With the "U" map, one can change to a later directory (successor).
1217 This map is the opposite of the "u" map. (see |netrw-u|) Use the
1218 q map to list both the bookmarks and history. (see |netrw-qb|)
1221 NETRW CLEAN *netrw-clean* *:NetrwClean*
1223 With :NetrwClean one may easily remove netrw from one's home directory;
1224 more precisely, from the first directory on your |'runtimepath'|.
1226 With :NetrwClean!, netrw will remove netrw from all directories on your
1229 With either form of the command, netrw will first ask for confirmation
1230 that the removal is in fact what you want to do. If netrw doesn't have
1231 permission to remove a file, it will issue an error message.
1234 CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler* {{{2
1235 (also see |netrw_filehandler|)
1237 Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
1238 best seen with a special handler (ie. a tool provided with your computer).
1239 Netrw allows one to invoke such special handlers by: >
1241 * when Exploring, hit the "x" key
1242 * when editing, hit gx with the cursor atop the special filename
1243 < (not available if the |g:netrw_nogx| variable exists)
1245 Netrw determines which special handler by the following method:
1247 * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
1248 view files. Examples of useful settings (place into your <.vimrc>): >
1250 :let g:netrw_browsex_viewer= "kfmclient exec"
1252 :let g:netrw_browsex_viewer= "gnome-open"
1254 If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
1255 invoked first (see |netrw_filehandler|).
1257 * for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
1258 * for Gnome (with gnome-open): gnome-open is used.
1259 * for KDE (with kfmclient) : kfmclient is used.
1260 * for Mac OS X : open is used.
1261 * otherwise the netrwFileHandler plugin is used.
1263 The file's suffix is used by these various approaches to determine an
1264 appropriate application to use to "handle" these files. Such things as
1265 OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
1266 *.eps) can be handled.
1270 The "x" map applies a function to a file, based on its extension. Of course,
1271 the handler function must exist for it to be called!
1274 NFH_html("scp://user@host/some/path/mypgm.html")
1276 Users may write their own netrw File Handler functions to support more
1277 suffixes with special handling. See <autoload/netrwFileHandlers.vim> for
1278 examples on how to make file handler functions. As an example: >
1280 " NFH_suffix(filename)
1281 fun! NFH_suffix(filename)
1282 ..do something special with filename..
1285 These functions need to be defined in some file in your .vim/plugin
1286 (vimfiles\plugin) directory. Vim's function names may not have punctuation
1287 characters (except for the underscore) in them. To support suffices that
1288 contain such characters, netrw will first convert the suffix using the
1291 @ -> AT ! -> EXCLAMATION % -> PERCENT
1292 : -> COLON = -> EQUAL ? -> QUESTION
1293 , -> COMMA - -> MINUS ; -> SEMICOLON
1294 $ -> DOLLAR + -> PLUS ~ -> TILDE
1298 file.rcs,v -> NFH_rcsCOMMAv()
1300 If more such translations are necessary, please send me email: >
1301 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
1304 Associated setting variable: |g:netrw_browsex_viewer|
1307 DELETING BOOKMARKS *netrw-mB* {{{2
1309 To delete a bookmark, use >
1314 |netrw-gb| how to return (go) to a bookmark
1315 |netrw-mb| how to make a bookmark
1316 |netrw-qb| how to list bookmarks
1319 DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2
1321 If files have not been marked with |netrw-mf|: (local marked file list)
1323 Deleting/removing files and directories involves moving the cursor to the
1324 file/directory to be deleted and pressing "D". Directories must be empty
1325 first before they can be successfully removed. If the directory is a
1326 softlink to a directory, then netrw will make two requests to remove the
1327 directory before succeeding. Netrw will ask for confirmation before doing
1328 the removal(s). You may select a range of lines with the "V" command
1329 (visual selection), and then pressing "D".
1331 If files have been marked with |netrw-mf|: (local marked file list)
1333 Marked files (and empty directories) will be deleted; again, you'll be
1334 asked to confirm the deletion before it actually takes place.
1336 The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are
1337 used to control the attempts to remove files and directories. The
1338 g:netrw_rm_cmd is used with files, and its default value is:
1340 g:netrw_rm_cmd: ssh HOSTNAME rm
1342 The g:netrw_rmdir_cmd variable is used to support the removal of directories.
1343 Its default value is:
1345 g:netrw_rmdir_cmd: ssh HOSTNAME rmdir
1347 If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
1348 to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
1350 g:netrw_rmf_cmd: ssh HOSTNAME rm -f
1352 Associated setting variable: |g:netrw_local_rmdir| |g:netrw_rm_cmd|
1353 |g:netrw_rmdir_cmd| |g:netrw_ssh_cmd|
1356 *netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore*
1357 *netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore*
1358 DIRECTORY EXPLORATION COMMANDS {{{2
1360 :[N]Explore[!] [dir]... Explore directory of current file *:Explore*
1361 :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
1362 :Rexplore ... Return to Explorer *:Rexplore*
1363 :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore*
1364 :Texplore [dir]... Tab & Explore *:Texplore*
1365 :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
1367 Used with :Explore **/pattern : (also see |netrw-starstar|)
1368 :Nexplore............. go to next matching file *:Nexplore*
1369 :Pexplore............. go to previous matching file *:Pexplore*
1371 :Explore will open the local-directory browser on the current file's
1372 directory (or on directory [dir] if specified). The window will be
1373 split only if the file has been modified, otherwise the browsing
1374 window will take over that window. Normally the splitting is taken
1376 :Explore! is like :Explore, but will use vertical splitting.
1377 :Sexplore will always split the window before invoking the local-directory
1378 browser. As with Explore, the splitting is normally done
1380 :Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically.
1381 :Hexplore [dir] does an :Explore with |:belowright| horizontal splitting.
1382 :Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting.
1383 :Vexplore [dir] does an :Explore with |:leftabove| vertical splitting.
1384 :Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting.
1385 :Texplore [dir] does a tabnew before generating the browser window
1387 By default, these commands use the current file's directory. However, one may
1388 explicitly provide a directory (path) to use.
1390 The [N] will override |g:netrw_winsize| to specify the quantity of rows and/or
1391 columns the new explorer window should have.
1393 Otherwise, the |g:netrw_winsize| variable, if it has been specified by the
1394 user, is used to control the quantity of rows and/or columns new explorer
1395 windows should have.
1397 :Rexplore This command is a little different from the others. When one
1398 edits a file, for example by pressing <cr> when atop a file in
1399 a netrw browser window, :Rexplore will return the display to
1400 that of the last netrw browser window. It is a command version
1401 of the <2-leftmouse> map (which is only available under gvim and
1405 *netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat*
1406 EXPLORING WITH STARS AND PATTERNS
1408 When Explore, Sexplore, Hexplore, or Vexplore are used with one of the
1409 following four styles, Explore generates a list of files which satisfy
1412 */filepat files in current directory which satisfy filepat
1413 **/filepat files in current directory or below which satisfy the
1415 *//pattern files in the current directory which contain the
1416 pattern (vimgrep is used)
1417 **//pattern files in the current directory or below which contain
1418 the pattern (vimgrep is used)
1420 The cursor will be placed on the first file in the list. One may then
1421 continue to go to subsequent files on that list via |:Nexplore| or to
1422 preceding files on that list with |:Pexplore|. Explore will update the
1423 directory and place the cursor appropriately.
1427 will clear the explore list.
1429 If your console or gui produces recognizable shift-up or shift-down sequences,
1430 then you'll likely find using shift-downarrow and shift-uparrow convenient.
1431 They're mapped by netrw:
1433 <s-down> == Nexplore, and
1436 As an example, consider
1443 The status line will show, on the right hand side of the status line, a
1444 message like "Match 3 of 20".
1446 Associated setting variables: |g:netrw_keepdir| |g:netrw_browse_split|
1447 |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject|
1448 |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
1449 |g:netrw_ftp_timelist_cmd| |g:netrw_list_cmd|
1453 DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2
1455 With the cursor atop a filename, pressing "qf" will reveal the file's size
1456 and last modification timestamp. Currently this capability is only available
1460 EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2
1462 The "<ctrl-h>" map brings up a requestor allowing the user to change the
1463 file/directory hiding list contained in |g:netrw_list_hide|. The hiding list
1464 consists of one or more patterns delimited by commas. Files and/or
1465 directories satisfying these patterns will either be hidden (ie. not shown) or
1466 be the only ones displayed (see |netrw-a|).
1468 The "gh" mapping (see |netrw-gh|) quickly alternates between the usual
1469 hiding list and the hiding of files or directories that begin with ".".
1472 let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+'
1473 Effectively, this makes the effect of a |netrw-gh| command the initial setting.
1476 \(^\|\s\s\) : if the line begins with the following, -or-
1477 two consecutive spaces are encountered
1478 \zs : start the hiding match now
1479 \. : if it now begins with a dot
1480 \S\+ : and is followed by one or more non-whitespace
1483 Associated setting variables: |g:netrw_hide| |g:netrw_list_hide|
1484 Associated topics: |netrw-a| |netrw-gh| |netrw-mh|
1487 EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2
1489 When "Sorted by" is name, one may specify priority via the sorting sequence
1490 (g:netrw_sort_sequence). The sorting sequence typically prioritizes the
1491 name-listing by suffix, although any pattern will do. Patterns are delimited
1492 by commas. The default sorting sequence is (all one line):
1495 '[\/]$,\<core\%(\.\d\+\)\=,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,
1496 \.info$,\.swp$,\.bak$,\~$'
1499 '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,
1502 The lone * is where all filenames not covered by one of the other patterns
1503 will end up. One may change the sorting sequence by modifying the
1504 g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by
1507 Related topics: |netrw-s| |netrw-S|
1508 Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options|
1511 GOING UP *netrw--* {{{2
1513 To go up a directory, press "-" or press the <cr> when atop the ../ directory
1514 entry in the listing.
1516 Netrw will use the command in |g:netrw_list_cmd| to perform the directory
1517 listing operation after changing HOSTNAME to the host specified by the
1518 user-provided url. By default netrw provides the command as:
1520 ssh HOSTNAME ls -FLa
1522 where the HOSTNAME becomes the [user@]hostname as requested by the attempt to
1523 read. Naturally, the user may override this command with whatever is
1524 preferred. The NetList function which implements remote browsing
1525 expects that directories will be flagged by a trailing slash.
1528 HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2
1530 Netrw's browsing facility allows one to use the hiding list in one of three
1531 ways: ignore it, hide files which match, and show only those files which
1534 If no files have been marked via |netrw-mf|:
1536 The "a" map allows the user to cycle through the three hiding modes.
1538 The |g:netrw_list_hide| variable holds a comma delimited list of patterns
1539 based on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list.
1540 (also see |netrw-ctrl-h|) To set the hiding list, use the <c-h> map. As an
1541 example, to hide files which begin with a ".", one may use the <c-h> map to
1542 set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*'
1543 in one's <.vimrc>). One may then use the "a" key to show all files, hide
1544 matching files, or to show only the matching files.
1547 This hiding list command will hide/show all *.c and *.h files.
1550 This hiding list command will also hide/show all *.c and *.h
1553 Don't forget to use the "a" map to select the mode (normal/hiding/show) you
1556 If files have been marked using |netrw-mf|, then this command will:
1558 if showing all files or non-hidden files:
1559 modify the g:netrw_list_hide list by appending the marked files to it
1560 and showing only non-hidden files.
1562 else if showing hidden files only:
1563 modify the g:netrw_list_hide list by removing the marked files from it
1564 and showing only non-hidden files.
1567 *netrw-gh* *netrw-hide*
1568 As a quick shortcut, one may press >
1570 to toggle between hiding files which begin with a period (dot) and not hiding
1573 Associated setting variable: |g:netrw_list_hide|
1574 Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh|
1576 IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2
1578 Especially with the remote directory browser, constantly entering the password
1581 For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength
1582 tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip
1583 for setting up no-password ssh and scp and discusses associated security
1584 issues. It used to be available at http://hacks.oreilly.com/pub/h/66 ,
1585 but apparently that address is now being redirected to some "hackzine".
1586 I'll attempt a summary based on that article and on a communication from
1589 1. Generate a public/private key pair on the local machine
1592 (saving the file in ~/.ssh/id_rsa as prompted)
1594 2. Just hit the <CR> when asked for passphrase (twice) for no
1595 passphrase. If you do use a passphrase, you will also need to use
1596 ssh-agent so you only have to type the passphrase once per session.
1597 If you don't use a passphrase, simply logging onto your local
1598 computer or getting access to the keyfile in any way will suffice
1599 to access any ssh servers which have that key authorized for login.
1601 3. This creates two files: >
1605 4. On the target machine (ssh server): >
1610 5. On your local machine (ssh client): (one line) >
1611 ssh {serverhostname}
1612 cat '>>' '~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub
1614 or, for OpenSSH, (one line) >
1615 ssh {serverhostname}
1616 cat '>>' '~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub
1618 You can test it out with >
1619 ssh {serverhostname}
1620 and you should be log onto the server machine without further need to type
1623 If you decided to use a passphrase, do: >
1626 ssh {serverhostname}
1627 You will be prompted for your key passphrase when you use ssh-add, but not
1628 subsequently when you use ssh. For use with vim, you can use >
1630 and, when next within vim, use >
1632 Alternatively, you can apply ssh-agent to the terminal you're planning on
1635 and do ssh-add whenever you need.
1637 For Windows, folks on the vim mailing list have mentioned that Pageant helps
1638 with avoiding the constant need to enter the password.
1640 Kingston Fung wrote about another way to avoid constantly needing to enter
1643 In order to avoid the need to type in the password for scp each time, you
1644 provide a hack in the docs to set up a non password ssh account. I found a
1645 better way to do that: I can use a regular ssh account which uses a
1646 password to access the material without the need to key-in the password
1647 each time. It's good for security and convenience. I tried ssh public key
1648 authorization + ssh-agent, implementing this, and it works! Here are two
1649 links with instructions:
1651 http://www.ibm.com/developerworks/library/l-keyc2/
1652 http://sial.org/howto/openssh/publickey-auth/
1655 LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2
1657 Pressing "qb" (query bookmarks) will list both the bookmarked directories and
1658 directory traversal history.
1661 |netrw-gb| how to return (go) to a bookmark
1662 |netrw-mb| how to make a bookmark
1663 |netrw-mB| how to delete bookmarks
1664 |netrw-u| change to a predecessor directory via the history stack
1665 |netrw-U| change to a successor directory via the history stack
1667 MAKING A NEW DIRECTORY *netrw-d* {{{2
1669 With the "d" map one may make a new directory either remotely (which depends
1670 on the global variable g:netrw_mkdir_cmd) or locally (which depends on the
1671 global variable g:netrw_local_mkdir). Netrw will issue a request for the new
1672 directory's name. A bare <CR> at that point will abort the making of the
1673 directory. Attempts to make a local directory that already exists (as either
1674 a file or a directory) will be detected, reported on, and ignored.
1676 Currently, making a directory via ftp is not supported.
1678 Associated setting variable: |g:netrw_local_mkdir| |g:netrw_mkdir_cmd|
1681 MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* {{{2
1683 By default, |g:netrw_keepdir| is 1. This setting means that the current
1684 directory will not track the browsing directory.
1686 Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory to
1687 track netrw's browsing directory.
1689 However, given the default setting for g:netrw_keepdir of 1 where netrw
1690 maintains its own separate notion of the current directory, in order to make
1691 the two directories the same, use the "c" map (just type c). That map will
1692 set Vim's notion of the current directory to netrw's current browsing
1695 Associated setting variable: |g:netrw_keepdir|
1697 MARKING FILES *netrw-mf* {{{2
1698 (also see |netrw-mr|)
1700 One may mark files with the cursor atop a filename and then pressing "mf".
1701 With gvim, one may also mark files with <s-leftmouse>. The following netrw
1702 maps make use of marked files:
1704 |netrw-a| Hide marked files/directories
1705 |netrw-D| Delete marked files/directories
1706 |netrw-mc| Copy marked files to target
1707 |netrw-md| Apply vimdiff to marked files
1708 |netrw-me| Edit marked files
1709 |netrw-mg| Apply vimgrep to marked files
1710 |netrw-mm| Move marked files
1711 |netrw-mp| Print marked files
1712 |netrw-mt| Set target for |netrw-mm| and |netrw-mc|
1713 |netrw-mT| Generate tags using marked files
1714 |netrw-mx| Apply shell command to marked files
1715 |netrw-mz| Compress/Decompress marked files
1716 |netrw-O| Obtain marked files
1717 |netrw-R| Rename marked files
1719 One may unmark files one at a time the same way one marks them; ie. place
1720 the cursor atop a marked file and press "mf". This process also works
1721 with <s-leftmouse> using gvim. One may unmark all files by pressing
1722 "mu" (see |netrw-mu|).
1724 *markfilelist* *global_markfilelist* *local_markfilelist*
1725 All marked files are entered onto the global marked file list; there is only
1726 one such list. In addition, every netrw buffer also has its own local marked
1727 file list; since netrw buffers are associated with specific directories, this
1728 means that each directory has its own local marked file list. The various
1729 commands which operate on marked files use one or the other of the marked file
1733 MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
1734 (also see |netrw-mf|)
1736 One may also mark files by pressing "mr"; netrw will then issue a prompt,
1737 "Enter regexp: ". You may then enter a shell-style regular expression such
1738 as *.c$ (see |glob()|). For remote systems, glob() doesn't work -- so netrw
1739 converts "*" into ".*" (see |regexp|) and marks files based on that. In the
1740 future I may make it possible to use |regexp|s instead of glob()-style
1741 expressions (yet-another-option).
1744 MARKED FILES: ARBITRARY COMMAND *netrw-mx* {{{2
1745 (See |netrw-mf| and |netrw-mr| for how to mark files)
1746 (uses the local marked-file list)
1748 Upon activation of the "mx" map, netrw will query the user for some (external)
1749 command to be applied to all marked files. All "%"s in the command will be
1750 substituted with the name of each marked file in turn. If no "%"s are in the
1751 command, then the command will be followed by a space and a marked filename.
1754 MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2
1755 (See |netrw-mf| and |netrw-mr| for how to mark files)
1756 (uses the local marked file list)
1758 If any marked files are compressed, then "mz" will decompress them.
1759 If any marked files are decompressed, then "mz" will compress them
1760 using the command specified by |g:netrw_compress|; by default,
1763 For decompression, netrw provides a |Dictionary| of suffices and their
1764 associated decompressing utilities; see |g:netrw_decompress|.
1766 Associated setting variables: |g:netrw_compress| |g:netrw_decompress|
1768 MARKED FILES: COPYING *netrw-mc* {{{2
1769 (See |netrw-mf| and |netrw-mr| for how to mark files)
1770 (Uses the global marked file list)
1772 Select a target directory with mt (|netrw-mt|). Then change directory,
1773 select file(s) (see |netrw-mf|), and press "mc".
1775 Associated setting variable: |g:netrw_localcopycmd| |g:netrw_ssh_cmd|
1777 MARKED FILES: DIFF *netrw-md* {{{2
1778 (See |netrw-mf| and |netrw-mr| for how to mark files)
1779 (uses the global marked file list)
1781 Use |vimdiff| to visualize difference between selected files (two or
1782 three may be selected for this). Uses the global marked file list.
1784 MARKED FILES: EDITING *netrw-me* {{{2
1785 (See |netrw-mf| and |netrw-mr| for how to mark files)
1786 (uses the global marked file list)
1788 This command will place the marked files on the |arglist| and commence
1789 editing them. One may return the to explorer window with |:Rexplore|.
1791 MARKED FILES: GREP *netrw-mg* {{{2
1792 (See |netrw-mf| and |netrw-mr| for how to mark files)
1793 (uses the global marked file list)
1795 This command will apply |:vimgrep| to the marked files. The command will ask
1796 for the requested pattern; one may enter: >
1801 MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2
1802 (See |netrw-mf| and |netrw-mr| for how to mark files)
1803 (uses the local marked file list)
1805 This command extracts the suffices of the marked files and toggles their
1806 presence on the hiding list. Please note that marking the same suffix
1807 this way multiple times will result in the suffix's presence being toggled
1808 for each file (so an even quantity of marked files having the same suffix
1809 is the same as not having bothered to select them at all).
1811 Related topics: |netrw-a| |g:netrw_list_hide|
1813 MARKED FILES: MOVING *netrw-mm* {{{2
1814 (See |netrw-mf| and |netrw-mr| for how to mark files)
1815 (uses the global marked file list)
1817 WARNING: moving files is more dangerous than copying them.
1818 A file being moved is first copied and then deleted; if the
1819 copy operation fails and the delete succeeds, you will lose
1820 the file. Either try things out with unimportant files
1821 first or do the copy and then delete yourself using mc and D.
1822 Use at your own risk!
1824 Select a target directory with mt (|netrw-mt|). Then change directory,
1825 select file(s) (see |netrw-mf|), and press "mm".
1827 Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|
1829 MARKED FILES: PRINTING *netrw-mp* {{{2
1830 (See |netrw-mf| and |netrw-mr| for how to mark files)
1831 (uses the local marked file list)
1833 Netrw will apply the |:hardcopy| command to marked files. What it does
1834 is open each file in a one-line window, execute hardcopy, then close the
1838 MARKED FILES: SOURCING *netrw-ms* {{{2
1839 (See |netrw-mf| and |netrw-mr| for how to mark files)
1840 (uses the local marked file list)
1842 Netrw will source the marked files (using vim's |:source| command)
1845 MARKED FILES: TAGGING *netrw-mT* {{{2
1846 (See |netrw-mf| and |netrw-mr| for how to mark files)
1847 (uses the global marked file list)
1849 The "mT" mapping will apply the command in |g:netrw_ctags| (by default, it is
1850 "ctags") to marked files. For remote browsing, in order to create a tags file
1851 netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for
1852 this to work on remote systems. For your local system, see |ctags| on how to
1853 get a version. I myself use hdrtags, currently available at
1854 http://mysite.verizon.net/astronaut/src/index.html , and have >
1856 let g:netrw_ctags= "hdrtag"
1860 When a remote set of files are tagged, the resulting tags file is "obtained";
1861 ie. a copy is transferred to the local system's directory. The local tags
1862 file is then modified so that one may use it through the network. The
1863 modification is concerns the names of the files in the tags; each filename is
1864 preceded by the netrw-compatible url used to obtain it. When one subsequently
1865 uses one of the go to tag actions (|tags|), the url will be used by netrw to
1866 edit the desired file and go to the tag.
1868 Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd|
1871 MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2
1872 (See |netrw-mf| and |netrw-mr| for how to mark files)
1874 Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
1876 * if the cursor is atop a file name, then the netrw window's currently
1877 displayed directory is used for the copy/move-to target.
1879 * also, if the cursor is in the banner, then the netrw window's currently
1880 displayed directory is used for the copy/move-to target.
1882 * however, if the cursor is atop a directory name, then that directory is
1883 used for the copy/move-to target
1885 There is only one copy/move-to target per vim session; ie. the target is a
1886 script variable (see |s:var|) and is shared between all netrw windows (in an
1889 MARKED FILES: UNMARKING *netrw-mu* {{{2
1890 (See |netrw-mf| and |netrw-mr| for how to mark files)
1892 The "mu" mapping will unmark all currently marked files.
1895 NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2
1897 (if you're interested in the netrw file transfer settings, see |netrw-options|)
1899 The <netrw.vim> browser provides settings in the form of variables which
1900 you may modify; by placing these settings in your <.vimrc>, you may customize
1901 your browsing preferences. (see also: |netrw-settings|)
1906 < *g:netrw_alto* change from above splitting to below splitting
1907 by setting this variable (see |netrw-o|)
1908 default: =&sb (see |'sb'|)
1910 *g:netrw_altv* change from left splitting to right splitting
1911 by setting this variable (see |netrw-v|)
1912 default: =&spr (see |'spr'|)
1914 *g:netrw_banner* enable/suppress the banner
1915 =0: suppress the banner
1916 =1: banner is enabled (default)
1917 NOTE: suppressing the banner is a new feature
1918 which may cause problems.
1920 *g:netrw_browse_split* when browsing, <cr> will open the file by:
1921 =0: re-using the same window
1922 =1: horizontally splitting the window first
1923 =2: vertically splitting the window first
1924 =3: open file in new tab
1925 =4: act like "P" (ie. open previous window)
1926 Note that |g:netrw_preview| may be used
1927 to get vertical splitting instead of
1928 horizontal splitting.
1930 *g:netrw_browsex_viewer* specify user's preference for a viewer: >
1935 < is used, then netrwFileHandler() will look for
1936 a script/function to handle the given
1937 extension. (see |netrw_filehandler|).
1939 *g:netrw_chgperm* Unix/Linux: "chmod PERM FILENAME"
1940 Windows: "cacls FILENAME /e /p PERM"
1941 Used to change access permission for a file.
1943 *g:netrw_compress* ="gzip"
1944 Will compress marked files with this
1947 *g:netrw_ctags* ="ctags"
1948 The default external program used to create tags
1950 *g:netrw_cursorline* = 1 (default)
1951 will use the |'cursorline'| local setting when
1952 |g:netrw_liststyle| ==0 (thin listing) or
1953 |g:netrw_liststyle| ==1 (long listing) or
1954 |g:netrw_liststyle| ==3 (tree listing)
1955 (ie. doesn't affect the wide listing)
1957 =2: like ==1, but the wide listing gets both
1958 cursorline and |'cursorcolumn'|locally set
1960 *g:netrw_decompress* = { ".gz" : "gunzip" ,
1961 ".bz2" : "bunzip2" ,
1964 A dictionary mapping suffices to
1965 decompression programs.
1967 *g:netrw_fastbrowse* =0: slow speed directory browsing;
1968 never re-uses directory listings,
1969 always obtains directory listings.
1970 =1: medium speed directory browsing;
1971 re-use directory listings only
1972 when remote directory browsing.
1974 =2: fast directory browsing;
1975 only obtains directory listings when the
1976 directory hasn't been seen before
1977 (or |netrw-ctrl-l| is used).
1979 Fast browsing retains old directory listing
1980 buffers so that they don't need to be
1981 re-acquired. This feature is especially
1982 important for remote browsing. However, if
1983 a file is introduced or deleted into or from
1984 such directories, the old directory buffer
1985 becomes out-of-date. One may always refresh
1986 such a directory listing with |netrw-ctrl-l|.
1987 This option gives the user the choice of
1988 trading off accuracy (ie. up-to-date listing)
1991 *g:netrw_fname_escape* =' ?&;%'
1992 Used on filenames before remote reading/writing
1994 *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
1995 that can show up as "directories" and "files"
1996 in the listing. This pattern is used to
1997 remove such embedded messages. By default its
2000 ^Trying\s\+\d\+.*$\|
2001 ^KERBEROS_V\d rejected\|
2002 ^Security extensions not\|
2004 : connect to address [0-9a-fA-F:]*
2005 : No route to host$'
2007 *g:netrw_ftp_list_cmd* options for passing along to ftp for directory
2009 unix or g:netrw_cygwin set: : "ls -lF"
2013 *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory
2014 listing, sorted by size of file.
2016 unix or g:netrw_cygwin set: : "ls -slF"
2019 *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory
2020 listing, sorted by time of last modification.
2022 unix or g:netrw_cygwin set: : "ls -tlF"
2025 *g:netrw_glob_escape* ='[]*?`{~$'
2026 These characters in directory names are
2027 escaped before applying glob()
2029 *g:netrw_hide* if true, the hiding list is used
2032 *g:netrw_home* The home directory for where bookmarks and
2033 history are saved (as .netrwbook and
2035 default: the first directory on the
2038 *g:netrw_keepdir* =1 (default) keep current directory immune from
2039 the browsing directory.
2040 =0 keep the current directory the same as the
2042 The current browsing directory is contained in
2043 b:netrw_curdir (also see |netrw-c|)
2045 *g:netrw_list_cmd* command for listing remote directories
2046 default: (if ssh is executable)
2047 "ssh HOSTNAME ls -FLa"
2049 *g:netrw_liststyle* Set the default listing style:
2050 = 0: thin listing (one file per line)
2051 = 1: long listing (one file per line with time
2052 stamp information and file size)
2053 = 2: wide listing (multiple files in columns)
2054 = 3: tree style listing
2055 *g:netrw_list_hide* comma separated pattern list for hiding files
2056 Patterns are regular expressions (see |regexp|)
2057 Example: let g:netrw_list_hide= '.*\.swp$'
2060 *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin
2062 Copies marked files (|netrw-mf|) to target
2063 directory (|netrw-mt|, |netrw-mc|)
2065 *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin
2067 Moves marked files (|netrw-mf|) to target
2068 directory (|netrw-mt|, |netrw-mm|)
2070 *g:netrw_local_mkdir* command for making a local directory
2073 *g:netrw_local_rmdir* remove directory command (rmdir)
2076 *g:netrw_maxfilenamelen* =32 by default, selected so as to make long
2077 listings fit on 80 column displays.
2078 If your screen is wider, and you have file
2079 or directory names longer than 32 bytes,
2080 you may set this option to keep listings
2083 *g:netrw_mkdir_cmd* command for making a remote directory
2084 default: "ssh USEPORT HOSTNAME mkdir"
2086 *g:netrw_mousemaps* =1 (default) enables the mouse buttons
2088 leftmouse : open file/directory
2089 shift-leftmouse : mark file
2090 middlemouse : same as P
2091 rightmouse : remove file/directory
2092 =0: disables mouse maps
2094 *g:netrw_retmap* if it exists and is set to one, then:
2095 * if in a netrw-selected file, AND
2096 * no normal-mode <2-leftmouse> mapping exists,
2097 then the <2-leftmouse> will be mapped for easy
2098 return to the netrw browser window.
2099 example: click once to select and open a file,
2100 double-click to return.
2102 Note that one may instead choose to:
2103 * let g:netrw_retmap= 1, AND
2104 * nmap <silent> YourChoice <Plug>NetrwReturn
2105 and have another mapping instead of
2106 <2-leftmouse> to invoke the return.
2108 You may also use the |:Rexplore| command to do
2113 *g:netrw_rm_cmd* command for removing files
2114 default: "ssh USEPORT HOSTNAME rm"
2116 *g:netrw_rmdir_cmd* command for removing directories
2117 default: "ssh USEPORT HOSTNAME rmdir"
2119 *g:netrw_rmf_cmd* command for removing softlinks
2120 default: "ssh USEPORT HOSTNAME rm -f"
2122 *g:netrw_sort_by* sort by "name", "time", or "size"
2125 *g:netrw_sort_direction* sorting direction: "normal" or "reverse"
2128 *g:netrw_sort_options* sorting is done using |:sort|; this
2129 variable's value is appended to the
2130 sort command. Thus one may ignore case,
2131 for example, with the following in your
2133 let g:netrw_sort_options="i"
2136 *g:netrw_sort_sequence* when sorting by name, first sort by the
2137 comma-separated pattern sequence. Note that
2138 the filigree added to indicate filetypes
2139 should be accounted for in your pattern.
2140 default: '[\/]$,*,\.bak$,\.o$,\.h$,
2141 \.info$,\.swp$,\.obj$'
2143 *g:netrw_special_syntax* If true, then certain files will be shown
2144 in special syntax in the browser:
2147 netrwCompress: *.gz *.bz2 *.Z *.zip
2150 netrwLib : *.a *.so *.lib *.dll
2151 netrwMakefile: [mM]akefile *.mak
2152 netrwObj : *.o *.obj
2153 netrwTags : tags ANmenu ANtags
2155 netrwTmp : tmp* *tmp
2157 These syntax highlighting groups are linked
2158 to Folded or DiffChange by default
2159 (see |hl-Folded| and |hl-DiffChange|), but
2160 one may put lines like >
2161 hi link netrwCompress Visual
2162 < into one's <.vimrc> to use one's own
2165 *g:netrw_ssh_cmd* One may specify an executable command
2166 to use instead of ssh for remote actions
2167 such as listing, file removal, etc.
2170 *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines,
2171 messages, banners, and whatnot that one doesn't
2172 want masquerading as "directories" and "files".
2173 Use this pattern to remove such embedded
2174 messages. By default its value is:
2178 *g:netrw_tmpfile_escape* =' &;'
2179 escape() is applied to all temporary files
2180 to escape these characters.
2182 *g:netrw_timefmt* specify format string to vim's strftime().
2183 The default, "%c", is "the preferred date
2184 and time representation for the current
2185 locale" according to my manpage entry for
2186 strftime(); however, not all are satisfied
2187 with it. Some alternatives:
2189 " %a %Y-%m-%d %I-%M-%S %p"
2192 *g:netrw_use_noswf* netrw normally avoids writing swapfiles
2193 for browser buffers. However, under some
2194 systems this apparently is causing nasty
2195 ml_get errors to appear; if you're getting
2196 ml_get errors, try putting
2197 let g:netrw_use_noswf= 0
2200 *g:netrw_winsize* specify initial size of new windows made with
2201 "o" (see |netrw-o|), "v" (see |netrw-v|),
2202 |:Hexplore| or |:Vexplore|.
2205 *g:netrw_xstrlen* Controls how netrw computes string lengths,
2206 including multi-byte characters' string
2207 length. (thanks to N Weibull, T Mechelynck)
2208 =0: uses Vim's built-in strlen()
2209 =1: number of codepoints (Latin a + combining
2210 circumflex is two codepoints) (DEFAULT)
2211 =2: number of spacing codepoints (Latin a +
2212 combining circumflex is one spacing
2213 codepoint; a hard tab is one; wide and
2214 narrow CJK are one each; etc.)
2215 =3: virtual length (counting tabs as anything
2216 between 1 and |'tabstop'|, wide CJK as 2
2217 rather than 1, Arabic alif as zero when
2218 immediately preceded by lam, one
2221 *g:NetrwTopLvlMenu* This variable specifies the top level
2222 menu name; by default, it's "Netrw.". If
2223 you wish to change this, do so in your
2226 NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* {{{2
2228 Netrw has been designed to handle user options by saving them, setting the
2229 options to something that's compatible with netrw's needs, and then restoring
2230 them. However, the autochdir option: >
2232 is problematical. Autochdir sets the current directory to that containing the
2233 file you edit; this apparently also applies to directories. In other words,
2234 autochdir sets the current directory to that containing the "file" (even if
2235 that "file" is itself a directory).
2237 NETRW SETTINGS *netrw-settings* {{{2
2239 With the NetrwSettings.vim plugin, >
2241 will bring up a window with the many variables that netrw uses for its
2242 settings. You may change any of their values; when you save the file, the
2243 settings therein will be used. One may also press "?" on any of the lines for
2244 help on what each of the variables do.
2246 (also see: |netrw-browser-var| |netrw-protocol| |netrw-var| |netrw-variables|)
2249 ==============================================================================
2250 OBTAINING A FILE *netrw-O* {{{2
2252 If there are no marked files:
2254 When browsing a remote directory, one may obtain a file under the cursor
2255 (ie. get a copy on your local machine, but not edit it) by pressing the O
2258 If there are marked files:
2260 The marked files will be obtained (ie. a copy will be transferred to your
2261 local machine, but not set up for editing).
2263 Only ftp and scp are supported for this operation (but since these two are
2264 available for browsing, that shouldn't be a problem). The status bar will
2265 then show, on its right hand side, a message like "Obtaining filename". The
2266 statusline will be restored after the transfer is complete.
2268 Netrw can also "obtain" a file using the local browser. Netrw's display
2269 of a directory is not necessarily the same as Vim's "current directory",
2270 unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select
2271 a file using the local browser (by putting the cursor on it) and pressing
2272 "O" will then "obtain" the file; ie. copy it to Vim's current directory.
2275 * To see what the current directory is, use |:pwd|
2276 * To make the currently browsed directory the current directory, see |netrw-c|
2277 * To automatically make the currently browsed directory the current
2278 directory, see |g:netrw_keepdir|.
2281 OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%*
2283 To open a file in netrw's current directory, press "%". This map will
2284 query the user for a new filename; an empty file by that name will be
2285 placed in the netrw's current directory (ie. b:netrw_curdir).
2288 PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2
2290 One may use a preview window by using the "p" key when the cursor is atop the
2291 desired filename to be previewed. The display will then split to show both
2292 the browser (where the cursor will remain) and the file (see |:pedit|).
2293 By default, the split will be taken horizontally; one may use vertical
2294 splitting if one has set |g:netrw_preview| first.
2297 PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2
2299 To edit a file or directory in the previously used (last accessed) window (see
2300 :he |CTRL-W_p|), press a "P". If there's only one window, then the one window
2301 will be horizontally split (above/below splitting is controlled by
2302 |g:netrw_alto|, and its initial size is controlled by |g:netrw_winsize|).
2304 If there's more than one window, the previous window will be re-used on
2305 the selected file/directory. If the previous window's associated buffer
2306 has been modified, and there's only one window with that buffer, then
2307 the user will be asked if s/he wishes to save the buffer first (yes,
2311 REFRESHING THE LISTING *netrw-ctrl-l* *netrw-ctrl_l* {{{2
2313 To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
2314 hit the <cr> when atop the ./ directory entry in the listing. One may also
2315 refresh a local directory by using ":e .".
2318 RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2
2320 If there are no marked files: (see |netrw-mf|)
2322 Renaming/moving files and directories involves moving the cursor to the
2323 file/directory to be moved (renamed) and pressing "R". You will then be
2324 queried for where you want the file/directory to be moved. You may select
2325 a range of lines with the "V" command (visual selection), and then
2328 If there are marked files: (see |netrw-mf|)
2330 Marked files will be renamed (moved). You will be queried as above in
2331 order to specify where you want the file/directory to be moved.
2335 Note that moving files is a dangerous operation; copies are safer. That's
2336 because a "move" for remote files is actually a copy + delete -- and if
2337 the copy fails and the delete does not, you may lose the file.
2339 The g:netrw_rename_cmd variable is used to implement renaming. By default its
2344 One may rename a block of files and directories by selecting them with
2345 the V (|linewise-visual|).
2348 REVERSING SORTING ORDER *netrw-r* *netrw-reverse* {{{2
2350 One may toggle between normal and reverse sorting order by pressing the
2353 Related topics: |netrw-s|
2354 Associated setting variable: |g:netrw_sort_direction|
2357 SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2
2359 One may select the sorting style by name, time, or (file) size. The "s" map
2360 allows one to circulate amongst the three choices; the directory listing will
2361 automatically be refreshed to reflect the selected style.
2363 Related topics: |netrw-r| |netrw-S|
2364 Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
2367 SETTING EDITING WINDOW *netrw-C* {{{2
2369 One may select a netrw window for editing with the "C" mapping, or by setting
2370 g:netrw_chgwin to the selected window number. Subsequent selection of a file
2371 to edit (|netrw-cr|) will use that window.
2373 Related topics: |netrw-cr|
2374 Associated setting variables: |g:netrw_chgwin|
2377 10. Problems and Fixes *netrw-problems* {{{1
2379 (This section is likely to grow as I get feedback)
2380 (also see |netrw-debug|)
2382 P1. I use windows 95, and my ftp dumps four blank lines at the
2385 See |netrw-fixup|, and put the following into your
2388 let g:netrw_win95ftp= 1
2391 P2. I use Windows, and my network browsing with ftp doesn't sort by
2392 time or size! -or- The remote system is a Windows server; why
2393 don't I get sorts by time or size?
2395 Windows' ftp has a minimal support for ls (ie. it doesn't
2396 accept sorting options). It doesn't support the -F which
2397 gives an explanatory character (ABC/ for "ABC is a directory").
2398 Netrw then uses "dir" to get both its thin and long listings.
2399 If you think your ftp does support a full-up ls, put the
2400 following into your <.vimrc>: >
2402 let g:netrw_ftp_list_cmd = "ls -lF"
2403 let g:netrw_ftp_timelist_cmd= "ls -tlF"
2404 let g:netrw_ftp_sizelist_cmd= "ls -slF"
2406 Alternatively, if you have cygwin on your Windows box, put
2407 into your <.vimrc>: >
2409 let g:netrw_cygwin= 1
2411 This problem also occurs when the remote system is Windows.
2412 In this situation, the various g:netrw_ftp_[time|size]list_cmds
2413 are as shown above, but the remote system will not correctly
2414 modify its listing behavior.
2418 P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw
2419 used ssh! That wasn't what I asked for...
2421 Netrw has two methods for browsing remote directories: ssh
2422 and ftp. Unless you specify ftp specifically, ssh is used.
2423 When it comes time to do download a file (not just a directory
2424 listing), netrw will use the given protocol to do so.
2427 P4. I would like long listings to be the default.
2429 Put the following statement into your |.vimrc|: >
2431 let g:netrw_liststyle= 1
2433 Check out |netrw-browser-var| for more customizations that
2437 P5. My times come up oddly in local browsing
2439 Does your system's strftime() accept the "%c" to yield dates
2440 such as "Sun Apr 27 11:49:23 1997"? If not, do a "man strftime"
2441 and find out what option should be used. Then put it into
2444 let g:netrw_timefmt= "%X" (where X is the option)
2447 P6. I want my current directory to track my browsing.
2450 Put the following line in your |.vimrc|:
2452 let g:netrw_keepdir= 0
2455 P7. I use Chinese (or other non-ascii) characters in my filenames, and
2456 netrw (Explore, Sexplore, Hexplore, etc) doesn't display them!
2458 (taken from an answer provided by Wu Yongwei on the vim
2460 I now see the problem. You code page is not 936, right? Vim
2461 seems only able to open files with names that are valid in the
2462 current code page, as are many other applications that do not
2463 use the Unicode version of Windows APIs. This is an OS-related
2464 issue. You should not have such problems when the system
2465 locale uses UTF-8, such as modern Linux distros.
2467 (...it is one more reason to recommend that people use utf-8!)
2470 P8. I'm getting "ssh is not executable on your system" -- what do I
2473 (Dudley Fox) Most people I know use putty for windows ssh. It
2474 is a free ssh/telnet application. You can read more about it
2477 http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also:
2479 (Marlin Unruh) This program also works for me. It's a single
2480 executable, so he/she can copy it into the Windows\System32
2481 folder and create a shortcut to it.
2483 (Dudley Fox) You might also wish to consider plink, as it
2484 sounds most similar to what you are looking for. plink is an
2485 application in the putty suite.
2487 http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink
2489 (Vissale Neang) Maybe you can try OpenSSH for windows, which
2490 can be obtained from:
2492 http://sshwindows.sourceforge.net/
2494 It doesn't need the full Cygwin package.
2496 (Antoine Mechelynck) For individual Unix-like programs needed
2497 for work in a native-Windows environment, I recommend getting
2498 them from the GnuWin32 project on sourceforge if it has them:
2500 http://gnuwin32.sourceforge.net/
2502 Unlike Cygwin, which sets up a Unix-like virtual machine on
2503 top of Windows, GnuWin32 is a rewrite of Unix utilities with
2504 Windows system calls, and its programs works quite well in the
2507 (dave) Download WinSCP and use that to connect to the server.
2508 In Preferences > Editors, set gvim as your editor:
2511 - Set External Editor (adjust path as needed, include
2512 the quotes and !.! at the end):
2513 "c:\Program Files\Vim\vim70\gvim.exe" !.!
2514 - Check that the filetype in the box below is
2515 {asterisk}.{asterisk} (all files), or whatever types
2516 you want (cec: change {asterisk} to * ; I had to
2517 write it that way because otherwise the helptags
2518 system thinks it's a tag)
2519 - Make sure it's at the top of the listbox (click it,
2520 then click "Up" if it's not)
2521 If using the Norton Commander style, you just have to hit <F4>
2522 to edit a file in a local copy of gvim.
2524 (Vit Gottwald) How to generate public/private key and save
2525 public key it on server: >
2526 http://www.tartarus.org/~simon/puttydoc/Chapter8.html#pubkey-gettingready
2527 8.3 Getting ready for public key authentication
2529 How to use a private key with 'pscp': >
2531 http://www.tartarus.org/~simon/puttydoc/Chapter5.html
2532 5.2.4 Using public key authentication with PSCP
2534 (Ben Schmidt) I find the ssh included with cwRsync is
2535 brilliant, and install cwRsync or cwRsyncServer on most
2536 Windows systems I come across these days. I guess COPSSH,
2537 packed by the same person, is probably even better for use as
2538 just ssh on Windows, and probably includes sftp, etc. which I
2539 suspect the cwRsync doesn't, though it might
2541 (cec) To make proper use of these suggestions above, you will
2542 need to modify the following user-settable variables in your
2545 |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd|
2546 |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd|
2548 The first one (|g:netrw_ssh_cmd|) is the most important; most
2549 of the others will use the string in g:netrw_ssh_cmd by
2551 *netrw-p9* *netrw-ml_get*
2552 P9. I'm browsing, changing directory, and bang! ml_get errors
2553 appear and I have to kill vim. Any way around this?
2555 Normally netrw attempts to avoid writing swapfiles for
2556 its temporary directory buffers. However, on some systems
2557 this attempt appears to be causing ml_get errors to
2558 appear. Please try setting |g:netrw_use_noswf| to 0
2560 let g:netrw_use_noswf= 0
2563 P10. I'm being pestered with "[something] is a directory" and
2564 "Press ENTER or type command to continue" prompts...
2566 The "[something] is a directory" prompt is issued by Vim,
2567 not by netrw, and there appears to be no way to work around
2568 it. Coupled with the default cmdheight of 1, this message
2569 causes the "Press ENTER..." prompt. So: read |hit-enter|;
2570 I also suggest that you set your |'cmdheight'| to 2 (or more) in
2574 P11. I want to have two windows; a thin one on the left and my editing
2575 window on the right. How can I do this?
2577 * Put the following line in your <.vimrc>:
2578 let g:netrw_altv = 1
2579 * Edit the current directory: :e .
2580 * Select some file, press v
2581 * Resize the windows as you wish (see |CTRL-W_<| and
2582 |CTRL-W_>|). If you're using gvim, you can drag
2583 the separating bar with your mouse.
2584 * When you want a new file, use ctrl-w h to go back to the
2585 netrw browser, select a file, then press P (see |CTRL-W_h|
2586 and |netrw-P|). If you're using gvim, you can press
2587 <leftmouse> in the browser window and then press the
2588 <middlemouse> to select the file.
2591 P12. My directory isn't sorting correctly, or unwanted letters are
2592 appearing in the listed filenames, or things aren't lining
2593 up properly in the wide listing, ...
2595 This may be due to an encoding problem. I myself usually use
2596 utf-8, but really only use ascii (ie. bytes from 32-126).
2597 Multibyte encodings use two (or more) bytes per character.
2598 You may need to change |g:netrw_sepchr| and/or |g:netrw_xstrlen|.
2600 ==============================================================================
2601 11. Debugging Netrw Itself *netrw-debug* {{{1
2603 The <netrw.vim> script is typically available as:
2605 /usr/local/share/vim/vim6x/plugin/netrwPlugin.vim
2606 /usr/local/share/vim/vim6x/autoload/netrw.vim
2608 /usr/local/share/vim/vim7x/plugin/netrwPlugin.vim
2609 /usr/local/share/vim/vim7x/autoload/netrw.vim
2611 which is loaded automatically at startup (assuming :set nocp).
2613 1. Get the <Decho.vim> script, available as:
2615 http://mysite.verizon.net/astronaut/vim/index.html#DECHO
2617 http://vim.sourceforge.net/scripts/script.php?script_id=120
2619 It now comes as a "vimball"; if you're using vim 7.0 or earlier,
2620 you'll need to update vimball, too. See
2621 http://mysite.verizon.net/astronaut/vim/index.html#VIMBALL
2623 2. Edit the <netrw.vim> file by typing: >
2629 To restore to normal non-debugging behavior, re-edit <netrw.vim>
2636 This command, provided by <Decho.vim>, will comment out all
2637 Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()).
2639 3. Then bring up vim and attempt to evoke the problem by doing a
2640 transfer or doing some browsing. A set of messages should appear
2641 concerning the steps that <netrw.vim> took in attempting to
2642 read/write your file over the network in a separate tab.
2644 To save the file, use >
2648 < Please send that information to <netrw.vim>'s maintainer, >
2649 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
2651 ==============================================================================
2652 12. History *netrw-history* {{{1
2654 v136: Jan 14, 2009 * extended |g:Netrw_funcref| to also handle lists
2655 of function references
2656 Jan 14, 2009 * (reported by Marvin Renich) with spell check
2657 enabled, some filenamess will still being
2658 displayed as spelling errors.
2659 Apr 13, 2009 * (Björn Winckler) writing a file using
2660 remote scp caused syntax highlighting problem.
2661 Solution: avoid syntax/syntax.vim's
2662 au Filetype * syntax setting autocommand by
2663 checking that the current buffer has the
2664 netrw filetype before attempting a doau
2665 in s:NetrwSafeOptions().
2666 Apr 14, 2009 * (asgeo1) suggested the "T" map (|netrw-T|)
2667 Apr 14, 2009 * marking wasn't working on executable and
2668 other special filenames
2669 Apr 20, 2009 * (Dennis Benzinger) files opened via http have
2670 their syntax filetype auto-detected
2671 Jun 19, 2009 * (Yukihiro Nakadaira) help document improvements
2672 Jul 22, 2009 * g:netrw_browse_split will honor the
2673 |'equalalways'| setting.
2674 Jul 29, 2009 * implemented "I" mapping to toggle banner
2675 (this is experimental and still being debugged)
2676 Sep 19, 2009 * (Mike McEwan) writes via ftp now send both
2677 g:netrw_ftpmode and g:netrw_ftpextracmd (if the
2679 Dec 02, 2009 * netrw uses vimgrep several places; it now uses
2680 "noautocmd vimgrep" (should be speedier).
2681 Dec 03, 2009 * changed back to using -source instead of -dump
2682 for elinks-using commands. (requested by James
2683 Vega and Karsten Hopp)
2684 v135: Oct 29, 2008 * using |simplify()| on directory names
2685 (supporting handling ".."s in directory names)
2686 Oct 31, 2008 * added special file highlighting for core dumps
2687 under Unix/Linux. The default sorting sequence
2688 now also gives core dumps priority.
2689 Nov 10, 2008 * uses a call to netrw#Nread() instead of Nread
2690 to avoid having to use fnameescape()
2691 * fixed a tree redrawing problem (open directory,
2692 open subdir, close subdir, close dir)
2693 Nov 19, 2008 * sprinkled some histdel("/",-1)s through the code
2694 in an attempt to prevent netrw from changing
2696 Jan 02, 2009 * |g:Netrw_funcref| included
2697 Jan 05, 2009 * Explore */ **/ *// **// all clear explorer
2699 Jan 05, 2009 * (Panagiotis Louridas) extended s:WinPath()
2700 to remove cygdrive from non-cygwin Windows
2701 paths. Improved the determination as to
2702 whether or not to do so.
2703 Jan 13, 2009 * included contains=@NoSpell in every syntax
2704 group for syntax/netrw.vim .
2705 v134: Sep 30, 2008 * (Sander Marechal) provided a bugfix involving
2706 the use of the |netrw-t| command with a remote
2708 Sep 30, 2008 * using "x" on a remote jpg was failing; fixed.
2709 Oct 03, 2008 * bookmarks now go on a list and are stored to
2710 the first directory on the |'runtimepath'| in
2711 the hopes of making their retention reliable.
2712 History now also goes to that directory.
2713 Oct 07, 2008 * Included check that vim 7.0 or later is in use.
2714 Oct 07, 2008 * Improved |g:netrw_retmap| handling.
2715 Oct 12, 2008 * Based upon Sébastien Migniot's suggestion, if
2716 cadaver isn't available then netrw will try to
2717 use curl for the dav://... protocol.
2718 Oct 13, 2008 * added @*/ to netrw buffers' |'iskeyword'|setting
2719 This lets mf (|netrw-mf|) mark directories, links
2721 Oct 13, 2008 * avoids a second NetrwBrowse() refresh when
2722 g:netrw_fastbrowse is <= 1 (slow, medium speed)
2723 Oct 22, 2008 * |g:netrw_http_xcmd| may now be overridden
2724 independently of |g:netrw_http_cmd|.
2725 Oct 23, 2008 * [N] added to the various Explore commands to
2726 let users specify the width/height of new
2727 explorer windows, overriding |g:netrw_winsize|.
2728 v133: Aug 10, 2008 * NetReadFixup() for win95 was missing some "a:"s
2729 Aug 12, 2008 * (Jan Minář) an error condition in NetrwMethod()
2730 wasn't being used, resulting in "b:netrw_fname
2732 Aug 12, 2008 * (François Ingeirest) asked that "hi link" be
2733 changed to hi default link in the netrw syntax
2735 Aug 12, 2008 * using s:NetrwUnmarkList() more often. Filenames
2736 were being left on the global list when removed
2737 from the buffer-local lists.
2738 Aug 14, 2008 * (Joshua Clayton) an errant extra ")" was left in
2739 the rcp-handling portion of NetRead().
2740 Sep 03, 2008 * added |'cursorline'| highlighting to thin, long,
2742 v132: Aug 06, 2008 * Fixed marked file-based obtain
2743 Aug 08, 2008 * sourcing a file via ftp from a netrw-generated
2744 buffer (or any buffer with |'nobl'|) left an
2745 empty no-name buffer in its wake. Fixed.
2746 v130: Jul 31, 2008 * trying out elinks/links for http://host/
2747 requests. One problem: in-page links
2748 (such as with ...#LABEL) are not supported
2749 * verified that Bram's modified netrwPlugin works
2750 Aug 01, 2008 * fixed a bug: when sourcing a file via ftp, the
2751 "filter window" was left behind.
2752 v129: Jul 31, 2008 * bug found in non-mouse enabled vim and some
2754 v128: Jul 30, 2008 * much work done in using shellescape() and
2756 v126: Jun 30, 2008 * after having gone to a remote directory,
2757 <f1> was no longer taking one to the correct
2758 entry in the help (|netrw-quickhelp|). Fixed.
2759 Jul 01, 2008 * extracting the last filename from a wide listing
2760 missed the last letter when |'virtualedit'| not
2762 Jul 01, 2008 * vim foo/bar was creating [Scratch] buffers,
2763 where bar was also a directory
2764 Jul 01, 2008 * numerous additional changes were made to netrw
2765 to use fnameescape() and shellescape() instead
2766 of escape(). Not all changes have been tested
2768 Jul 01, 2008 * (James Vega reported) some problems with
2769 :NetrwSettings (due to no longer used setting
2771 Jul 07, 2008 * Additional numerous changes to support security;
2772 shellescape(arg,1), etc.
2773 v125: Apr 07, 2008 * (Cristian Rigamonti) CR provides a patch; he
2774 noted that gx was failing since its call to
2775 netrw#NetBrowseX() wasn't updated to
2776 netrw#NetrwBrowseX().
2777 * (Stanis Trendelenburg) ST provides a patch to
2778 supports davs: (dav + ssl)
2779 * (Rick Choi) noted that directory names comprised
2780 of three digits were not being displayed by
2781 the internal browser. Fixed.
2782 * (Erik Falor) provided a patch to handle problems
2783 with changing directory and |'acd'| option.
2784 * (James Vega, Teemu Likonen) noted that netrw
2785 wasn't handling multi-byte filenames/directories
2787 * (Rick) found problem with g:netrw_maxfilenamelen
2789 * (James Vega) pointed out that netrw was
2790 misidentifying all files in a symbolically linked
2791 directory as being symbolically linked
2792 themselves. This particular problem was fixed;
2793 however, there are now situations where
2794 symbolically linked files will not be detected.
2795 Really need an internal vim function to do this
2797 Apr 17, 2008 * When g:netrw_keepdir==0, current directory
2798 doesn't necessarily equal b:netrw_curdir
2799 initially. Problem is due to the patch directly
2801 * Fixed qf to handle case where b:netrw_curdir
2802 isn't the same as the current directory under
2804 * New: |netrw-mg| (apply vimgrep to marked files)
2805 May 05, 2008 * (Rick) pointed out that a "setlocal ts=32" was
2806 interfering with g:netrw_maxfilenamelen
2807 May 05, 2008 * (James Vega) a file inside a linked directory
2808 was showing up as a symbolic link itself.
2809 May 22, 2008 * symbolic links, fifos, and sockets are now
2810 indicated by a trailing @, |, or =, respectively.
2811 Jun 06, 2008 * Removed numerous bugs from the marked file
2812 move and copy. Tested these changes under
2814 * :Rexplore returns to the screen position in the
2815 netrw listing from whence the file was edited
2816 v124: Apr 02, 2008 * (Adrian Rollett) change the line supporting the
2817 "x" action for mac to use g:netrw_shq
2818 v123: Feb 27, 2008 * Marked files now keeps a "global" marked file
2819 list. The global marked file list is used to
2820 support tag processing and vimdiff'ing
2821 (|netrw-md| |netrw-mt|)
2822 * Been insuring that mm and mc works with various
2823 combinations of local and remote directories
2824 * (Stefan Bittner) http://.../ should always have
2825 filetype "html" -- fixed.
2826 * (Stefan Bittner) a "?" in a http://.../ request
2827 wasn't being handled correctly. Fixed by
2828 removing ? from default |g:netrw_tmpfile_escape|.
2829 * (Nico Weber) % codes in http://.../ requests
2830 weren't being handled correctly. Fixed by
2831 including % in default |g:netrw_fname_escape|.
2832 * (Stefan Bittner) attempts to update Buffers.Refresh
2833 were failing because locale use changed the menu
2834 names. I implemented a workaround.
2835 v122: Feb 12, 2008 * bugfix - first sorting sequence match now has
2837 Feb 14, 2008 * bugfix - sorting sequence was effectively ignoring
2838 sequencing priority of anything following '*'
2839 * toggling a marked file was showing incorrect list
2840 (list was correct, but displayed matches weren't)
2841 * |g:netrw_special_syntax| implemented
2842 v121: Feb 11, 2008 * Bram M reported that :e file ... :e . would not
2843 retain the alternate file. Fixed -- I hope!
2844 * bugfix -- apparently v120 broke an explicit
2846 v120: Jan 21, 2008 * |netrw-mt| changed to allow for target selection
2847 based on whether or not word under cursor is a
2848 directory or file, or if cursor is in banner
2850 * |netrw-mh| included (hiding by marked-file suffix)
2851 * functions moved about a bit (improved
2853 * executable files now displayed with trailing (*)
2854 * symbolically linked files now displayed with
2856 * Somewhen, s:NetrwMarkFileMove() got damaged. It
2857 * is now restored (missing an endif, for example).
2858 * |netrw-mu| implemented (unmarking marked files)
2859 * many bugs have been removed from the marked file
2860 system (tnx to Mark S. for feedback)
2861 * |netrw-ms| implemented (sourcing marked files)
2862 * fixed use of P with tree listing style
2863 * multiple tree listing now supported
2865 * changed q -> qb (query bookmarks)
2866 * implemented |netrw-qf|
2867 * Explore now has four special list-generation
2868 modes: */filepat **/filepat
2869 *//pattern **//pattern
2870 * gh (|netrw-gh|) is a shortcut for toggling the
2871 hiding of files and directories beginning with a
2873 v119: Jan 10, 2008 * When g:netrw_keepdir is false,
2874 NetrwOptionsRestore() had a problem
2876 Jan 11, 2008 * Netrw now shows symbolic links with a trailing
2877 "@" and special highlighting.
2878 Jan 15, 2008 * Changed g:netrw_noretmap -> |g:netrw_retmap|.
2879 Changed: disabled by default at Bram's
2881 v118: Jan 02, 2008 * Fixed a problem with Windows;
2882 :Explore c:/path/ would not work,
2883 but :Explore c:/path would.
2884 * Fixed a bug in s:NetrwOptionRestore() - lcd's
2885 argument wasn't being properly escaped so it
2886 wouldn't handle spaces in directory names.
2888 v117: Jan 02, 2008 * Fixed a problem with P; had to include
2889 a b:netrw_curdir bypass (Bram Moolenaar)
2890 v116: Nov 27, 2007 * netrw#LocalBrowseCheck() has &ft=="netrw"
2891 check to prevent doing a directory listing
2892 (was getting unexpected directory refreshes
2893 in the middle of some function calls)
2894 * NetrwOptionRestore moved after e! filename
2895 in order to retain user options for editing
2896 in s:NetrwBrowseChgDir()
2897 Dec 12, 2007 * Bug fix -- netrw does a better job of retaining
2898 user options when editing files under the aegis
2900 v115: Oct 04, 2007 * Erik Remmelzwaal pointed out that the use of
2901 shellslash in s:GetTempfile() was incorrect
2902 Oct 11, 2007 * Tracked down and eliminated a bug with editing
2903 remote *.tar.gz and *.tar.bz2 files
2904 Oct 11, 2007 * g:netrw_localmovecmd wasn't being initialized
2905 properly, and g:netrw_localcopycmd was being
2907 Oct 12, 2007 * Placed all :Rexplore and <2-leftmouse> setup
2908 in a new support function (s:SetRexDir()).
2909 Oct 15, 2007 * new: g:netrw_browse_split == 4; means <cr>
2910 based selection will use previous window
2911 Oct 20, 2007 * also checks on |'shellxquote'| to set g:netrw_shq
2912 Oct 24, 2007 * Explore handles path/**/filename
2913 Oct 27, 2007 * sourcing remote files often didn't work with ftp,
2914 turns out that b:netrw_method was undefined, so
2915 s:SaveBufVars and s:RestoreBufVars() fixed it.
2916 v114: Sep 28, 2007 * mT, the map that invokes tags, has been improved
2917 to support use of remote tags files.
2918 Oct 02, 2007 * changed Netrw menu to use more submenus
2919 v113: Sep 07, 2007 * worked out why the cursor position wasn't being
2920 saved and restored as intended after doing such
2921 things as deleting and renaming files.
2922 Sep 11, 2007 * Fixed bug which effectively disabled <c-l> and
2924 Sep 18, 2007 * there used to be one NetrwOptionRestore() call at
2925 the end of the s:NetrwBrowseChgDir() function;
2926 they're now at the end of every if..elseif..else
2927 block. The edit-a-file one is not quite at the end
2928 of its block; instead, it's just before the edit.
2929 Restores user options, then this new placement
2930 allows ftplugins, autocmds, etc to change settings
2931 (ex. ftplugin/cpp.vim sets cindent).
2932 Sep 19, 2007 * changed all strlen() calls to use s:Strlen(), a
2933 function which handles utf-8 wide characters
2935 Sep 20, 2007 * (Nico Weber) the "x" command has been extended
2936 to Mac's OS/X (macunix); it now uses open to
2937 handle |netrw-x| browsing with special files.
2938 Sep 22, 2007 * Added g:netrw_noretmap to netrw at Tony M's
2940 * Included path to NetrwRemoteRmFile()
2941 v112: Aug 18, 2007 * added mx (|netrw-mx|) for executing arbitrary
2942 commands on marked files
2943 Aug 22, 2007 * more option save/restore work for
2944 s:NetrwBrowseChgDir(); s:NetrwOptionSave()
2945 and s:NetrwOptionRestore() now take a parameter
2946 specifying the type of variables to be used for
2947 saving and restoring (either "w:" or "s:")
2948 Sep 04, 2007 * added the :NetrwClean[!] command
2949 v111: Jul 25, 2007 * using Windows but not using Cygwin, netrw does a
2950 "file bufname" where the bufname uses /s
2951 instead of \s; Vim "fixes" it by changing the
2952 bufname to use \s anyway. This meant that
2953 NetrwGetBuffer() didn't find the appropriately
2954 named buffer, and so would generate a new
2955 buffer listing; hence the cursor would appear
2956 to have been moved when doing a preview.
2957 * added <2-leftmouse> map to return to netrw's
2959 Aug 16, 2007 * added the mark-file system, including
2960 maps for mf mp mt mz and mu. Modifications
2961 made to maps for a D O and R to support
2963 v110: May 10, 2007 * added [ and ] maps to NetrwTreeListing
2964 May 25, 2007 * |g:netrw_preview| included
2965 May 29, 2007 * modified netrw#NetBrowseX to consistently use
2966 g:netrw_shq instead of hardcoded quotes,
2967 and modified the snippet that sets up redir
2968 so Windows machines use "nul" instead of
2970 Jun 01, 2007 * fixed bug -- NetGetBuffer() wasn't always
2971 recognizing a buffer name match when it should,
2972 thus resulting in [Scratch] buffers.
2973 Jun 04, 2007 * Gary Johnson found a bugfix for the "c" mapping
2974 when the directory is to be made current but
2975 the name contains spaces.
2976 v109: Mar 26, 2007 * if a directory name includes a "$" character,
2977 Explore() will use expand() in an attempt to
2979 May 07, 2007 * g:netrw_use_errorwindow now allows one to
2980 have error messages go to a reliable window
2981 or to use a less reliable but recallable
2983 May 07, 2007 * g:netrw_scpport and g:netrw_sshport support
2984 use of -P and -p, respectively, to set port
2986 v108: Jan 03, 2007 * included preview map (|netrw-p|), supporting
2988 * netrw can now source remote files
2989 Jan 26, 2007 * Colton Jamieson noted that remote directory
2990 browsing did not support alternate port
2991 selection. This feature has now been extended
2992 to apply to all remote browsing commands via ssh.
2993 (list, remove/delete, rename)
2994 Jan 31, 2007 * Luis Florit reported that @* was an invalid
2995 register. The @* register is now only saved and
2996 restored if |'guioptions'| contains "a".
2997 Feb 02, 2007 * Fixed a bug that cropped up when writing files
2998 via scp using cygwin
2999 Feb 08, 2007 * tree listing mode managed to stop working again;
3001 Feb 15, 2007 * Guido Van Hoecke reported that netrw didn't
3002 handle browsing well with M$ ftp servers. He even
3003 set up a temporary account for me to test with
3004 (thanks!). Netrw now can browse M$ ftp servers.
3005 v107: Oct 12, 2006 * bypassed the autowrite option
3006 Oct 24, 2006 * handles automatic decompression of *.gz and *.bz2
3008 Nov 03, 2006 * Explore will highlight matching files when
3009 **/pattern is used (and if the |'hls'| option
3011 Nov 09, 2006 * a debugging line, when enabled, was inadvertently
3012 bringing up help instead of simply reporting on
3014 Nov 21, 2006 * tree listing improved (cursor remains put)
3015 Nov 27, 2006 * fixed b:netrw_curdir bug when repeated "i"s were
3017 Dec 15, 2006 * considerable qty of changes, mostly to share more
3018 code between local and remote browsing. Includes
3019 support for tree-style listing for both remote
3021 Dec 15, 2006 * Included Peter Bengtsson's modifications to
3023 v106: Sep 21, 2006 * removed old v:version<700 code as netrw now
3025 * worked around a bug where register * was
3026 overwritten during local browsing
3027 v104: Sep 05, 2006 * as suggested by Rodolfo Borges, :Explore and
3028 variants will position the cursor on the file
3029 just having been edited
3030 * changed default |g:netrw_sort_sequence| order
3031 * changed b, Nb to simply mb (see |netrw-mb|)
3032 * changed B, NB to simply gb (see |netrw-gb|)
3033 * tree listing style (see |g:netrw_liststyle|)
3034 * attempts to retain the alternate file
3035 v103: Jul 26, 2006 * used Yakov Lerner's tip#1289 to improve netrw
3036 error message display
3037 * wide listings didn't handle files with backslashes
3038 in their names properly. A symptom was an
3039 inability to open files.
3040 Aug 09, 2006 * included "t" mapping for opening tabbed windows,
3041 both for remote and local browsing
3042 * changed netrw_longlist to netrw_liststyle
3043 Aug 15, 2006 * fixed one of the NB maps
3044 Aug 22, 2006 * changed *Explore commands to use -nargs=* instead
3045 of -nargs=?. Allows both -complete=dir _and_ the
3046 starstar arguments to work (-nargs=? seems to
3047 require one or the other).
3048 Aug 23, 2006 * copied all w:.. variables across splits to
3050 Aug 25, 2006 * when g:netrw_browsex_viewer was '-'
3051 (see |g:netrw_browsex_viewer|) it wasn't causing
3052 netrwFileHandlers#Invoke() to be called as it
3053 was expected to. (tnx Steve Dugaro)
3054 Aug 29, 2006 * changed NetBrowseX() to use "setlocal ... noswf"
3055 instead of "set ... noswf" (tnx Benji Fisher)
3056 Aug 31, 2006 * tabs and fastbrowse<=1 didn't work together.
3057 v102: Jun 15, 2006 * chgd netrwPlugin to call netrw#LocalBrowseCheck()
3058 * bugfix: g:netrw_keepdir==0 had stopped working
3059 Jul 06, 2006 * bugfix: NetOptionSave/Restore now saves/restores
3060 the unnamed register (|registers|)
3061 Jul 07, 2006 * |g:netrw_menu| support included
3062 Jul 13, 2006 * :Texplore command implemented
3063 Jul 17, 2006 * NetSplit and (Local|Net)BrowseChgDir() were both
3064 splitting windows. This affected o, v, and
3065 g:netrw_browse_split.
3066 Jul 20, 2006 * works around wildignore setting (was causing
3067 netrw's local browser not to list wildignore'd
3069 Jul 24, 2006 * <leftmouse> acts as a <cr> for selecting a file
3070 <rightmouse> acts as a <del> for deleting a file
3071 v100: May 14, 2006 * when using Windows and shell==cmd.exe, the
3072 default for g:netrw_ignorenetrc is now 1
3073 * bugfix: unwanted ^Ms now removed
3074 (affected shell==cmd.exe - Windows)
3075 * added Bookmarks and History to the menu
3076 * an error message about non-existing
3077 w:netrw_longlist was appearing during attempts to
3079 * g:netrw_shq now available to make netrw use
3080 specified style of quotes for commands
3081 May 29, 2006 * user NFH_*() functions were inadvertently being
3083 * fixed a Windows non-cygwin ftp handling problem.
3084 * hiding pattern candidate separators included some
3085 characters it shouldn't have (tnx to Osei Poku)
3086 Jun 01, 2006 * for browsing, netrw was supposed to use "dir"
3087 instead of "ls -lF" when using
3088 ftp+non-cygwin+windows. Fixed.
3089 * an inadvertently left-in-place debugging statement
3090 was preventing use of the "x" key with browsing.
3091 Jun 05, 2006 * g:netrw_nogx available to prevent making the gx
3092 map (see |g:netrw_nogx|)
3093 * bugfix, Explore wouldn't change directory
3094 properly (vim ., :Explore subdirname)
3095 Jun 06, 2006 * moved history to 2nd line in Netrw menu
3096 * fixed delete for unix-based systems
3097 Jun 07, 2006 * x key now works for windows-noncygwin-ftp
3098 Jun 08, 2006 * Explore */pat and **//pat now wraps
3099 v99: May 09, 2006 * g:netrw_browse_split=3 for opening files in new
3101 May 12, 2006 * deletes temporary file at end of NetRead()
3102 * visual mode based Obtain implemented
3103 * added -complete=dir to the various Explore
3105 v98: May 02, 2006 * the "p" key didn't work properly when the browsing
3106 directory name had spaces in it.
3107 v97: May 01, 2006 * exists("&acd") now used to determine if
3108 the 'acd' option exists
3109 * "obtain" now works again under Windows
3110 v96: * bugfix - the |'acd'| option is not always defined
3111 but is now bypassed only when it is
3112 v95: * bugfix - Hiding mode worked correctly (don't show
3113 any file matching any of the g:netrw_hide
3114 patterns), but showing mode was showing only those
3115 files that didn't match any of the g:netrw_hide
3116 patterns. Instead, it now shows all files that
3117 match any of the g:netrw_hide patterns (the
3118 difference between a logical and and logical or).
3119 v94: * bugfix - a Decho() had a missing quote; only
3120 affects things when debugging was enabled.
3121 v93: * bugfix - removed FocusGained event from causing a
3122 slow-browser refresh for Windows
3123 v92: * :Explore **//pattern implemented
3124 (**/filepattern was already taken)
3125 v91: * :Explore */pattern implemented
3126 * |'acd'| option bypassed
3127 v90: * mark ', as suggested by Yegappan Lakshmanan, used
3128 to help guarantee entry into the jump list when
3130 * <s-down> and <s-up> are no longer defined until a
3131 :Explore **/pattern is used (if the user already
3132 has a map for them). They will be defined for new
3133 browser windows from that point forward.
3134 v89: * A <s-down>, <s-up>, :Nexplore, or a :Pexplore
3135 without having first done an :Explore **/pattern
3136 (see |netrw-starstar|) caused
3137 a lot of unhelpful error messages to appear
3138 v88: * moved DrChip.Netrw menu to Netrw. Now has
3139 priority 80 by default.
3140 g:NetrwTopLvlMenu == "Netrw" and can be changed
3141 by the user to suit. The priority is given by
3142 g:NetrwMenuPriority.
3143 * Changed filetype for browser displays from
3145 v87: * bug fix -- menus were partially disappearing
3146 v85: * bug fix -- missing an endif
3147 * bug fix -- handles spaces in names and directories
3148 when using ftp-based browsing
3149 v83: * disabled stop-acd handling; the change in directory
3150 handling may allow acd to be used again.
3151 * D was refusing to delete remote files/directories
3152 in wide listing mode.
3153 v81: * FocusGained also used to refresh/wipe local browser
3155 * (bugfix) netrw was leaving [Scratch] buffers behind
3156 when the user had the "hidden" option set. The
3157 'hidden' option is now bypassed.
3158 v80: * ShellCmdPost event used in conjunction with
3159 g:netrw_fastbrowse to refresh/wipe local browser
3161 v79: * directories are now displayed with nowrap
3162 * (bugfix) if the column width was smaller than the
3163 largest file's name, then netrw would hang when
3164 using wide-listing mode - fixed
3165 * g:netrw_fastbrowse introduced
3166 v78: * progress has been made on allowing spaces inside
3167 directory names for remote work (reading, writing,
3169 v77: * Mikolaj Machowski fixed a bug in a substitute cmd
3170 * g:netrw_browsex_viewer implemented
3171 * Mikolaj Machowski pointed out that gnome-open is
3172 often executable under KDE systems, although it is
3173 effectively not functional. NetBrowseX now looks
3174 for "kicker" as a running process to determine if
3175 KDE is actually running.
3176 * Explorer's O functionality was inadvertently left
3177 out. Netrw now does the same thing, but with the
3179 * added g:netrw_browse_split option
3180 * fixed a bug where the directory contained a "." but
3181 the file didn't (was treating the dirname from "."
3182 onwards as a suffix)
3183 v76: * "directory is missing" error message now restores
3185 v75: * file://... now conforms to RFC2396 (thanks to
3187 * if the binary option is set, then NetWrite() will
3188 only write the whole file (line numbers don't make
3189 sense with this). Supports writing of tar and zip
3191 v74: * bugfix (vim, then :Explore) now works
3192 * ctrl-L keeps cursor at same screen location (both
3193 local and remote browsing)
3194 * netrw now can read remote zip and tar files
3195 * Obtain now uses WinXP ftp+.netrc successfully
3196 v73: * bugfix -- scp://host/path/file was getting named
3198 * netrw detects use of earlier-than-7.0 version of
3199 vim and issues a pertinent error message.
3200 * netrwSettings.vim is now uses autoloading. Only
3201 <netrwPlugin.vim> is needed as a pure plugin
3202 (ie. always loaded).
3203 v72: * bugfix -- formerly, one could prevent the loading
3204 of netrw by "let g:loaded_netrw=1"; when
3205 autoloading became supported, this feature was
3206 lost. It is now restored.
3207 v71: * bugfix -- made some "set nomodifiable"s into
3208 setlocal variants (allows :e somenewfile to be
3209 modifiable as usual)
3210 * NetrwSettings calls a netrw function, thereby
3211 assuring that netrw has loaded. However, if netrw
3212 does not load for whatever reason, then
3213 NetrwSettings will now issue a warning message.
3214 * For what reason I don't recall, when wget and fetch
3215 are both not present, and an attempt to read a
3216 http://... url is made, netrw exited. It now only
3218 * When ch=1, on the second and subsequent uses of
3219 browsing Netrw would issue a blank line to clear
3220 the echo'd messages. This caused an annoying
3221 "Hit-Enter" prompt; now a blank line message
3222 is echo'd only if &ch>1.
3223 v70: * when using |netrw-O|, the "Obtaining filename"
3224 message is now shown using |hl-User9|. If User9
3225 has not been defined, netrw itself will define it.
3226 v69: * Bugfix: win95/98 machines were experiencing a
3227 "E121: Undefined variable: g:netrw_win95ftp"
3229 v68: * double-click-leftmouse selects word under mouse
3230 v67: * Passwords which contain blanks will now be
3231 surrounded by double-quotes automatically (Yongwei)
3232 v66: * Netrw now seems to work with a few more Windows
3234 * O now obtains a file: remote browsing
3235 file -> local copy, locally browsing
3236 file -> current directory (see :pwd)
3237 * i now cycles between thin, long, and wide listing
3239 * NB and Nb are maps that are always available;
3240 corresponding B and b maps are only available when
3241 not using wide listing in order to allow them to
3243 v65: * Browser functions now use NetOptionSave/Restore; in
3244 particular, netrw now works around the report
3246 v64: * Bugfix - browsing a "/" directory (Unix) yielded
3247 buffers named "[Scratch]" instead of "/"
3248 * Bugfix - remote browsing with ftp was omitting
3250 v63: * netrw now takes advantage of autoload (needs 7.0)
3251 * Bugfix - using r (to reverse sort) working again
3252 v62: * Bugfix - spaces allowed again in directory names
3253 with g:netrw_keepdir=0. In fact, I've tested netrw
3254 with most ANSI punctuation marks for directory
3256 * Bugfix - NetrwSettings gave errors when
3257 g:netrw_silent had not be set.
3258 v61: * Document upgrade -- netrw variable-based settings
3259 all should have tags. Supports NetrwSettings cmd.
3260 * Several important variables are window-oriented.
3261 Netrw has to transfer these across a window split.
3262 See s:BufWinVars() and s:UseBufWinVars().
3263 v60: * When using the i map to switch between long and
3264 short listings, netrw will now keep cursor on same
3266 * "Match # of #" now uses status line
3267 * :Explore **/*.c will now work from a
3268 non-netrw-browser window
3269 * :Explore **/patterns can now be run in separate
3271 * active banner (hit <cr> will cause various things
3273 v59: * bugfix -- another keepalt work-around installed
3275 * "Match # of #" for Explore **/pattern matches
3276 v58: * Explore and relatives can now handle
3277 **/somefilepattern (v7)
3278 * Nexplore and Pexplore introduced (v7). shift-down
3279 and shift-up cursor keys will invoke Nexplore and
3280 Pexplore, respectively.
3281 * bug fixed with o and v
3282 * autochdir only worked around for vim when it has
3283 been compiled with either
3284 |+netbeans_intg| or |+sun_workshop|
3285 * Under Windows, all directories and files were
3286 being preceded with a "/" when local browsing.
3288 * When: syntax highlighting is off, laststatus=2, and
3289 remote browsing is used, sometimes the laststatus
3290 highlighting bleeds into the entire display. Work
3291 around - do an extra redraw in that case.
3292 * Bugfix: when g:netrw_keepdir=0, due to re-use of
3293 buffers, netrw didn't change the directory when it
3295 * Bugfix: D and R commands work again
3296 v57: * Explore and relatives can now handle RO files
3297 * reverse sort restored with vim7's sort command
3298 * g:netrw_keepdir now being used to keep the current
3299 directory unchanged as intended (sense change)
3300 * vim 6.3 still supported
3301 v56: * LocalBrowse now saves autochdir setting, unsets it,
3302 and restores it before returning.
3303 * using vim's rename() instead of system +
3304 local_rename variable
3305 * avoids changing directory when g:netrw_keepdir is
3307 v55: * -bar used with :Explore :Sexplore etc to allow
3308 multiple commands to be separated by |s
3309 * browser listings now use the "nowrap" option
3310 * browser: some unuseful error messages now
3312 v54: * For backwards compatibility, Explore and Sexplore
3313 have been implemented. In addition, Hexplore and
3314 Vexplore commands are available, too.
3315 * <amatch> used instead of <afile> in the
3316 transparency support (BufReadCmd, FileReadCmd,
3318 * ***netrw*** prepended to various error messages
3320 * g:netrw_port used instead of b:netrw_port for scp
3321 * any leading [:#] is removed from port numbers
3322 v53: * backslashes as well as slashes placed in various
3323 patterns (ex. g:netrw_sort_sequence) to better
3325 v52: * nonumber'ing now set for browsing buffers
3326 * when the hiding list hid all files, error messages
3328 * when browsing, swf is set, but directory is not
3329 set, when netrw was attempting to restore options,
3330 vim wanted to save a swapfile to a local directory
3331 using an url-style path. Fixed
3332 v51: * cygwin detection now automated
3333 (using windows and &shell is bash)
3334 * customizable browser "file" rejection patterns
3336 * :[range]w url now supported (ie. netrw uses a
3338 * error messages have a "Press <cr> to continue" to
3339 allow them to be seen
3340 * directory browser displays no longer bother the
3342 * u/U commands to go up and down the history stack
3343 * history stack may be saved with viminfo with it's
3345 * bugfixes associated with unwanted [No Files]
3347 v50: * directories now displayed using buftype=nofile;
3348 should keep the directory names as-is
3349 * attempts to remove empty "[No File]" buffers
3350 leftover from :file ..name.. commands
3351 * bugfix: a "caps-lock" editing difficulty left in
3353 * syntax highlighting for "Showing:" the hiding list
3355 * bookmarks can now be retained if "!" is in the
3357 v49: * will use ftp for http://.../ browsing
3358 v48: * One may use ftp to do remote host file browsing
3359 * (windows and !cygwin) remote browsing with ftp can
3360 now use the "dir" command internally to provide
3362 * g:netrw_keepdir now allows one to keep the initial
3363 current directory as the current directory
3364 (normally the local file browser makes the
3365 currently viewed directory the current directory)
3366 * g:netrw_alto and g:netrw_altv now support
3367 alternate placement of windows started with o or v
3368 * Nread ? and Nwrite ? now uses echomsg (instead of
3369 echo) so :messages can repeat showing the help
3370 * bugfix: avoids problems with partial matches of
3371 directory names to prior buffers with longer names
3372 * one can suppress error messages with g:netrw_quiet
3374 * instead of <Leader>h for editing hiding list one
3375 may edit the sorting sequence with the S map, which
3376 now allows confirmation of deletion with
3377 [y(es) n(o) a(ll) q(uit)]
3378 * the "x" map now handles special file viewing with:
3379 (windows) rundll32 url.dll (gnome) gnome-open (kde)
3380 kfmclient If none of these are on the executable
3381 path, then netrwFileHandlers.vim is used.
3382 * directory bookmarking during both local and remote
3383 browsing implemented
3384 * one may view all, use the hiding list to suppress,
3385 or use the hiding list to show-only remote and
3386 local file/directory listings
3387 * improved unusual file and directory name handling
3388 preview window support
3389 v47: * now handles local browsing.
3390 v46: * now handles remote browsing
3391 * g:netrw_silent (if 1) will cause all transfers to
3393 v45: * made the [user@]hostname:path form a bit more
3394 restrictive to better handle errors in using
3395 protocols (e.g. scp:usr@host:file was being
3396 recognized as an rcp request)
3397 v44: * changed from "rsync -a" to just "rsync"
3398 * somehow an editing error messed up the test to
3399 recognize use of the fetch method for NetRead.
3400 * more debugging statements included
3401 v43: * moved "Explanation" comments to <pi_netrw.txt> help
3402 file as "Network Reference" (|netrw-ref|)
3403 * <netrw.vim> now uses Dfunc() Decho() and Dret() for
3405 * removed superfluous NetRestorePosn() calls
3406 v42: * now does BufReadPre and BufReadPost events on
3407 file:///* and file://localhost/*
3408 v41: * installed file:///* and file://localhost/* handling
3409 v40: * prevents redraw when a protocol error occurs so
3410 that the user may see it
3412 v38: * Now uses NetRestorePosn() calls with Nread/Nwrite
3414 * Temporary files now removed via bwipe! instead of
3415 bwipe (thanks to Dave Roberts)
3416 v37: * Claar's modifications which test if ftp is
3417 successful, otherwise give an error message
3418 * After a read, the alternate file was pointing to
3419 the temp file. The temp file buffer is now wiped
3421 * removed silent from transfer methods so user can
3422 see what's happening
3425 ==============================================================================
3426 13. Todo *netrw-todo* {{{1
3428 07/29/09 : banner :|g:netrw_banner| can be used to suppress the
3429 suppression banner. This feature is new and experimental,
3430 so its in the process of being debugged.
3431 09/04/09 : "gp" : See if it can be made to work for remote systems.
3432 : See if it can be made to work with marked files.
3434 ==============================================================================
3435 14. Credits *netrw-credits* {{{1
3437 Vim editor by Bram Moolenaar (Thanks, Bram!)
3438 dav support by C Campbell
3439 fetch support by Bram Moolenaar and C Campbell
3440 ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM>
3441 http support by Bram Moolenaar <bram@moolenaar.net>
3443 rsync support by C Campbell (suggested by Erik Warendorph)
3444 scp support by raf <raf@comdyn.com.au>
3445 sftp support by C Campbell
3447 inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell
3449 Jérôme Augé -- also using new buffer method with ftp+.netrc
3450 Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use,
3452 Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution
3453 Erik Warendorph -- for several suggestions (g:netrw_..._cmd
3454 variables, rsync etc)
3455 Doug Claar -- modifications to test for success with ftp
3458 ==============================================================================
3460 vim:tw=78:ts=8:ft=help:norl:fdm=marker