blob: 991c9a4a05d175e10b7bd7947b7b87bf1d027e05 [file] [log] [blame]
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001*pi_netrw.txt For Vim version 6.2. Last change: Sep 10, 2004
Bram Moolenaar071d4272004-06-13 20:20:40 +00002
3
4 VIM REFERENCE MANUAL by Charles E. Campbell, Jr.
5
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00006*dav* *http* *network* *rcp* *scp*
7*fetch* *netrw* *Nread* *rsync* *sftp*
8*ftp* *netrw.vim* *Nwrite* *netrw-file*
Bram Moolenaar071d4272004-06-13 20:20:40 +00009
10==============================================================================
110. Contents *netrw-contents*
12
131. Netrw Reference.....................................|netrw-ref|
142. Network-Oriented File Transfer......................|netrw-xfer|
153. Activation..........................................|netrw-activate|
164. Transparent File Transfer...........................|netrw-transparent|
175. Ex Commands.........................................|netrw-ex|
186. Variables and Options...............................|netrw-var|
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000197. Directory Browser...................................|netrw-browse|
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000208. Problems and Fixes..................................|netrw-problems|
219. Debugging...........................................|netrw-debug|
2210. History.............................................|netrw-history|
2311. Credits.............................................|netrw-credits|
Bram Moolenaar071d4272004-06-13 20:20:40 +000024
25The functionality mentioned here is done via using |standard-plugin|
26techniques. This plugin is only available if
27
Bram Moolenaar69a7cb42004-06-20 12:51:53 +000028 set nocp " 'compatible' is not set
29 filetype plugin on " plugins are enabled
Bram Moolenaar071d4272004-06-13 20:20:40 +000030
31You can avoid loading this plugin by setting the "loaded_netrw" variable
32in your <.vimrc> file: >
33
34 :let loaded_netrw = 1
35
36{Vi does not have any of this}
37
38==============================================================================
391. Netrw Reference *netrw-ref*
40
41 OPTIONS
42 let g:netrw_ftp =0 use ftp (default) (uid password)
43 =1 use alternate ftp method (user uid password)
44 If you're having trouble with ftp, try changing the value
45 of this variable in your <.vimrc> to change methods
46
47 let g:netrw_ignorenetrc= 1
48 If you have a <.netrc> file but it doesn't work and you
49 want it ignored, then set this variable as shown. Its mere
50 existence is enough to cause <.netrc> to be ignored.
51
52 Controlling External Applications
53
Bram Moolenaar69a7cb42004-06-20 12:51:53 +000054 Protocol Variable Default Value
55 -------- ---------------- -------------
56 dav: g:netrw_dav_cmd = "cadaver"
57 fetch: g:netrw_fetch_cmd = "fetch -o"
58 ftp: g:netrw_ftp_cmd = "ftp"
59 http: g:netrw_http_cmd = "fetch -o" if fetch is available
60 http: g:netrw_http_cmd = "wget -q -O" If wget is available
61 rcp: g:netrw_rcp_cmd = "rcp"
62 rsync: g:netrw_rsync_cmd = "rsync -a"
63 scp: g:netrw_scp_cmd = "scp -q"
Bram Moolenaar071d4272004-06-13 20:20:40 +000064 sftp: g:netrw_sftp_cmd = "sftp"
65
Bram Moolenaard4755bb2004-09-02 19:12:26 +000066 READING *netrw-read* *netrw-nread*
Bram Moolenaar071d4272004-06-13 20:20:40 +000067 :Nread ? give help
Bram Moolenaard4755bb2004-09-02 19:12:26 +000068 :Nread "machine:path" uses rcp
69 :Nread "machine path" uses ftp with <.netrc>
70 :Nread "machine id password path" uses ftp
71 :Nread "dav://machine[:port]/path" uses cadaver
72 :Nread "fetch://[user@]machine/path" uses fetch
73 :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp autodetects <.netrc>
74 :Nread "http://[user@]machine/path" uses http uses wget
75 :Nread "rcp://[user@]machine/path" uses rcp
76 :Nread "rsync://[user@]machine[:port]/path" uses rsync
77 :Nread "scp://[user@]machine[[:#]port]/path" uses scp
78 :Nread "sftp://[user@]machine/path" uses sftp
Bram Moolenaar071d4272004-06-13 20:20:40 +000079
Bram Moolenaard4755bb2004-09-02 19:12:26 +000080 WRITING *netrw-write* *netrw-nwrite*
Bram Moolenaar69a7cb42004-06-20 12:51:53 +000081 :Nwrite ? give help
Bram Moolenaard4755bb2004-09-02 19:12:26 +000082 :Nwrite "machine:path" uses rcp
83 :Nwrite "machine path" uses ftp with <.netrc>
84 :Nwrite "machine id password path" uses ftp
85 :Nwrite "dav://machine[:port]/path" uses cadaver
86 :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp autodetects <.netrc>
87 :Nwrite "rcp://[user@]machine/path" uses rcp
88 :Nwrite "rsync://[user@]machine[:port]/path" uses rsync
89 :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp
90 :Nwrite "sftp://[user@]machine/path" uses sftp
Bram Moolenaar071d4272004-06-13 20:20:40 +000091 http: not supported!
92
Bram Moolenaar69a7cb42004-06-20 12:51:53 +000093 DIRECTORY LISTING
94 :Nread [protocol]://[user]@hostname/path/
95
Bram Moolenaar071d4272004-06-13 20:20:40 +000096 USER AND PASSWORD CHANGING
97 Attempts to use ftp will prompt you for a user-id and a password.
98 These will be saved in g:netrw_uid and g:netrw_passwd Subsequent uses
99 of ftp will re-use those. If you need to use a different user id
100 and/or password, you'll want to call NetUserPass() first.
101
102 :NetUserPass [uid [password]] -- prompts as needed
103 :call NetUserPass() -- prompts for uid and password
104 :call NetUserPass("uid") -- prompts for password
105 :call NetUserPass("uid","password") -- sets global uid and password
106
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000107 VARIABLES *netrw-variables*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000108 b:netrw_lastfile last file Network-read/written retained on
109 a per-buffer basis (supports plain :Nw )
110 s:netrw_line during Nw/NetWrite, holds current line number
111 s:netrw_col during Nw/NetWrite, holds current column number
112 s:netrw_line and s:netrw_col are used to
113 restore the cursor position on writes
114 g:netrw_ftp if it doesn't exist, use default ftp
115 =0 use default ftp (uid password)
116 =1 use alternate ftp method (user uid password)
117 g:netrw_ftpmode ="binary" (default)
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000118 ="ascii"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000119 g:netrw_uid (ftp) user-id, retained on a per-session basis
120 g:netrw_passwd (ftp) password, retained on a per-session basis
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000121 g:netrw_win95ftp =1 if using Win95, will remove four trailing blank
122 lines that o/s's ftp "provides" on transfers
123 =0 force normal ftp behavior (no trailing line
124 removal)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000125 g:netrw_cygwin =1 assume scp under windows is from cygwin
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000126 Also permits network browsing to use
127 ls with time and size sorting
Bram Moolenaar071d4272004-06-13 20:20:40 +0000128 (default if windows)
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000129 =0 assume Windows' scp accepts windows-style paths
130 Network browsing uses dir instead of ls
131 This option is ignored if you're using unix
132 g:netrw_use_nt_rcp=0 don't use the rcp of WinNT, Win2000 and WinXP
133 =1 use WinNT's rcp in binary mode (default)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000134
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000135 PATHS *netrw-path*
136
137 Paths to files are generally user-directory relative for most protocols.
138 It is possible that some protocol will make paths relative to some
139 associated directory, however.
140
141 example: vim scp://user@host/somefile
142 example: vim scp://user@host/subdir1/subdir2/somefile
143
144 where "somefile" is the "user"'s home directory. If you wish to get a
145 file using root-relative paths, use the full path:
146
147 example: vim scp://user@host//somefile
148 example: vim scp://user@host//subdir1/subdir2/somefile
149
Bram Moolenaar071d4272004-06-13 20:20:40 +0000150
151==============================================================================
1522. Network-Oriented File Transfer *netrw-xfer*
153
154Network-oriented file transfer under Vim is implemented by a VimL-based script
155(<netrw.vim>) using plugin techniques. It currently supports both reading
156and writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch,
157dav/cadaver, rsync, or sftp.
158
159http is currently supported read-only via use of wget or fetch.
160
161<netrw.vim> is a standard plugin which acts as glue between Vim and the
162various file transfer programs. It uses autocommand events (BufReadCmd,
163FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. >
164
165 ex. vim ftp://hostname/path/to/file
166<
167The characters preceding the colon specify the protocol to use;
168in the example, its ftp. The <netrw.vim> script then formulates
169a command or a series of commands (typically ftp) which it issues
170to an external program (ftp, scp, etc) which does the actual file
171transfer/protocol. Files are read from/written to a temporary file
172(under Unix/Linux, /tmp/...) which the <netrw.vim> script will
173clean up.
174
175One may modify any protocol's implementing external application
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000176by setting a variable (ex. scp uses the variable g:netrw_scp_cmd,
Bram Moolenaar071d4272004-06-13 20:20:40 +0000177which is defaulted to "scp -q").
178
179Ftp, an old protocol, seems to be blessed by numerous implementations.
180Unfortunately, some implementations are noisy (ie., add junk to the end
181of the file). Thus, concerned users may decide to write a NetReadFixup()
182function that will clean up after reading with their ftp. Some Unix systems
183(ie., FreeBSD) provide a utility called "fetch" which uses the ftp protocol
184but is not noisy and more convenient, actually, for <netrw.vim> to use.
185Consequently, if "fetch" is executable, it will be used to do reads for
186ftp://... (and http://...) . See |netrw-var| for more about this.
187
188For rcp, scp, sftp, and http, one may use network-oriented file transfers
189transparently; ie.
190>
191 vim rcp://[user@]machine/path
192 vim scp://[user@]machine/path
193<
194If your ftp supports <.netrc>, then it too can be just as transparently used
195if the needed triad of machine name, user id, and password are present in
196that file. Your ftp must be able to use the <.netrc> file on its own, however.
197>
198 vim ftp://[user@]machine[[:#]portnumber]/path
199<
200However, ftp will often need to query the user for the userid and password.
201The latter will be done "silently"; ie. asterisks will show up instead of
202the actually-typed-in password. Netrw will retain the userid and password
203for subsequent read/writes from the most recent transfer so subsequent
204transfers (read/write) to or from that machine will take place without
205additional prompting.
206
207 *netrw-urls*
208 +=================================+============================+============+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000209 | Reading | Writing | Uses |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000210 +=================================+============================+============+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000211 | DAV: | | |
212 | dav://host/path | | cadaver |
213 | :Nread dav://host/path | :Nwrite dav://host/path | cadaver |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000214 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000215 | FETCH: | | |
216 | fetch://[user@]host/path | | |
217 | fetch://[user@]host:http/path | Not Available | fetch |
218 | :Nread fetch://[user@]host/path| | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000219 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000220 | FILE: | | |
221 | file:///* | file:///* | |
222 | file://localhost/* | file://localhost/* | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000223 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000224 | FTP: (*3) | (*3) | |
225 | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) |
226 | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc |
227 | :Nread host path | :Nwrite host path | ftp+.netrc |
228 | :Nread host uid pass path | :Nwrite host uid pass path | ftp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000229 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000230 | HTTP: wget is executable: (*4) | | |
231 | http://[user@]host/path | Not Available | wget |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000232 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000233 | HTTP: fetch is executable (*4) | | |
234 | http://[user@]host/path | Not Available | fetch |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000235 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000236 | RCP: | | |
237 | rcp://[user@]host/path | rcp://[user@]host/path | rcp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000238 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000239 | RSYNC: | | |
240 | rsync://[user@]host/path | rsync://[user@]host/path | rsync |
241 | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync |
242 | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000243 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000244 | SCP: | | |
245 | scp://[user@]host/path | scp://[user@]host/path | scp |
246 | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000247 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000248 | SFTP: | | |
249 | sftp://[user@]host/path | sftp://[user@]host/path | sftp |
250 | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000251 +=================================+============================+============+
252
253 (*1) For an absolute path use scp://machine//path.
254
255 (*2) if <.netrc> is present, it is assumed that it will
256 work with your ftp client. Otherwise the script will
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000257 prompt for user-id and pasword.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000258
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000259 (*3) for ftp, "machine" may be machine#port or machine:port
Bram Moolenaar071d4272004-06-13 20:20:40 +0000260 if a different port is needed than the standard ftp port
261
262 (*4) for http:..., if wget is available it will be used. Otherwise,
263 if fetch is available it will be used.
264
265Both the :Nread and the :Nwrite ex-commands can accept multiple filenames.
266
267
268NETRC *netrw-netrc*
269
270The typical syntax for lines in a <.netrc> file is given as shown below.
271Ftp under Unix usually support <.netrc>; Windows' ftp usually doesn't.
272>
273 machine {full machine name} login {user-id} password "{password}"
274 default login {user-id} password "{password}"
275
276Your ftp client must handle the use of <.netrc> on its own, but if the
277<.netrc> file exists, an ftp transfer will not ask for the user-id or
278password.
279
280 Note:
281 Since this file contains passwords, make very sure nobody else can
282 read this file! Most programs will refuse to use a .netrc that is
283 readable for others. Don't forget that the system administrator can
284 still read the file!
285
286
287PASSWORD *netrw-passwd*
288
289The script attempts to get passwords for ftp invisibly using |inputsecret()|,
290a built-in Vim function. See |netrw-uidpass| for how to change the password
291after one has set it.
292
293Unfortunately there doesn't appear to be a way for netrw to feed a password
294to scp. Thus every transfer via scp will require re-entry of the password.
295
296
297==============================================================================
2983. Activation *netrw-activate*
299
300Network-oriented file transfers are available by default whenever
301|'nocompatible'| mode is enabled. The <netrw.vim> file resides in your
302system's vim-plugin directory and is sourced automatically whenever you
303bring up vim.
304
305
306==============================================================================
3074. Transparent File Transfer *netrw-transparent*
308
309Transparent file transfers occur whenever a regular file read or write
310(invoked via an |:autocmd| for |BufReadCmd| or |BufWriteCmd| events) is made.
311Thus one may use files across networks as if they were local. >
312
313 vim ftp://[user@]machine/path
314 ...
315 :wq
316
317
318==============================================================================
3195. Ex Commands *netrw-ex*
320
321The usual read/write commands are supported. There are also a couple of
322additional commands available.
323
324:[range]Nw Write the specified lines to the current
325 file as specified in b:netrw_lastfile.
326
327:[range]Nw {netfile} [{netfile}]...
328 Write the specified lines to the {netfile}.
329
330:Nread
331 Read the specified lines into the current
332 buffer from the file specified in
333 b:netrw_lastfile.
334
335:Nread {netfile} {netfile}...
336 Read the {netfile} after the current line.
337
338 *netrw-uidpass*
339:call NetUserPass()
340 If b:netrw_uid and b:netrw_passwd don't exist,
341 this function query the user for them.
342
343:call NetUserPass("userid")
344 This call will set the b:netrw_uid and, if
345 the password doesn't exist, will query the user for it.
346
347:call NetUserPass("userid","passwd")
348 This call will set both the b:netrw_uid and b:netrw_passwd.
349 The user-id and password are used by ftp transfers. One may
350 effectively remove the user-id and password by using ""
351 strings.
352
353
354==============================================================================
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00003556. Variables and Options *netrw-options* *netrw-var*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000356
357The script <netrw.vim> uses several variables which can affect <netrw.vim>'s
358behavior. These variables typically may be set in the user's <.vimrc> file:
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000359>
360 -------------
361 Netrw Options
362 -------------
363 Option Meaning
364 -------------- -----------------------------------------------
365<
366 b:netrw_col Holds current cursor position (during NetWrite)
367 g:netrw_cygwin =1 assume scp under windows is from cygwin
368 (default/windows)
369 =0 assume scp under windows accepts windows
370 style paths (default/else)
371 g:netrw_ftp =0 use default ftp (uid password)
372 g:netrw_ftpmode ="binary" (default)
373 ="ascii" (your choice)
374 g:netrw_ignorenetrc =1 (default)
375 if you have a <.netrc> file but you don't
Bram Moolenaar071d4272004-06-13 20:20:40 +0000376 want it used, then set this variable. Its
377 mere existence is enough to cause <.netrc>
378 to be ignored.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000379 b:netrw_lastfile Holds latest method/machine/path.
380 b:netrw_line Holds current line number (during NetWrite)
381 g:netrw_passwd Holds current password for ftp.
382 g:netrw_silent =0 transfers done normally
383 =1 transfers done silently
384 g:netrw_uid Holds current user-id for ftp.
385 =1 use alternate ftp (user uid password)
386 (see |netrw-options|)
387 g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
388 =1 use WinNT/2K/XP's rcp, binary mode
389 g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc
390 =1 use default method to do ftp >
391 -----------------------------------------------------------------------
392<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000393The script will also make use of the following variables internally, albeit
394temporarily.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000395>
396 -------------------
397 Temporary Variables
398 -------------------
399 Variable Meaning
400 -------- ------------------------------------
401<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000402 g:netrw_method Index indicating rcp/ftp+.netrc/ftp
403 g:netrw_machine Holds machine name parsed from input
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000404 g:netrw_fname Holds filename being accessed >
405 ------------------------------------------------------------
406<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000407 *netrw-protocol*
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000408
409Netrw supports a number of protocols. These protocols are invoked using the
410variables listed below, and may be modified by the user.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000411>
412 ------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000413 Protocol Control Options
Bram Moolenaar071d4272004-06-13 20:20:40 +0000414 ------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000415 Option Type Setting Meaning
416 --------- -------- -------------- ---------------------------
417<
418 netrw_ftp variable =doesn't exist userid set by "user userid"
419 =0 userid set by "user userid"
420 =1 userid set by "userid"
421 NetReadFixup function =doesn't exist no change
422 =exists Allows user to have files
423 read via ftp automatically
424 transformed however they wish
425 by NetReadFixup()
Bram Moolenaar071d4272004-06-13 20:20:40 +0000426 g:netrw_dav_cmd variable ="cadaver"
427 g:netrw_fetch_cmd variable ="fetch -o"
428 g:netrw_ftp_cmd variable ="ftp"
429 g:netrw_http_cmd variable ="fetch -o" else if fetch is executable
430 g:netrw_http_cmd variable ="wget -O" if wget is executable
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000431 g:netrw_list_cmd variable ="ssh HOSTNAME ls -Fa"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000432 g:netrw_rcp_cmd variable ="rcp"
433 g:netrw_rsync_cmd variable ="rsync -a"
434 g:netrw_scp_cmd variable ="scp -q"
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000435 g:netrw_sftp_cmd variable ="sftp" >
436 -------------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000437<
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000438 *netrw-ftp*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000439The first two options both help with certain ftp's that give trouble otherwise.
440In order to best understand how to use these options if ftp is giving you
441troubles, a bit of discussion follows on how netrw does ftp reads.
442
443The g:netrw_..._cmd variables specify the external program to use handle
444the associated protocol (rcp, ftp, etc), plus any options.
445
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000446The g:netrw_list_cmd's HOSTNAME entry will be changed via substitution with
447whatever the current request is for a hostname.
448
449For ftp, netrw typically builds up lines of one of the following formats in a
Bram Moolenaar071d4272004-06-13 20:20:40 +0000450temporary file:
451>
452 IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1
453 ---------------------------------- ------------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000454<
455 open machine [port] open machine [port]
456 user userid password userid password
457 [g:netrw_ftpmode] password
458 get filename tempfile [g:netrw_ftpmode]
459 get filename tempfile >
460 ---------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000461<
462Netrw then executes the lines above by use of a filter:
463>
464 :%! {g:netrw_ftp_cmd} -i [-n]
465<
466
467where
468 g:netrw_ftp_cmd is usually "ftp",
469 -i tells ftp not to be interactive
470 -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>)
471
472If <.netrc> exists it will be used to avoid having to query the user for
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000473userid and password. The transferred file is put into a temporary file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000474The temporary file is then read into the main editing session window that
475requested it and the temporary file deleted.
476
477If your ftp doesn't accept the "user" command and immediately just demands
478a userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
479
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000480 *netrw-cadaver*
481To handle the SSL certificate dialog for untrusted servers, one may pull
482down the certificate and place it into /usr/ssl/cert.pem. This operation
483renders the server treatment as "trusted".
484
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000485 *netrw-fixup*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000486If your ftp for whatever reason generates unwanted lines (such as AUTH
487messages) you may write a NetReadFixup(tmpfile) function:
488>
489 function! NetReadFixup(method,line1,line2)
490 " a:line1: first new line in current file
491 " a:line2: last new line in current file
492 if a:method == 1 "rcp
493 elseif a:method == 2 "ftp + <.netrc>
494 elseif a:method == 3 "ftp + machine,uid,password,filename
495 elseif a:method == 4 "scp
496 elseif a:method == 5 "http/wget
497 elseif a:method == 6 "dav/cadaver
498 elseif a:method == 7 "rsync
499 elseif a:method == 8 "fetch
500 elseif a:method == 9 "sftp
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000501 else " complain
Bram Moolenaar071d4272004-06-13 20:20:40 +0000502 endif
503 endfunction
504>
505The NetReadFixup() function will be called if it exists and thus allows
506you to customize your reading process. As a further example, <netrw.vim>
507contains just such a function to handle Windows 95 ftp. For whatever
508reason, Windows 95's ftp dumps four blank lines at the end of a transfer,
509and so it is desirable to automate their removal. Here's some code taken
510from <netrw.vim> itself:
511>
512 if has("win95") && g:netrw_win95ftp
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000513 fun! NetReadFixup(method, line1, line2)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000514 if method == 3 " ftp (no <.netrc>)
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000515 let fourblanklines= line2 - 3
516 silent fourblanklines.",".line2."g/^\s*/d"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000517 endif
518 endfunction
519 endif
520>
521
522==============================================================================
Bram Moolenaard4755bb2004-09-02 19:12:26 +00005237. Directory Browser *netrw-browse* *netrw-dir* *netrw-list* *netrw-help*
Bram Moolenaar8299df92004-07-10 09:47:34 +0000524 ?..........Help....................................|netrw-help|
525 <cr>.......Browsing................................|netrw-cr|
Bram Moolenaar269ec652004-07-29 08:43:53 +0000526 <del>......Deleting Files or Directories...........|netrw-delete|
Bram Moolenaar8299df92004-07-10 09:47:34 +0000527 -..........Going Up................................|netrw--|
528 a..........Hiding Files or Directories.............|netrw-a|
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000529 b..........Bookmarking a Directory.................|netrw-b|
530 B..........Changing to a Bookmarked Directory......|netrw-B|
531 c..........Make Browsing Directory The Current Dir.|netrw-c|
532 d..........Make A New Directory....................|netrw-d|
Bram Moolenaar269ec652004-07-29 08:43:53 +0000533 D..........Deleting Files or Directories...........|netrw-D|
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000534 <c-h>......Edit File/Directory Hiding List.........|netrw-h|
Bram Moolenaar8299df92004-07-10 09:47:34 +0000535 i..........Long Listing............................|netrw-i|
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000536 <c-l>......Refreshing the Listing..................|netrw-ctrl-l|
Bram Moolenaar8299df92004-07-10 09:47:34 +0000537 o..........Browsing with a Horizontal Split........|netrw-o|
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000538 p..........Preview Window..........................|netrw-p|
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000539 q..........Listing Bookmarks.......................|netrw-q|
Bram Moolenaar8299df92004-07-10 09:47:34 +0000540 r..........Reversing Sorting Order.................|netrw-r|
Bram Moolenaar269ec652004-07-29 08:43:53 +0000541 R..........Renaming Files or Directories...........|netrw-R|
Bram Moolenaar8299df92004-07-10 09:47:34 +0000542 s..........Selecting Sorting Style.................|netrw-s|
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000543 S..........Editing the Sorting Sequence............|netrw-S|
Bram Moolenaar8299df92004-07-10 09:47:34 +0000544 v..........Browsing with a Vertical Split..........|netrw-v|
545 x..........Customizing Browsing....................|netrw-x|
Bram Moolenaar269ec652004-07-29 08:43:53 +0000546
547QUICK REFERENCE COMMANDS TABLE *netrw-browse-cmds*
Bram Moolenaar843ee412004-06-30 16:16:41 +0000548>
Bram Moolenaar8299df92004-07-10 09:47:34 +0000549 ------- -----------
Bram Moolenaar843ee412004-06-30 16:16:41 +0000550 Command Explanation
551 ------- -----------
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000552< ? Causes Netrw to issue help
Bram Moolenaar843ee412004-06-30 16:16:41 +0000553 <cr> Netrw will enter the directory or read the file
554 <del> Netrw will attempt to remove the file/directory
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000555 d Make a directory
Bram Moolenaar843ee412004-06-30 16:16:41 +0000556 D Netrw will attempt to remove the file(s)/directory(ies)
557 R Netrw will attempt to rename the file(s)/directory(ies)
558 - Makes Netrw go up one directory
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000559 a Toggles between normal display,
560 hiding (suppress display of files matching g:netrw_list_hide)
561 showing (display only files which match g:netrw_list_hide)
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000562 c Make current browsing directory the current directory
563 <c-h> Edit file hiding list
Bram Moolenaar8299df92004-07-10 09:47:34 +0000564 i Toggles between long and short listing
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000565 <c-l> Causes Netrw to refresh the directory listing
Bram Moolenaar843ee412004-06-30 16:16:41 +0000566 o Enter the file/directory under the cursor in a new browser
567 window. A horizontal split is used.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000568 r Reverse sorting order
569 s Select sorting style: by name, time, or file size
Bram Moolenaar843ee412004-06-30 16:16:41 +0000570 v Enter the file/directory under the cursor in a new browser
571 window. A vertical split is used.
572 x Apply a function to a file.
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000573
Bram Moolenaar269ec652004-07-29 08:43:53 +0000574NETRW BROWSER VARIABLES *netrw-browse-var*
Bram Moolenaar843ee412004-06-30 16:16:41 +0000575>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000576 --- -----------
577 Var Explanation
578 --- -----------
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000579< g:netrw_alto change from above splitting to
580 below splitting by setting this
581 variable (see |netrw-o|)
582 g:netrw_altv change from left splitting to
583 right splitting by setting this
584 variable (see |netrw-v|)
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000585 g:netrw_ftp_browse_reject ftp can produce a number of errors
586 and warnings that can show up as
587 "directories" and "files" in the
588 listing. This pattern is used to
589 remove such embedded messages.
590 g:netrw_keepdir keep current directory immune from the
591 browsing directory. The browsing
592 directory is contained in b:netrw_curdir
593 g:netrw_list_cmd command for listing remote directories
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000594 g:netrw_ftp_list_cmd options for passing along to ftp for
595 directory listing. Defaults:
596 unix or g:netrw_cygwin set: : "ls -lF"
597 otherwise "dir"
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000598 g:netrw_list_hide comma separated list of patterns for
599 hiding files
600 g:netrw_local_mkdir command for making a local directory
601 g:netrw_local_rmdir remove directory command (rmdir)
602 g:netrw_local_rename rename file/directory command
603 unix-default: rm win32-default: ren
604 g:netrw_mkdir_cmd command for making a remote directory
605 g:netrw_rm_cmd command for removing files
606 g:netrw_rmdir_cmd command for removing directories
607 g:netrw_rmf_cmd command for removing softlinks
608 g:netrw_hide if true, the hiding list is used
609 g:netrw_sort_by sort by "name", "time", or "size"
610 g:netrw_sort_direction sorting direction: "normal" or "reverse"
611 g:netrw_sort_sequence when sorting by name, first sort by the
612 comma-separated pattern sequence
613 g:netrw_timefmt specify format string to strftime() (%c)
614 g:netrw_winsize specify initial size of new o/v windows
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000615
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000616INTRODUCTION TO DIRECTORY BROWSING
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000617
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000618Netrw supports the browsing of directories on the local system and on remote
619hosts, including generating listing directories, entering directories, editing
620files therein, deleting files/directories, making new directories, and moving
621(renaming) files and directories. The Netrw browser generally implements the
622previous explorer maps and commands for remote directories, although details
623(such as pertinent global variable names) necessarily differ.
624
625The Netrw remote file and directory browser handles two protocols: ssh and
626ftp. The protocol in the url, if it is ftp, will cause netrw to use ftp
627in its remote browsing. Any other protocol will be used for file transfers,
628but otherwise the ssh protocol will be used to do remote directory browsing.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000629
Bram Moolenaar843ee412004-06-30 16:16:41 +0000630To enter the netrw directory browser, simply attempt to read a "file" with a
631trailing slash and it will be interpreted as a request to list a directory:
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000632
633 vim [protocol]://[user@]hostname/path/
634
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000635If you'd like to avoid entering the password in for directory listings, scp,
636ssh interaction, etc, see |netrw-list-hack|.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000637
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000638REFRESHING THE LISTING *netrw-ctrl-l*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000639
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000640To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
641hit the <cr> when atop the ./ directory entry in the listing. One may also
642refresh a local directory by using ":e .".
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000643
644
645GOING UP *netrw--*
646
647To go up a directory, press - or his the <cr> when atop the ../ directory
648entry in the listing.
649
650Netrw will modify the command in *g:netrw_list_cmd* to perform the directory
Bram Moolenaar843ee412004-06-30 16:16:41 +0000651listing operation. By default the command is:
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000652
Bram Moolenaar843ee412004-06-30 16:16:41 +0000653 ssh HOSTNAME ls -FLa
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000654
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000655where the HOSTNAME becomes the [user@]hostname as requested by the attempt to
656read. Naturally, the user may override this command with whatever is
657preferred. The NetList function which implements remote directory browsing
658expects that directories will be flagged by a trailing slash.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000659
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000660
Bram Moolenaar8299df92004-07-10 09:47:34 +0000661BROWSING *netrw-cr*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000662
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000663Browsing is simple: move the cursor onto a file or directory of interest.
Bram Moolenaar843ee412004-06-30 16:16:41 +0000664Hitting the <cr> (the return key) will select the file or directory.
665Directories will themselves be listed, and files will be opened using the
666protocol given in the original read request.
667
Bram Moolenaar8299df92004-07-10 09:47:34 +0000668LONG VS SHORT LISTING *netrw-i*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000669
Bram Moolenaar8299df92004-07-10 09:47:34 +0000670The short listing format gives just the files' and directories' names.
671The long listing is either based on the "ls" command via ssh for remote
672directories or displays the filename, file size (in bytes), and the
673time and date of last modification for local directories.
674
675
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000676MAKING A NEW DIRECTORY *netrw-d*
Bram Moolenaar8299df92004-07-10 09:47:34 +0000677
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000678With the "d" map one may make a new directory either remotely (which
Bram Moolenaar8299df92004-07-10 09:47:34 +0000679depends on the global variable g:netrw_mkdir_cmd) or locally (which depends on
680the global variable g:netrw_local_mkdir). Netrw will issue a request for the
681new directory's name. A bare <CR> at that point will abort the making of the
682directory. Attempts to make a local directory that already exists (as either
683a file or a directory) will be detected, reported on, and ignored.
684
Bram Moolenaar269ec652004-07-29 08:43:53 +0000685DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D*
Bram Moolenaar843ee412004-06-30 16:16:41 +0000686
687Deleting/removing files and directories involves moving the cursor to the
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000688file/directory to be deleted and pressing "D". Directories must be empty first
689before they can be successfully removed. If the directory is a softlink to a
690directory, then netrw will make two requests to remove the directory before
691succeeding. Netrw will ask for confirmation before doing the removal(s).
692You may select a range of lines with the "V" command (visual selection),
693and then pressing "D".
Bram Moolenaar843ee412004-06-30 16:16:41 +0000694
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000695 *g:netrw_rm_cmd*
696The g:netrw_rm_cmd, g:netrw_rmf_cmd, and g:netrw_rmdir_cmd variables are used
697to control the attempts to remove files and directories. The g:netrw_rm_cmd
698is used with files, and its default value is:
Bram Moolenaar843ee412004-06-30 16:16:41 +0000699
700 g:netrw_rm_cmd: ssh HOSTNAME rm
701
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000702 *g:netrw_rmdir_cmd*
703The g:netrw_rmdir_cmd variable is used to support the removal of directories.
704Its default value is:
Bram Moolenaar843ee412004-06-30 16:16:41 +0000705
706 g:netrw_rmdir_cmd: ssh HOSTNAME rmdir
707
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000708 *g:netrw_rmf_cmd*
Bram Moolenaar843ee412004-06-30 16:16:41 +0000709If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000710to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
Bram Moolenaar843ee412004-06-30 16:16:41 +0000711
712 g:netrw_rmf_cmd: ssh HOSTNAME rm -f
713
Bram Moolenaar843ee412004-06-30 16:16:41 +0000714
Bram Moolenaar8299df92004-07-10 09:47:34 +0000715RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R*
Bram Moolenaar843ee412004-06-30 16:16:41 +0000716
717Renaming/moving files and directories involves moving the cursor to the
718file/directory to be moved (renamed) and pressing "R". You will then be
719queried for where you want the file/directory to be moved. You may select a
720range of lines with the "V" command (visual selection), and then pressing "R".
721
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000722The g:netrw_rename_cmd variable is used to implement renaming. By default its
Bram Moolenaar843ee412004-06-30 16:16:41 +0000723value is:
724
725 ssh HOSTNAME mv
726
Bram Moolenaar269ec652004-07-29 08:43:53 +0000727One may rename a block of files and directories by selecting them with
728the V (|linewise-visual|).
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000729
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000730
Bram Moolenaar269ec652004-07-29 08:43:53 +0000731HIDING FILES OR DIRECTORIES *g:netrw-a* *g:netrw_list_hide*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000732
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000733Netrw's browsing facility allows one to use the hiding list in one of
734three ways: ignore it, hide files which match, and show only those files
735which match. The g:netrw_list_hide variable holds a comma delimited list
736of patterns (ex. \.obj) which specify the hiding list. (also see |netrw-h|)
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000737
738
Bram Moolenaar269ec652004-07-29 08:43:53 +0000739EDIT FILE OR DIRECTORY HIDING LIST *netrw-h*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000740
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000741The "<ctrl-h>" map brings up a requestor allowing the user to change the
Bram Moolenaar269ec652004-07-29 08:43:53 +0000742file/directory hiding list. The hiding list consists of one or more patterns
743delimited by commas. Files and/or directories satisfying these patterns will
744be hidden (ie. not shown).
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000745
746
747BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o*
748
Bram Moolenaar269ec652004-07-29 08:43:53 +0000749Normally one enters a file or directory using the <cr>. However, the "o" map
750allows one to open a new window to hold the new directory listing or file. A
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000751horizontal split is used. (for vertical splitting, see |netrw-v|)
752
753Normally, the o key splits the window horizontally with the new window
754and cursor at the top. To change to splitting the window horizontally
755with the new window and cursor at the bottom, have
756
757 let g:netrw_alto = 1
758
759in your <.vimrc>.
760
761PREVIEW WINDOW
762
763One may use a preview window (currently only for local browsing) by using
764the "p" key when the cursor is atop the desired filename to be previewed.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000765
766
767SELECTING SORTING STYLE *netrw-s*
768
769One may select the sorting style by name, time, or (file) size. The
770"s" map allows one to circulate among the three choices; the directory
771listing will automatically be refreshed to reflect the selected style.
772
773
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000774EDITING THE SORTING SEQUENCE *netrw-S*
775
776When "Sorted by" is name, one may specify priority via the sorting
777sequence (g:netrw_sort_sequence). The sorting sequence typically
778prioritizes the name-listing by suffix, although any pattern will do.
779Patterns are delimited by commas. The default sorting sequence is:
780>
781 /$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
782<
783The lone * is where all filenames not covered by one of the other
784patterns will end up. One may change the sorting sequence by modifying
785the g:netrw_sort_sequence variable (either manually or in your <.vimrc>)
786or by using the "S" map.
787
788
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000789REVERSING SORTING ORDER *netrw-r*
790
791One may toggle between normal and reverse sorting order by pressing the
792"r" key.
793
794
795BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v*
796
797Normally one enters a file or directory using the <cr>. However, the "v"
798map allows one to open a new window to hold the new directory listing or
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000799file. A vertical split is used. (for horizontal splitting, see |netrw-o|)
800
801Normally, the v key splits the window vertically with the new window
802and cursor at the left. To change to splitting the window vertically
803with the new window and cursor at the right, have
804
805 let g:netrw_altv = 1
806
807in your <.vimrc>.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000808
809
810CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x*
811
812One may "enter" a file with a special handler, thereby firing up a browser or
813other application, for example, on a file by hitting the "x" key. Presumably
814one could write handlers that would start OpenOffice programs (oowriter), etc,
815based on the file's extension coupled with the user's hitting the "x" key atop
816the file.
817
818The Netrw executor applies a user-defined function to a file, based on its
819extension. Of course, the handler function must exist for it to be called!
820>
821 Ex. mypgm.html x ->
822 NetrwFileHandler_html("scp://user@host/some/path/mypgm.html")
823<
824See the <plugin/NetrwFileHandlers.vim> for an example of how to handle an html
825file with mozilla.
826
827
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000828MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c*
829
830By default, g:netrw_keepdir is 0. This setting means that the current
831directory will track the browsing directory. However, setting g:netrw_keepdir
832to 1 (say, in your <.vimrc>) will keep the current directory independent
833of the browsing directory. In that case, in order to make the two
834directories the same, use the "c" map (just type c).
835
836
837BOOKMARKING A DIRECTORY *netrw-b*
838
839One may easily "bookmark" a directory by using
840
841 {cnt}b
842
843Any count may be used.
844
845
846CHANGING TO A BOOKMARKED DIRECTORY *netrw-B*
847
848To change directory back to a bookmarked directory, use
849
850 {cnt}B
851
852Any count may be used.
853
854
855LISTING BOOKMARKS *netrw-q*
856
857Pressing "q" will list the bookmarked directories. (query)
858
859
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000860IMPROVING DIRECTORY BROWSING *netrw-list-hack*
861
862Especially with the remote directory browser, constantly entering the password
863is tedious.
864
Bram Moolenaar843ee412004-06-30 16:16:41 +0000865For Linux/Unix systems, I suggest looking into
866
867 http://hacks.oreilly.com/pub/h/66
868
869It gives a tip for setting up password-less use of ssh and scp, and discusses
870the associated security issues.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000871
872
873==============================================================================
Bram Moolenaarc0197e22004-09-13 20:26:32 +00008748. Problems and Fixes *netrw-problems*
875
876 (This section is likely to grow as I get feedback)
877 (also see |netrw-debug|)
878
879 P1. I use windows 95, and my ftp dumps four blank lines at the
880 end of every read.
881
882 See |netrw-fixup|, and put the following into your
883 <.vimrc> file:
884
885 let g:netrw_win95ftp= 1
886
887
888
889 P2. I use windows, and my network browsing with ftp doesn't sort by
890 time or size
891
892 Windows' ftp has a minimal support for ls (ie. it doesn't
893 accept sorting options). It doesn't support the -F which
894 gives an explanatory character (ABC/ for "ABC is a directory").
895 Netrw uses dir to get its short and long listings. If you
896 think your ftp does support a full-up ls, put the following
897 into your <.vimrc>:
898
899 let g:netrw_ftp_list_cmd= "ls -lF"
900
901 Alternatively, if you have cygwin on your Windows box, put
902 into your <.vimrc>:
903
904 let g:netrw_cygwin= 1
905
906 P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw
907 used ssh! That wasn't what I asked for...
908
909 Netrw has two methods for browsing remote directories: ssh
910 and ftp. Unless you specify ftp specifically, ssh is used.
911 When it comes time to do download a file (not just a directory
912 listing), netrw will use the given protocol to do so.
913
914 P4. I would like long listings to be the default.
915
916 let g:netrw_longlist=1
917
918 P5. My times come up oddly in local browsing
919
920 Does your system's strftime() accept the "%c" to yield dates
921 such as "Sun Apr 27 11:49:23 1997"? If not, do a "man strftime"
922 and find out what option should be used. Then put it into
923 your <.vimrc>:
924 let g:netrw_timefmt= "%X" (where X is the option)
925
926 P6. I don't want my current directory changing just because I'm
927 browsing somewhere.
928
929 let g:netrw_keepdir= 1
930
931
932==============================================================================
9339. Debugging *netrw-debug*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000934
935The <netrw.vim> script is typically available as:
936
937 /usr/local/share/vim/vim6x/plugin/netrw.vim
938
939which is loaded automatically at startup (assuming :set nocp).
940
941 1. Get the <Decho.vim> script, available as:
942
943 http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_scripts
944 as "Decho, a vimL debugging aid"
945 or
946 http://vim.sourceforge.net/scripts/script.php?script_id=120
947
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000948 and put it into your local plugin directory.
949
950 2. <Decho.vim> itself needs the <cecutil.vim> script, so you'll need
951 to put it into your .vim/plugin, too. You may obtain it from:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000952
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000953 http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs
954 as "DrC's Utilities"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000955
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000956 3. Edit the <netrw.vim> file by typing:
957
958 vim netrw.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000959 :DechoOn
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000960 :wq
Bram Moolenaar071d4272004-06-13 20:20:40 +0000961
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000962 To restore to normal non-debugging behavior, edit <netrw.vim>
963 by typing
Bram Moolenaar071d4272004-06-13 20:20:40 +0000964
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000965 vim netrw.vim
966 :DechoOff
967 :wq
968
969 This command, provided by <Decho.vim>, will comment out all
970 Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()).
971
972 4. Then bring up vim and attempt a transfer. A set of messages
Bram Moolenaar071d4272004-06-13 20:20:40 +0000973 should appear concerning the steps that <netrw.vim> took in
974 attempting to read/write your file over the network. Please
975 send that information to <netrw.vim>'s maintainer,
976
977 drchipNOSPAM at campbellfamily.biz - NOSPAM
978
979==============================================================================
Bram Moolenaarc0197e22004-09-13 20:26:32 +000098010. History *netrw-history*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000981
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000982 v48: * One may use ftp to do remote host file browsing
983 * (windows and !cygwin) remote browsing with ftp can now use
984 the "dir" command internally to provide listings
985 * g:netrw_keepdir now allows one to keep the initial current
986 directory as the current directory (normally the local
987 file browser makes the currently viewed directory the
988 current directory)
989 * g:netrw_alto and g:netrw_altv now support alternate placement
990 of windows started with o or v
991 * Nread ? and Nwrite ? now uses echomsg (instead of echo) so
992 :messages can repeat showing the help
993 * bugfix: avoids problems with partial matches of directory names
994 to prior buffers with longer names
995 * one can suppress error messages with g:netrw_quiet
996 * ctrl-h used instead of <Leader>h for editing hiding list
997 * one may edit the sorting sequence with the S map
998 * now allows confirmation of deletion with [y(es) n(o) a(ll) q(uit)]
999 * the "x" map now handles special file viewing with:
1000 (windows) rundll32 url.dll
1001 (gnome) gnome-open
1002 (kde) kfmclient
1003 If none of these are on the executable path, then
1004 NetrwFileHandlers.vim is used.
1005 * directory bookmarking during both local and remote browsing
1006 implemented
1007 * one may view all, use the hiding list to suppress, or use the
1008 hiding list to show-only remote and local file/directory listings
1009 * improved unusual file and directory name handling
1010 * preview window support
Bram Moolenaar269ec652004-07-29 08:43:53 +00001011 v47: * now handles local directory browsing.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001012 v46: * now handles remote directory browsing
1013 * g:netrw_silent (if 1) will cause all transfers to be silent'd
1014 v45: * made the [user@]hostname:path form a bit more restrictive
1015 to better handle errors in using protocols
1016 (e.g. scp:usr@host:file was being recognized as an rcp request)
1017 v44: * changed from "rsync -a" to just "rsync"
1018 * somehow an editing error messed up the test to recognize
1019 use of the fetch method for NetRead.
1020 * more debugging statements included
1021 v43: * moved "Explanation" comments to <pi_netrw.txt> help file
1022 as "Network Reference" (|netrw-ref|)
1023 * <netrw.vim> now uses Dfunc() Decho() and Dret() for debugging
1024 * removed superfluous NetRestorePosn() calls
1025 v42: * now does BufReadPre and BufReadPost events on file:///*
1026 and file://localhost/*
1027 v41: * installed file:///* and file://localhost/* handling
1028 v40: * prevents redraw when a protocol error occurs so that the
1029 user may see it
1030 v39: * sftp support
1031 v38: * Now uses NetRestorePosn() calls with Nread/Nwrite commands
1032 * Temporary files now removed via bwipe! instead of bwipe
1033 (thanks to Dave Roberts)
1034 v37: * Claar's modifications which test if ftp is successful, otherwise
1035 give an error message
1036 * After a read, the alternate file was pointing to the temp file.
1037 The temp file buffer is now wiped out.
1038 * removed silent from transfer methods so user can see what's
1039 happening
Bram Moolenaar071d4272004-06-13 20:20:40 +00001040
1041
1042==============================================================================
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000104311. Credits *netrw-credits*
Bram Moolenaar071d4272004-06-13 20:20:40 +00001044
1045 Vim editor by Bram Moolenaar (Thanks, Bram!)
1046 dav support by C Campbell
1047 fetch support by Bram Moolenaar and C Campbell
1048 ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM> - NOSPAM
1049 http support by Bram Moolenaar <bram@moolenaar.net>
1050 rcp
1051 rsync support by C Campbell (suggested by Erik Warendorph)
1052 scp support by raf <raf@comdyn.com.au>
1053 sftp support by C Campbell
1054
1055 inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell
1056
1057 Jérôme Augé -- also using new buffer method with ftp+.netrc
1058 Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use, fetch,...
1059 Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution
1060 Erik Warendorph -- for several suggestions (g:netrw_..._cmd
1061 variables, rsync etc)
1062 Doug Claar -- modifications to test for success with ftp operation
1063
1064==============================================================================
1065 vim:tw=78:ts=8:ft=help:norl: