blob: 8cb8010fd0d9acb1e324e0c5e31a0df72835bdee [file] [log] [blame]
Bram Moolenaarb21e5842006-04-16 18:30:08 +00001*pi_netrw.txt* For Vim version 7.0e. Last change: Apr 12, 2006
Bram Moolenaar071d4272004-06-13 20:20:40 +00002
3 VIM REFERENCE MANUAL by Charles E. Campbell, Jr.
4
Bram Moolenaar1afcace2005-11-25 19:54:28 +00005
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00006*dav* *http* *network* *rcp* *scp*
7*fetch* *netrw* *Nread* *rsync* *sftp*
8*ftp* *netrw.vim* *Nwrite* *netrw-file*
Bram Moolenaar071d4272004-06-13 20:20:40 +00009
10==============================================================================
110. Contents *netrw-contents*
12
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000131. Starting With Netrw..................................|netrw-start|
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000142. Netrw Reference......................................|netrw-ref|
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +000015 CONTROLLING EXTERNAL APPLICATIONS..................|netrw-externapp|
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000016 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|
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000223. Network-Oriented File Transfer.......................|netrw-xfer|
Bram Moolenaar83bab712005-08-01 21:58:57 +000023 NETRC..............................................|netrw-netrc|
24 PASSWORD...........................................|netrw-passwd|
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000254. Activation...........................................|netrw-activate|
265. Transparent File Transfer............................|netrw-transparent|
276. Ex Commands..........................................|netrw-ex|
287. Variables and Options................................|netrw-var|
298. Directory Browsing...................................|netrw-browse| {{{1
Bram Moolenaar83bab712005-08-01 21:58:57 +000030 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|
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +000035 Netrw Browsing And Option Incompatibilities........|netrw-incompatible|
Bram Moolenaar83bab712005-08-01 21:58:57 +000036 Directory Exploring Commands.......................|netrw-explore|
37 Refreshing The Listing.............................|netrw-ctrl-l|
38 Going Up...........................................|netrw--|
39 Browsing...........................................|netrw-cr|
Bram Moolenaar578b49e2005-09-10 19:22:57 +000040 Obtaining A File...................................|netrw-O|
41 Thin, Long, and Wide Listings......................|netrw-i|
Bram Moolenaar83bab712005-08-01 21:58:57 +000042 Making A New Directory.............................|netrw-d|
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +000043 Deleting Files Or Directories......................|netrw-D|
Bram Moolenaar83bab712005-08-01 21:58:57 +000044 Renaming Files Or Directories......................|netrw-move|
Bram Moolenaar482aaeb2005-09-29 18:26:07 +000045 Hiding Files Or Directories........................|netrw-a|
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +000046 Edit File Or Directory Hiding List.................|netrw-ctrl-h|
Bram Moolenaar83bab712005-08-01 21:58:57 +000047 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|
Bram Moolenaar578b49e2005-09-10 19:22:57 +000057 Bookmarking A Directory............................|netrw-b| |netrw-Nb|
58 Changing To A Bookmarked Directory.................|netrw-B| |netrw-NB|
Bram Moolenaar83bab712005-08-01 21:58:57 +000059 Listing Bookmarks And History......................|netrw-q|
Bram Moolenaar578b49e2005-09-10 19:22:57 +000060 Improving Directory Browsing.......................|netrw-listhack| }}}1
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000619. Problems and Fixes...................................|netrw-problems|
6210. Debugging............................................|netrw-debug|
6311. History..............................................|netrw-history|
6412. Credits..............................................|netrw-credits|
Bram Moolenaar071d4272004-06-13 20:20:40 +000065
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000066The Netrw plugin is generally sourced automatically as it is a
67|standard-plugin|. That said, to make use of netrw, one must
68have plugins available which can be done with the following
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +000069two lines in your <.vimrc>: >
Bram Moolenaar071d4272004-06-13 20:20:40 +000070
Bram Moolenaar69a7cb42004-06-20 12:51:53 +000071 set nocp " 'compatible' is not set
72 filetype plugin on " plugins are enabled
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +000073<
Bram Moolenaar071d4272004-06-13 20:20:40 +000074You can avoid loading this plugin by setting the "loaded_netrw" variable
75in your <.vimrc> file: >
76
77 :let loaded_netrw = 1
78
79{Vi does not have any of this}
80
81==============================================================================
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000821. Starting With Netrw *netrw-start*
83
84Netrw makes reading, writing, and browsing over a network connection easy!
85First, make sure that you have plugins enabled, so you'll need to have at
86least the following in your <.vimrc>: (or see |netrw-activate|) >
87
88 set nocp " 'compatible' is not set
89 filetype plugin on " plugins are enabled
90<
91(see |'cp'| and |:filetype-plugin-on|)
92
93Netrw 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
95account on some other machine; try >
96
97 vim scp://hostname/path/to/file
98<
99if you have an ssh connection. Want to make ssh/scp easier to use? Check
100out |netrw-listhack|!
101
102What if you have ftp, not ssh/scp? That's easy, too; try >
103
104 vim ftp://hostname/path/to/file
105<
106Want 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
108permissions for only the user to read (ie. not group, world, other, etc),
109and has lines resembling >
110
111 machine HOSTNAME login USERID password "PASSWORD"
112 machine HOSTNAME login USERID password "PASSWORD"
113 ...
114 default login USERID password "PASSWORD"
115<
116How about browsing -- ie. you just want to look around before editing a
117file. For browsing on your current host, just "edit" a directory: >
118
119 vim .
120 vim /home/userid/path
121<
122For browsing on a remote host, "edit" a directory (but make sure that
123the directory name is followed by a "/"): >
124
125 vim scp://hostname/
126 vim ftp://hostname/path/to/dir/
127<
128See |netrw-browse| for more!
129
130There's more protocols supported than scp and ftp, too: see the next
131section, |netrw-externapp|.
132
133==============================================================================
1342. Netrw Reference *netrw-ref*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000135
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000136CONTROLLING EXTERNAL APPLICATIONS *netrw-externapp*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000137
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000138 Protocol Variable Default Value
139 -------- ---------------- -------------
140 dav: *g:netrw_dav_cmd* = "cadaver"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000141 fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000142 ftp: *g:netrw_ftp_cmd* = "ftp"
143 http: *g:netrw_http_cmd* = "fetch -o" if fetch is available
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"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000149
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000150READING *netrw-read* *netrw-nread*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000151 :Nread ? give help
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000152 :Nread "machine:path" uses rcp
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000153 :Nread "machine path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000154 :Nread "machine id password path" uses ftp
155 :Nread "dav://machine[:port]/path" uses cadaver
156 :Nread "fetch://[user@]machine/path" uses fetch
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000157 :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000158 :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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000163
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000164WRITING *netrw-write* *netrw-nwrite*
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000165 :Nwrite ? give help
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000166 :Nwrite "machine:path" uses rcp
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000167 :Nwrite "machine path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000168 :Nwrite "machine id password path" uses ftp
169 :Nwrite "dav://machine[:port]/path" uses cadaver
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000170 :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000171 :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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000175 http: not supported!
176
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000177DIRECTORY LISTING *netrw-dirlist*
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000178 :Nread [protocol]://[user]@hostname/path/
179
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000180 CHANGING USERID AND PASSWORD *netrw-chgup*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000181 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
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000191VARIABLES *netrw-variables*
192 *b:netrw_lastfile* last file Network-read/written retained on a per-buffer
193 basis (supports plain :Nw )
Bram Moolenaar071d4272004-06-13 20:20:40 +0000194
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000195 *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
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000199
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000200 *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.
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000206
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000207 *g:netrw_ftpmode* ="binary" (default)
208 ="ascii"
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000209
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000210 *g:netrw_ignorenetrc* =0 (default)
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000211 =1 If you have a <.netrc> file but it doesn't work and
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000212 you want it ignored, then set this variable as shown.
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000213
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000214 *g:netrw_uid* (ftp) user-id, retained on a per-session basis
215 *g:netrw_passwd* (ftp) password, retained on a per-session basis
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000216
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000217 *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)
220
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
229 =1 use WinNT's rcp in binary mode (default)
230
231PATHS *netrw-path*
232
233Paths to files are generally user-directory relative for most protocols.
234It is possible that some protocol will make paths relative to some
235associated directory, however.
236>
237 example: vim scp://user@host/somefile
238 example: vim scp://user@host/subdir1/subdir2/somefile
239<
240where "somefile" is the "user"'s home directory. If you wish to get a
241file 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<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000246
247==============================================================================
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00002483. Network-Oriented File Transfer *netrw-xfer*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000249
250Network-oriented file transfer under Vim is implemented by a VimL-based script
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000251(<netrw.vim>) using plugin techniques. It currently supports both reading and
252writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch,
Bram Moolenaar071d4272004-06-13 20:20:40 +0000253dav/cadaver, rsync, or sftp.
254
255http 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
258various file transfer programs. It uses autocommand events (BufReadCmd,
259FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. >
260
261 ex. vim ftp://hostname/path/to/file
262<
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000263The characters preceding the colon specify the protocol to use; in the
264example, its ftp. The <netrw.vim> script then formulates a command or a
265series 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
267from/written to a temporary file (under Unix/Linux, /tmp/...) which the
268<netrw.vim> script will clean up.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000269
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000270 *netrw-putty* *netrw-pscp*
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000271One may modify any protocol's implementing external application by setting a
272variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000273"scp -q"). As an example, consider using PuTTY: >
274 let g:netrw_scp_cmd= '"c:\Program Files\PuTTY\pscp.exe" -q -batch'
275<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000276Ftp, an old protocol, seems to be blessed by numerous implementations.
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000277Unfortunately, some implementations are noisy (ie., add junk to the end of the
278file). Thus, concerned users may decide to write a NetReadFixup() function
279that will clean up after reading with their ftp. Some Unix systems (ie.,
280FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is
281not noisy and more convenient, actually, for <netrw.vim> to use.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000282Consequently, if "fetch" is executable, it will be used to do reads for
283ftp://... (and http://...) . See |netrw-var| for more about this.
284
285For rcp, scp, sftp, and http, one may use network-oriented file transfers
Bram Moolenaar83bab712005-08-01 21:58:57 +0000286transparently; ie.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000287>
288 vim rcp://[user@]machine/path
289 vim scp://[user@]machine/path
290<
291If your ftp supports <.netrc>, then it too can be just as transparently used
292if the needed triad of machine name, user id, and password are present in
293that file. Your ftp must be able to use the <.netrc> file on its own, however.
294>
295 vim ftp://[user@]machine[[:#]portnumber]/path
296<
297However, ftp will often need to query the user for the userid and password.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000298The latter will be done "silently"; ie. asterisks will show up instead of
Bram Moolenaar071d4272004-06-13 20:20:40 +0000299the actually-typed-in password. Netrw will retain the userid and password
300for subsequent read/writes from the most recent transfer so subsequent
301transfers (read/write) to or from that machine will take place without
302additional prompting.
303
304 *netrw-urls*
305 +=================================+============================+============+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000306 | Reading | Writing | Uses |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000307 +=================================+============================+============+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000308 | DAV: | | |
309 | dav://host/path | | cadaver |
310 | :Nread dav://host/path | :Nwrite dav://host/path | cadaver |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000311 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000312 | FETCH: | | |
313 | fetch://[user@]host/path | | |
314 | fetch://[user@]host:http/path | Not Available | fetch |
315 | :Nread fetch://[user@]host/path| | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000316 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000317 | FILE: | | |
318 | file:///* | file:///* | |
319 | file://localhost/* | file://localhost/* | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000320 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000321 | 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 |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000326 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000327 | HTTP: wget is executable: (*4) | | |
328 | http://[user@]host/path | Not Available | wget |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000329 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000330 | HTTP: fetch is executable (*4) | | |
331 | http://[user@]host/path | Not Available | fetch |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000332 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000333 | RCP: | | |
334 | rcp://[user@]host/path | rcp://[user@]host/path | rcp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000335 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000336 | 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 |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000340 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000341 | SCP: | | |
342 | scp://[user@]host/path | scp://[user@]host/path | scp |
343 | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000344 +---------------------------------+----------------------------+------------+
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000345 | SFTP: | | |
346 | sftp://[user@]host/path | sftp://[user@]host/path | sftp |
347 | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000348 +=================================+============================+============+
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
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000354 prompt for user-id and pasword.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000355
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000356 (*3) for ftp, "machine" may be machine#port or machine:port
Bram Moolenaar071d4272004-06-13 20:20:40 +0000357 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
362Both the :Nread and the :Nwrite ex-commands can accept multiple filenames.
363
364
365NETRC *netrw-netrc*
366
367The typical syntax for lines in a <.netrc> file is given as shown below.
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000368Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000369>
370 machine {full machine name} login {user-id} password "{password}"
371 default login {user-id} password "{password}"
372
373Your 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
375password.
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
384PASSWORD *netrw-passwd*
385
386The script attempts to get passwords for ftp invisibly using |inputsecret()|,
387a built-in Vim function. See |netrw-uidpass| for how to change the password
388after one has set it.
389
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000390Unfortunately there doesn't appear to be a way for netrw to feed a password to
391scp. Thus every transfer via scp will require re-entry of the password.
392However, |netrw-listhack| can help with this problem.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000393
394
395==============================================================================
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00003964. Activation *netrw-activate*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000397
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000398Network-oriented file transfers are available by default whenever Vim's
Bram Moolenaar071d4272004-06-13 20:20:40 +0000399|'nocompatible'| mode is enabled. The <netrw.vim> file resides in your
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000400system's vim-plugin directory and is sourced automatically whenever you bring
401up vim. I suggest that, at a minimum, you have at least the following in your
402<.vimrc> customization file: >
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000403
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000404 set nocp
405 if version >= 600
406 filetype plugin indent on
407 endif
408<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000409
410==============================================================================
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00004115. Transparent File Transfer *netrw-transparent*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000412
413Transparent file transfers occur whenever a regular file read or write
414(invoked via an |:autocmd| for |BufReadCmd| or |BufWriteCmd| events) is made.
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000415Thus one may use files across networks just as simply as if they were local. >
Bram Moolenaar071d4272004-06-13 20:20:40 +0000416
417 vim ftp://[user@]machine/path
418 ...
419 :wq
420
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000421See |netrw-activate| for more on how to encourage your vim to use plugins
422such as netrw.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000423
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000424
Bram Moolenaar071d4272004-06-13 20:20:40 +0000425==============================================================================
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00004266. Ex Commands *netrw-ex*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000427
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000428The usual read/write commands are supported. There are also a few
429additional commands available. Often you won't need to use Nw or
430Nread as shown in |netrw-transparent| (ie. use :e url, :r url, :w url;
431see |netrw-urls|).
Bram Moolenaar071d4272004-06-13 20:20:40 +0000432
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
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000439:Nread Read the specified lines into the current
Bram Moolenaar071d4272004-06-13 20:20:40 +0000440 buffer from the file specified in
441 b:netrw_lastfile.
442
443:Nread {netfile} {netfile}...
444 Read the {netfile} after the current line.
445
Bram Moolenaar482aaeb2005-09-29 18:26:07 +0000446 *netrw-uidpass*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000447: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
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000461:NetrwSettings This command is desribed in |netrw-settings| -- used to
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000462 display netrw settings and change netrw behavior.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000463
Bram Moolenaar071d4272004-06-13 20:20:40 +0000464
465==============================================================================
Bram Moolenaar433f7c82006-03-21 21:29:36 +00004667. Variables and Options *netrw-options* *netrw-var*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000467
468The script <netrw.vim> uses several variables which can affect <netrw.vim>'s
469behavior. These variables typically may be set in the user's <.vimrc> file:
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000470(also see |netrw-settings|) >
471
472 -------------
473 Netrw Options
474 -------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000475 Option Meaning
476 -------------- -----------------------------------------------
477<
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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000488 want it used, then set this variable. Its
489 mere existence is enough to cause <.netrc>
490 to be ignored.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000491 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.
Bram Moolenaar482aaeb2005-09-29 18:26:07 +0000497 =1 use alternate ftp (user uid password)
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000498 (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 >
503 -----------------------------------------------------------------------
504<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000505The script will also make use of the following variables internally, albeit
506temporarily.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000507>
508 -------------------
509 Temporary Variables
510 -------------------
511 Variable Meaning
512 -------- ------------------------------------
513<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000514 g:netrw_method Index indicating rcp/ftp+.netrc/ftp
515 g:netrw_machine Holds machine name parsed from input
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000516 g:netrw_fname Holds filename being accessed >
517 ------------------------------------------------------------
518<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000519 *netrw-protocol*
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000520
521Netrw supports a number of protocols. These protocols are invoked using the
522variables listed below, and may be modified by the user.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000523>
524 ------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000525 Protocol Control Options
Bram Moolenaar071d4272004-06-13 20:20:40 +0000526 ------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000527 Option Type Setting Meaning
528 --------- -------- -------------- ---------------------------
529<
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()
Bram Moolenaar071d4272004-06-13 20:20:40 +0000538 g:netrw_dav_cmd variable ="cadaver"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000539 g:netrw_fetch_cmd variable ="fetch -o" if fetch is available
Bram Moolenaar071d4272004-06-13 20:20:40 +0000540 g:netrw_ftp_cmd variable ="ftp"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000541 g:netrw_http_cmd variable ="fetch -o" if fetch is available
542 g:netrw_http_cmd variable ="wget -O" else if wget is available
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000543 g:netrw_list_cmd variable ="ssh HOSTNAME ls -Fa"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000544 g:netrw_rcp_cmd variable ="rcp"
545 g:netrw_rsync_cmd variable ="rsync -a"
546 g:netrw_scp_cmd variable ="scp -q"
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000547 g:netrw_sftp_cmd variable ="sftp" >
548 -------------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000549<
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000550 *netrw-ftp*
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000551The first two options (netrw_ftp and NetReadFixup) both help with certain
552ftp's that give trouble otherwise. In order to best understand how to use
553these options if ftp is giving you troubles, a bit of discussion follows on
554how netrw does ftp reads.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000555
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000556The g:netrw_..._cmd variables specify the external program to use handle the
557associated protocol (rcp, ftp, etc), plus any options.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000558
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000559The g:netrw_list_cmd's HOSTNAME entry will be changed via substitution with
560whatever the current request is for a hostname.
561
562For ftp, netrw typically builds up lines of one of the following formats in a
Bram Moolenaar071d4272004-06-13 20:20:40 +0000563temporary file:
564>
565 IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1
566 ---------------------------------- ------------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000567<
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 >
573 ---------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000574<
575Netrw then executes the lines above by use of a filter:
576>
577 :%! {g:netrw_ftp_cmd} -i [-n]
578<
579
580where
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
585If <.netrc> exists it will be used to avoid having to query the user for
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000586userid and password. The transferred file is put into a temporary file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000587The temporary file is then read into the main editing session window that
588requested it and the temporary file deleted.
589
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000590If your ftp doesn't accept the "user" command and immediately just demands a
591userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000592
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000593 *netrw-cadaver*
594To handle the SSL certificate dialog for untrusted servers, one may pull
595down the certificate and place it into /usr/ssl/cert.pem. This operation
596renders the server treatment as "trusted".
597
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000598 *netrw-fixup* *netreadfixup*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000599If your ftp for whatever reason generates unwanted lines (such as AUTH
600messages) 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
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000614 else " complain
Bram Moolenaar071d4272004-06-13 20:20:40 +0000615 endif
616 endfunction
617>
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000618The NetReadFixup() function will be called if it exists and thus allows you to
619customize your reading process. As a further example, <netrw.vim> contains
620just such a function to handle Windows 95 ftp. For whatever reason, Windows
62195's ftp dumps four blank lines at the end of a transfer, and so it is
622desirable to automate their removal. Here's some code taken from <netrw.vim>
623itself:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000624>
625 if has("win95") && g:netrw_win95ftp
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000626 fun! NetReadFixup(method, line1, line2)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000627 if method == 3 " ftp (no <.netrc>)
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000628 let fourblanklines= line2 - 3
629 silent fourblanklines.",".line2."g/^\s*/d"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000630 endif
631 endfunction
632 endif
633>
634
635==============================================================================
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00006368. Directory Browsing *netrw-browse* *netrw-dir* *netrw-list* *netrw-help*
Bram Moolenaar83bab712005-08-01 21:58:57 +0000637
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000638MAPS *netrw-maps*
639 <F1>.............Help.......................................|netrw-help|
Bram Moolenaar83bab712005-08-01 21:58:57 +0000640 <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|
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000649 <c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h|
Bram Moolenaar83bab712005-08-01 21:58:57 +0000650 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*
Bram Moolenaar488c6512005-08-11 20:09:58 +0000665 :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|
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000671 :NetrwSettings.............................................|netrw-settings|
Bram Moolenaar269ec652004-07-29 08:43:53 +0000672
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000673QUICK REFERENCE COMMANDS TABLE *netrw-browse-cmds*
Bram Moolenaar843ee412004-06-30 16:16:41 +0000674>
Bram Moolenaar8299df92004-07-10 09:47:34 +0000675 ------- -----------
Bram Moolenaar843ee412004-06-30 16:16:41 +0000676 Command Explanation
677 ------- -----------
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000678< <F1> Causes Netrw to issue help
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000679 <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|
Bram Moolenaar843ee412004-06-30 16:16:41 +0000697 o Enter the file/directory under the cursor in a new browser
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000698 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|
Bram Moolenaar843ee412004-06-30 16:16:41 +0000708 v Enter the file/directory under the cursor in a new browser
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000709 window. A vertical split is used. |netrw-v|
710 x Apply a function to a file. (special browsers) |netrw-x|
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000711
Bram Moolenaar269ec652004-07-29 08:43:53 +0000712NETRW BROWSER VARIABLES *netrw-browse-var*
Bram Moolenaar843ee412004-06-30 16:16:41 +0000713>
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000714 --- -----------
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
Bram Moolenaar83bab712005-08-01 21:58:57 +0000720
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000721 *g:netrw_altv* change from left splitting to right splitting
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000722 by setting this variable (see |netrw-v|)
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000723 default: =0
Bram Moolenaar83bab712005-08-01 21:58:57 +0000724
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000725 *g:netrw_browse_split* when browsing, <cr> will open the file by:
726 =0: re-using the same window
727 =1: horizontally splitting the window first
728 =2: vertically splitting the window first
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000729
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000730 *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|).
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000738
739 *g:netrw_fastbrowse* =0: slow speed browsing, never re-use
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000740 directory listings; always obtain
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000741 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
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000759 *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$'
Bram Moolenaar83bab712005-08-01 21:58:57 +0000771
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000772 *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"
775 otherwise "dir"
776
777 *g:netrw_hide* if true, the hiding list is used
778 default: =0
Bram Moolenaar83bab712005-08-01 21:58:57 +0000779
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000780 *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
785 b:netrw_curdir
Bram Moolenaar83bab712005-08-01 21:58:57 +0000786
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000787 *g:netrw_list_cmd* command for listing remote directories
788 default: (if ssh is executable)
789 "ssh HOSTNAME ls -FLa"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000790
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000791 *g:netrw_longlist* if =1, then long listing will be default
Bram Moolenaar83bab712005-08-01 21:58:57 +0000792
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000793 *g:netrw_list_hide* comma separated pattern list for hiding files
794 default: ""
Bram Moolenaar83bab712005-08-01 21:58:57 +0000795
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000796 *g:netrw_local_mkdir* command for making a local directory
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000797 default: "mkdir"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000798
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000799 *g:netrw_local_rmdir* remove directory command (rmdir)
800 default: "rmdir"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000801
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000802 *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.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000808
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000809 *g:netrw_mkdir_cmd* command for making a remote directory
810 default: "ssh HOSTNAME mkdir"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000811
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000812 *g:netrw_rm_cmd* command for removing files
813 default: "ssh HOSTNAME rm"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000814
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000815 *g:netrw_rmdir_cmd* command for removing directories
816 default: "ssh HOSTNAME rmdir"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000817
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000818 *g:netrw_rmf_cmd* command for removing softlinks
819 default: "ssh HOSTNAME rm -f"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000820
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000821 *g:netrw_sort_by* sort by "name", "time", or "size"
822 default: "name"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000823
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000824 *g:netrw_sort_direction* sorting direction: "normal" or "reverse"
825 default: "normal"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000826
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000827 *g:netrw_sort_sequence* when sorting by name, first sort by the
828 comma-separated pattern sequence
829 default: '[\/]$,*,\.bak$,\.o$,\.h$,
830 \.info$,\.swp$,\.obj$'
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000831
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000832 *g:netrw_ssh_cmd* One may specify an executable command
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000833 to use instead of ssh for remote actions
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000834 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:
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000842 '^total\s\+\d\+$'
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000843
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000844 *g:netrw_timefmt* specify format string to strftime() (%c)
845 default: "%c"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000846
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000847 *g:netrw_winsize* specify initial size of new o/v windows
848 default: ""
Bram Moolenaar83bab712005-08-01 21:58:57 +0000849
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000850 *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.
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000854
Bram Moolenaar83bab712005-08-01 21:58:57 +0000855INTRODUCTION TO DIRECTORY BROWSING *netrw-browse-intro*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000856
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000857Netrw supports the browsing of directories on the local system and on remote
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000858hosts, including listing files and directories, entering directories, editing
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000859files therein, deleting files/directories, making new directories, and moving
860(renaming) files and directories. The Netrw browser generally implements the
861previous explorer maps and commands for remote directories, although details
862(such as pertinent global variable names) necessarily differ.
863
864The Netrw remote file and directory browser handles two protocols: ssh and
865ftp. The protocol in the url, if it is ftp, will cause netrw to use ftp
866in its remote browsing. Any other protocol will be used for file transfers,
867but otherwise the ssh protocol will be used to do remote directory browsing.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000868
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000869To use Netrw's remote directory browser, simply attempt to read a "file" with a
Bram Moolenaar843ee412004-06-30 16:16:41 +0000870trailing slash and it will be interpreted as a request to list a directory:
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000871
872 vim [protocol]://[user@]hostname/path/
873
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000874For local directories, the trailing slash is not required.
875
876If you'd like to avoid entering the password in for remote directory listings
877with ssh or scp, see |netrw-listhack|.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000878
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000879
880NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible*
881
882Netrw will not work properly with >
883
884 :set acd
885 :set fo=...ta...
886<
887If either of these options are present when browsing is attempted, netrw
888will change them by using noacd and removing the ta suboptions from the
Bram Moolenaara94bc432006-03-10 21:42:59 +0000889|'formatoptions'|.
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000890
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000891 *netrw-explore* *netrw-pexplore*
892 *netrw-hexplore* *netrw-sexplore*
893DIRECTORY EXPLORING COMMANDS *netrw-nexplore* *netrw-vexplore*
Bram Moolenaar83bab712005-08-01 21:58:57 +0000894
Bram Moolenaar488c6512005-08-11 20:09:58 +0000895 :Explore[!] [dir]... Explore directory of current file *:Explore*
896 :Sexplore[!] [dir]... Split&Explore directory of current file *:Sexplore*
897 :Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
898 :Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
Bram Moolenaar83bab712005-08-01 21:58:57 +0000899
Bram Moolenaar488c6512005-08-11 20:09:58 +0000900 Used with :Explore **/pattern :
901 :Nexplore............. go to next matching file *:Nexplore*
902 :Pexplore............. go to previous matching file *:Pexplore*
Bram Moolenaar83bab712005-08-01 21:58:57 +0000903
Bram Moolenaar488c6512005-08-11 20:09:58 +0000904:Explore will open the local-directory browser on the current file's
905 directory (or on directory [dir] if specified). The window will be
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
911 browser. As with Explore, the splitting is normally done
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.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000918
Bram Moolenaar488c6512005-08-11 20:09:58 +0000919By default, these commands use the current file's directory. However, one
920may explicitly provide a directory (path) to use.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000921
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000922(Following needs v7.0 or later) *netrw-starstar*
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000923When Explore, Sexplore, Hexplore, or Vexplore are used with a **,
924such as:
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000925>
926 :Explore **/filename_pattern
927<
928netrw will attempt to find a (sub)directory which matches the filename
929pattern. Internally, it produces a list of files which match the pattern
930and their paths; to that extent it resembles the Unix operation:
931>
932 find $(pwd) -name "$1" -exec "echo" "{}" ";" 2> /dev/null
933<
934The directory display is updated to show the subdirectory containing a
935matching file. One may then proceed to the next (or previous) matching files'
936directories by using Nexplore or Pexplore, respectively. If your console or
937gui produces recognizable shift-up or shift-down sequences, then you'll likely
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000938find using shift-downarrow and shift-uparrow convenient. They're mapped by
939netrw:
Bram Moolenaar572cb562005-08-05 21:35:02 +0000940
941 <s-down> == Nexplore, and
942 <s-up> == Pexplore.
943
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000944As an example, consider
945>
Bram Moolenaar572cb562005-08-05 21:35:02 +0000946 :Explore **/*.c
947 :Nexplore
948 :Nexplore
949 :Pexplore
950<
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000951The status line will show, on the right hand side of the status line, a
952message like "Match 3 of 20".
953
Bram Moolenaar83bab712005-08-01 21:58:57 +0000954
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000955REFRESHING THE LISTING *netrw-ctrl-l*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000956
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000957To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
958hit the <cr> when atop the ./ directory entry in the listing. One may also
959refresh a local directory by using ":e .".
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000960
961
962GOING UP *netrw--*
963
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000964To go up a directory, press "-" or press the <cr> when atop the ../ directory
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000965entry in the listing.
966
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000967Netrw will use the command in |g:netrw_list_cmd| to perform the directory
968listing operation after changing HOSTNAME to the host specified by the
969user-provided url. By default netrw provides the command as:
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000970
Bram Moolenaar843ee412004-06-30 16:16:41 +0000971 ssh HOSTNAME ls -FLa
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000972
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000973where the HOSTNAME becomes the [user@]hostname as requested by the attempt to
974read. Naturally, the user may override this command with whatever is
975preferred. The NetList function which implements remote directory browsing
976expects that directories will be flagged by a trailing slash.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000977
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000978
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000979BROWSING *netrw-cr*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000980
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000981Browsing is simple: move the cursor onto a file or directory of interest.
Bram Moolenaar843ee412004-06-30 16:16:41 +0000982Hitting the <cr> (the return key) will select the file or directory.
983Directories will themselves be listed, and files will be opened using the
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000984protocol given in the original read request.
985
986 CAVEAT: There are three forms of listing (see |netrw-i|). Netrw assumes
987 that two or more spaces delimit filenames and directory names for the long
988 and wide listing formats. Thus, if your filename or directory name has two
989 or more spaces embedded in it, or any trailing spaces, then you'll need to
990 use the "thin" format to select it.
Bram Moolenaar843ee412004-06-30 16:16:41 +0000991
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000992The |g:netrw_browse_split| option, which is zero by default, may be used to
993cause the opening of files to be done in a new window. The splitting will
994be done horizontally if the option is one and vertically if the option is
995two.
996
Bram Moolenaar83bab712005-08-01 21:58:57 +0000997
Bram Moolenaar578b49e2005-09-10 19:22:57 +0000998OBTAINING A FILE *netrw-O*
999
1000When browsing a remote directory, one may obtain a file under the cursor (ie.
1001get a copy on your local machine, but not edit it) by pressing the O key.
1002Only ftp and scp are supported for this operation (but since these two are
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001003available for browsing, that shouldn't be a problem). The status bar
1004will then show, on its right hand side, a message like "Obtaining filename".
1005The statusline will be restored after the transfer is complete.
1006
1007Netrw can also "obtain" a file using the local browser. Netrw's display
1008of a directory is not necessarily the same as Vim's "current directory",
1009unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select
1010a file using the local browser (by putting the cursor on it) and pressing
1011"O" will then "obtain" the file; ie. copy it to Vim's current directory.
1012
1013Related topics:
1014 * To see what the current directory is, use |:pwd|
1015 * To make the currently browsed directory the current directory, see |netrw-c|
1016 * To automatically make the currently browsed directory the current
1017 directory, see |g:netrw_keepdir|.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001018
1019
1020THIN, LONG, AND WIDE LISTINGS *netrw-i*
1021
1022The "i" map cycles between the thin, long, and wide listing formats.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001023
Bram Moolenaar8299df92004-07-10 09:47:34 +00001024The short listing format gives just the files' and directories' names.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001025
Bram Moolenaar8299df92004-07-10 09:47:34 +00001026The long listing is either based on the "ls" command via ssh for remote
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001027directories or displays the filename, file size (in bytes), and the time and
1028date of last modification for local directories. With the long listing
1029format, netrw is not able to recognize filenames which have trailing spaces.
1030Use the thin listing format for such files.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001031
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001032The wide listing format has a multi-column display of the various files in the
1033netrw current directory, rather like the Unix "ls" presents. In this mode the
1034"b" and "B" maps are not available; instead, use Nb (|netrw-Nb|) and NB
1035(|netrw-NB|). The wide listing format uses two or more contiguous spaces to
1036delineate filenames; when using that format, netrw won't be able to recognize
1037or use filenames which have two or more contiguous spaces embedded in the name
1038or any trailing spaces. The thin listing format will, however, work with such
1039files.
Bram Moolenaar8299df92004-07-10 09:47:34 +00001040
1041
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001042MAKING A NEW DIRECTORY *netrw-d*
Bram Moolenaar8299df92004-07-10 09:47:34 +00001043
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001044With the "d" map one may make a new directory either remotely (which depends
1045on the global variable g:netrw_mkdir_cmd) or locally (which depends on the
1046global variable g:netrw_local_mkdir). Netrw will issue a request for the new
1047directory's name. A bare <CR> at that point will abort the making of the
Bram Moolenaar8299df92004-07-10 09:47:34 +00001048directory. Attempts to make a local directory that already exists (as either
1049a file or a directory) will be detected, reported on, and ignored.
1050
Bram Moolenaar83bab712005-08-01 21:58:57 +00001051
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001052DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del*
Bram Moolenaar843ee412004-06-30 16:16:41 +00001053
1054Deleting/removing files and directories involves moving the cursor to the
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001055file/directory to be deleted and pressing "D". Directories must be empty
1056first before they can be successfully removed. If the directory is a softlink
1057to a directory, then netrw will make two requests to remove the directory
1058before succeeding. Netrw will ask for confirmation before doing the
1059removal(s). You may select a range of lines with the "V" command (visual
1060selection), and then pressing "D".
Bram Moolenaar843ee412004-06-30 16:16:41 +00001061
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001062The g:netrw_rm_cmd, g:netrw_rmf_cmd, and g:netrw_rmdir_cmd variables are used
1063to control the attempts to remove files and directories. The g:netrw_rm_cmd
1064is used with files, and its default value is:
Bram Moolenaar843ee412004-06-30 16:16:41 +00001065
1066 g:netrw_rm_cmd: ssh HOSTNAME rm
1067
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001068The g:netrw_rmdir_cmd variable is used to support the removal of directories.
1069Its default value is:
Bram Moolenaar843ee412004-06-30 16:16:41 +00001070
1071 g:netrw_rmdir_cmd: ssh HOSTNAME rmdir
1072
1073If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001074to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
Bram Moolenaar843ee412004-06-30 16:16:41 +00001075
1076 g:netrw_rmf_cmd: ssh HOSTNAME rm -f
1077
Bram Moolenaar843ee412004-06-30 16:16:41 +00001078
Bram Moolenaar8299df92004-07-10 09:47:34 +00001079RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R*
Bram Moolenaar843ee412004-06-30 16:16:41 +00001080
1081Renaming/moving files and directories involves moving the cursor to the
1082file/directory to be moved (renamed) and pressing "R". You will then be
1083queried for where you want the file/directory to be moved. You may select a
1084range of lines with the "V" command (visual selection), and then pressing "R".
1085
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001086The g:netrw_rename_cmd variable is used to implement renaming. By default its
Bram Moolenaar843ee412004-06-30 16:16:41 +00001087value is:
1088
1089 ssh HOSTNAME mv
1090
Bram Moolenaar269ec652004-07-29 08:43:53 +00001091One may rename a block of files and directories by selecting them with
1092the V (|linewise-visual|).
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001093
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001094
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00001095HIDING FILES OR DIRECTORIES *netrw-a*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001096
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001097Netrw's browsing facility allows one to use the hiding list in one of three
1098ways: ignore it, hide files which match, and show only those files which
1099match. The "a" map allows the user to cycle about these three ways.
Bram Moolenaar83bab712005-08-01 21:58:57 +00001100
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001101The g:netrw_list_hide variable holds a comma delimited list of patterns (ex.
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001102\.obj) which specify the hiding list. (also see |netrw-ctrl-h|) To set the hiding
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001103list, use the <c-h> map. As an example, to hide files which begin with a ".",
1104one may use the <c-h> map to set the hiding list to '^\..*' (or one may put
1105let g:netrw_list_hide= '^\..*' in one's <.vimrc>). One may then use the "a"
1106key to show all files, hide matching files, or to show only the matching
1107files.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001108
1109
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001110EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001111
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001112The "<ctrl-h>" map brings up a requestor allowing the user to change the
Bram Moolenaar269ec652004-07-29 08:43:53 +00001113file/directory hiding list. The hiding list consists of one or more patterns
1114delimited by commas. Files and/or directories satisfying these patterns will
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001115either be hidden (ie. not shown) or be the only ones displayed (see
1116|netrw-a|).
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001117
1118
Bram Moolenaar83bab712005-08-01 21:58:57 +00001119BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001120
Bram Moolenaar269ec652004-07-29 08:43:53 +00001121Normally one enters a file or directory using the <cr>. However, the "o" map
1122allows one to open a new window to hold the new directory listing or file. A
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001123horizontal split is used. (for vertical splitting, see |netrw-v|)
1124
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001125Normally, the o key splits the window horizontally with the new window and
1126cursor at the top. To change to splitting the window horizontally with the
1127new window and cursor at the bottom, have
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001128
1129 let g:netrw_alto = 1
1130
1131in your <.vimrc>.
1132
Bram Moolenaar83bab712005-08-01 21:58:57 +00001133
1134PREVIEW WINDOW *netrw-p* *netrw-preview*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001135
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001136One may use a preview window (currently only for local browsing) by using the
1137"p" key when the cursor is atop the desired filename to be previewed.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001138
1139
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001140PREVIOUS WINDOW *netrw-P* *netrw-prvwin*
1141
Bram Moolenaara94bc432006-03-10 21:42:59 +00001142To edit a file or directory in the previously used window (see :he |CTRL-W_P|),
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001143press a "P". If there's only one window, then the one window will be
Bram Moolenaara94bc432006-03-10 21:42:59 +00001144horizontally split (above/below splitting is controlled by |g:netrw_alto|,
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001145and its initial size is controlled by |g:netrw_winsize|).
1146
1147If there's more than one window, the previous window will be re-used on
1148the selected file/directory. If the previous window's associated buffer
1149has been modified, and there's only one window with that buffer, then
1150the user will be asked if s/he wishes to save the buffer first (yes,
1151no, or cancel).
1152
1153
Bram Moolenaar83bab712005-08-01 21:58:57 +00001154SELECTING SORTING STYLE *netrw-s* *netrw-sort*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001155
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001156One may select the sorting style by name, time, or (file) size. The "s" map
1157allows one to circulate amongst the three choices; the directory listing will
1158automatically be refreshed to reflect the selected style.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001159
1160
Bram Moolenaar83bab712005-08-01 21:58:57 +00001161EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence*
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001162
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001163When "Sorted by" is name, one may specify priority via the sorting sequence
1164(g:netrw_sort_sequence). The sorting sequence typically prioritizes the
1165name-listing by suffix, although any pattern will do. Patterns are delimited
1166by commas. The default sorting sequence is:
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001167>
Bram Moolenaar488c6512005-08-11 20:09:58 +00001168 [\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001169<
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001170The lone * is where all filenames not covered by one of the other patterns
1171will end up. One may change the sorting sequence by modifying the
1172g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by
1173using the "S" map.
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001174
1175
Bram Moolenaar83bab712005-08-01 21:58:57 +00001176REVERSING SORTING ORDER *netrw-r* *netrw-reverse*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001177
1178One may toggle between normal and reverse sorting order by pressing the
1179"r" key.
1180
1181
Bram Moolenaar83bab712005-08-01 21:58:57 +00001182CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir*
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001183
1184Every time you change to a new directory (new for the current session),
1185netrw will save the directory in a recently-visited directory history
1186list (unless g:netrw_dirhistmax is zero; by default, its ten). With the
1187"u" map, one can change to an earlier directory (predecessor). To do
1188the opposite, see |netrw-U|.
1189
1190
Bram Moolenaar83bab712005-08-01 21:58:57 +00001191CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir*
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001192
1193With the "U" map, one can change to a later directory (successor).
1194This map is the opposite of the "u" map. (see |netrw-u|) Use the
1195q map to list both the bookmarks and history. (see |netrw-q|)
1196
1197
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001198BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v*
1199
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001200Normally one enters a file or directory using the <cr>. However, the "v" map
1201allows one to open a new window to hold the new directory listing or file. A
1202vertical split is used. (for horizontal splitting, see |netrw-o|)
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001203
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001204Normally, the v key splits the window vertically with the new window and
1205cursor at the left. To change to splitting the window vertically with the new
1206window and cursor at the right, have
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001207
1208 let g:netrw_altv = 1
1209
1210in your <.vimrc>.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001211
1212
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001213CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler* *gx*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001214
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001215Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
1216best seen with a special handler (ie. a tool provided with your computer).
1217Netrw allows one to invoke such special handlers by: >
1218
1219 * when Exploring, hit the "x" key
1220 * when editing, hit gx with the cursor atop the special filename
1221<
1222Netrw determines which special handler by the following method:
1223
1224 * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
1225 view files. Examples of useful settings (place into your <.vimrc>): >
1226
1227 :let g:netrw_browsex_viewer= "kfmclient exec"
1228< or >
1229 :let g:netrw_browsex_viewer= "gnome-open"
1230<
1231 If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
1232 invoked first (see |netrw_filehandler|).
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001233
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001234 * for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001235 * for Gnome (with gnome-open): gnome-open is used.
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001236 * for KDE (with kfmclient): kfmclient is used.
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001237 * otherwise the netrwFileHandler plugin is used.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001238
1239The file's suffix is used by these various approaches to determine an
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001240appropriate application to use to "handle" these files. Such things as
1241OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
1242*.eps) can be handled.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001243
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001244 *netrw_filehandler*
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001245The netrwFileHandler applies a user-defined function to a file, based on its
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001246extension. Of course, the handler function must exist for it to be called!
1247>
1248 Ex. mypgm.html x ->
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001249 netrwFileHandler_html("scp://user@host/some/path/mypgm.html")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001250<
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001251See the <plugin/netrwFileHandlers.vim> for an example of how to handle an html
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001252file with mozilla.
1253
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001254One may write custom netrwFileHandlers; please look at the >
1255
1256 plugin/netrwFileHandlers.vim
1257
1258script for examples. If its likely to be generally useful, please feel free
1259to forward a copy to me for future inclusion in the distribution.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001260
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001261
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001262MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* *netrw-curdir*
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001263
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001264By default, g:netrw_keepdir is 1. This setting means that the current
1265directory will not track the browsing directory. However, setting
1266g:netrw_keepdir to 0 (say, in your <.vimrc>) will tell netrw to have the
1267currently browsed directory be the current directory.
1268
1269With the default setting for g:netrw_keepdir, in order to make the two
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001270directories the same, use the "c" map (just type c). That map will set the
1271current directory to the current browsing directory.
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001272
1273
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001274BOOKMARKING A DIRECTORY *netrw-b* *netrw-bookmark* *netrw-bookmarks*
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001275 *netrw-Nb*
Bram Moolenaar572cb562005-08-05 21:35:02 +00001276One may easily "bookmark" a directory by using >
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001277
1278 {cnt}b
Bram Moolenaar572cb562005-08-05 21:35:02 +00001279<
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001280Any count may be used. One may use viminfo's "!" option to retain bookmarks
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001281between vim sessions. See |netrw-B| for how to return to a bookmark and
1282|netrw-q| for how to list them.
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001283
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001284When wide listing is in use (see |netrw-i|), then the b map is not available;
1285instead, use {cnt}Nb.
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001286
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001287
1288CHANGING TO A BOOKMARKED DIRECTORY *netrw-NB* *netrw-B*
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001289
1290To change directory back to a bookmarked directory, use
1291
1292 {cnt}B
1293
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001294Any count may be used to reference any of the bookmarks. See |netrw-b| on
1295how to bookmark a directory and |netrw-q| on how to list bookmarks.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001296
1297When wide listing is in use (see |netrw-i|), then the B map is not available;
1298instead, use {cnt}NB.
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001299
1300
Bram Moolenaar83bab712005-08-01 21:58:57 +00001301LISTING BOOKMARKS AND HISTORY *netrw-q* *netrw-listbookmark*
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001302
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001303Pressing "q" will list the bookmarked directories and directory traversal
1304history (query). (see |netrw-b|, |netrw-B|, |netrw-u|, and |netrw-U|)
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001305
1306
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001307IMPROVING DIRECTORY BROWSING *netrw-listhack*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001308
1309Especially with the remote directory browser, constantly entering the password
1310is tedious.
1311
Bram Moolenaar843ee412004-06-30 16:16:41 +00001312For Linux/Unix systems, I suggest looking into
1313
1314 http://hacks.oreilly.com/pub/h/66
1315
1316It gives a tip for setting up password-less use of ssh and scp, and discusses
1317the associated security issues.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001318
Bram Moolenaar433f7c82006-03-21 21:29:36 +00001319For Windows, the vim mailing list has mentioned that Pageant helps with
1320avoiding the constant need to enter the password.
1321
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001322
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001323NETRW SETTINGS *netrw-settings*
1324
1325With the NetrwSettings.vim plugin, >
1326 :NetrwSettings
1327will bring up a window with the many variables that netrw uses for its
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001328settings. You may change any of their values; when you save the file, the
1329settings therein will be used. One may also press "?" on any of the lines for
1330help on what each of the variables do.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001331
1332
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001333==============================================================================
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +000013349. Problems and Fixes *netrw-problems*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001335
1336 (This section is likely to grow as I get feedback)
1337 (also see |netrw-debug|)
Bram Moolenaar488c6512005-08-11 20:09:58 +00001338 *netrw-p1*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001339 P1. I use windows 95, and my ftp dumps four blank lines at the
1340 end of every read.
1341
1342 See |netrw-fixup|, and put the following into your
1343 <.vimrc> file:
1344
1345 let g:netrw_win95ftp= 1
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001346
Bram Moolenaar488c6512005-08-11 20:09:58 +00001347 *netrw-p2*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001348 P2. I use windows, and my network browsing with ftp doesn't sort by
1349 time or size
1350
1351 Windows' ftp has a minimal support for ls (ie. it doesn't
1352 accept sorting options). It doesn't support the -F which
1353 gives an explanatory character (ABC/ for "ABC is a directory").
1354 Netrw uses dir to get its short and long listings. If you
1355 think your ftp does support a full-up ls, put the following
1356 into your <.vimrc>:
1357
1358 let g:netrw_ftp_list_cmd= "ls -lF"
1359
1360 Alternatively, if you have cygwin on your Windows box, put
1361 into your <.vimrc>:
1362
1363 let g:netrw_cygwin= 1
1364
Bram Moolenaar488c6512005-08-11 20:09:58 +00001365 *netrw-p3*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001366 P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw
1367 used ssh! That wasn't what I asked for...
1368
1369 Netrw has two methods for browsing remote directories: ssh
1370 and ftp. Unless you specify ftp specifically, ssh is used.
1371 When it comes time to do download a file (not just a directory
1372 listing), netrw will use the given protocol to do so.
1373
Bram Moolenaar488c6512005-08-11 20:09:58 +00001374 *netrw-p4*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001375 P4. I would like long listings to be the default.
1376
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001377 let g:netrw_longlist=1
1378
1379 Check out |netrw-browse-var| for more customizations that
1380 you can set.
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001381
Bram Moolenaar488c6512005-08-11 20:09:58 +00001382 *netrw-p5*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001383 P5. My times come up oddly in local browsing
1384
1385 Does your system's strftime() accept the "%c" to yield dates
1386 such as "Sun Apr 27 11:49:23 1997"? If not, do a "man strftime"
1387 and find out what option should be used. Then put it into
1388 your <.vimrc>:
1389 let g:netrw_timefmt= "%X" (where X is the option)
1390
Bram Moolenaar488c6512005-08-11 20:09:58 +00001391 *netrw-p6*
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001392 P6. I want my current directory to track my browsing.
1393 How do I do that?
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001394
Bram Moolenaar433f7c82006-03-21 21:29:36 +00001395 let g:netrw_keepdir= 0
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001396
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001397
1398==============================================================================
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000139910. Debugging *netrw-debug*
Bram Moolenaar071d4272004-06-13 20:20:40 +00001400
1401The <netrw.vim> script is typically available as:
Bram Moolenaar488c6512005-08-11 20:09:58 +00001402>
Bram Moolenaar071d4272004-06-13 20:20:40 +00001403 /usr/local/share/vim/vim6x/plugin/netrw.vim
Bram Moolenaar488c6512005-08-11 20:09:58 +00001404< -or- >
1405 /usr/local/share/vim/vim7x/plugin/netrw.vim
1406<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001407which is loaded automatically at startup (assuming :set nocp).
1408
1409 1. Get the <Decho.vim> script, available as:
1410
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00001411 http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_scripts
1412 as "Decho, a vimL debugging aid"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001413 or
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00001414 http://vim.sourceforge.net/scripts/script.php?script_id=120
Bram Moolenaar071d4272004-06-13 20:20:40 +00001415
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001416 and put it into your local plugin directory.
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001417
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001418 2. <Decho.vim> itself needs the <cecutil.vim> script, so you'll need
1419 to put it into your .vim/plugin, too. You may obtain it from:
Bram Moolenaar071d4272004-06-13 20:20:40 +00001420
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001421 http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs
1422 as "DrC's Utilities"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001423
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001424 3. Edit the <netrw.vim> file by typing:
1425
1426 vim netrw.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +00001427 :DechoOn
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001428 :wq
Bram Moolenaar071d4272004-06-13 20:20:40 +00001429
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001430 To restore to normal non-debugging behavior, edit <netrw.vim>
1431 by typing
Bram Moolenaar071d4272004-06-13 20:20:40 +00001432
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001433 vim netrw.vim
1434 :DechoOff
1435 :wq
1436
1437 This command, provided by <Decho.vim>, will comment out all
1438 Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()).
1439
1440 4. Then bring up vim and attempt a transfer. A set of messages
Bram Moolenaar071d4272004-06-13 20:20:40 +00001441 should appear concerning the steps that <netrw.vim> took in
1442 attempting to read/write your file over the network. Please
1443 send that information to <netrw.vim>'s maintainer,
1444
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001445 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
Bram Moolenaar071d4272004-06-13 20:20:40 +00001446
1447==============================================================================
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000144811. History *netrw-history* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00001449
Bram Moolenaar9e54a0e2006-04-14 20:42:25 +00001450 v88: * moved DrChip.Netrw menu to Netrw. Now has priority 80 by
1451 default. g:NetrwTopLvlMenu == "Netrw" and can be changed
1452 by the user to suit. The priority is g:NetrwMenuPriority.
1453 * Changed filetype for browser displays from netrwlist to netrw.
Bram Moolenaar7fc904b2006-04-13 20:37:35 +00001454 v87: * bug fix -- menus were partially disappearing
Bram Moolenaar8dff8182006-04-06 20:18:50 +00001455 v85: * bug fix -- missing an endif
1456 * bug fix -- handles spaces in names and directories when using
1457 ftp-based browsing
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001458 v83: * disabled stop-acd handling; the change in directory handling
1459 may allow acd to be used again. Awaiting feedback.
1460 * D was refusing to delete remote files/directories in wide
1461 listing mode.
Bram Moolenaar7d47b6e2006-03-15 22:59:18 +00001462 v81: * FocusGained also used to refresh/wipe local browser directory
1463 buffers
1464 * (bugfix) netrw was leaving [Scratch] buffers behind when the
1465 the user had the "hidden" option set. The 'hidden' option is
1466 now bypassed.
1467 v80: * ShellCmdPost event used in conjunction with g:netrw_fastbrowse
1468 to refresh/wipe local browser directory buffers.
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +00001469 v79: * directories are now displayed with nowrap
1470 * (bugfix) if the column width was smaller than the largest
1471 file's name, then netrw would hang when using wide-listing
1472 mode - fixed
1473 * g:netrw_fastbrowse introduced
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001474 v78: * progress has been made on allowing spaces inside directory
1475 names for remote work (reading, writing, browsing). (scp)
1476 v77: * Mikolaj Machowski fixed a bug in a substitute command
1477 * g:netrw_browsex_viewer implemented
1478 * Mikolaj Machowski pointed out that gnome-open is often
1479 executable under KDE systems, although it is effectively
1480 not functional. NetBrowseX now looks for "kicker" as
1481 a running process to determine if KDE is actually the
1482 really running.
1483 * Explorer's O functionality was inadvertently left out.
1484 Netrw now does the same thing, but with the "P" key.
1485 * added g:netrw_browse_split option
1486 * fixed a bug where the directory contained a "." but
1487 the file didn't (was treating the dirname from "."
1488 onwards as a suffix)
Bram Moolenaar36c31f72005-11-28 23:01:53 +00001489 v76: * "directory is missing" error message now restores echo
1490 highlighting
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001491 v75: * file://... now conforms to RFC2396 (thanks to S. Zacchiroli)
1492 * if the binary option is set, then NetWrite() will only write
1493 the whole file (line numbers don't make sense with this).
1494 Supports writing of tar and zip files.
1495 v74: * bugfix (vim, then :Explore) now works
1496 * ctrl-L keeps cursor at same screen location (both local and
1497 remote browsing)
1498 * netrw now can read remote zip and tar files
1499 * Obtain now uses WinXP ftp+.netrc successfully
1500 v73: * bugfix -- scp://host/path/file was getting named incorrectly
1501 * netrw detects use of earlier-than-7.0 version of vim and issues
1502 a pertinent error message.
1503 * netrwSettings.vim is now uses autoloading. Only
1504 <netrwPlugin.vim> is needed as a pure plugin
1505 (ie. always loaded).
1506 v72: * bugfix -- formerly, one could prevent the loading of netrw
1507 by "let g:loaded_netrw=1"; when autoloading became supported,
1508 this feature was lost. It is now restored.
1509 v71: * bugfix -- made some "set nomodifiable"s into setlocal variants
1510 (allows :e somenewfile to be modifiable as usual)
1511 * NetrwSettings calls a netrw function, thereby assuring that
1512 netrw has loaded. However, if netrw does not load for whatever
1513 reason, then NetrwSettings will now issue a warning message.
1514 * For what reason I don't recall, when wget and fetch are both
1515 not present, and an attempt to read a http://... url is made,
1516 netrw exited. It now only returns.
1517 * When ch=1, on the second and subsequent uses of browsing Netrw
1518 would issue a blank line to clear the echo'd messages. This
1519 caused an annoying "Hit-Enter" prompt; now a blank line message
1520 is echo'd only if &ch>1.
1521 v70: * when using |netrw-O|, the "Obtaining filename" message is now
1522 shown using |hl-User9|. If User9 has not been defined, netrw
1523 will define it.
1524 v69: * Bugfix: win95/98 machines were experiencing a
1525 "E121: Undefined variable: g:netrw_win95ftp" message
1526 v68: * double-click-leftmouse selects word under mouse
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00001527 v67: * Passwords which contain blanks will now be surrounded by
1528 double-quotes automatically (Yongwei)
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001529 v66: * Netrw now seems to work with a few more Windows situations
1530 * O now obtains a file: remote browsing file -> local copy,
1531 locally browsing file -> current directory (see :pwd)
1532 * i now cycles between thin, long, and wide listing styles
1533 * NB and Nb are maps that are always available; corresponding
1534 B and b maps are only available when not using wide listing
1535 in order to allow them to be used for motions
1536 v65: * Browser functions now use NetOptionSave/Restore; in particular,
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001537 netrw now works around the report setting
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001538 v64: * Bugfix - browsing a "/" directory (Unix) yielded buffers
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001539 named "[Scratch]" instead of "/"
1540 * Bugfix - remote browsing with ftp was omitting the ./ and ../
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001541 v63: * netrw now takes advantage of autoload (and requires 7.0)
1542 * Bugfix - using r (to reverse sort) working again
1543 v62: * Bugfix - spaces allowed again in directory names with
1544 g:netrw_keepdir=0. In fact, I've tested netrw (again)
1545 with most ANSI punctuation marks for directory names.
1546 * Bugfix - NetrwSettings gave errors when g:netrw_silent
1547 had not be set.
Bram Moolenaar90cfdbe2005-08-12 19:59:19 +00001548 v61: * document upgrade -- netrw variable-based settings all should
1549 have tags. Supports NetrwSettings command.
1550 * several important variables are window-oriented. Netrw has
1551 to transfer these across a window split. See s:BufWinVars()
1552 and s:UseBufWinVars().
Bram Moolenaar488c6512005-08-11 20:09:58 +00001553 v60: * when using the i map to switch between long and short listings,
1554 netrw will now keep cursor on same line
1555 * "Match # of #" now uses status line
1556 * :Explore **/*.c will now work from a non-netrw-browser window
1557 * :Explore **/patterns can now be run in separate browser windows
1558 * active banner (hit <cr> will cause various things to happen)
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001559 v59: * bugfix -- another keepalt work-around installed (for vim6.3)
1560 * "Match # of #" for Explore **/pattern matches
Bram Moolenaar572cb562005-08-05 21:35:02 +00001561 v58: * Explore and relatives can now handle **/somefilepattern (v7)
1562 * Nexplore and Pexplore introduced (v7). shift-down and shift-up
1563 cursor keys will invoke Nexplore and Pexplore, respectively.
1564 * bug fixed with o and v
1565 * autochdir only worked around for vim when it has been
1566 compiled with either |+netbeans_intg| or |+sun_workshop|
1567 * Under Windows, all directories and files were being preceded
1568 with a "/" when local browsing. Fixed.
1569 * When: syntax highlighting is off, laststatus=2, and remote
1570 browsing is used, sometimes the laststatus highlighting
1571 bleeds into the entire display. Work around - do an extra
1572 redraw in that case.
1573 * Bugfix: when g:netrw_keepdir=0, due to re-use of buffers,
1574 netrw didn't change the directory when it should've
1575 * Bugfix: D and R commands work again
Bram Moolenaar1d94f9b2005-08-04 21:29:45 +00001576 v57: * Explore and relatives can now handle RO files
1577 * reverse sort restored with vim7's sort command
1578 * g:netrw_keepdir now being used to keep the current directory
1579 unchanged as intended (sense change)
1580 * vim 6.3 still supported
Bram Moolenaar83bab712005-08-01 21:58:57 +00001581 v56: * LocalBrowse now saves autochdir setting, unsets it, and
1582 restores it before returning.
1583 * using vim's rename() instead of system + local_rename variable
Bram Moolenaar1d94f9b2005-08-04 21:29:45 +00001584 * avoids changing directory when g:netrw_keepdir is false
Bram Moolenaar83bab712005-08-01 21:58:57 +00001585 v55: * -bar used with :Explore :Sexplore etc to allow multiple
1586 commands to be separated by |s
1587 * browser listings now use the "nowrap" option
1588 * browser: some unuseful error messages now suppressed
1589 v54: * For backwards compatibility, Explore and Sexplore have been
1590 implemented. In addition, Hexplore and Vexplore commands
1591 are available, too.
1592 * <amatch> used instead of <afile> in the transparency
1593 support (BufReadCmd, FileReadCmd, FileWriteCmd)
1594 * ***netrw*** prepended to various error messages netrw may emit
1595 * g:netrw_port used instead of b:netrw_port for scp
1596 * any leading [:#] is removed from port numbers
1597 v53: * backslashes as well as slashes placed in various patterns
1598 (ex. g:netrw_sort_sequence) to better support Windows
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001599 v52: * nonumber'ing now set for browsing buffers
1600 * when the hiding list hid all files, error messages ensued. Fixed
1601 * when browsing, swf is set, but directory is not set, when netrw
1602 was attempting to restore options, vim wanted to save a swapfile
1603 to a local directory using an url-style path. Fixed
1604 v51: * cygwin detection now automated (using windows and &shell is bash)
1605 * customizable browser "file" rejection patterns
1606 * directory history
1607 * :[range]w url now supported (ie. netrw has a FileWriteCmd event)
1608 * error messages have a "Press <cr> to continue" to allow them
1609 to be seen
1610 * directory browser displays no longer bother the swapfile
1611 * u/U commands to go up and down the history stack
1612 * history stack may be saved with viminfo with its "!" option
1613 * bugfixes associated with unwanted [No Files] entries
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001614 v50: * directories now displayed using buftype=nofile; should keep the
1615 directory names as-is
1616 * attempts to remove empty "[No File]" buffers leftover
1617 from :file ..name.. commands
1618 * bugfix: a "caps-lock" editing difficulty left in v49 was fixed
1619 * syntax highlighting for "Showing:" the hiding list included
1620 * bookmarks can now be retained if "!" is in the viminfo option
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001621 v49: * will use ftp for http://.../ browsing v48:
1622 * One may use ftp to do remote host file browsing
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001623 * (windows and !cygwin) remote browsing with ftp can now use
1624 the "dir" command internally to provide listings
1625 * g:netrw_keepdir now allows one to keep the initial current
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001626 directory as the current directory (normally the local file
1627 browser makes the currently viewed directory the current
1628 directory)
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001629 * g:netrw_alto and g:netrw_altv now support alternate placement
1630 of windows started with o or v
1631 * Nread ? and Nwrite ? now uses echomsg (instead of echo) so
1632 :messages can repeat showing the help
1633 * bugfix: avoids problems with partial matches of directory names
1634 to prior buffers with longer names
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001635 * one can suppress error messages with g:netrw_quiet ctrl-h used
1636 * instead of <Leader>h for editing hiding list one may edit the
1637 * sorting sequence with the S map now allows confirmation of
1638 * deletion with [y(es) n(o) a(ll) q(uit)] the "x" map now handles
1639 * special file viewing with:
1640 (windows) rundll32 url.dll (gnome) gnome-open (kde)
1641 kfmclient If none of these are on the executable path, then
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001642 netrwFileHandlers.vim is used.
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001643 * directory bookmarking during both local and remote browsing
1644 implemented
1645 * one may view all, use the hiding list to suppress, or use the
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001646 hiding list to show-only remote and local file/directory
1647 listings
1648 * improved unusual file and directory name handling preview
1649 * window support
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001650 v47: * now handles local directory browsing.
1651 v46: * now handles remote directory browsing
1652 * g:netrw_silent (if 1) will cause all transfers to be silent
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001653 v45: * made the [user@]hostname:path form a bit more restrictive to
1654 better handle errors in using protocols (e.g. scp:usr@host:file
1655 was being recognized as an rcp request) v44: * changed from
1656 "rsync -a" to just "rsync"
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001657 * somehow an editing error messed up the test to recognize
1658 use of the fetch method for NetRead.
1659 * more debugging statements included
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001660 v43: * moved "Explanation" comments to <pi_netrw.txt> help file as
1661 "Network Reference" (|netrw-ref|)
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001662 * <netrw.vim> now uses Dfunc() Decho() and Dret() for debugging
1663 * removed superfluous NetRestorePosn() calls
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001664 v42: * now does BufReadPre and BufReadPost events on file:///* and
1665 file://localhost/* v41: * installed file:///* and
1666 file://localhost/* handling v40: * prevents redraw when a
1667 protocol error occurs so that the user may see it v39: * sftp
1668 support v38: * Now uses NetRestorePosn() calls with
1669 Nread/Nwrite commands
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001670 * Temporary files now removed via bwipe! instead of bwipe
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001671 (thanks to Dave Roberts) v37: * Claar's modifications which
1672 test if ftp is successful, otherwise give an error message
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001673 * After a read, the alternate file was pointing to the temp file.
1674 The temp file buffer is now wiped out.
1675 * removed silent from transfer methods so user can see what's
1676 happening
Bram Moolenaar071d4272004-06-13 20:20:40 +00001677
1678
1679==============================================================================
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000168011. Credits *netrw-credits* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00001681
1682 Vim editor by Bram Moolenaar (Thanks, Bram!)
1683 dav support by C Campbell
1684 fetch support by Bram Moolenaar and C Campbell
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00001685 ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM>
Bram Moolenaar071d4272004-06-13 20:20:40 +00001686 http support by Bram Moolenaar <bram@moolenaar.net>
1687 rcp
1688 rsync support by C Campbell (suggested by Erik Warendorph)
1689 scp support by raf <raf@comdyn.com.au>
1690 sftp support by C Campbell
1691
1692 inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell
1693
1694 Jérôme Augé -- also using new buffer method with ftp+.netrc
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00001695 Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use,
1696 fetch,...
Bram Moolenaar071d4272004-06-13 20:20:40 +00001697 Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution
1698 Erik Warendorph -- for several suggestions (g:netrw_..._cmd
1699 variables, rsync etc)
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00001700 Doug Claar -- modifications to test for success with ftp
1701 operation
Bram Moolenaar071d4272004-06-13 20:20:40 +00001702
1703==============================================================================
Bram Moolenaar83bab712005-08-01 21:58:57 +00001704 vim:tw=78:ts=8:ft=help:norl:fdm=marker