874
|
1 *pi_netrw.txt* For Vim version 7.0. Last change: 2006 May 02
|
7
|
2
|
857
|
3 NETRW REFERENCE MANUAL by Charles E. Campbell, Jr.
|
7
|
4
|
559
|
5
|
856
|
6 *dav* *http* *network* *rcp* *scp*
|
|
7 *fetch* *netrw* *Nread* *rsync* *sftp*
|
|
8 *ftp* *netrw.vim* *Nwrite* *netrw-file*
|
7
|
9
|
|
10 ==============================================================================
|
|
11 0. Contents *netrw-contents*
|
|
12
|
794
|
13 1. Starting With Netrw..................................|netrw-start|
|
650
|
14 2. Netrw Reference......................................|netrw-ref|
|
719
|
15 CONTROLLING EXTERNAL APPLICATIONS..................|netrw-externapp|
|
482
|
16 READING............................................|netrw-read|
|
|
17 WRITING............................................|netrw-write|
|
|
18 DIRECTORY LISTING..................................|netrw-dirlist|
|
|
19 CHANGING THE USERID AND PASSWORD...................|netrw-chgup|
|
|
20 VARIABLES..........................................|netrw-variables|
|
|
21 PATHS..............................................|netrw-path|
|
650
|
22 3. Network-Oriented File Transfer.......................|netrw-xfer|
|
459
|
23 NETRC..............................................|netrw-netrc|
|
|
24 PASSWORD...........................................|netrw-passwd|
|
650
|
25 4. Activation...........................................|netrw-activate|
|
|
26 5. Transparent File Transfer............................|netrw-transparent|
|
|
27 6. Ex Commands..........................................|netrw-ex|
|
|
28 7. Variables and Options................................|netrw-var|
|
|
29 8. Directory Browsing...................................|netrw-browse| {{{1
|
459
|
30 Maps...............................................|netrw-maps|
|
|
31 Exploring..........................................|netrw-explore-cmds|
|
|
32 Quick Reference Commands Table.....................|netrw-browse-cmds|
|
|
33 Netrw Browser Variables............................|netrw-browse-var|
|
|
34 Introduction To Directory Browsing.................|netrw-browse-intro|
|
719
|
35 Netrw Browsing And Option Incompatibilities........|netrw-incompatible|
|
459
|
36 Directory Exploring Commands.......................|netrw-explore|
|
|
37 Refreshing The Listing.............................|netrw-ctrl-l|
|
|
38 Going Up...........................................|netrw--|
|
|
39 Browsing...........................................|netrw-cr|
|
519
|
40 Obtaining A File...................................|netrw-O|
|
|
41 Thin, Long, and Wide Listings......................|netrw-i|
|
459
|
42 Making A New Directory.............................|netrw-d|
|
719
|
43 Deleting Files Or Directories......................|netrw-D|
|
459
|
44 Renaming Files Or Directories......................|netrw-move|
|
534
|
45 Hiding Files Or Directories........................|netrw-a|
|
650
|
46 Edit File Or Directory Hiding List.................|netrw-ctrl-h|
|
459
|
47 Browsing With A Horizontally Split Window..........|netrw-o|
|
|
48 Preview Window.....................................|netrw-p|
|
|
49 Selecting Sorting Style............................|netrw-s|
|
|
50 Editing The Sorting Sequence.......................|netrw-S|
|
|
51 Reversing Sorting Order............................|netrw-r|
|
|
52 Changing To A Predecessor Directory................|netrw-u|
|
|
53 Changing To A Successor Directory..................|netrw-U|
|
|
54 Browsing With A Vertically Split Window............|netrw-v|
|
|
55 Customizing Browsing With A User Function..........|netrw-x|
|
|
56 Making The Browsing Directory The Current Directory|netrw-c|
|
519
|
57 Bookmarking A Directory............................|netrw-b| |netrw-Nb|
|
|
58 Changing To A Bookmarked Directory.................|netrw-B| |netrw-NB|
|
459
|
59 Listing Bookmarks And History......................|netrw-q|
|
519
|
60 Improving Directory Browsing.......................|netrw-listhack| }}}1
|
650
|
61 9. Problems and Fixes...................................|netrw-problems|
|
|
62 10. Debugging............................................|netrw-debug|
|
|
63 11. History..............................................|netrw-history|
|
|
64 12. Credits..............................................|netrw-credits|
|
7
|
65
|
482
|
66 The Netrw plugin is generally sourced automatically as it is a
|
|
67 |standard-plugin|. That said, to make use of netrw, one must
|
|
68 have plugins available which can be done with the following
|
650
|
69 two lines in your <.vimrc>: >
|
7
|
70
|
856
|
71 set nocp " 'compatible' is not set
|
|
72 filetype plugin on " plugins are enabled
|
650
|
73 <
|
7
|
74 You can avoid loading this plugin by setting the "loaded_netrw" variable
|
|
75 in your <.vimrc> file: >
|
|
76
|
|
77 :let loaded_netrw = 1
|
|
78
|
|
79 {Vi does not have any of this}
|
|
80
|
|
81 ==============================================================================
|
650
|
82 1. Starting With Netrw *netrw-start*
|
|
83
|
|
84 Netrw makes reading, writing, and browsing over a network connection easy!
|
|
85 First, make sure that you have plugins enabled, so you'll need to have at
|
|
86 least the following in your <.vimrc>: (or see |netrw-activate|) >
|
|
87
|
856
|
88 set nocp " 'compatible' is not set
|
|
89 filetype plugin on " plugins are enabled
|
650
|
90 <
|
|
91 (see |'cp'| and |:filetype-plugin-on|)
|
|
92
|
|
93 Netrw supports "transparent" editing of files on other machines using urls
|
|
94 (see |netrw-transparent|). As an example of this, let's assume you have an
|
|
95 account on some other machine; try >
|
|
96
|
|
97 vim scp://hostname/path/to/file
|
|
98 <
|
|
99 if you have an ssh connection. Want to make ssh/scp easier to use? Check
|
|
100 out |netrw-listhack|!
|
|
101
|
|
102 What if you have ftp, not ssh/scp? That's easy, too; try >
|
|
103
|
|
104 vim ftp://hostname/path/to/file
|
|
105 <
|
|
106 Want to make ftp simpler to use? See if your ftp supports a file called
|
|
107 <.netrc> -- typically it goes in your home directory, has read/write
|
|
108 permissions for only the user to read (ie. not group, world, other, etc),
|
|
109 and has lines resembling >
|
|
110
|
|
111 machine HOSTNAME login USERID password "PASSWORD"
|
|
112 machine HOSTNAME login USERID password "PASSWORD"
|
|
113 ...
|
856
|
114 default login USERID password "PASSWORD"
|
650
|
115 <
|
|
116 How about browsing -- ie. you just want to look around before editing a
|
|
117 file. For browsing on your current host, just "edit" a directory: >
|
|
118
|
|
119 vim .
|
|
120 vim /home/userid/path
|
|
121 <
|
|
122 For browsing on a remote host, "edit" a directory (but make sure that
|
|
123 the directory name is followed by a "/"): >
|
|
124
|
|
125 vim scp://hostname/
|
|
126 vim ftp://hostname/path/to/dir/
|
|
127 <
|
|
128 See |netrw-browse| for more!
|
|
129
|
|
130 There's more protocols supported than scp and ftp, too: see the next
|
|
131 section, |netrw-externapp|.
|
|
132
|
|
133 ==============================================================================
|
|
134 2. Netrw Reference *netrw-ref*
|
7
|
135
|
719
|
136 CONTROLLING EXTERNAL APPLICATIONS *netrw-externapp*
|
7
|
137
|
482
|
138 Protocol Variable Default Value
|
|
139 -------- ---------------- -------------
|
|
140 dav: *g:netrw_dav_cmd* = "cadaver"
|
650
|
141 fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available
|
482
|
142 ftp: *g:netrw_ftp_cmd* = "ftp"
|
856
|
143 http: *g:netrw_http_cmd* = "fetch -o" if fetch is available
|
482
|
144 http: g:netrw_http_cmd = "wget -q -O" If wget is available
|
|
145 rcp: *g:netrw_rcp_cmd* = "rcp"
|
|
146 rsync: *g:netrw_rsync_cmd* = "rsync -a"
|
|
147 scp: *g:netrw_scp_cmd* = "scp -q"
|
|
148 sftp: *g:netrw_sftp_cmd* = "sftp"
|
7
|
149
|
482
|
150 READING *netrw-read* *netrw-nread*
|
7
|
151 :Nread ? give help
|
22
|
152 :Nread "machine:path" uses rcp
|
482
|
153 :Nread "machine path" uses ftp w/ <.netrc>
|
22
|
154 :Nread "machine id password path" uses ftp
|
|
155 :Nread "dav://machine[:port]/path" uses cadaver
|
|
156 :Nread "fetch://[user@]machine/path" uses fetch
|
482
|
157 :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
|
22
|
158 :Nread "http://[user@]machine/path" uses http uses wget
|
|
159 :Nread "rcp://[user@]machine/path" uses rcp
|
|
160 :Nread "rsync://[user@]machine[:port]/path" uses rsync
|
|
161 :Nread "scp://[user@]machine[[:#]port]/path" uses scp
|
|
162 :Nread "sftp://[user@]machine/path" uses sftp
|
7
|
163
|
482
|
164 WRITING *netrw-write* *netrw-nwrite*
|
794
|
165 :Nwrite ? give help
|
22
|
166 :Nwrite "machine:path" uses rcp
|
482
|
167 :Nwrite "machine path" uses ftp w/ <.netrc>
|
22
|
168 :Nwrite "machine id password path" uses ftp
|
|
169 :Nwrite "dav://machine[:port]/path" uses cadaver
|
482
|
170 :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
|
22
|
171 :Nwrite "rcp://[user@]machine/path" uses rcp
|
|
172 :Nwrite "rsync://[user@]machine[:port]/path" uses rsync
|
|
173 :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp
|
|
174 :Nwrite "sftp://[user@]machine/path" uses sftp
|
7
|
175 http: not supported!
|
|
176
|
482
|
177 DIRECTORY LISTING *netrw-dirlist*
|
9
|
178 :Nread [protocol]://[user]@hostname/path/
|
|
179
|
482
|
180 CHANGING USERID AND PASSWORD *netrw-chgup*
|
7
|
181 Attempts to use ftp will prompt you for a user-id and a password.
|
|
182 These will be saved in g:netrw_uid and g:netrw_passwd Subsequent uses
|
|
183 of ftp will re-use those. If you need to use a different user id
|
|
184 and/or password, you'll want to call NetUserPass() first.
|
|
185
|
|
186 :NetUserPass [uid [password]] -- prompts as needed
|
|
187 :call NetUserPass() -- prompts for uid and password
|
|
188 :call NetUserPass("uid") -- prompts for password
|
|
189 :call NetUserPass("uid","password") -- sets global uid and password
|
|
190
|
482
|
191 VARIABLES *netrw-variables*
|
|
192 *b:netrw_lastfile* last file Network-read/written retained on a per-buffer
|
|
193 basis (supports plain :Nw )
|
|
194
|
|
195 *s:netrw_line* during :Nw/NetWrite, holds current line number
|
|
196 *s:netrw_col* during :Nw/NetWrite, holds current column number
|
|
197 s:netrw_line and s:netrw_col are used to
|
|
198 restore the cursor position on writes
|
|
199
|
|
200 *g:netrw_ftp* if it doesn't exist, use default ftp
|
|
201 =0 use default ftp (uid password)
|
|
202 =1 use alternate ftp method (user uid password)
|
|
203 If you're having trouble with ftp, try changing the
|
|
204 value of this variable to see if the alternate ftp
|
|
205 method works for your setup.
|
|
206
|
|
207 *g:netrw_ftpmode* ="binary" (default)
|
|
208 ="ascii"
|
|
209
|
|
210 *g:netrw_ignorenetrc* =0 (default)
|
794
|
211 =1 If you have a <.netrc> file but it doesn't work and
|
482
|
212 you want it ignored, then set this variable as shown.
|
|
213
|
|
214 *g:netrw_uid* (ftp) user-id, retained on a per-session basis
|
|
215 *g:netrw_passwd* (ftp) password, retained on a per-session basis
|
7
|
216
|
482
|
217 *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank
|
|
218 lines that o/s's ftp "provides" on transfers
|
|
219 =0 force normal ftp behavior (no trailing line removal)
|
22
|
220
|
482
|
221 *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also
|
|
222 permits network browsing to use ls with time and
|
|
223 size sorting (default if windows)
|
|
224 =0 assume Windows' scp accepts windows-style paths
|
|
225 Network browsing uses dir instead of ls
|
|
226 This option is ignored if you're using unix
|
|
227
|
|
228 *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP
|
856
|
229 =1 use WinNT's rcp in binary mode (default)
|
22
|
230
|
482
|
231 PATHS *netrw-path*
|
466
|
232
|
482
|
233 Paths to files are generally user-directory relative for most protocols.
|
|
234 It is possible that some protocol will make paths relative to some
|
|
235 associated directory, however.
|
|
236 >
|
|
237 example: vim scp://user@host/somefile
|
|
238 example: vim scp://user@host/subdir1/subdir2/somefile
|
|
239 <
|
|
240 where "somefile" is the "user"'s home directory. If you wish to get a
|
|
241 file using root-relative paths, use the full path:
|
|
242 >
|
|
243 example: vim scp://user@host//somefile
|
|
244 example: vim scp://user@host//subdir1/subdir2/somefile
|
|
245 <
|
7
|
246
|
|
247 ==============================================================================
|
650
|
248 3. Network-Oriented File Transfer *netrw-xfer*
|
7
|
249
|
|
250 Network-oriented file transfer under Vim is implemented by a VimL-based script
|
559
|
251 (<netrw.vim>) using plugin techniques. It currently supports both reading and
|
|
252 writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch,
|
7
|
253 dav/cadaver, rsync, or sftp.
|
|
254
|
|
255 http is currently supported read-only via use of wget or fetch.
|
|
256
|
|
257 <netrw.vim> is a standard plugin which acts as glue between Vim and the
|
|
258 various file transfer programs. It uses autocommand events (BufReadCmd,
|
|
259 FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. >
|
|
260
|
|
261 ex. vim ftp://hostname/path/to/file
|
|
262 <
|
559
|
263 The characters preceding the colon specify the protocol to use; in the
|
|
264 example, its ftp. The <netrw.vim> script then formulates a command or a
|
|
265 series of commands (typically ftp) which it issues to an external program
|
|
266 (ftp, scp, etc) which does the actual file transfer/protocol. Files are read
|
|
267 from/written to a temporary file (under Unix/Linux, /tmp/...) which the
|
|
268 <netrw.vim> script will clean up.
|
7
|
269
|
794
|
270 *netrw-putty* *netrw-pscp*
|
559
|
271 One may modify any protocol's implementing external application by setting a
|
|
272 variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
|
794
|
273 "scp -q"). As an example, consider using PuTTY: >
|
|
274 let g:netrw_scp_cmd= '"c:\Program Files\PuTTY\pscp.exe" -q -batch'
|
|
275 <
|
7
|
276 Ftp, an old protocol, seems to be blessed by numerous implementations.
|
559
|
277 Unfortunately, some implementations are noisy (ie., add junk to the end of the
|
|
278 file). Thus, concerned users may decide to write a NetReadFixup() function
|
|
279 that will clean up after reading with their ftp. Some Unix systems (ie.,
|
|
280 FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is
|
|
281 not noisy and more convenient, actually, for <netrw.vim> to use.
|
7
|
282 Consequently, if "fetch" is executable, it will be used to do reads for
|
|
283 ftp://... (and http://...) . See |netrw-var| for more about this.
|
|
284
|
|
285 For rcp, scp, sftp, and http, one may use network-oriented file transfers
|
459
|
286 transparently; ie.
|
7
|
287 >
|
|
288 vim rcp://[user@]machine/path
|
|
289 vim scp://[user@]machine/path
|
|
290 <
|
|
291 If your ftp supports <.netrc>, then it too can be just as transparently used
|
|
292 if the needed triad of machine name, user id, and password are present in
|
|
293 that file. Your ftp must be able to use the <.netrc> file on its own, however.
|
|
294 >
|
|
295 vim ftp://[user@]machine[[:#]portnumber]/path
|
|
296 <
|
|
297 However, ftp will often need to query the user for the userid and password.
|
459
|
298 The latter will be done "silently"; ie. asterisks will show up instead of
|
7
|
299 the actually-typed-in password. Netrw will retain the userid and password
|
|
300 for subsequent read/writes from the most recent transfer so subsequent
|
|
301 transfers (read/write) to or from that machine will take place without
|
|
302 additional prompting.
|
|
303
|
|
304 *netrw-urls*
|
|
305 +=================================+============================+============+
|
856
|
306 | Reading | Writing | Uses |
|
7
|
307 +=================================+============================+============+
|
856
|
308 | DAV: | | |
|
|
309 | dav://host/path | | cadaver |
|
|
310 | :Nread dav://host/path | :Nwrite dav://host/path | cadaver |
|
7
|
311 +---------------------------------+----------------------------+------------+
|
856
|
312 | FETCH: | | |
|
|
313 | fetch://[user@]host/path | | |
|
|
314 | fetch://[user@]host:http/path | Not Available | fetch |
|
|
315 | :Nread fetch://[user@]host/path| | |
|
7
|
316 +---------------------------------+----------------------------+------------+
|
856
|
317 | FILE: | | |
|
|
318 | file:///* | file:///* | |
|
|
319 | file://localhost/* | file://localhost/* | |
|
7
|
320 +---------------------------------+----------------------------+------------+
|
856
|
321 | FTP: (*3) | (*3) | |
|
|
322 | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) |
|
|
323 | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc |
|
|
324 | :Nread host path | :Nwrite host path | ftp+.netrc |
|
|
325 | :Nread host uid pass path | :Nwrite host uid pass path | ftp |
|
7
|
326 +---------------------------------+----------------------------+------------+
|
856
|
327 | HTTP: wget is executable: (*4) | | |
|
|
328 | http://[user@]host/path | Not Available | wget |
|
7
|
329 +---------------------------------+----------------------------+------------+
|
856
|
330 | HTTP: fetch is executable (*4) | | |
|
|
331 | http://[user@]host/path | Not Available | fetch |
|
7
|
332 +---------------------------------+----------------------------+------------+
|
856
|
333 | RCP: | | |
|
|
334 | rcp://[user@]host/path | rcp://[user@]host/path | rcp |
|
7
|
335 +---------------------------------+----------------------------+------------+
|
856
|
336 | RSYNC: | | |
|
|
337 | rsync://[user@]host/path | rsync://[user@]host/path | rsync |
|
|
338 | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync |
|
|
339 | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp |
|
7
|
340 +---------------------------------+----------------------------+------------+
|
856
|
341 | SCP: | | |
|
|
342 | scp://[user@]host/path | scp://[user@]host/path | scp |
|
|
343 | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) |
|
7
|
344 +---------------------------------+----------------------------+------------+
|
856
|
345 | SFTP: | | |
|
|
346 | sftp://[user@]host/path | sftp://[user@]host/path | sftp |
|
|
347 | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) |
|
7
|
348 +=================================+============================+============+
|
|
349
|
|
350 (*1) For an absolute path use scp://machine//path.
|
|
351
|
|
352 (*2) if <.netrc> is present, it is assumed that it will
|
|
353 work with your ftp client. Otherwise the script will
|
9
|
354 prompt for user-id and pasword.
|
7
|
355
|
856
|
356 (*3) for ftp, "machine" may be machine#port or machine:port
|
7
|
357 if a different port is needed than the standard ftp port
|
|
358
|
|
359 (*4) for http:..., if wget is available it will be used. Otherwise,
|
|
360 if fetch is available it will be used.
|
|
361
|
|
362 Both the :Nread and the :Nwrite ex-commands can accept multiple filenames.
|
|
363
|
|
364
|
|
365 NETRC *netrw-netrc*
|
|
366
|
|
367 The typical syntax for lines in a <.netrc> file is given as shown below.
|
799
|
368 Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't.
|
7
|
369 >
|
|
370 machine {full machine name} login {user-id} password "{password}"
|
|
371 default login {user-id} password "{password}"
|
|
372
|
|
373 Your ftp client must handle the use of <.netrc> on its own, but if the
|
|
374 <.netrc> file exists, an ftp transfer will not ask for the user-id or
|
|
375 password.
|
|
376
|
|
377 Note:
|
|
378 Since this file contains passwords, make very sure nobody else can
|
|
379 read this file! Most programs will refuse to use a .netrc that is
|
|
380 readable for others. Don't forget that the system administrator can
|
|
381 still read the file!
|
|
382
|
|
383
|
|
384 PASSWORD *netrw-passwd*
|
|
385
|
|
386 The script attempts to get passwords for ftp invisibly using |inputsecret()|,
|
|
387 a built-in Vim function. See |netrw-uidpass| for how to change the password
|
|
388 after one has set it.
|
|
389
|
559
|
390 Unfortunately there doesn't appear to be a way for netrw to feed a password to
|
|
391 scp. Thus every transfer via scp will require re-entry of the password.
|
|
392 However, |netrw-listhack| can help with this problem.
|
7
|
393
|
|
394
|
|
395 ==============================================================================
|
650
|
396 4. Activation *netrw-activate*
|
7
|
397
|
799
|
398 Network-oriented file transfers are available by default whenever Vim's
|
7
|
399 |'nocompatible'| mode is enabled. The <netrw.vim> file resides in your
|
559
|
400 system's vim-plugin directory and is sourced automatically whenever you bring
|
|
401 up vim. I suggest that, at a minimum, you have at least the following in your
|
|
402 <.vimrc> customization file: >
|
799
|
403
|
559
|
404 set nocp
|
|
405 if version >= 600
|
|
406 filetype plugin indent on
|
|
407 endif
|
|
408 <
|
7
|
409
|
|
410 ==============================================================================
|
650
|
411 5. Transparent File Transfer *netrw-transparent*
|
7
|
412
|
|
413 Transparent file transfers occur whenever a regular file read or write
|
|
414 (invoked via an |:autocmd| for |BufReadCmd| or |BufWriteCmd| events) is made.
|
559
|
415 Thus one may use files across networks just as simply as if they were local. >
|
7
|
416
|
|
417 vim ftp://[user@]machine/path
|
|
418 ...
|
|
419 :wq
|
|
420
|
559
|
421 See |netrw-activate| for more on how to encourage your vim to use plugins
|
|
422 such as netrw.
|
7
|
423
|
799
|
424
|
7
|
425 ==============================================================================
|
650
|
426 6. Ex Commands *netrw-ex*
|
7
|
427
|
799
|
428 The usual read/write commands are supported. There are also a few
|
|
429 additional commands available. Often you won't need to use Nw or
|
|
430 Nread as shown in |netrw-transparent| (ie. use :e url, :r url, :w url;
|
|
431 see |netrw-urls|).
|
7
|
432
|
|
433 :[range]Nw Write the specified lines to the current
|
|
434 file as specified in b:netrw_lastfile.
|
|
435
|
|
436 :[range]Nw {netfile} [{netfile}]...
|
|
437 Write the specified lines to the {netfile}.
|
|
438
|
559
|
439 :Nread Read the specified lines into the current
|
7
|
440 buffer from the file specified in
|
|
441 b:netrw_lastfile.
|
|
442
|
|
443 :Nread {netfile} {netfile}...
|
|
444 Read the {netfile} after the current line.
|
|
445
|
534
|
446 *netrw-uidpass*
|
7
|
447 :call NetUserPass()
|
|
448 If b:netrw_uid and b:netrw_passwd don't exist,
|
|
449 this function query the user for them.
|
|
450
|
|
451 :call NetUserPass("userid")
|
|
452 This call will set the b:netrw_uid and, if
|
|
453 the password doesn't exist, will query the user for it.
|
|
454
|
|
455 :call NetUserPass("userid","passwd")
|
|
456 This call will set both the b:netrw_uid and b:netrw_passwd.
|
|
457 The user-id and password are used by ftp transfers. One may
|
|
458 effectively remove the user-id and password by using ""
|
|
459 strings.
|
|
460
|
857
|
461 :NetrwSettings This command is desribed in |netrw-settings| -- used to
|
856
|
462 display netrw settings and change netrw behavior.
|
482
|
463
|
7
|
464
|
|
465 ==============================================================================
|
794
|
466 7. Variables and Options *netrw-options* *netrw-var*
|
7
|
467
|
|
468 The script <netrw.vim> uses several variables which can affect <netrw.vim>'s
|
|
469 behavior. These variables typically may be set in the user's <.vimrc> file:
|
559
|
470 (also see |netrw-settings|) >
|
|
471
|
856
|
472 -------------
|
|
473 Netrw Options
|
|
474 -------------
|
9
|
475 Option Meaning
|
|
476 -------------- -----------------------------------------------
|
|
477 <
|
856
|
478 b:netrw_col Holds current cursor position (during NetWrite)
|
|
479 g:netrw_cygwin =1 assume scp under windows is from cygwin
|
|
480 (default/windows)
|
|
481 =0 assume scp under windows accepts windows
|
|
482 style paths (default/else)
|
|
483 g:netrw_ftp =0 use default ftp (uid password)
|
|
484 g:netrw_ftpmode ="binary" (default)
|
|
485 ="ascii" (your choice)
|
|
486 g:netrw_ignorenetrc =1 (default)
|
|
487 if you have a <.netrc> file but you don't
|
7
|
488 want it used, then set this variable. Its
|
|
489 mere existence is enough to cause <.netrc>
|
|
490 to be ignored.
|
856
|
491 b:netrw_lastfile Holds latest method/machine/path.
|
|
492 b:netrw_line Holds current line number (during NetWrite)
|
|
493 g:netrw_passwd Holds current password for ftp.
|
|
494 g:netrw_silent =0 transfers done normally
|
|
495 =1 transfers done silently
|
|
496 g:netrw_uid Holds current user-id for ftp.
|
|
497 =1 use alternate ftp (user uid password)
|
|
498 (see |netrw-options|)
|
|
499 g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
|
|
500 =1 use WinNT/2K/XP's rcp, binary mode
|
|
501 g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc
|
|
502 =1 use default method to do ftp >
|
9
|
503 -----------------------------------------------------------------------
|
|
504 <
|
7
|
505 The script will also make use of the following variables internally, albeit
|
|
506 temporarily.
|
9
|
507 >
|
|
508 -------------------
|
|
509 Temporary Variables
|
|
510 -------------------
|
|
511 Variable Meaning
|
|
512 -------- ------------------------------------
|
|
513 <
|
7
|
514 g:netrw_method Index indicating rcp/ftp+.netrc/ftp
|
|
515 g:netrw_machine Holds machine name parsed from input
|
9
|
516 g:netrw_fname Holds filename being accessed >
|
|
517 ------------------------------------------------------------
|
|
518 <
|
|
519 *netrw-protocol*
|
7
|
520
|
9
|
521 Netrw supports a number of protocols. These protocols are invoked using the
|
|
522 variables listed below, and may be modified by the user.
|
7
|
523 >
|
|
524 ------------------------
|
856
|
525 Protocol Control Options
|
7
|
526 ------------------------
|
856
|
527 Option Type Setting Meaning
|
|
528 --------- -------- -------------- ---------------------------
|
9
|
529 <
|
856
|
530 netrw_ftp variable =doesn't exist userid set by "user userid"
|
|
531 =0 userid set by "user userid"
|
|
532 =1 userid set by "userid"
|
|
533 NetReadFixup function =doesn't exist no change
|
|
534 =exists Allows user to have files
|
|
535 read via ftp automatically
|
|
536 transformed however they wish
|
|
537 by NetReadFixup()
|
7
|
538 g:netrw_dav_cmd variable ="cadaver"
|
856
|
539 g:netrw_fetch_cmd variable ="fetch -o" if fetch is available
|
7
|
540 g:netrw_ftp_cmd variable ="ftp"
|
650
|
541 g:netrw_http_cmd variable ="fetch -o" if fetch is available
|
|
542 g:netrw_http_cmd variable ="wget -O" else if wget is available
|
9
|
543 g:netrw_list_cmd variable ="ssh HOSTNAME ls -Fa"
|
7
|
544 g:netrw_rcp_cmd variable ="rcp"
|
|
545 g:netrw_rsync_cmd variable ="rsync -a"
|
|
546 g:netrw_scp_cmd variable ="scp -q"
|
9
|
547 g:netrw_sftp_cmd variable ="sftp" >
|
|
548 -------------------------------------------------------------------------
|
7
|
549 <
|
12
|
550 *netrw-ftp*
|
650
|
551 The first two options (netrw_ftp and NetReadFixup) both help with certain
|
|
552 ftp's that give trouble otherwise. In order to best understand how to use
|
|
553 these options if ftp is giving you troubles, a bit of discussion follows on
|
|
554 how netrw does ftp reads.
|
7
|
555
|
559
|
556 The g:netrw_..._cmd variables specify the external program to use handle the
|
|
557 associated protocol (rcp, ftp, etc), plus any options.
|
7
|
558
|
9
|
559 The g:netrw_list_cmd's HOSTNAME entry will be changed via substitution with
|
|
560 whatever the current request is for a hostname.
|
|
561
|
|
562 For ftp, netrw typically builds up lines of one of the following formats in a
|
7
|
563 temporary file:
|
|
564 >
|
|
565 IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1
|
|
566 ---------------------------------- ------------------------------
|
9
|
567 <
|
856
|
568 open machine [port] open machine [port]
|
|
569 user userid password userid password
|
|
570 [g:netrw_ftpmode] password
|
|
571 get filename tempfile [g:netrw_ftpmode]
|
|
572 get filename tempfile >
|
9
|
573 ---------------------------------------------------------------------
|
7
|
574 <
|
|
575 Netrw then executes the lines above by use of a filter:
|
|
576 >
|
|
577 :%! {g:netrw_ftp_cmd} -i [-n]
|
|
578 <
|
|
579
|
|
580 where
|
|
581 g:netrw_ftp_cmd is usually "ftp",
|
|
582 -i tells ftp not to be interactive
|
|
583 -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>)
|
|
584
|
|
585 If <.netrc> exists it will be used to avoid having to query the user for
|
9
|
586 userid and password. The transferred file is put into a temporary file.
|
7
|
587 The temporary file is then read into the main editing session window that
|
|
588 requested it and the temporary file deleted.
|
|
589
|
559
|
590 If your ftp doesn't accept the "user" command and immediately just demands a
|
|
591 userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
|
7
|
592
|
12
|
593 *netrw-cadaver*
|
|
594 To handle the SSL certificate dialog for untrusted servers, one may pull
|
|
595 down the certificate and place it into /usr/ssl/cert.pem. This operation
|
|
596 renders the server treatment as "trusted".
|
|
597
|
794
|
598 *netrw-fixup* *netreadfixup*
|
7
|
599 If your ftp for whatever reason generates unwanted lines (such as AUTH
|
|
600 messages) you may write a NetReadFixup(tmpfile) function:
|
|
601 >
|
|
602 function! NetReadFixup(method,line1,line2)
|
|
603 " a:line1: first new line in current file
|
|
604 " a:line2: last new line in current file
|
|
605 if a:method == 1 "rcp
|
|
606 elseif a:method == 2 "ftp + <.netrc>
|
|
607 elseif a:method == 3 "ftp + machine,uid,password,filename
|
|
608 elseif a:method == 4 "scp
|
|
609 elseif a:method == 5 "http/wget
|
|
610 elseif a:method == 6 "dav/cadaver
|
|
611 elseif a:method == 7 "rsync
|
|
612 elseif a:method == 8 "fetch
|
|
613 elseif a:method == 9 "sftp
|
856
|
614 else " complain
|
7
|
615 endif
|
|
616 endfunction
|
|
617 >
|
559
|
618 The NetReadFixup() function will be called if it exists and thus allows you to
|
|
619 customize your reading process. As a further example, <netrw.vim> contains
|
|
620 just such a function to handle Windows 95 ftp. For whatever reason, Windows
|
|
621 95's ftp dumps four blank lines at the end of a transfer, and so it is
|
|
622 desirable to automate their removal. Here's some code taken from <netrw.vim>
|
|
623 itself:
|
7
|
624 >
|
|
625 if has("win95") && g:netrw_win95ftp
|
9
|
626 fun! NetReadFixup(method, line1, line2)
|
7
|
627 if method == 3 " ftp (no <.netrc>)
|
856
|
628 let fourblanklines= line2 - 3
|
|
629 silent fourblanklines.",".line2."g/^\s*/d"
|
7
|
630 endif
|
|
631 endfunction
|
|
632 endif
|
|
633 >
|
|
634
|
|
635 ==============================================================================
|
650
|
636 8. Directory Browsing *netrw-browse* *netrw-dir* *netrw-list* *netrw-help*
|
459
|
637
|
794
|
638 MAPS *netrw-maps*
|
|
639 <F1>.............Help.......................................|netrw-help|
|
459
|
640 <cr>.............Browsing...................................|netrw-cr|
|
|
641 <del>............Deleting Files or Directories..............|netrw-delete|
|
|
642 -................Going Up...................................|netrw--|
|
|
643 a................Hiding Files or Directories................|netrw-a|
|
|
644 b................Bookmarking a Directory....................|netrw-b|
|
|
645 B................Changing to a Bookmarked Directory.........|netrw-B|
|
|
646 c................Make Browsing Directory The Current Dir....|netrw-c|
|
|
647 d................Make A New Directory.......................|netrw-d|
|
|
648 D................Deleting Files or Directories..............|netrw-D|
|
650
|
649 <c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h|
|
459
|
650 i................Long Listing...............................|netrw-i|
|
|
651 <c-l>............Refreshing the Listing.....................|netrw-ctrl-l|
|
|
652 o................Browsing with a Horizontal Split...........|netrw-o|
|
|
653 p................Preview Window.............................|netrw-p|
|
|
654 q................Listing Bookmarks and History..............|netrw-q|
|
|
655 r................Reversing Sorting Order....................|netrw-r|
|
|
656 R................Renaming Files or Directories..............|netrw-R|
|
|
657 s................Selecting Sorting Style....................|netrw-s|
|
|
658 S................Editing the Sorting Sequence...............|netrw-S|
|
|
659 u................Changing to a Predecessor Directory........|netrw-u|
|
|
660 U................Changing to a Successor Directory..........|netrw-U|
|
|
661 v................Browsing with a Vertical Split.............|netrw-v|
|
|
662 x................Customizing Browsing.......................|netrw-x|
|
|
663
|
|
664 COMMANDS *netrw-explore-cmds*
|
477
|
665 :Explore[!] [dir] Explore directory of current file........|netrw-explore|
|
|
666 :Sexplore[!] [dir] Split & Explore directory ...............|netrw-explore|
|
|
667 :Hexplore[!] [dir] Horizontal Split & Explore...............|netrw-explore|
|
|
668 :Vexplore[!] [dir] Vertical Split & Explore.................|netrw-explore|
|
|
669 :Pexplore[!] [dir] Vertical Split & Explore.................|netrw-explore|
|
|
670 :Nexplore[!] [dir] Vertical Split & Explore.................|netrw-explore|
|
482
|
671 :NetrwSettings.............................................|netrw-settings|
|
21
|
672
|
794
|
673 QUICK REFERENCE COMMANDS TABLE *netrw-browse-cmds*
|
11
|
674 >
|
857
|
675 ------- -----------
|
11
|
676 Command Explanation
|
856
|
677 ------- -----------
|
794
|
678 < <F1> Causes Netrw to issue help
|
650
|
679 <cr> Netrw will enter the directory or read the file |netrw-cr|
|
|
680 <del> Netrw will attempt to remove the file/directory |netrw-del|
|
|
681 - Makes Netrw go up one directory |netrw--|
|
|
682 a Toggles between normal display, |netrw-a|
|
|
683 hiding (suppress display of files matching g:netrw_list_hide)
|
|
684 showing (display only files which match g:netrw_list_hide)
|
|
685 b bookmark current directory; use Nb if compact listing
|
|
686 in use |netrw-b|
|
|
687 B go to previous bookmarked directory; use Nb if compact
|
|
688 listing is in use |netrw-B|
|
|
689 c Make current browsing directory the current directory |netrw-c|
|
|
690 d Make a directory |netrw-d|
|
|
691 D Netrw will attempt to remove the file(s)/directory(ies) |netrw-D|
|
|
692 <c-h> Edit file hiding list |netrw-ctrl-h|
|
|
693 i Toggles between long and short listing |netrw-i|
|
|
694 <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
|
|
695 Nb Same as b, but always available |netrw-Nb|
|
|
696 NB Same as B, but always available |netrw-NB|
|
11
|
697 o Enter the file/directory under the cursor in a new browser
|
650
|
698 window. A horizontal split is used. |netrw-o|
|
|
699 O Obtain a file specified by cursor |netrw-O|
|
|
700 p Preview the file |netrw-p|
|
|
701 P Browse in the previously used window |netrw-P|
|
|
702 r Reverse sorting order |netrw-r|
|
|
703 R Rename the designed file(s)/directory(ies) |netrw-R|
|
|
704 s Select sorting style: by name, time, or file size |netrw-s|
|
|
705 S Specify suffix priority for name-sorting |netrw-S|
|
|
706 u Change to recently-visited directory |netrw-u|
|
|
707 U Change to subsequently-visited directory |netrw-U|
|
11
|
708 v Enter the file/directory under the cursor in a new browser
|
650
|
709 window. A vertical split is used. |netrw-v|
|
|
710 x Apply a function to a file. (special browsers) |netrw-x|
|
24
|
711
|
21
|
712 NETRW BROWSER VARIABLES *netrw-browse-var*
|
11
|
713 >
|
482
|
714 --- -----------
|
|
715 Var Explanation
|
|
716 --- -----------
|
|
717 < *g:netrw_alto* change from above splitting to below splitting
|
|
718 by setting this variable (see |netrw-o|)
|
|
719 default: =0
|
459
|
720
|
482
|
721 *g:netrw_altv* change from left splitting to right splitting
|
794
|
722 by setting this variable (see |netrw-v|)
|
482
|
723 default: =0
|
459
|
724
|
650
|
725 *g:netrw_browse_split* when browsing, <cr> will open the file by:
|
|
726 =0: re-using the same window
|
856
|
727 =1: horizontally splitting the window first
|
|
728 =2: vertically splitting the window first
|
719
|
729
|
650
|
730 *g:netrw_browsex_viewer* specify user's preference for a viewer: >
|
|
731 "kfmclient exec"
|
|
732 "gnome-open"
|
|
733 < If >
|
|
734 "-"
|
|
735 < is used, then netrwFileHandler() will look for
|
|
736 a script/function to handle the given
|
|
737 extension. (see |netrw_filehandler|).
|
719
|
738
|
|
739 *g:netrw_fastbrowse* =0: slow speed browsing, never re-use
|
794
|
740 directory listings; always obtain
|
719
|
741 directory listings.
|
|
742 =1: medium speed browsing, re-use directory
|
|
743 listings only when remote browsing.
|
|
744 (default value)
|
|
745 =2: fast browsing, only obtains directory
|
|
746 listings when the directory hasn't been
|
|
747 seen before (or |netrw-ctrl-l| is used).
|
|
748 Fast browsing retains old directory listing
|
|
749 buffers so that they don't need to be
|
|
750 re-acquired. This feature is especially
|
|
751 important for remote browsing. However, if
|
|
752 a file is introduced or deleted into or from
|
|
753 such directories, the old directory buffer
|
|
754 becomes out-of-date. One may always refresh
|
|
755 such a directory listing with |netrw-ctrl-l|.
|
|
756 This option gives the choice of the trade-off
|
|
757 between accuracy and speed to the user.
|
|
758
|
482
|
759 *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
|
|
760 that can show up as "directories" and "files"
|
|
761 in the listing. This pattern is used to
|
|
762 remove such embedded messages. By default its
|
|
763 value is:
|
|
764 '^total\s\+\d\+$\|
|
|
765 ^Trying\s\+\d\+.*$\|
|
|
766 ^KERBEROS_V\d rejected\|
|
|
767 ^Security extensions not\|
|
|
768 No such file\|
|
|
769 : connect to address [0-9a-fA-F:]*
|
|
770 : No route to host$'
|
459
|
771
|
559
|
772 *g:netrw_ftp_list_cmd* options for passing along to ftp for directory
|
|
773 listing. Defaults:
|
|
774 unix or g:netrw_cygwin set: : "ls -lF"
|
856
|
775 otherwise "dir"
|
559
|
776
|
|
777 *g:netrw_hide* if true, the hiding list is used
|
|
778 default: =0
|
459
|
779
|
482
|
780 *g:netrw_keepdir* =1 (default) keep current directory immune from
|
|
781 the browsing directory.
|
|
782 =0 keep the current directory the same as the
|
|
783 browsing directory.
|
|
784 The current browsing directory is contained in
|
839
|
785 b:netrw_curdir (also see |netrw-c|)
|
459
|
786
|
482
|
787 *g:netrw_list_cmd* command for listing remote directories
|
|
788 default: (if ssh is executable)
|
856
|
789 "ssh HOSTNAME ls -FLa"
|
459
|
790
|
482
|
791 *g:netrw_longlist* if =1, then long listing will be default
|
459
|
792
|
482
|
793 *g:netrw_list_hide* comma separated pattern list for hiding files
|
|
794 default: ""
|
459
|
795
|
482
|
796 *g:netrw_local_mkdir* command for making a local directory
|
559
|
797 default: "mkdir"
|
459
|
798
|
482
|
799 *g:netrw_local_rmdir* remove directory command (rmdir)
|
|
800 default: "rmdir"
|
459
|
801
|
482
|
802 *g:netrw_maxfilenamelen* =32 by default, selected so as to make long
|
|
803 listings fit on 80 column displays.
|
|
804 If your screen is wider, and you have file
|
|
805 or directory names longer than 32 bytes,
|
|
806 you may set this option to keep listings
|
|
807 columnar.
|
459
|
808
|
482
|
809 *g:netrw_mkdir_cmd* command for making a remote directory
|
|
810 default: "ssh HOSTNAME mkdir"
|
459
|
811
|
482
|
812 *g:netrw_rm_cmd* command for removing files
|
|
813 default: "ssh HOSTNAME rm"
|
459
|
814
|
482
|
815 *g:netrw_rmdir_cmd* command for removing directories
|
|
816 default: "ssh HOSTNAME rmdir"
|
459
|
817
|
482
|
818 *g:netrw_rmf_cmd* command for removing softlinks
|
|
819 default: "ssh HOSTNAME rm -f"
|
459
|
820
|
482
|
821 *g:netrw_sort_by* sort by "name", "time", or "size"
|
|
822 default: "name"
|
459
|
823
|
482
|
824 *g:netrw_sort_direction* sorting direction: "normal" or "reverse"
|
|
825 default: "normal"
|
459
|
826
|
482
|
827 *g:netrw_sort_sequence* when sorting by name, first sort by the
|
|
828 comma-separated pattern sequence
|
|
829 default: '[\/]$,*,\.bak$,\.o$,\.h$,
|
856
|
830 \.info$,\.swp$,\.obj$'
|
459
|
831
|
559
|
832 *g:netrw_ssh_cmd* One may specify an executable command
|
794
|
833 to use instead of ssh for remote actions
|
559
|
834 such as listing, file removal, etc.
|
|
835 default: ssh
|
|
836
|
|
837 *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines,
|
|
838 messages, banners, and whatnot that one doesn't
|
|
839 want masquerading as "directories" and "files".
|
|
840 Use this pattern to remove such embedded
|
|
841 messages. By default its value is:
|
794
|
842 '^total\s\+\d\+$'
|
559
|
843
|
482
|
844 *g:netrw_timefmt* specify format string to strftime() (%c)
|
|
845 default: "%c"
|
459
|
846
|
482
|
847 *g:netrw_winsize* specify initial size of new o/v windows
|
|
848 default: ""
|
24
|
849
|
828
|
850 *g:NetrwTopLvlMenu* This variable specifies the top level
|
|
851 menu name; by default, its "Netrw.". If
|
|
852 you wish to change this, do so in your
|
|
853 .vimrc.
|
719
|
854
|
459
|
855 INTRODUCTION TO DIRECTORY BROWSING *netrw-browse-intro*
|
12
|
856
|
22
|
857 Netrw supports the browsing of directories on the local system and on remote
|
559
|
858 hosts, including listing files and directories, entering directories, editing
|
22
|
859 files therein, deleting files/directories, making new directories, and moving
|
|
860 (renaming) files and directories. The Netrw browser generally implements the
|
|
861 previous explorer maps and commands for remote directories, although details
|
|
862 (such as pertinent global variable names) necessarily differ.
|
|
863
|
|
864 The Netrw remote file and directory browser handles two protocols: ssh and
|
|
865 ftp. The protocol in the url, if it is ftp, will cause netrw to use ftp
|
|
866 in its remote browsing. Any other protocol will be used for file transfers,
|
|
867 but otherwise the ssh protocol will be used to do remote directory browsing.
|
9
|
868
|
559
|
869 To use Netrw's remote directory browser, simply attempt to read a "file" with a
|
11
|
870 trailing slash and it will be interpreted as a request to list a directory:
|
9
|
871
|
|
872 vim [protocol]://[user@]hostname/path/
|
|
873
|
559
|
874 For local directories, the trailing slash is not required.
|
|
875
|
|
876 If you'd like to avoid entering the password in for remote directory listings
|
|
877 with ssh or scp, see |netrw-listhack|.
|
12
|
878
|
719
|
879
|
|
880 NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible*
|
|
881
|
|
882 Netrw will not work properly with >
|
|
883
|
|
884 :set acd
|
|
885 :set fo=...ta...
|
|
886 <
|
|
887 If either of these options are present when browsing is attempted, netrw
|
|
888 will change them by using noacd and removing the ta suboptions from the
|
724
|
889 |'formatoptions'|.
|
719
|
890
|
466
|
891 *netrw-explore* *netrw-pexplore*
|
|
892 *netrw-hexplore* *netrw-sexplore*
|
|
893 DIRECTORY EXPLORING COMMANDS *netrw-nexplore* *netrw-vexplore*
|
459
|
894
|
477
|
895 :Explore[!] [dir]... Explore directory of current file *:Explore*
|
|
896 :Sexplore[!] [dir]... Split&Explore directory of current file *:Sexplore*
|
856
|
897 :Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
|
|
898 :Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
|
477
|
899
|
|
900 Used with :Explore **/pattern :
|
856
|
901 :Nexplore............. go to next matching file *:Nexplore*
|
|
902 :Pexplore............. go to previous matching file *:Pexplore*
|
459
|
903
|
477
|
904 :Explore will open the local-directory browser on the current file's
|
856
|
905 directory (or on directory [dir] if specified). The window will be
|
477
|
906 split only if the file has been modified, otherwise the browsing
|
|
907 window will take over that window. Normally the splitting is taken
|
|
908 horizontally.
|
|
909 :Explore! is like :Explore, but will use vertical splitting.
|
|
910 :Sexplore will always split the window before invoking the local-directory
|
856
|
911 browser. As with Explore, the splitting is normally done
|
477
|
912 horizontally.
|
|
913 :Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically.
|
|
914 :Hexplore [dir] does an :Explore with |:belowright| horizontal splitting.
|
|
915 :Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting.
|
|
916 :Vexplore [dir] does an :Explore with |:leftabove| vertical splitting.
|
|
917 :Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting.
|
459
|
918
|
477
|
919 By default, these commands use the current file's directory. However, one
|
|
920 may explicitly provide a directory (path) to use.
|
459
|
921
|
839
|
922 *netrw-starstar*
|
|
923 When Explore, Sexplore, Hexplore, or Vexplore are used with a **/filepat,
|
559
|
924 such as:
|
466
|
925 >
|
|
926 :Explore **/filename_pattern
|
|
927 <
|
839
|
928 netrw will attempt to find a file in the current directory or any subdirectory
|
|
929 which matches the filename pattern. Internally, it produces a list of files
|
|
930 which match the pattern and their paths; to that extent it resembles the Unix
|
|
931 operation:
|
466
|
932 >
|
|
933 find $(pwd) -name "$1" -exec "echo" "{}" ";" 2> /dev/null
|
|
934 <
|
|
935 The directory display is updated to show the subdirectory containing a
|
|
936 matching file. One may then proceed to the next (or previous) matching files'
|
|
937 directories by using Nexplore or Pexplore, respectively. If your console or
|
|
938 gui produces recognizable shift-up or shift-down sequences, then you'll likely
|
559
|
939 find using shift-downarrow and shift-uparrow convenient. They're mapped by
|
|
940 netrw:
|
464
|
941
|
|
942 <s-down> == Nexplore, and
|
|
943 <s-up> == Pexplore.
|
|
944
|
466
|
945 As an example, consider
|
|
946 >
|
464
|
947 :Explore **/*.c
|
|
948 :Nexplore
|
|
949 :Nexplore
|
|
950 :Pexplore
|
|
951 <
|
466
|
952 The status line will show, on the right hand side of the status line, a
|
|
953 message like "Match 3 of 20".
|
|
954
|
839
|
955 *netrw-starpat*
|
|
956 When Explore, Sexplore, Hexplore, or Vexplore are used with a */pattern,
|
|
957 such as:
|
|
958 >
|
|
959 :Explore */pattern
|
|
960 <
|
|
961 netrw will use |:vimgrep| to find files which contain the given pattern.
|
|
962 Like what happens with |netrw-starstar|, a list of files which contain
|
|
963 matches to the given pattern is generated. The cursor will then jump
|
|
964 to the first file with the given pattern; |:Nexplore|, |:Pexplore|, and
|
|
965 the shifted-down and -up arrows work with the list to move to the next
|
|
966 or previous files in that list.
|
459
|
967
|
841
|
968 *netrw-starstarpat*
|
|
969 When Explore, Sexplore, Hexplore, or Vexplore are used with a **//pattern,
|
|
970 such as:
|
|
971 >
|
|
972 :Explore **//pattern
|
|
973 <
|
|
974 then Explore will use |:vimgrep| to find files like |netrw-starpat|;
|
|
975 however, Explore will also search subdirectories as well as the current
|
|
976 directory.
|
|
977
|
|
978
|
22
|
979 REFRESHING THE LISTING *netrw-ctrl-l*
|
12
|
980
|
22
|
981 To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
|
|
982 hit the <cr> when atop the ./ directory entry in the listing. One may also
|
|
983 refresh a local directory by using ":e .".
|
12
|
984
|
|
985
|
|
986 GOING UP *netrw--*
|
|
987
|
559
|
988 To go up a directory, press "-" or press the <cr> when atop the ../ directory
|
12
|
989 entry in the listing.
|
|
990
|
559
|
991 Netrw will use the command in |g:netrw_list_cmd| to perform the directory
|
|
992 listing operation after changing HOSTNAME to the host specified by the
|
|
993 user-provided url. By default netrw provides the command as:
|
9
|
994
|
11
|
995 ssh HOSTNAME ls -FLa
|
9
|
996
|
22
|
997 where the HOSTNAME becomes the [user@]hostname as requested by the attempt to
|
|
998 read. Naturally, the user may override this command with whatever is
|
|
999 preferred. The NetList function which implements remote directory browsing
|
|
1000 expects that directories will be flagged by a trailing slash.
|
9
|
1001
|
12
|
1002
|
794
|
1003 BROWSING *netrw-cr*
|
12
|
1004
|
9
|
1005 Browsing is simple: move the cursor onto a file or directory of interest.
|
11
|
1006 Hitting the <cr> (the return key) will select the file or directory.
|
|
1007 Directories will themselves be listed, and files will be opened using the
|
856
|
1008 protocol given in the original read request.
|
559
|
1009
|
|
1010 CAVEAT: There are three forms of listing (see |netrw-i|). Netrw assumes
|
|
1011 that two or more spaces delimit filenames and directory names for the long
|
|
1012 and wide listing formats. Thus, if your filename or directory name has two
|
|
1013 or more spaces embedded in it, or any trailing spaces, then you'll need to
|
|
1014 use the "thin" format to select it.
|
519
|
1015
|
650
|
1016 The |g:netrw_browse_split| option, which is zero by default, may be used to
|
|
1017 cause the opening of files to be done in a new window. The splitting will
|
|
1018 be done horizontally if the option is one and vertically if the option is
|
|
1019 two.
|
|
1020
|
519
|
1021
|
|
1022 OBTAINING A FILE *netrw-O*
|
|
1023
|
|
1024 When browsing a remote directory, one may obtain a file under the cursor (ie.
|
|
1025 get a copy on your local machine, but not edit it) by pressing the O key.
|
|
1026 Only ftp and scp are supported for this operation (but since these two are
|
559
|
1027 available for browsing, that shouldn't be a problem). The status bar
|
|
1028 will then show, on its right hand side, a message like "Obtaining filename".
|
|
1029 The statusline will be restored after the transfer is complete.
|
|
1030
|
|
1031 Netrw can also "obtain" a file using the local browser. Netrw's display
|
|
1032 of a directory is not necessarily the same as Vim's "current directory",
|
|
1033 unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select
|
|
1034 a file using the local browser (by putting the cursor on it) and pressing
|
|
1035 "O" will then "obtain" the file; ie. copy it to Vim's current directory.
|
|
1036
|
|
1037 Related topics:
|
|
1038 * To see what the current directory is, use |:pwd|
|
|
1039 * To make the currently browsed directory the current directory, see |netrw-c|
|
|
1040 * To automatically make the currently browsed directory the current
|
|
1041 directory, see |g:netrw_keepdir|.
|
11
|
1042
|
459
|
1043
|
519
|
1044 THIN, LONG, AND WIDE LISTINGS *netrw-i*
|
|
1045
|
|
1046 The "i" map cycles between the thin, long, and wide listing formats.
|
12
|
1047
|
15
|
1048 The short listing format gives just the files' and directories' names.
|
519
|
1049
|
15
|
1050 The long listing is either based on the "ls" command via ssh for remote
|
559
|
1051 directories or displays the filename, file size (in bytes), and the time and
|
|
1052 date of last modification for local directories. With the long listing
|
|
1053 format, netrw is not able to recognize filenames which have trailing spaces.
|
|
1054 Use the thin listing format for such files.
|
519
|
1055
|
559
|
1056 The wide listing format has a multi-column display of the various files in the
|
|
1057 netrw current directory, rather like the Unix "ls" presents. In this mode the
|
|
1058 "b" and "B" maps are not available; instead, use Nb (|netrw-Nb|) and NB
|
|
1059 (|netrw-NB|). The wide listing format uses two or more contiguous spaces to
|
|
1060 delineate filenames; when using that format, netrw won't be able to recognize
|
|
1061 or use filenames which have two or more contiguous spaces embedded in the name
|
|
1062 or any trailing spaces. The thin listing format will, however, work with such
|
|
1063 files.
|
15
|
1064
|
|
1065
|
22
|
1066 MAKING A NEW DIRECTORY *netrw-d*
|
15
|
1067
|
559
|
1068 With the "d" map one may make a new directory either remotely (which depends
|
|
1069 on the global variable g:netrw_mkdir_cmd) or locally (which depends on the
|
|
1070 global variable g:netrw_local_mkdir). Netrw will issue a request for the new
|
|
1071 directory's name. A bare <CR> at that point will abort the making of the
|
15
|
1072 directory. Attempts to make a local directory that already exists (as either
|
|
1073 a file or a directory) will be detected, reported on, and ignored.
|
|
1074
|
459
|
1075
|
650
|
1076 DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del*
|
11
|
1077
|
|
1078 Deleting/removing files and directories involves moving the cursor to the
|
559
|
1079 file/directory to be deleted and pressing "D". Directories must be empty
|
|
1080 first before they can be successfully removed. If the directory is a softlink
|
|
1081 to a directory, then netrw will make two requests to remove the directory
|
|
1082 before succeeding. Netrw will ask for confirmation before doing the
|
|
1083 removal(s). You may select a range of lines with the "V" command (visual
|
|
1084 selection), and then pressing "D".
|
11
|
1085
|
12
|
1086 The g:netrw_rm_cmd, g:netrw_rmf_cmd, and g:netrw_rmdir_cmd variables are used
|
|
1087 to control the attempts to remove files and directories. The g:netrw_rm_cmd
|
|
1088 is used with files, and its default value is:
|
11
|
1089
|
|
1090 g:netrw_rm_cmd: ssh HOSTNAME rm
|
|
1091
|
12
|
1092 The g:netrw_rmdir_cmd variable is used to support the removal of directories.
|
|
1093 Its default value is:
|
11
|
1094
|
|
1095 g:netrw_rmdir_cmd: ssh HOSTNAME rmdir
|
|
1096
|
|
1097 If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
|
12
|
1098 to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
|
11
|
1099
|
|
1100 g:netrw_rmf_cmd: ssh HOSTNAME rm -f
|
|
1101
|
|
1102
|
15
|
1103 RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R*
|
11
|
1104
|
|
1105 Renaming/moving files and directories involves moving the cursor to the
|
|
1106 file/directory to be moved (renamed) and pressing "R". You will then be
|
|
1107 queried for where you want the file/directory to be moved. You may select a
|
|
1108 range of lines with the "V" command (visual selection), and then pressing "R".
|
|
1109
|
12
|
1110 The g:netrw_rename_cmd variable is used to implement renaming. By default its
|
11
|
1111 value is:
|
|
1112
|
|
1113 ssh HOSTNAME mv
|
|
1114
|
21
|
1115 One may rename a block of files and directories by selecting them with
|
|
1116 the V (|linewise-visual|).
|
12
|
1117
|
22
|
1118
|
534
|
1119 HIDING FILES OR DIRECTORIES *netrw-a*
|
12
|
1120
|
559
|
1121 Netrw's browsing facility allows one to use the hiding list in one of three
|
|
1122 ways: ignore it, hide files which match, and show only those files which
|
|
1123 match. The "a" map allows the user to cycle about these three ways.
|
459
|
1124
|
559
|
1125 The g:netrw_list_hide variable holds a comma delimited list of patterns (ex.
|
650
|
1126 \.obj) which specify the hiding list. (also see |netrw-ctrl-h|) To set the hiding
|
559
|
1127 list, use the <c-h> map. As an example, to hide files which begin with a ".",
|
|
1128 one may use the <c-h> map to set the hiding list to '^\..*' (or one may put
|
|
1129 let g:netrw_list_hide= '^\..*' in one's <.vimrc>). One may then use the "a"
|
|
1130 key to show all files, hide matching files, or to show only the matching
|
|
1131 files.
|
12
|
1132
|
|
1133
|
650
|
1134 EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide*
|
15
|
1135
|
22
|
1136 The "<ctrl-h>" map brings up a requestor allowing the user to change the
|
21
|
1137 file/directory hiding list. The hiding list consists of one or more patterns
|
|
1138 delimited by commas. Files and/or directories satisfying these patterns will
|
559
|
1139 either be hidden (ie. not shown) or be the only ones displayed (see
|
|
1140 |netrw-a|).
|
12
|
1141
|
|
1142
|
459
|
1143 BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz*
|
12
|
1144
|
21
|
1145 Normally one enters a file or directory using the <cr>. However, the "o" map
|
|
1146 allows one to open a new window to hold the new directory listing or file. A
|
24
|
1147 horizontal split is used. (for vertical splitting, see |netrw-v|)
|
|
1148
|
559
|
1149 Normally, the o key splits the window horizontally with the new window and
|
|
1150 cursor at the top. To change to splitting the window horizontally with the
|
|
1151 new window and cursor at the bottom, have
|
24
|
1152
|
|
1153 let g:netrw_alto = 1
|
|
1154
|
|
1155 in your <.vimrc>.
|
|
1156
|
459
|
1157
|
|
1158 PREVIEW WINDOW *netrw-p* *netrw-preview*
|
24
|
1159
|
559
|
1160 One may use a preview window (currently only for local browsing) by using the
|
|
1161 "p" key when the cursor is atop the desired filename to be previewed.
|
12
|
1162
|
|
1163
|
650
|
1164 PREVIOUS WINDOW *netrw-P* *netrw-prvwin*
|
|
1165
|
724
|
1166 To edit a file or directory in the previously used window (see :he |CTRL-W_P|),
|
650
|
1167 press a "P". If there's only one window, then the one window will be
|
724
|
1168 horizontally split (above/below splitting is controlled by |g:netrw_alto|,
|
650
|
1169 and its initial size is controlled by |g:netrw_winsize|).
|
|
1170
|
|
1171 If there's more than one window, the previous window will be re-used on
|
|
1172 the selected file/directory. If the previous window's associated buffer
|
|
1173 has been modified, and there's only one window with that buffer, then
|
|
1174 the user will be asked if s/he wishes to save the buffer first (yes,
|
|
1175 no, or cancel).
|
|
1176
|
|
1177
|
459
|
1178 SELECTING SORTING STYLE *netrw-s* *netrw-sort*
|
12
|
1179
|
559
|
1180 One may select the sorting style by name, time, or (file) size. The "s" map
|
|
1181 allows one to circulate amongst the three choices; the directory listing will
|
|
1182 automatically be refreshed to reflect the selected style.
|
12
|
1183
|
|
1184
|
459
|
1185 EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence*
|
22
|
1186
|
559
|
1187 When "Sorted by" is name, one may specify priority via the sorting sequence
|
|
1188 (g:netrw_sort_sequence). The sorting sequence typically prioritizes the
|
|
1189 name-listing by suffix, although any pattern will do. Patterns are delimited
|
|
1190 by commas. The default sorting sequence is:
|
22
|
1191 >
|
477
|
1192 [\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
|
22
|
1193 <
|
559
|
1194 The lone * is where all filenames not covered by one of the other patterns
|
|
1195 will end up. One may change the sorting sequence by modifying the
|
|
1196 g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by
|
|
1197 using the "S" map.
|
22
|
1198
|
|
1199
|
459
|
1200 REVERSING SORTING ORDER *netrw-r* *netrw-reverse*
|
12
|
1201
|
|
1202 One may toggle between normal and reverse sorting order by pressing the
|
|
1203 "r" key.
|
|
1204
|
|
1205
|
459
|
1206 CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir*
|
36
|
1207
|
|
1208 Every time you change to a new directory (new for the current session),
|
|
1209 netrw will save the directory in a recently-visited directory history
|
|
1210 list (unless g:netrw_dirhistmax is zero; by default, its ten). With the
|
|
1211 "u" map, one can change to an earlier directory (predecessor). To do
|
|
1212 the opposite, see |netrw-U|.
|
|
1213
|
|
1214
|
459
|
1215 CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir*
|
36
|
1216
|
|
1217 With the "U" map, one can change to a later directory (successor).
|
|
1218 This map is the opposite of the "u" map. (see |netrw-u|) Use the
|
|
1219 q map to list both the bookmarks and history. (see |netrw-q|)
|
|
1220
|
|
1221
|
12
|
1222 BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v*
|
|
1223
|
559
|
1224 Normally one enters a file or directory using the <cr>. However, the "v" map
|
|
1225 allows one to open a new window to hold the new directory listing or file. A
|
|
1226 vertical split is used. (for horizontal splitting, see |netrw-o|)
|
24
|
1227
|
559
|
1228 Normally, the v key splits the window vertically with the new window and
|
|
1229 cursor at the left. To change to splitting the window vertically with the new
|
|
1230 window and cursor at the right, have
|
24
|
1231
|
|
1232 let g:netrw_altv = 1
|
|
1233
|
|
1234 in your <.vimrc>.
|
12
|
1235
|
|
1236
|
650
|
1237 CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler* *gx*
|
|
1238
|
|
1239 Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
|
|
1240 best seen with a special handler (ie. a tool provided with your computer).
|
|
1241 Netrw allows one to invoke such special handlers by: >
|
12
|
1242
|
650
|
1243 * when Exploring, hit the "x" key
|
|
1244 * when editing, hit gx with the cursor atop the special filename
|
|
1245 <
|
|
1246 Netrw determines which special handler by the following method:
|
|
1247
|
|
1248 * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
|
|
1249 view files. Examples of useful settings (place into your <.vimrc>): >
|
|
1250
|
|
1251 :let g:netrw_browsex_viewer= "kfmclient exec"
|
|
1252 < or >
|
|
1253 :let g:netrw_browsex_viewer= "gnome-open"
|
|
1254 <
|
|
1255 If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
|
|
1256 invoked first (see |netrw_filehandler|).
|
12
|
1257
|
856
|
1258 * for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
|
650
|
1259 * for Gnome (with gnome-open): gnome-open is used.
|
482
|
1260 * for KDE (with kfmclient): kfmclient is used.
|
559
|
1261 * otherwise the netrwFileHandler plugin is used.
|
482
|
1262
|
|
1263 The file's suffix is used by these various approaches to determine an
|
559
|
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.
|
482
|
1267
|
650
|
1268 *netrw_filehandler*
|
559
|
1269 The netrwFileHandler applies a user-defined function to a file, based on its
|
12
|
1270 extension. Of course, the handler function must exist for it to be called!
|
|
1271 >
|
|
1272 Ex. mypgm.html x ->
|
856
|
1273 netrwFileHandler_html("scp://user@host/some/path/mypgm.html")
|
12
|
1274 <
|
559
|
1275 See the <plugin/netrwFileHandlers.vim> for an example of how to handle an html
|
12
|
1276 file with mozilla.
|
|
1277
|
650
|
1278 One may write custom netrwFileHandlers; please look at the >
|
|
1279
|
|
1280 plugin/netrwFileHandlers.vim
|
|
1281
|
|
1282 script for examples. If its likely to be generally useful, please feel free
|
|
1283 to forward a copy to me for future inclusion in the distribution.
|
482
|
1284
|
12
|
1285
|
26
|
1286 MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* *netrw-curdir*
|
22
|
1287
|
839
|
1288 By default, |g:netrw_keepdir| is 1. This setting means that the current
|
26
|
1289 directory will not track the browsing directory. However, setting
|
839
|
1290 g:netrw_keepdir to 0 (say, in your <.vimrc>) will tell netrw to make the
|
|
1291 currently browsed directory also be the current directory.
|
26
|
1292
|
839
|
1293 However, with the default setting for g:netrw_keepdir of 1 where netrw
|
|
1294 maintains its own separate notion of the current directory, in order to make
|
|
1295 the two directories the same, use the "c" map (just type c). That map will
|
|
1296 set Vim's notion of the current directory to the netrw's current browsing
|
|
1297 directory.
|
22
|
1298
|
|
1299
|
26
|
1300 BOOKMARKING A DIRECTORY *netrw-b* *netrw-bookmark* *netrw-bookmarks*
|
519
|
1301 *netrw-Nb*
|
464
|
1302 One may easily "bookmark" a directory by using >
|
22
|
1303
|
|
1304 {cnt}b
|
464
|
1305 <
|
26
|
1306 Any count may be used. One may use viminfo's "!" option to retain bookmarks
|
36
|
1307 between vim sessions. See |netrw-B| for how to return to a bookmark and
|
|
1308 |netrw-q| for how to list them.
|
22
|
1309
|
519
|
1310 When wide listing is in use (see |netrw-i|), then the b map is not available;
|
|
1311 instead, use {cnt}Nb.
|
22
|
1312
|
519
|
1313
|
|
1314 CHANGING TO A BOOKMARKED DIRECTORY *netrw-NB* *netrw-B*
|
22
|
1315
|
|
1316 To change directory back to a bookmarked directory, use
|
|
1317
|
|
1318 {cnt}B
|
|
1319
|
559
|
1320 Any count may be used to reference any of the bookmarks. See |netrw-b| on
|
|
1321 how to bookmark a directory and |netrw-q| on how to list bookmarks.
|
519
|
1322
|
|
1323 When wide listing is in use (see |netrw-i|), then the B map is not available;
|
|
1324 instead, use {cnt}NB.
|
22
|
1325
|
|
1326
|
459
|
1327 LISTING BOOKMARKS AND HISTORY *netrw-q* *netrw-listbookmark*
|
22
|
1328
|
36
|
1329 Pressing "q" will list the bookmarked directories and directory traversal
|
|
1330 history (query). (see |netrw-b|, |netrw-B|, |netrw-u|, and |netrw-U|)
|
22
|
1331
|
|
1332
|
519
|
1333 IMPROVING DIRECTORY BROWSING *netrw-listhack*
|
12
|
1334
|
|
1335 Especially with the remote directory browser, constantly entering the password
|
|
1336 is tedious.
|
|
1337
|
11
|
1338 For Linux/Unix systems, I suggest looking into
|
|
1339
|
|
1340 http://hacks.oreilly.com/pub/h/66
|
|
1341
|
|
1342 It gives a tip for setting up password-less use of ssh and scp, and discusses
|
|
1343 the associated security issues.
|
9
|
1344
|
794
|
1345 For Windows, the vim mailing list has mentioned that Pageant helps with
|
|
1346 avoiding the constant need to enter the password.
|
|
1347
|
9
|
1348
|
482
|
1349 NETRW SETTINGS *netrw-settings*
|
|
1350
|
|
1351 With the NetrwSettings.vim plugin, >
|
|
1352 :NetrwSettings
|
|
1353 will bring up a window with the many variables that netrw uses for its
|
559
|
1354 settings. You may change any of their values; when you save the file, the
|
|
1355 settings therein will be used. One may also press "?" on any of the lines for
|
|
1356 help on what each of the variables do.
|
482
|
1357
|
|
1358
|
9
|
1359 ==============================================================================
|
650
|
1360 9. Problems and Fixes *netrw-problems*
|
24
|
1361
|
|
1362 (This section is likely to grow as I get feedback)
|
|
1363 (also see |netrw-debug|)
|
477
|
1364 *netrw-p1*
|
24
|
1365 P1. I use windows 95, and my ftp dumps four blank lines at the
|
|
1366 end of every read.
|
|
1367
|
|
1368 See |netrw-fixup|, and put the following into your
|
|
1369 <.vimrc> file:
|
|
1370
|
|
1371 let g:netrw_win95ftp= 1
|
466
|
1372
|
477
|
1373 *netrw-p2*
|
24
|
1374 P2. I use windows, and my network browsing with ftp doesn't sort by
|
|
1375 time or size
|
|
1376
|
|
1377 Windows' ftp has a minimal support for ls (ie. it doesn't
|
|
1378 accept sorting options). It doesn't support the -F which
|
|
1379 gives an explanatory character (ABC/ for "ABC is a directory").
|
|
1380 Netrw uses dir to get its short and long listings. If you
|
|
1381 think your ftp does support a full-up ls, put the following
|
|
1382 into your <.vimrc>:
|
|
1383
|
|
1384 let g:netrw_ftp_list_cmd= "ls -lF"
|
|
1385
|
|
1386 Alternatively, if you have cygwin on your Windows box, put
|
|
1387 into your <.vimrc>:
|
|
1388
|
|
1389 let g:netrw_cygwin= 1
|
|
1390
|
477
|
1391 *netrw-p3*
|
24
|
1392 P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw
|
|
1393 used ssh! That wasn't what I asked for...
|
|
1394
|
|
1395 Netrw has two methods for browsing remote directories: ssh
|
|
1396 and ftp. Unless you specify ftp specifically, ssh is used.
|
|
1397 When it comes time to do download a file (not just a directory
|
|
1398 listing), netrw will use the given protocol to do so.
|
|
1399
|
477
|
1400 *netrw-p4*
|
24
|
1401 P4. I would like long listings to be the default.
|
|
1402
|
26
|
1403 let g:netrw_longlist=1
|
|
1404
|
|
1405 Check out |netrw-browse-var| for more customizations that
|
|
1406 you can set.
|
24
|
1407
|
477
|
1408 *netrw-p5*
|
24
|
1409 P5. My times come up oddly in local browsing
|
|
1410
|
|
1411 Does your system's strftime() accept the "%c" to yield dates
|
|
1412 such as "Sun Apr 27 11:49:23 1997"? If not, do a "man strftime"
|
|
1413 and find out what option should be used. Then put it into
|
|
1414 your <.vimrc>:
|
|
1415 let g:netrw_timefmt= "%X" (where X is the option)
|
|
1416
|
477
|
1417 *netrw-p6*
|
26
|
1418 P6. I want my current directory to track my browsing.
|
|
1419 How do I do that?
|
24
|
1420
|
794
|
1421 let g:netrw_keepdir= 0
|
466
|
1422
|
24
|
1423
|
|
1424 ==============================================================================
|
650
|
1425 10. Debugging *netrw-debug*
|
7
|
1426
|
|
1427 The <netrw.vim> script is typically available as:
|
477
|
1428 >
|
7
|
1429 /usr/local/share/vim/vim6x/plugin/netrw.vim
|
477
|
1430 < -or- >
|
|
1431 /usr/local/share/vim/vim7x/plugin/netrw.vim
|
|
1432 <
|
7
|
1433 which is loaded automatically at startup (assuming :set nocp).
|
|
1434
|
|
1435 1. Get the <Decho.vim> script, available as:
|
|
1436
|
534
|
1437 http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_scripts
|
|
1438 as "Decho, a vimL debugging aid"
|
7
|
1439 or
|
534
|
1440 http://vim.sourceforge.net/scripts/script.php?script_id=120
|
7
|
1441
|
22
|
1442 and put it into your local plugin directory.
|
466
|
1443
|
22
|
1444 2. <Decho.vim> itself needs the <cecutil.vim> script, so you'll need
|
|
1445 to put it into your .vim/plugin, too. You may obtain it from:
|
7
|
1446
|
22
|
1447 http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs
|
|
1448 as "DrC's Utilities"
|
7
|
1449
|
22
|
1450 3. Edit the <netrw.vim> file by typing:
|
|
1451
|
|
1452 vim netrw.vim
|
7
|
1453 :DechoOn
|
22
|
1454 :wq
|
7
|
1455
|
22
|
1456 To restore to normal non-debugging behavior, edit <netrw.vim>
|
|
1457 by typing
|
7
|
1458
|
22
|
1459 vim netrw.vim
|
|
1460 :DechoOff
|
|
1461 :wq
|
|
1462
|
|
1463 This command, provided by <Decho.vim>, will comment out all
|
|
1464 Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()).
|
|
1465
|
|
1466 4. Then bring up vim and attempt a transfer. A set of messages
|
7
|
1467 should appear concerning the steps that <netrw.vim> took in
|
|
1468 attempting to read/write your file over the network. Please
|
|
1469 send that information to <netrw.vim>'s maintainer,
|
|
1470
|
36
|
1471 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
|
7
|
1472
|
|
1473 ==============================================================================
|
650
|
1474 11. History *netrw-history* {{{1
|
7
|
1475
|
857
|
1476 v98: May 02, 2006 * the "p" key didn't work properly when the browsing
|
|
1477 directory name had spaces in it.
|
|
1478 v97: May 01, 2006 * exists("&acd") now used to determine if
|
|
1479 the 'acd' option exists
|
|
1480 * "obtain" now works again under Windows
|
|
1481 v96: * bugfix - the |'acd'| option is not always defined but is
|
|
1482 now bypassed only when it is
|
849
|
1483 v95: * bugfix - Hiding mode worked correctly (don't show any file
|
|
1484 matching any of the g:netrw_hide patterns), but
|
|
1485 but showing mode was showing only those files that didn't
|
|
1486 match any of the g:netrw_hide patterns. Instead, it now
|
|
1487 shows all files that match any of the g:netrw_hide patterns
|
|
1488 (the difference between a logical and and logical or).
|
844
|
1489 v94: * bugfix - a Decho() had a missing quote; only affects things
|
|
1490 when debugging was enabled.
|
|
1491 v93: * bugfix - removed FocusGained event from causing a slow-browser
|
|
1492 refresh for Windows
|
|
1493 v92: * :Explore **//pattern implemented (**/filepattern already taken)
|
839
|
1494 v91: * :Explore */pattern implemented
|
|
1495 * |'acd'| option bypassed
|
|
1496 v90: * mark ', as suggested by Yegappan Lakshmanan, used to help
|
|
1497 guarantee entry into the jump list when appropriate.
|
|
1498 * <s-down> and <s-up> are no longer defined until a
|
|
1499 :Explore **/pattern is used (if the user already has a map
|
|
1500 for them). They will be defined for new browser windows
|
|
1501 from that point forward.
|
|
1502 v89: * A <s-down>, <s-up>, :Nexplore, or a :Pexplore without having
|
|
1503 first done an :Explore **/pattern (see |netrw-starstar|) caused
|
|
1504 a lot of unhelpful error messages to appear
|
829
|
1505 v88: * moved DrChip.Netrw menu to Netrw. Now has priority 80 by
|
|
1506 default. g:NetrwTopLvlMenu == "Netrw" and can be changed
|
|
1507 by the user to suit. The priority is g:NetrwMenuPriority.
|
|
1508 * Changed filetype for browser displays from netrwlist to netrw.
|
828
|
1509 v87: * bug fix -- menus were partially disappearing
|
820
|
1510 v85: * bug fix -- missing an endif
|
|
1511 * bug fix -- handles spaces in names and directories when using
|
|
1512 ftp-based browsing
|
799
|
1513 v83: * disabled stop-acd handling; the change in directory handling
|
|
1514 may allow acd to be used again. Awaiting feedback.
|
|
1515 * D was refusing to delete remote files/directories in wide
|
|
1516 listing mode.
|
766
|
1517 v81: * FocusGained also used to refresh/wipe local browser directory
|
|
1518 buffers
|
|
1519 * (bugfix) netrw was leaving [Scratch] buffers behind when the
|
|
1520 the user had the "hidden" option set. The 'hidden' option is
|
|
1521 now bypassed.
|
|
1522 v80: * ShellCmdPost event used in conjunction with g:netrw_fastbrowse
|
|
1523 to refresh/wipe local browser directory buffers.
|
719
|
1524 v79: * directories are now displayed with nowrap
|
|
1525 * (bugfix) if the column width was smaller than the largest
|
|
1526 file's name, then netrw would hang when using wide-listing
|
|
1527 mode - fixed
|
|
1528 * g:netrw_fastbrowse introduced
|
650
|
1529 v78: * progress has been made on allowing spaces inside directory
|
|
1530 names for remote work (reading, writing, browsing). (scp)
|
|
1531 v77: * Mikolaj Machowski fixed a bug in a substitute command
|
|
1532 * g:netrw_browsex_viewer implemented
|
|
1533 * Mikolaj Machowski pointed out that gnome-open is often
|
|
1534 executable under KDE systems, although it is effectively
|
856
|
1535 not functional. NetBrowseX now looks for "kicker" as
|
650
|
1536 a running process to determine if KDE is actually the
|
|
1537 really running.
|
|
1538 * Explorer's O functionality was inadvertently left out.
|
|
1539 Netrw now does the same thing, but with the "P" key.
|
|
1540 * added g:netrw_browse_split option
|
|
1541 * fixed a bug where the directory contained a "." but
|
|
1542 the file didn't (was treating the dirname from "."
|
|
1543 onwards as a suffix)
|
568
|
1544 v76: * "directory is missing" error message now restores echo
|
|
1545 highlighting
|
559
|
1546 v75: * file://... now conforms to RFC2396 (thanks to S. Zacchiroli)
|
|
1547 * if the binary option is set, then NetWrite() will only write
|
|
1548 the whole file (line numbers don't make sense with this).
|
|
1549 Supports writing of tar and zip files.
|
|
1550 v74: * bugfix (vim, then :Explore) now works
|
|
1551 * ctrl-L keeps cursor at same screen location (both local and
|
|
1552 remote browsing)
|
|
1553 * netrw now can read remote zip and tar files
|
|
1554 * Obtain now uses WinXP ftp+.netrc successfully
|
|
1555 v73: * bugfix -- scp://host/path/file was getting named incorrectly
|
|
1556 * netrw detects use of earlier-than-7.0 version of vim and issues
|
|
1557 a pertinent error message.
|
|
1558 * netrwSettings.vim is now uses autoloading. Only
|
|
1559 <netrwPlugin.vim> is needed as a pure plugin
|
|
1560 (ie. always loaded).
|
|
1561 v72: * bugfix -- formerly, one could prevent the loading of netrw
|
|
1562 by "let g:loaded_netrw=1"; when autoloading became supported,
|
|
1563 this feature was lost. It is now restored.
|
|
1564 v71: * bugfix -- made some "set nomodifiable"s into setlocal variants
|
|
1565 (allows :e somenewfile to be modifiable as usual)
|
|
1566 * NetrwSettings calls a netrw function, thereby assuring that
|
|
1567 netrw has loaded. However, if netrw does not load for whatever
|
|
1568 reason, then NetrwSettings will now issue a warning message.
|
|
1569 * For what reason I don't recall, when wget and fetch are both
|
|
1570 not present, and an attempt to read a http://... url is made,
|
|
1571 netrw exited. It now only returns.
|
|
1572 * When ch=1, on the second and subsequent uses of browsing Netrw
|
|
1573 would issue a blank line to clear the echo'd messages. This
|
|
1574 caused an annoying "Hit-Enter" prompt; now a blank line message
|
|
1575 is echo'd only if &ch>1.
|
|
1576 v70: * when using |netrw-O|, the "Obtaining filename" message is now
|
|
1577 shown using |hl-User9|. If User9 has not been defined, netrw
|
|
1578 will define it.
|
|
1579 v69: * Bugfix: win95/98 machines were experiencing a
|
|
1580 "E121: Undefined variable: g:netrw_win95ftp" message
|
|
1581 v68: * double-click-leftmouse selects word under mouse
|
534
|
1582 v67: * Passwords which contain blanks will now be surrounded by
|
|
1583 double-quotes automatically (Yongwei)
|
519
|
1584 v66: * Netrw now seems to work with a few more Windows situations
|
|
1585 * O now obtains a file: remote browsing file -> local copy,
|
|
1586 locally browsing file -> current directory (see :pwd)
|
|
1587 * i now cycles between thin, long, and wide listing styles
|
|
1588 * NB and Nb are maps that are always available; corresponding
|
|
1589 B and b maps are only available when not using wide listing
|
|
1590 in order to allow them to be used for motions
|
|
1591 v65: * Browser functions now use NetOptionSave/Restore; in particular,
|
484
|
1592 netrw now works around the report setting
|
856
|
1593 v64: * Bugfix - browsing a "/" directory (Unix) yielded buffers
|
484
|
1594 named "[Scratch]" instead of "/"
|
|
1595 * Bugfix - remote browsing with ftp was omitting the ./ and ../
|
482
|
1596 v63: * netrw now takes advantage of autoload (and requires 7.0)
|
|
1597 * Bugfix - using r (to reverse sort) working again
|
|
1598 v62: * Bugfix - spaces allowed again in directory names with
|
|
1599 g:netrw_keepdir=0. In fact, I've tested netrw (again)
|
|
1600 with most ANSI punctuation marks for directory names.
|
|
1601 * Bugfix - NetrwSettings gave errors when g:netrw_silent
|
|
1602 had not be set.
|
480
|
1603 v61: * document upgrade -- netrw variable-based settings all should
|
|
1604 have tags. Supports NetrwSettings command.
|
|
1605 * several important variables are window-oriented. Netrw has
|
|
1606 to transfer these across a window split. See s:BufWinVars()
|
|
1607 and s:UseBufWinVars().
|
477
|
1608 v60: * when using the i map to switch between long and short listings,
|
|
1609 netrw will now keep cursor on same line
|
|
1610 * "Match # of #" now uses status line
|
|
1611 * :Explore **/*.c will now work from a non-netrw-browser window
|
|
1612 * :Explore **/patterns can now be run in separate browser windows
|
|
1613 * active banner (hit <cr> will cause various things to happen)
|
466
|
1614 v59: * bugfix -- another keepalt work-around installed (for vim6.3)
|
|
1615 * "Match # of #" for Explore **/pattern matches
|
464
|
1616 v58: * Explore and relatives can now handle **/somefilepattern (v7)
|
|
1617 * Nexplore and Pexplore introduced (v7). shift-down and shift-up
|
|
1618 cursor keys will invoke Nexplore and Pexplore, respectively.
|
|
1619 * bug fixed with o and v
|
|
1620 * autochdir only worked around for vim when it has been
|
|
1621 compiled with either |+netbeans_intg| or |+sun_workshop|
|
|
1622 * Under Windows, all directories and files were being preceded
|
|
1623 with a "/" when local browsing. Fixed.
|
|
1624 * When: syntax highlighting is off, laststatus=2, and remote
|
|
1625 browsing is used, sometimes the laststatus highlighting
|
|
1626 bleeds into the entire display. Work around - do an extra
|
|
1627 redraw in that case.
|
|
1628 * Bugfix: when g:netrw_keepdir=0, due to re-use of buffers,
|
|
1629 netrw didn't change the directory when it should've
|
|
1630 * Bugfix: D and R commands work again
|
461
|
1631 v57: * Explore and relatives can now handle RO files
|
|
1632 * reverse sort restored with vim7's sort command
|
|
1633 * g:netrw_keepdir now being used to keep the current directory
|
|
1634 unchanged as intended (sense change)
|
|
1635 * vim 6.3 still supported
|
459
|
1636 v56: * LocalBrowse now saves autochdir setting, unsets it, and
|
|
1637 restores it before returning.
|
|
1638 * using vim's rename() instead of system + local_rename variable
|
461
|
1639 * avoids changing directory when g:netrw_keepdir is false
|
459
|
1640 v55: * -bar used with :Explore :Sexplore etc to allow multiple
|
|
1641 commands to be separated by |s
|
|
1642 * browser listings now use the "nowrap" option
|
|
1643 * browser: some unuseful error messages now suppressed
|
|
1644 v54: * For backwards compatibility, Explore and Sexplore have been
|
|
1645 implemented. In addition, Hexplore and Vexplore commands
|
|
1646 are available, too.
|
|
1647 * <amatch> used instead of <afile> in the transparency
|
|
1648 support (BufReadCmd, FileReadCmd, FileWriteCmd)
|
|
1649 * ***netrw*** prepended to various error messages netrw may emit
|
|
1650 * g:netrw_port used instead of b:netrw_port for scp
|
|
1651 * any leading [:#] is removed from port numbers
|
|
1652 v53: * backslashes as well as slashes placed in various patterns
|
|
1653 (ex. g:netrw_sort_sequence) to better support Windows
|
36
|
1654 v52: * nonumber'ing now set for browsing buffers
|
|
1655 * when the hiding list hid all files, error messages ensued. Fixed
|
|
1656 * when browsing, swf is set, but directory is not set, when netrw
|
|
1657 was attempting to restore options, vim wanted to save a swapfile
|
|
1658 to a local directory using an url-style path. Fixed
|
|
1659 v51: * cygwin detection now automated (using windows and &shell is bash)
|
|
1660 * customizable browser "file" rejection patterns
|
|
1661 * directory history
|
|
1662 * :[range]w url now supported (ie. netrw has a FileWriteCmd event)
|
|
1663 * error messages have a "Press <cr> to continue" to allow them
|
|
1664 to be seen
|
|
1665 * directory browser displays no longer bother the swapfile
|
|
1666 * u/U commands to go up and down the history stack
|
|
1667 * history stack may be saved with viminfo with its "!" option
|
|
1668 * bugfixes associated with unwanted [No Files] entries
|
26
|
1669 v50: * directories now displayed using buftype=nofile; should keep the
|
|
1670 directory names as-is
|
|
1671 * attempts to remove empty "[No File]" buffers leftover
|
|
1672 from :file ..name.. commands
|
|
1673 * bugfix: a "caps-lock" editing difficulty left in v49 was fixed
|
|
1674 * syntax highlighting for "Showing:" the hiding list included
|
|
1675 * bookmarks can now be retained if "!" is in the viminfo option
|
36
|
1676 v49: * will use ftp for http://.../ browsing v48:
|
|
1677 * One may use ftp to do remote host file browsing
|
24
|
1678 * (windows and !cygwin) remote browsing with ftp can now use
|
|
1679 the "dir" command internally to provide listings
|
|
1680 * g:netrw_keepdir now allows one to keep the initial current
|
26
|
1681 directory as the current directory (normally the local file
|
|
1682 browser makes the currently viewed directory the current
|
|
1683 directory)
|
24
|
1684 * g:netrw_alto and g:netrw_altv now support alternate placement
|
|
1685 of windows started with o or v
|
|
1686 * Nread ? and Nwrite ? now uses echomsg (instead of echo) so
|
|
1687 :messages can repeat showing the help
|
|
1688 * bugfix: avoids problems with partial matches of directory names
|
|
1689 to prior buffers with longer names
|
26
|
1690 * one can suppress error messages with g:netrw_quiet ctrl-h used
|
|
1691 * instead of <Leader>h for editing hiding list one may edit the
|
|
1692 * sorting sequence with the S map now allows confirmation of
|
|
1693 * deletion with [y(es) n(o) a(ll) q(uit)] the "x" map now handles
|
|
1694 * special file viewing with:
|
|
1695 (windows) rundll32 url.dll (gnome) gnome-open (kde)
|
|
1696 kfmclient If none of these are on the executable path, then
|
559
|
1697 netrwFileHandlers.vim is used.
|
24
|
1698 * directory bookmarking during both local and remote browsing
|
|
1699 implemented
|
|
1700 * one may view all, use the hiding list to suppress, or use the
|
26
|
1701 hiding list to show-only remote and local file/directory
|
|
1702 listings
|
|
1703 * improved unusual file and directory name handling preview
|
|
1704 * window support
|
36
|
1705 v47: * now handles local directory browsing.
|
|
1706 v46: * now handles remote directory browsing
|
|
1707 * g:netrw_silent (if 1) will cause all transfers to be silent
|
26
|
1708 v45: * made the [user@]hostname:path form a bit more restrictive to
|
|
1709 better handle errors in using protocols (e.g. scp:usr@host:file
|
|
1710 was being recognized as an rcp request) v44: * changed from
|
|
1711 "rsync -a" to just "rsync"
|
9
|
1712 * somehow an editing error messed up the test to recognize
|
|
1713 use of the fetch method for NetRead.
|
|
1714 * more debugging statements included
|
26
|
1715 v43: * moved "Explanation" comments to <pi_netrw.txt> help file as
|
|
1716 "Network Reference" (|netrw-ref|)
|
9
|
1717 * <netrw.vim> now uses Dfunc() Decho() and Dret() for debugging
|
|
1718 * removed superfluous NetRestorePosn() calls
|
26
|
1719 v42: * now does BufReadPre and BufReadPost events on file:///* and
|
|
1720 file://localhost/* v41: * installed file:///* and
|
|
1721 file://localhost/* handling v40: * prevents redraw when a
|
|
1722 protocol error occurs so that the user may see it v39: * sftp
|
|
1723 support v38: * Now uses NetRestorePosn() calls with
|
|
1724 Nread/Nwrite commands
|
9
|
1725 * Temporary files now removed via bwipe! instead of bwipe
|
26
|
1726 (thanks to Dave Roberts) v37: * Claar's modifications which
|
|
1727 test if ftp is successful, otherwise give an error message
|
9
|
1728 * After a read, the alternate file was pointing to the temp file.
|
|
1729 The temp file buffer is now wiped out.
|
|
1730 * removed silent from transfer methods so user can see what's
|
|
1731 happening
|
7
|
1732
|
|
1733
|
|
1734 ==============================================================================
|
650
|
1735 11. Credits *netrw-credits* {{{1
|
7
|
1736
|
|
1737 Vim editor by Bram Moolenaar (Thanks, Bram!)
|
|
1738 dav support by C Campbell
|
|
1739 fetch support by Bram Moolenaar and C Campbell
|
534
|
1740 ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM>
|
7
|
1741 http support by Bram Moolenaar <bram@moolenaar.net>
|
|
1742 rcp
|
|
1743 rsync support by C Campbell (suggested by Erik Warendorph)
|
|
1744 scp support by raf <raf@comdyn.com.au>
|
|
1745 sftp support by C Campbell
|
|
1746
|
|
1747 inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell
|
|
1748
|
|
1749 Jérôme Augé -- also using new buffer method with ftp+.netrc
|
534
|
1750 Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use,
|
856
|
1751 fetch,...
|
7
|
1752 Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution
|
|
1753 Erik Warendorph -- for several suggestions (g:netrw_..._cmd
|
|
1754 variables, rsync etc)
|
534
|
1755 Doug Claar -- modifications to test for success with ftp
|
856
|
1756 operation
|
7
|
1757
|
|
1758 ==============================================================================
|
459
|
1759 vim:tw=78:ts=8:ft=help:norl:fdm=marker
|