Mercurial > vim
comparison runtime/doc/pi_netrw.txt @ 9:4102fb4ea781 v7.0002
updated for version 7.0002
author | vimboss |
---|---|
date | Sun, 20 Jun 2004 12:51:53 +0000 |
parents | 3fc0f57ecb91 |
children | 4424b47a0797 |
comparison
equal
deleted
inserted
replaced
8:7edf9b6e4c36 | 9:4102fb4ea781 |
---|---|
1 *pi_netrw.txt* For Vim version 7.0aa. Last change: Apr 21, 2004 | 1 *pi_netrw.txt* For Vim version 6.2. Last change: Jun 15, 2004 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Charles E. Campbell, Jr. | 4 VIM REFERENCE MANUAL by Charles E. Campbell, Jr. |
5 | 5 |
6 *dav* *http* *network* *rcp* *scp* | 6 *dav* *http* *network* *rcp* *scp* |
7 *fetch* *netrw* *Nread* *rsync* *sftp* | 7 *fetch* *netrw* *Nread* *rsync* *sftp* |
8 *ftp* *netrw.vim* *Nwrite* *netrw-file* | 8 *ftp* *netrw.vim* *Nwrite* *netrw-file* |
9 | 9 |
10 ============================================================================== | 10 ============================================================================== |
11 0. Contents *netrw-contents* | 11 0. Contents *netrw-contents* |
12 | 12 |
13 1. Netrw Reference.....................................|netrw-ref| | 13 1. Netrw Reference.....................................|netrw-ref| |
14 2. Network-Oriented File Transfer......................|netrw-xfer| | 14 2. Network-Oriented File Transfer......................|netrw-xfer| |
15 3. Activation..........................................|netrw-activate| | 15 3. Activation..........................................|netrw-activate| |
16 4. Transparent File Transfer...........................|netrw-transparent| | 16 4. Transparent File Transfer...........................|netrw-transparent| |
17 5. Ex Commands.........................................|netrw-ex| | 17 5. Ex Commands.........................................|netrw-ex| |
18 6. Variables and Options...............................|netrw-var| | 18 6. Variables and Options...............................|netrw-var| |
19 7. Debugging...........................................|netrw-debug| | 19 7. Remote Directory Listing............................|netrw-dir| |
20 8. New Stuff...........................................|netrw-new| | 20 8. Debugging...........................................|netrw-debug| |
21 9. Credits.............................................|netrw-credits| | 21 9. History.............................................|netrw-history| |
22 10. Credits.............................................|netrw-credits| | |
22 | 23 |
23 The functionality mentioned here is done via using |standard-plugin| | 24 The functionality mentioned here is done via using |standard-plugin| |
24 techniques. This plugin is only available if | 25 techniques. This plugin is only available if |
25 | 26 |
26 set nocp " 'compatible' is not set | 27 set nocp " 'compatible' is not set |
27 filetype plugin on " plugins are enabled | 28 filetype plugin on " plugins are enabled |
28 | 29 |
29 You can avoid loading this plugin by setting the "loaded_netrw" variable | 30 You can avoid loading this plugin by setting the "loaded_netrw" variable |
30 in your <.vimrc> file: > | 31 in your <.vimrc> file: > |
31 | 32 |
32 :let loaded_netrw = 1 | 33 :let loaded_netrw = 1 |
47 want it ignored, then set this variable as shown. Its mere | 48 want it ignored, then set this variable as shown. Its mere |
48 existence is enough to cause <.netrc> to be ignored. | 49 existence is enough to cause <.netrc> to be ignored. |
49 | 50 |
50 Controlling External Applications | 51 Controlling External Applications |
51 | 52 |
52 Protocol Variable Default Value | 53 Protocol Variable Default Value |
53 -------- ---------------- ------------- | 54 -------- ---------------- ------------- |
54 dav: g:netrw_dav_cmd = "cadaver" | 55 dav: g:netrw_dav_cmd = "cadaver" |
55 fetch: g:netrw_fetch_cmd = "fetch -o" | 56 fetch: g:netrw_fetch_cmd = "fetch -o" |
56 ftp: g:netrw_ftp_cmd = "ftp" | 57 ftp: g:netrw_ftp_cmd = "ftp" |
57 http: g:netrw_http_cmd = "fetch -o" else if fetch is available | 58 http: g:netrw_http_cmd = "fetch -o" if fetch is available |
58 http: g:netrw_http_cmd = "wget -q -O" If wget is available | 59 http: g:netrw_http_cmd = "wget -q -O" If wget is available |
59 rcp: g:netrw_rcp_cmd = "rcp" | 60 rcp: g:netrw_rcp_cmd = "rcp" |
60 rsync: g:netrw_rsync_cmd = "rsync -a" | 61 rsync: g:netrw_rsync_cmd = "rsync -a" |
61 scp: g:netrw_scp_cmd = "scp -q" | 62 scp: g:netrw_scp_cmd = "scp -q" |
62 sftp: g:netrw_sftp_cmd = "sftp" | 63 sftp: g:netrw_sftp_cmd = "sftp" |
63 | 64 |
64 READING | 65 READING |
65 :Nread ? give help | 66 :Nread ? give help |
66 :Nread "machine:file" uses rcp | 67 :Nread "machine:file" uses rcp |
74 :Nread "rsync://[user@]machine[:port]/file" uses rsync | 75 :Nread "rsync://[user@]machine[:port]/file" uses rsync |
75 :Nread "scp://[user@]machine[[:#]port]/file" uses scp | 76 :Nread "scp://[user@]machine[[:#]port]/file" uses scp |
76 :Nread "sftp://[user@]machine/file" uses sftp | 77 :Nread "sftp://[user@]machine/file" uses sftp |
77 | 78 |
78 WRITING | 79 WRITING |
79 :Nwrite ? give help | 80 :Nwrite ? give help |
80 :Nwrite "machine:file" uses rcp | 81 :Nwrite "machine:file" uses rcp |
81 :Nwrite "machine file" uses ftp with <.netrc> | 82 :Nwrite "machine file" uses ftp with <.netrc> |
82 :Nwrite "machine id password file" uses ftp | 83 :Nwrite "machine id password file" uses ftp |
83 :Nwrite "dav://machine[:port]/file" uses cadaver | 84 :Nwrite "dav://machine[:port]/file" uses cadaver |
84 :Nwrite "ftp://[user@]machine[[:#]port]/file" uses ftp autodetects <.netrc> | 85 :Nwrite "ftp://[user@]machine[[:#]port]/file" uses ftp autodetects <.netrc> |
85 :Nwrite "rcp://[user@]machine/file" uses rcp | 86 :Nwrite "rcp://[user@]machine/file" uses rcp |
86 :Nwrite "rsync://[user@]machine[:port]/file" uses rsync | 87 :Nwrite "rsync://[user@]machine[:port]/file" uses rsync |
87 :Nwrite "scp://[user@]machine[[:#]port]/file" uses scp | 88 :Nwrite "scp://[user@]machine[[:#]port]/file" uses scp |
88 :Nwrite "sftp://[user@]machine/file" uses sftp | 89 :Nwrite "sftp://[user@]machine/file" uses sftp |
89 http: not supported! | 90 http: not supported! |
91 | |
92 DIRECTORY LISTING | |
93 :Nread [protocol]://[user]@hostname/path/ | |
90 | 94 |
91 USER AND PASSWORD CHANGING | 95 USER AND PASSWORD CHANGING |
92 Attempts to use ftp will prompt you for a user-id and a password. | 96 Attempts to use ftp will prompt you for a user-id and a password. |
93 These will be saved in g:netrw_uid and g:netrw_passwd Subsequent uses | 97 These will be saved in g:netrw_uid and g:netrw_passwd Subsequent uses |
94 of ftp will re-use those. If you need to use a different user id | 98 of ftp will re-use those. If you need to use a different user id |
146 transfer/protocol. Files are read from/written to a temporary file | 150 transfer/protocol. Files are read from/written to a temporary file |
147 (under Unix/Linux, /tmp/...) which the <netrw.vim> script will | 151 (under Unix/Linux, /tmp/...) which the <netrw.vim> script will |
148 clean up. | 152 clean up. |
149 | 153 |
150 One may modify any protocol's implementing external application | 154 One may modify any protocol's implementing external application |
151 by setting a variable (ex. scp uses the variable g:netrw_scp_cmd, | 155 by settinbg a variable (ex. scp uses the variable g:netrw_scp_cmd, |
152 which is defaulted to "scp -q"). | 156 which is defaulted to "scp -q"). |
153 | 157 |
154 Ftp, an old protocol, seems to be blessed by numerous implementations. | 158 Ftp, an old protocol, seems to be blessed by numerous implementations. |
155 Unfortunately, some implementations are noisy (ie., add junk to the end | 159 Unfortunately, some implementations are noisy (ie., add junk to the end |
156 of the file). Thus, concerned users may decide to write a NetReadFixup() | 160 of the file). Thus, concerned users may decide to write a NetReadFixup() |
179 transfers (read/write) to or from that machine will take place without | 183 transfers (read/write) to or from that machine will take place without |
180 additional prompting. | 184 additional prompting. |
181 | 185 |
182 *netrw-urls* | 186 *netrw-urls* |
183 +=================================+============================+============+ | 187 +=================================+============================+============+ |
184 | Reading | Writing | Uses | | 188 | Reading | Writing | Uses | |
185 +=================================+============================+============+ | 189 +=================================+============================+============+ |
186 | DAV: | | | | 190 | DAV: | | | |
187 | dav://host/path | | cadaver | | 191 | dav://host/path | | cadaver | |
188 | :Nread dav://host/path | :Nwrite dav://host/path | cadaver | | 192 | :Nread dav://host/path | :Nwrite dav://host/path | cadaver | |
189 +---------------------------------+----------------------------+------------+ | 193 +---------------------------------+----------------------------+------------+ |
190 | FETCH: | | | | 194 | FETCH: | | | |
191 | fetch://[user@]host/path | | | | 195 | fetch://[user@]host/path | | | |
192 | fetch://[user@]host:http/path | Not Available | fetch | | 196 | fetch://[user@]host:http/path | Not Available | fetch | |
193 | :Nread fetch://[user@]host/path| | | | 197 | :Nread fetch://[user@]host/path| | | |
194 +---------------------------------+----------------------------+------------+ | 198 +---------------------------------+----------------------------+------------+ |
195 | FILE: | | | | 199 | FILE: | | | |
196 | file:///* | file:///* | | | 200 | file:///* | file:///* | | |
197 | file://localhost/* | file://localhost/* | | | 201 | file://localhost/* | file://localhost/* | | |
198 +---------------------------------+----------------------------+------------+ | 202 +---------------------------------+----------------------------+------------+ |
199 | FTP: (*3) | (*3) | | | 203 | FTP: (*3) | (*3) | | |
200 | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) | | 204 | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) | |
201 | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc | | 205 | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc | |
202 | :Nread host path | :Nwrite host path | ftp+.netrc | | 206 | :Nread host path | :Nwrite host path | ftp+.netrc | |
203 | :Nread host uid pass path | :Nwrite host uid pass path | ftp | | 207 | :Nread host uid pass path | :Nwrite host uid pass path | ftp | |
204 +---------------------------------+----------------------------+------------+ | 208 +---------------------------------+----------------------------+------------+ |
205 | HTTP: wget is executable: (*4) | | | | 209 | HTTP: wget is executable: (*4) | | | |
206 | http://[user@]host/path | Not Available | wget | | 210 | http://[user@]host/path | Not Available | wget | |
207 +---------------------------------+----------------------------+------------+ | 211 +---------------------------------+----------------------------+------------+ |
208 | HTTP: fetch is executable (*4) | | | | 212 | HTTP: fetch is executable (*4) | | | |
209 | http://[user@]host/path | Not Available | fetch | | 213 | http://[user@]host/path | Not Available | fetch | |
210 +---------------------------------+----------------------------+------------+ | 214 +---------------------------------+----------------------------+------------+ |
211 | RCP: | | | | 215 | RCP: | | | |
212 | rcp://[user@]host/path | rcp://[user@]host/path | rcp | | 216 | rcp://[user@]host/path | rcp://[user@]host/path | rcp | |
213 +---------------------------------+----------------------------+------------+ | 217 +---------------------------------+----------------------------+------------+ |
214 | RSYNC: | | | | 218 | RSYNC: | | | |
215 | rsync://[user@]host/path | rsync://[user@]host/path | rsync | | 219 | rsync://[user@]host/path | rsync://[user@]host/path | rsync | |
216 | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync | | 220 | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync | |
217 | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp | | 221 | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp | |
218 +---------------------------------+----------------------------+------------+ | 222 +---------------------------------+----------------------------+------------+ |
219 | SCP: | | | | 223 | SCP: | | | |
220 | scp://[user@]host/path | scp://[user@]host/path | scp | | 224 | scp://[user@]host/path | scp://[user@]host/path | scp | |
221 | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) | | 225 | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) | |
222 +---------------------------------+----------------------------+------------+ | 226 +---------------------------------+----------------------------+------------+ |
223 | SFTP: | | | | 227 | SFTP: | | | |
224 | sftp://[user@]host/path | sftp://[user@]host/path | sftp | | 228 | sftp://[user@]host/path | sftp://[user@]host/path | sftp | |
225 | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) | | 229 | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) | |
226 +=================================+============================+============+ | 230 +=================================+============================+============+ |
227 | 231 |
228 (*1) For an absolute path use scp://machine//path. | 232 (*1) For an absolute path use scp://machine//path. |
229 | 233 |
230 (*2) if <.netrc> is present, it is assumed that it will | 234 (*2) if <.netrc> is present, it is assumed that it will |
231 work with your ftp client. Otherwise the script will | 235 work with your ftp client. Otherwise the script will |
232 prompt for user-id and password. | 236 prompt for user-id and pasword. |
233 | 237 |
234 (*3) for ftp, "machine" may be machine#port or machine:port | 238 (*3) for ftp, "machine" may be machine#port or machine:port |
235 if a different port is needed than the standard ftp port | 239 if a different port is needed than the standard ftp port |
236 | 240 |
237 (*4) for http:..., if wget is available it will be used. Otherwise, | 241 (*4) for http:..., if wget is available it will be used. Otherwise, |
238 if fetch is available it will be used. | 242 if fetch is available it will be used. |
239 | 243 |
325 effectively remove the user-id and password by using "" | 329 effectively remove the user-id and password by using "" |
326 strings. | 330 strings. |
327 | 331 |
328 | 332 |
329 ============================================================================== | 333 ============================================================================== |
330 6. Variables and Options *netrw-options* *netrw-var* | 334 6. Variables and Options *netrw-options* *netrw-var* |
331 | 335 |
332 The script <netrw.vim> uses several variables which can affect <netrw.vim>'s | 336 The script <netrw.vim> uses several variables which can affect <netrw.vim>'s |
333 behavior. These variables typically may be set in the user's <.vimrc> file: | 337 behavior. These variables typically may be set in the user's <.vimrc> file: |
334 | 338 > |
335 g:netrw_uid Holds current user-id for ftp. | 339 ------------- |
336 g:netrw_passwd Holds current password for ftp. | 340 Netrw Options |
337 b:netrw_lastfile Holds latest method/machine/path. | 341 ------------- |
338 b:netrw_line Holds current line number (during NetWrite) | 342 Option Meaning |
339 b:netrw_col Holds current cursor position (during NetWrite) | 343 -------------- ----------------------------------------------- |
340 g:netrw_ftp =0 use default ftp (uid password) | 344 < |
341 =1 use alternate ftp (user uid password) | 345 b:netrw_col Holds current cursor position (during NetWrite) |
342 (see |netrw-options|) | 346 g:netrw_cygwin =1 assume scp under windows is from cygwin |
343 g:netrw_ftpmode ="binary" (default) | 347 (default/windows) |
344 ="ascii" (your choice) | 348 =0 assume scp under windows accepts windows |
345 g:netrw_ignorenetrc =1 (default) | 349 style paths (default/else) |
346 if you have a <.netrc> file but you don't | 350 g:netrw_ftp =0 use default ftp (uid password) |
351 g:netrw_ftpmode ="binary" (default) | |
352 ="ascii" (your choice) | |
353 g:netrw_ignorenetrc =1 (default) | |
354 if you have a <.netrc> file but you don't | |
347 want it used, then set this variable. Its | 355 want it used, then set this variable. Its |
348 mere existence is enough to cause <.netrc> | 356 mere existence is enough to cause <.netrc> |
349 to be ignored. | 357 to be ignored. |
350 g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc | 358 b:netrw_lastfile Holds latest method/machine/path. |
351 =1 use default method to do ftp | 359 b:netrw_line Holds current line number (during NetWrite) |
352 g:netrw_cygwin =1 assume scp under windows is from cygwin | 360 g:netrw_passwd Holds current password for ftp. |
353 (default/windows) | 361 g:netrw_silent =0 transfers done normally |
354 =0 assume scp under windows accepts windows | 362 =1 transfers done silently |
355 style paths (default/else) | 363 g:netrw_uid Holds current user-id for ftp. |
356 g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default) | 364 =1 use alternate ftp (user uid password) |
357 =1 use WinNT/2K/XP's rcp, binary mode | 365 (see |netrw-options|) |
358 | 366 g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default) |
359 | 367 =1 use WinNT/2K/XP's rcp, binary mode |
368 g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc | |
369 =1 use default method to do ftp > | |
370 ----------------------------------------------------------------------- | |
371 < | |
360 The script will also make use of the following variables internally, albeit | 372 The script will also make use of the following variables internally, albeit |
361 temporarily. | 373 temporarily. |
362 | 374 > |
375 ------------------- | |
376 Temporary Variables | |
377 ------------------- | |
378 Variable Meaning | |
379 -------- ------------------------------------ | |
380 < | |
363 g:netrw_method Index indicating rcp/ftp+.netrc/ftp | 381 g:netrw_method Index indicating rcp/ftp+.netrc/ftp |
364 g:netrw_machine Holds machine name parsed from input | 382 g:netrw_machine Holds machine name parsed from input |
365 g:netrw_fname Holds filename being accessed | 383 g:netrw_fname Holds filename being accessed > |
366 | 384 ------------------------------------------------------------ |
385 < | |
367 *netrw-protocol* | 386 *netrw-protocol* |
387 | |
388 Netrw supports a number of protocols. These protocols are invoked using the | |
389 variables listed below, and may be modified by the user. | |
368 > | 390 > |
369 ------------------------ | 391 ------------------------ |
370 Protocol Control Options | 392 Protocol Control Options |
371 ------------------------ | 393 ------------------------ |
372 Option Type Setting Meaning ~ | 394 Option Type Setting Meaning |
373 --------- -------- -------------- --------------------------- > | 395 --------- -------- -------------- --------------------------- |
374 netrw_ftp variable =doesn't exist userid set by "user userid" | 396 < |
375 =0 userid set by "user userid" | 397 netrw_ftp variable =doesn't exist userid set by "user userid" |
376 =1 userid set by "userid" | 398 =0 userid set by "user userid" |
377 NetReadFixup function =doesn't exist no change | 399 =1 userid set by "userid" |
378 =exists Allows user to have files | 400 NetReadFixup function =doesn't exist no change |
379 read via ftp automatically | 401 =exists Allows user to have files |
380 transformed however they wish | 402 read via ftp automatically |
381 by NetReadFixup() | 403 transformed however they wish |
404 by NetReadFixup() | |
382 g:netrw_dav_cmd variable ="cadaver" | 405 g:netrw_dav_cmd variable ="cadaver" |
383 g:netrw_fetch_cmd variable ="fetch -o" | 406 g:netrw_fetch_cmd variable ="fetch -o" |
384 g:netrw_ftp_cmd variable ="ftp" | 407 g:netrw_ftp_cmd variable ="ftp" |
385 g:netrw_http_cmd variable ="fetch -o" else if fetch is executable | 408 g:netrw_http_cmd variable ="fetch -o" else if fetch is executable |
386 g:netrw_http_cmd variable ="wget -O" if wget is executable | 409 g:netrw_http_cmd variable ="wget -O" if wget is executable |
410 g:netrw_list_cmd variable ="ssh HOSTNAME ls -Fa" | |
387 g:netrw_rcp_cmd variable ="rcp" | 411 g:netrw_rcp_cmd variable ="rcp" |
388 g:netrw_rsync_cmd variable ="rsync -a" | 412 g:netrw_rsync_cmd variable ="rsync -a" |
389 g:netrw_scp_cmd variable ="scp -q" | 413 g:netrw_scp_cmd variable ="scp -q" |
390 g:netrw_sftp_cmd variable ="sftp" | 414 g:netrw_sftp_cmd variable ="sftp" > |
415 ------------------------------------------------------------------------- | |
391 < | 416 < |
392 The first two options both help with certain ftp's that give trouble otherwise. | 417 The first two options both help with certain ftp's that give trouble otherwise. |
393 In order to best understand how to use these options if ftp is giving you | 418 In order to best understand how to use these options if ftp is giving you |
394 troubles, a bit of discussion follows on how netrw does ftp reads. | 419 troubles, a bit of discussion follows on how netrw does ftp reads. |
395 | 420 |
396 The g:netrw_..._cmd variables specify the external program to use handle | 421 The g:netrw_..._cmd variables specify the external program to use handle |
397 the associated protocol (rcp, ftp, etc), plus any options. | 422 the associated protocol (rcp, ftp, etc), plus any options. |
398 | 423 |
399 Netrw typically builds up lines of one of the following formats in a | 424 The g:netrw_list_cmd's HOSTNAME entry will be changed via substitution with |
425 whatever the current request is for a hostname. | |
426 | |
427 For ftp, netrw typically builds up lines of one of the following formats in a | |
400 temporary file: | 428 temporary file: |
401 > | 429 > |
402 IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1 | 430 IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1 |
403 ---------------------------------- ------------------------------ | 431 ---------------------------------- ------------------------------ |
404 open machine [port] open machine [port] | 432 < |
405 user userid password userid password | 433 open machine [port] open machine [port] |
406 [g:netrw_ftpmode] password | 434 user userid password userid password |
407 get filename tempfile [g:netrw_ftpmode] | 435 [g:netrw_ftpmode] password |
408 get filename tempfile | 436 get filename tempfile [g:netrw_ftpmode] |
437 get filename tempfile > | |
438 --------------------------------------------------------------------- | |
409 < | 439 < |
410 Netrw then executes the lines above by use of a filter: | 440 Netrw then executes the lines above by use of a filter: |
411 > | 441 > |
412 :%! {g:netrw_ftp_cmd} -i [-n] | 442 :%! {g:netrw_ftp_cmd} -i [-n] |
413 < | 443 < |
416 g:netrw_ftp_cmd is usually "ftp", | 446 g:netrw_ftp_cmd is usually "ftp", |
417 -i tells ftp not to be interactive | 447 -i tells ftp not to be interactive |
418 -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>) | 448 -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>) |
419 | 449 |
420 If <.netrc> exists it will be used to avoid having to query the user for | 450 If <.netrc> exists it will be used to avoid having to query the user for |
421 userid and password). The transferred file is put into a temporary file. | 451 userid and password. The transferred file is put into a temporary file. |
422 The temporary file is then read into the main editing session window that | 452 The temporary file is then read into the main editing session window that |
423 requested it and the temporary file deleted. | 453 requested it and the temporary file deleted. |
424 | 454 |
425 If your ftp doesn't accept the "user" command and immediately just demands | 455 If your ftp doesn't accept the "user" command and immediately just demands |
426 a userid, then try putting "let netrw_ftp=1" in your <.vimrc>. | 456 a userid, then try putting "let netrw_ftp=1" in your <.vimrc>. |
427 | 457 |
428 *netrw-fixup* | 458 *netrw-fixup* |
429 If your ftp for whatever reason generates unwanted lines (such as AUTH | 459 If your ftp for whatever reason generates unwanted lines (such as AUTH |
430 messages) you may write a NetReadFixup(tmpfile) function: | 460 messages) you may write a NetReadFixup(tmpfile) function: |
431 > | 461 > |
432 function! NetReadFixup(method,line1,line2) | 462 function! NetReadFixup(method,line1,line2) |
433 " a:line1: first new line in current file | 463 " a:line1: first new line in current file |
439 elseif a:method == 5 "http/wget | 469 elseif a:method == 5 "http/wget |
440 elseif a:method == 6 "dav/cadaver | 470 elseif a:method == 6 "dav/cadaver |
441 elseif a:method == 7 "rsync | 471 elseif a:method == 7 "rsync |
442 elseif a:method == 8 "fetch | 472 elseif a:method == 8 "fetch |
443 elseif a:method == 9 "sftp | 473 elseif a:method == 9 "sftp |
444 else " complain | 474 else " complain |
445 endif | 475 endif |
446 endfunction | 476 endfunction |
447 > | 477 > |
448 The NetReadFixup() function will be called if it exists and thus allows | 478 The NetReadFixup() function will be called if it exists and thus allows |
449 you to customize your reading process. As a further example, <netrw.vim> | 479 you to customize your reading process. As a further example, <netrw.vim> |
451 reason, Windows 95's ftp dumps four blank lines at the end of a transfer, | 481 reason, Windows 95's ftp dumps four blank lines at the end of a transfer, |
452 and so it is desirable to automate their removal. Here's some code taken | 482 and so it is desirable to automate their removal. Here's some code taken |
453 from <netrw.vim> itself: | 483 from <netrw.vim> itself: |
454 > | 484 > |
455 if has("win95") && g:netrw_win95ftp | 485 if has("win95") && g:netrw_win95ftp |
456 fu! NetReadFixup(method, line1, line2) | 486 fun! NetReadFixup(method, line1, line2) |
457 if method == 3 " ftp (no <.netrc>) | 487 if method == 3 " ftp (no <.netrc>) |
458 let fourblanklines= line2 - 3 | 488 let fourblanklines= line2 - 3 |
459 silent fourblanklines.",".line2."g/^\s*/d" | 489 silent fourblanklines.",".line2."g/^\s*/d" |
460 endif | 490 endif |
461 endfunction | 491 endfunction |
462 endif | 492 endif |
463 > | 493 > |
464 | 494 |
465 ============================================================================== | 495 ============================================================================== |
466 7. Debugging *netrw-debug* | 496 7. Remote Directory Listing *netrw-dir* *netrw-list* |
497 | |
498 Netrw supports listing (browsing) directories on remote hosts; simply attempt | |
499 to read a "file" with a trailing slash and it will be interpreted as a | |
500 request to browse a directory: | |
501 | |
502 vim [protocol]://[user@]hostname/path/ | |
503 | |
504 Netrw will modify the command in g:netrw_list to perform the directory listing | |
505 operation. By default the command is: | |
506 | |
507 ssh HOSTNAME ls -Fa | |
508 | |
509 where the HOSTNAME becomes the hostname as requested by the attempted | |
510 read. Naturally, the user may override this command with whatever is | |
511 preferred. The NetList function which implements remote directory | |
512 browsing expects that directories will be flagged by a trailing slash. | |
513 | |
514 Browsing is simple: move the cursor onto a file or directory of interest. | |
515 Hitting the <cr> (the return key) will select the file or directory. Directories | |
516 will themselves be listed, and files will be opened using the protocol given | |
517 in the original read request. | |
518 | |
519 | |
520 ============================================================================== | |
521 8. Debugging *netrw-debug* | |
467 | 522 |
468 The <netrw.vim> script is typically available as: | 523 The <netrw.vim> script is typically available as: |
469 | 524 |
470 /usr/local/share/vim/vim6x/plugin/netrw.vim | 525 /usr/local/share/vim/vim6x/plugin/netrw.vim |
471 | 526 |
492 send that information to <netrw.vim>'s maintainer, | 547 send that information to <netrw.vim>'s maintainer, |
493 | 548 |
494 drchipNOSPAM at campbellfamily.biz - NOSPAM | 549 drchipNOSPAM at campbellfamily.biz - NOSPAM |
495 | 550 |
496 ============================================================================== | 551 ============================================================================== |
497 8. New Stuff *netrw-new* *netrw-newstuff* | 552 9. History *netrw-history* |
498 | 553 |
499 v43: * moved "Explanation" comments to <pi_netrw.txt> help file | 554 v46: * now handles remote directory browsing |
500 as "Network Reference" (|netrw-ref|) | 555 * g:netrw_silent (if 1) will cause all transfers to be silent'd |
501 * <netrw.vim> now uses Dfunc() Decho() and Dret() for debugging | 556 v45: * made the [user@]hostname:path form a bit more restrictive |
502 * removed superfluous NetRestorePosn() calls | 557 to better handle errors in using protocols |
503 v42: * now does BufReadPre and BufReadPost events on file:///* | 558 (e.g. scp:usr@host:file was being recognized as an rcp request) |
504 and file://localhost/* | 559 v44: * changed from "rsync -a" to just "rsync" |
505 v41: * installed file:///* and file://localhost/* handling | 560 * somehow an editing error messed up the test to recognize |
506 v40: * prevents redraw when a protocol error occurs so that the | 561 use of the fetch method for NetRead. |
507 user may see it | 562 * more debugging statements included |
508 v39: * sftp support | 563 v43: * moved "Explanation" comments to <pi_netrw.txt> help file |
509 v38: * Now uses NetRestorePosn() calls with Nread/Nwrite commands | 564 as "Network Reference" (|netrw-ref|) |
510 * Temporary files now removed via bwipe! instead of bwipe | 565 * <netrw.vim> now uses Dfunc() Decho() and Dret() for debugging |
511 (thanks to Dave Roberts) | 566 * removed superfluous NetRestorePosn() calls |
512 v37: * Claar's modifications which test if ftp is successful, otherwise | 567 v42: * now does BufReadPre and BufReadPost events on file:///* |
513 give an error message | 568 and file://localhost/* |
514 * After a read, the alternate file was pointing to the temp file. | 569 v41: * installed file:///* and file://localhost/* handling |
515 The temp file buffer is now wiped out. | 570 v40: * prevents redraw when a protocol error occurs so that the |
516 * removed silent from transfer methods so user can see what's | 571 user may see it |
517 happening | 572 v39: * sftp support |
518 | 573 v38: * Now uses NetRestorePosn() calls with Nread/Nwrite commands |
519 | 574 * Temporary files now removed via bwipe! instead of bwipe |
520 ============================================================================== | 575 (thanks to Dave Roberts) |
521 9. Credits *netrw-credits* | 576 v37: * Claar's modifications which test if ftp is successful, otherwise |
577 give an error message | |
578 * After a read, the alternate file was pointing to the temp file. | |
579 The temp file buffer is now wiped out. | |
580 * removed silent from transfer methods so user can see what's | |
581 happening | |
582 | |
583 | |
584 ============================================================================== | |
585 10. Credits *netrw-credits* | |
522 | 586 |
523 Vim editor by Bram Moolenaar (Thanks, Bram!) | 587 Vim editor by Bram Moolenaar (Thanks, Bram!) |
524 dav support by C Campbell | 588 dav support by C Campbell |
525 fetch support by Bram Moolenaar and C Campbell | 589 fetch support by Bram Moolenaar and C Campbell |
526 ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM> - NOSPAM | 590 ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM> - NOSPAM |