blob: d5821de11be370a3ec84b11487e1c2065bceafde [file] [log] [blame]
Bram Moolenaar9964e462007-05-05 17:54:07 +00001*pi_netrw.txt* For Vim version 7.1a. Last change: 2007 May 05
Bram Moolenaar071d4272004-06-13 20:20:40 +00002
Bram Moolenaar9964e462007-05-05 17:54:07 +00003 -----------------------------------------------------
4 NETRW REFERENCE MANUAL by Charles E. Campbell, Jr.
5 -----------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +00006
Bram Moolenaar1afcace2005-11-25 19:54:28 +00007
Bram Moolenaar9964e462007-05-05 17:54:07 +00008*dav* *http* *network* *Nwrite* *netrw-file*
9*fetch* *netrw* *Nread* *rcp* *scp*
10*ftp* *netrw.vim* *Nsource* *rsync* *sftp*
Bram Moolenaar071d4272004-06-13 20:20:40 +000011
12==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000131. Contents *netrw-contents*
Bram Moolenaar071d4272004-06-13 20:20:40 +000014
Bram Moolenaar9964e462007-05-05 17:54:07 +0000151. Contents.............................................|netrw-contents|
162. Starting With Netrw..................................|netrw-start|
173. Netrw Reference......................................|netrw-ref|
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +000018 CONTROLLING EXTERNAL APPLICATIONS..................|netrw-externapp|
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000019 READING............................................|netrw-read|
20 WRITING............................................|netrw-write|
21 DIRECTORY LISTING..................................|netrw-dirlist|
22 CHANGING THE USERID AND PASSWORD...................|netrw-chgup|
23 VARIABLES..........................................|netrw-variables|
24 PATHS..............................................|netrw-path|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000254. Network-Oriented File Transfer.......................|netrw-xfer|
Bram Moolenaar83bab712005-08-01 21:58:57 +000026 NETRC..............................................|netrw-netrc|
27 PASSWORD...........................................|netrw-passwd|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000285. Activation...........................................|netrw-activate|
296. Transparent File Transfer............................|netrw-transparent|
307. Ex Commands..........................................|netrw-ex|
318. Variables and Options................................|netrw-var|
329. Directory Browsing...................................|netrw-browse| {{{1
Bram Moolenaar83bab712005-08-01 21:58:57 +000033 Maps...............................................|netrw-maps|
34 Exploring..........................................|netrw-explore-cmds|
35 Quick Reference Commands Table.....................|netrw-browse-cmds|
36 Netrw Browser Variables............................|netrw-browse-var|
37 Introduction To Directory Browsing.................|netrw-browse-intro|
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +000038 Netrw Browsing And Option Incompatibilities........|netrw-incompatible|
Bram Moolenaar83bab712005-08-01 21:58:57 +000039 Directory Exploring Commands.......................|netrw-explore|
40 Refreshing The Listing.............................|netrw-ctrl-l|
41 Going Up...........................................|netrw--|
42 Browsing...........................................|netrw-cr|
Bram Moolenaar578b49e2005-09-10 19:22:57 +000043 Obtaining A File...................................|netrw-O|
Bram Moolenaar9964e462007-05-05 17:54:07 +000044 Change Listing Style...............................|netrw-i|
Bram Moolenaar83bab712005-08-01 21:58:57 +000045 Making A New Directory.............................|netrw-d|
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +000046 Deleting Files Or Directories......................|netrw-D|
Bram Moolenaar83bab712005-08-01 21:58:57 +000047 Renaming Files Or Directories......................|netrw-move|
Bram Moolenaar482aaeb2005-09-29 18:26:07 +000048 Hiding Files Or Directories........................|netrw-a|
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +000049 Edit File Or Directory Hiding List.................|netrw-ctrl-h|
Bram Moolenaar83bab712005-08-01 21:58:57 +000050 Browsing With A Horizontally Split Window..........|netrw-o|
Bram Moolenaar9964e462007-05-05 17:54:07 +000051 Browsing With A Vertically Split Window............|netrw-v|
52 Browsing With A New Tab............................|netrw-t|
Bram Moolenaar83bab712005-08-01 21:58:57 +000053 Preview Window.....................................|netrw-p|
54 Selecting Sorting Style............................|netrw-s|
55 Editing The Sorting Sequence.......................|netrw-S|
56 Reversing Sorting Order............................|netrw-r|
57 Changing To A Predecessor Directory................|netrw-u|
58 Changing To A Successor Directory..................|netrw-U|
Bram Moolenaar83bab712005-08-01 21:58:57 +000059 Customizing Browsing With A User Function..........|netrw-x|
60 Making The Browsing Directory The Current Directory|netrw-c|
Bram Moolenaar9964e462007-05-05 17:54:07 +000061 Bookmarking A Directory............................|netrw-mb|
62 Changing To A Bookmarked Directory.................|netrw-gb|
Bram Moolenaar83bab712005-08-01 21:58:57 +000063 Listing Bookmarks And History......................|netrw-q|
Bram Moolenaar578b49e2005-09-10 19:22:57 +000064 Improving Directory Browsing.......................|netrw-listhack| }}}1
Bram Moolenaar9964e462007-05-05 17:54:07 +00006510. Problems and Fixes...................................|netrw-problems|
6611. Debugging............................................|netrw-debug|
6712. History..............................................|netrw-history|
6813. Credits..............................................|netrw-credits|
Bram Moolenaar071d4272004-06-13 20:20:40 +000069
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000070The Netrw plugin is generally sourced automatically as it is a
71|standard-plugin|. That said, to make use of netrw, one must
72have plugins available which can be done with the following
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +000073two lines in your <.vimrc>: >
Bram Moolenaar071d4272004-06-13 20:20:40 +000074
Bram Moolenaar9964e462007-05-05 17:54:07 +000075 set nocp " 'compatible' is not set
76 filetype plugin on " plugins are enabled
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +000077<
Bram Moolenaar071d4272004-06-13 20:20:40 +000078You can avoid loading this plugin by setting the "loaded_netrw" variable
79in your <.vimrc> file: >
80
81 :let loaded_netrw = 1
82
83{Vi does not have any of this}
84
85==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000862. Starting With Netrw *netrw-start*
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +000087
88Netrw makes reading, writing, and browsing over a network connection easy!
89First, make sure that you have plugins enabled, so you'll need to have at
90least the following in your <.vimrc>: (or see |netrw-activate|) >
91
Bram Moolenaar9964e462007-05-05 17:54:07 +000092 set nocp " 'compatible' is not set
93 filetype plugin on " plugins are enabled
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +000094<
95(see |'cp'| and |:filetype-plugin-on|)
96
97Netrw supports "transparent" editing of files on other machines using urls
98(see |netrw-transparent|). As an example of this, let's assume you have an
99account on some other machine; try >
100
101 vim scp://hostname/path/to/file
102<
103if you have an ssh connection. Want to make ssh/scp easier to use? Check
104out |netrw-listhack|!
105
106What if you have ftp, not ssh/scp? That's easy, too; try >
107
108 vim ftp://hostname/path/to/file
109<
110Want to make ftp simpler to use? See if your ftp supports a file called
111<.netrc> -- typically it goes in your home directory, has read/write
112permissions for only the user to read (ie. not group, world, other, etc),
113and has lines resembling >
114
115 machine HOSTNAME login USERID password "PASSWORD"
116 machine HOSTNAME login USERID password "PASSWORD"
117 ...
Bram Moolenaar9964e462007-05-05 17:54:07 +0000118 default login USERID password "PASSWORD"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000119<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000120Now about browsing -- ie. when you just want to look around before editing a
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000121file. For browsing on your current host, just "edit" a directory: >
122
123 vim .
124 vim /home/userid/path
125<
126For browsing on a remote host, "edit" a directory (but make sure that
127the directory name is followed by a "/"): >
128
129 vim scp://hostname/
130 vim ftp://hostname/path/to/dir/
131<
132See |netrw-browse| for more!
133
134There's more protocols supported than scp and ftp, too: see the next
135section, |netrw-externapp|.
136
137==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +00001383. Netrw Reference *netrw-ref*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000139
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000140CONTROLLING EXTERNAL APPLICATIONS *netrw-externapp*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000141
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000142 Protocol Variable Default Value
143 -------- ---------------- -------------
144 dav: *g:netrw_dav_cmd* = "cadaver"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000145 fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000146 ftp: *g:netrw_ftp_cmd* = "ftp"
Bram Moolenaar9964e462007-05-05 17:54:07 +0000147 http: *g:netrw_http_cmd* = "curl -o" if curl is available
148 http: g:netrw_http_cmd = "wget -q -O" else if wget is available
149 http: g:netrw_http_cmd = "fetch -o" else if fetch is available
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000150 rcp: *g:netrw_rcp_cmd* = "rcp"
151 rsync: *g:netrw_rsync_cmd* = "rsync -a"
152 scp: *g:netrw_scp_cmd* = "scp -q"
153 sftp: *g:netrw_sftp_cmd* = "sftp"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000154
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000155READING *netrw-read* *netrw-nread*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000156 :Nread ? give help
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000157 :Nread "machine:path" uses rcp
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000158 :Nread "machine path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000159 :Nread "machine id password path" uses ftp
160 :Nread "dav://machine[:port]/path" uses cadaver
161 :Nread "fetch://[user@]machine/path" uses fetch
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000162 :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000163 :Nread "http://[user@]machine/path" uses http uses wget
164 :Nread "rcp://[user@]machine/path" uses rcp
165 :Nread "rsync://[user@]machine[:port]/path" uses rsync
166 :Nread "scp://[user@]machine[[:#]port]/path" uses scp
167 :Nread "sftp://[user@]machine/path" uses sftp
Bram Moolenaar071d4272004-06-13 20:20:40 +0000168
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000169WRITING *netrw-write* *netrw-nwrite*
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000170 :Nwrite ? give help
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000171 :Nwrite "machine:path" uses rcp
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000172 :Nwrite "machine path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000173 :Nwrite "machine id password path" uses ftp
174 :Nwrite "dav://machine[:port]/path" uses cadaver
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000175 :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000176 :Nwrite "rcp://[user@]machine/path" uses rcp
177 :Nwrite "rsync://[user@]machine[:port]/path" uses rsync
178 :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp
179 :Nwrite "sftp://[user@]machine/path" uses sftp
Bram Moolenaar071d4272004-06-13 20:20:40 +0000180 http: not supported!
181
Bram Moolenaar9964e462007-05-05 17:54:07 +0000182SOURCING *netrw-source*
183 :Nsource ? give help
184 :Nsource "dav://machine[:port]/path" uses cadaver
185 :Nsource "fetch://[user@]machine/path" uses fetch
186 :Nsource "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
187 :Nsource "http://[user@]machine/path" uses http uses wget
188 :Nsource "rcp://[user@]machine/path" uses rcp
189 :Nsource "rsync://[user@]machine[:port]/path" uses rsync
190 :Nsource "scp://[user@]machine[[:#]port]/path" uses scp
191 :Nsource "sftp://[user@]machine/path" uses sftp
192
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000193DIRECTORY LISTING *netrw-dirlist*
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000194 :Nread [protocol]://[user]@hostname/path/
195
Bram Moolenaar9964e462007-05-05 17:54:07 +0000196 *netrw-login* *netrw-password*
197 CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000198 Attempts to use ftp will prompt you for a user-id and a password.
199 These will be saved in g:netrw_uid and g:netrw_passwd Subsequent uses
200 of ftp will re-use those. If you need to use a different user id
201 and/or password, you'll want to call NetUserPass() first.
202
203 :NetUserPass [uid [password]] -- prompts as needed
204 :call NetUserPass() -- prompts for uid and password
205 :call NetUserPass("uid") -- prompts for password
206 :call NetUserPass("uid","password") -- sets global uid and password
207
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000208VARIABLES *netrw-variables*
Bram Moolenaar9964e462007-05-05 17:54:07 +0000209
210(see also: |netrw-browse-var| |netrw-protocol| |netrw-settings| |netrw-var|)
211
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000212 *b:netrw_lastfile* last file Network-read/written retained on a per-buffer
213 basis (supports plain :Nw )
Bram Moolenaar071d4272004-06-13 20:20:40 +0000214
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000215 *g:netrw_ftp* if it doesn't exist, use default ftp
216 =0 use default ftp (uid password)
217 =1 use alternate ftp method (user uid password)
218 If you're having trouble with ftp, try changing the
219 value of this variable to see if the alternate ftp
220 method works for your setup.
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000221
Bram Moolenaar9964e462007-05-05 17:54:07 +0000222 *g:netrw_extracmd* default: doesn't exist
223 If this variable exists, then any string it contains
224 will be placed into the commands set to your ftp
225 client. As an example:
226 ="passive"
227
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000228 *g:netrw_ftpmode* ="binary" (default)
229 ="ascii"
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000230
Bram Moolenaar9964e462007-05-05 17:54:07 +0000231 *g:netrw_ignorenetrc* =0 (default for linux, cygwin)
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000232 =1 If you have a <.netrc> file but it doesn't work and
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000233 you want it ignored, then set this variable as shown.
Bram Moolenaar9964e462007-05-05 17:54:07 +0000234 (default for Windows + cmd.exe)
235
236 *g:netrw_menu* =0 disable netrw's menu
237 =1 (default) netrw's menu enabled
238
239 *g:netrw_nogx* if this variable exists, then the "gx" map will not
240 be available (see |netrw-gx|)
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000241
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000242 *g:netrw_uid* (ftp) user-id, retained on a per-session basis
243 *g:netrw_passwd* (ftp) password, retained on a per-session basis
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000244
Bram Moolenaar9964e462007-05-05 17:54:07 +0000245 *g:netrw_shq* = "'" for Unix/Linux systems (ie. a single quote)
246 = "'" for Windows + cygwin systems (ie. a single quote)
247 = '"' for Windows systems, not using cygwin
248 (ie. a double quote)
249 Controls the quoting character used during scp and ftp
250 commands.
251
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000252 *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank
253 lines that o/s's ftp "provides" on transfers
254 =0 force normal ftp behavior (no trailing line removal)
255
256 *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also
257 permits network browsing to use ls with time and
258 size sorting (default if windows)
259 =0 assume Windows' scp accepts windows-style paths
260 Network browsing uses dir instead of ls
261 This option is ignored if you're using unix
262
263 *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP
Bram Moolenaar9964e462007-05-05 17:54:07 +0000264 =1 use WinNT's rcp in binary mode (default)
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000265
266PATHS *netrw-path*
267
268Paths to files are generally user-directory relative for most protocols.
269It is possible that some protocol will make paths relative to some
270associated directory, however.
271>
272 example: vim scp://user@host/somefile
273 example: vim scp://user@host/subdir1/subdir2/somefile
274<
275where "somefile" is the "user"'s home directory. If you wish to get a
276file using root-relative paths, use the full path:
277>
278 example: vim scp://user@host//somefile
279 example: vim scp://user@host//subdir1/subdir2/somefile
280<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000281
282==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +00002834. Network-Oriented File Transfer *netrw-xfer*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000284
285Network-oriented file transfer under Vim is implemented by a VimL-based script
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000286(<netrw.vim>) using plugin techniques. It currently supports both reading and
287writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch,
Bram Moolenaar071d4272004-06-13 20:20:40 +0000288dav/cadaver, rsync, or sftp.
289
290http is currently supported read-only via use of wget or fetch.
291
292<netrw.vim> is a standard plugin which acts as glue between Vim and the
293various file transfer programs. It uses autocommand events (BufReadCmd,
294FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. >
295
296 ex. vim ftp://hostname/path/to/file
297<
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000298The characters preceding the colon specify the protocol to use; in the
299example, its ftp. The <netrw.vim> script then formulates a command or a
300series of commands (typically ftp) which it issues to an external program
301(ftp, scp, etc) which does the actual file transfer/protocol. Files are read
302from/written to a temporary file (under Unix/Linux, /tmp/...) which the
303<netrw.vim> script will clean up.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000304
Bram Moolenaar9964e462007-05-05 17:54:07 +0000305 *netrw-putty* *netrw-pscp* *netrw-psftp*
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000306One may modify any protocol's implementing external application by setting a
307variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000308"scp -q"). As an example, consider using PuTTY: >
Bram Moolenaar9964e462007-05-05 17:54:07 +0000309
310 let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch'
311 let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"'
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000312<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000313See |netrw-p8| for more about putty, pscp, psftp, etc.
314
Bram Moolenaar071d4272004-06-13 20:20:40 +0000315Ftp, an old protocol, seems to be blessed by numerous implementations.
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000316Unfortunately, some implementations are noisy (ie., add junk to the end of the
317file). Thus, concerned users may decide to write a NetReadFixup() function
318that will clean up after reading with their ftp. Some Unix systems (ie.,
319FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is
320not noisy and more convenient, actually, for <netrw.vim> to use.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000321Consequently, if "fetch" is executable, it will be used to do reads for
322ftp://... (and http://...) . See |netrw-var| for more about this.
323
324For rcp, scp, sftp, and http, one may use network-oriented file transfers
Bram Moolenaar83bab712005-08-01 21:58:57 +0000325transparently; ie.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000326>
327 vim rcp://[user@]machine/path
328 vim scp://[user@]machine/path
329<
330If your ftp supports <.netrc>, then it too can be just as transparently used
331if the needed triad of machine name, user id, and password are present in
332that file. Your ftp must be able to use the <.netrc> file on its own, however.
333>
334 vim ftp://[user@]machine[[:#]portnumber]/path
335<
336However, ftp will often need to query the user for the userid and password.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000337The latter will be done "silently"; ie. asterisks will show up instead of
Bram Moolenaar071d4272004-06-13 20:20:40 +0000338the actually-typed-in password. Netrw will retain the userid and password
339for subsequent read/writes from the most recent transfer so subsequent
340transfers (read/write) to or from that machine will take place without
341additional prompting.
342
343 *netrw-urls*
344 +=================================+============================+============+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000345 | Reading | Writing | Uses |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000346 +=================================+============================+============+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000347 | DAV: | | |
348 | dav://host/path | | cadaver |
349 | :Nread dav://host/path | :Nwrite dav://host/path | cadaver |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000350 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000351 | FETCH: | | |
352 | fetch://[user@]host/path | | |
353 | fetch://[user@]host:http/path | Not Available | fetch |
354 | :Nread fetch://[user@]host/path| | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000355 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000356 | FILE: | | |
357 | file:///* | file:///* | |
358 | file://localhost/* | file://localhost/* | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000359 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000360 | FTP: (*3) | (*3) | |
361 | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) |
362 | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc |
363 | :Nread host path | :Nwrite host path | ftp+.netrc |
364 | :Nread host uid pass path | :Nwrite host uid pass path | ftp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000365 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000366 | HTTP: wget is executable: (*4) | | |
367 | http://[user@]host/path | Not Available | wget |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000368 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000369 | HTTP: fetch is executable (*4) | | |
370 | http://[user@]host/path | Not Available | fetch |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000371 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000372 | RCP: | | |
373 | rcp://[user@]host/path | rcp://[user@]host/path | rcp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000374 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000375 | RSYNC: | | |
376 | rsync://[user@]host/path | rsync://[user@]host/path | rsync |
377 | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync |
378 | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000379 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000380 | SCP: | | |
381 | scp://[user@]host/path | scp://[user@]host/path | scp |
382 | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000383 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000384 | SFTP: | | |
385 | sftp://[user@]host/path | sftp://[user@]host/path | sftp |
386 | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000387 +=================================+============================+============+
388
389 (*1) For an absolute path use scp://machine//path.
390
391 (*2) if <.netrc> is present, it is assumed that it will
392 work with your ftp client. Otherwise the script will
Bram Moolenaar9964e462007-05-05 17:54:07 +0000393 prompt for user-id and password.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000394
Bram Moolenaar9964e462007-05-05 17:54:07 +0000395 (*3) for ftp, "machine" may be machine#port or machine:port
Bram Moolenaar071d4272004-06-13 20:20:40 +0000396 if a different port is needed than the standard ftp port
397
398 (*4) for http:..., if wget is available it will be used. Otherwise,
399 if fetch is available it will be used.
400
401Both the :Nread and the :Nwrite ex-commands can accept multiple filenames.
402
403
404NETRC *netrw-netrc*
405
406The typical syntax for lines in a <.netrc> file is given as shown below.
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000407Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000408>
409 machine {full machine name} login {user-id} password "{password}"
410 default login {user-id} password "{password}"
411
412Your ftp client must handle the use of <.netrc> on its own, but if the
413<.netrc> file exists, an ftp transfer will not ask for the user-id or
414password.
415
416 Note:
417 Since this file contains passwords, make very sure nobody else can
418 read this file! Most programs will refuse to use a .netrc that is
419 readable for others. Don't forget that the system administrator can
420 still read the file!
421
422
423PASSWORD *netrw-passwd*
424
425The script attempts to get passwords for ftp invisibly using |inputsecret()|,
426a built-in Vim function. See |netrw-uidpass| for how to change the password
427after one has set it.
428
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000429Unfortunately there doesn't appear to be a way for netrw to feed a password to
430scp. Thus every transfer via scp will require re-entry of the password.
431However, |netrw-listhack| can help with this problem.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000432
433
434==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +00004355. Activation *netrw-activate*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000436
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000437Network-oriented file transfers are available by default whenever Vim's
Bram Moolenaar071d4272004-06-13 20:20:40 +0000438|'nocompatible'| mode is enabled. The <netrw.vim> file resides in your
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000439system's vim-plugin directory and is sourced automatically whenever you bring
440up vim. I suggest that, at a minimum, you have at least the following in your
441<.vimrc> customization file: >
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000442
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000443 set nocp
444 if version >= 600
445 filetype plugin indent on
446 endif
447<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000448
449==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +00004506. Transparent File Transfer *netrw-transparent*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000451
452Transparent file transfers occur whenever a regular file read or write
453(invoked via an |:autocmd| for |BufReadCmd| or |BufWriteCmd| events) is made.
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000454Thus one may use files across networks just as simply as if they were local. >
Bram Moolenaar071d4272004-06-13 20:20:40 +0000455
456 vim ftp://[user@]machine/path
457 ...
458 :wq
459
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000460See |netrw-activate| for more on how to encourage your vim to use plugins
461such as netrw.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000462
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000463
Bram Moolenaar071d4272004-06-13 20:20:40 +0000464==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +00004657. Ex Commands *netrw-ex*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000466
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000467The usual read/write commands are supported. There are also a few
468additional commands available. Often you won't need to use Nw or
Bram Moolenaar9964e462007-05-05 17:54:07 +0000469Nread as shown in |netrw-transparent| (ie. simply use >
470 :e url
471 :r url
472 :w url
473instead, as appropriate) -- see |netrw-urls|. In the explanations
474below, a {netfile} is an url to a remote file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000475
476:[range]Nw Write the specified lines to the current
477 file as specified in b:netrw_lastfile.
478
479:[range]Nw {netfile} [{netfile}]...
480 Write the specified lines to the {netfile}.
481
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000482:Nread Read the specified lines into the current
Bram Moolenaar071d4272004-06-13 20:20:40 +0000483 buffer from the file specified in
484 b:netrw_lastfile.
485
486:Nread {netfile} {netfile}...
487 Read the {netfile} after the current line.
488
Bram Moolenaar9964e462007-05-05 17:54:07 +0000489:Nsource {netfile}
490 Source the {netfile}.
491 To start up vim using a remote .vimrc, one may use
492 the following (all on one line) (tnx to Antoine Mechelynck) >
493 vim -u NORC -N
494 --cmd "runtime plugin/netrwPlugin.vim"
495 --cmd "source scp://HOSTNAME/.vimrc"
496< *netrw-uidpass*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000497:call NetUserPass()
498 If b:netrw_uid and b:netrw_passwd don't exist,
499 this function query the user for them.
500
501:call NetUserPass("userid")
502 This call will set the b:netrw_uid and, if
503 the password doesn't exist, will query the user for it.
504
505:call NetUserPass("userid","passwd")
506 This call will set both the b:netrw_uid and b:netrw_passwd.
507 The user-id and password are used by ftp transfers. One may
508 effectively remove the user-id and password by using ""
509 strings.
510
Bram Moolenaar9964e462007-05-05 17:54:07 +0000511:NetrwSettings This command is described in |netrw-settings| -- used to
512 display netrw settings and change netrw behavior.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000513
Bram Moolenaar071d4272004-06-13 20:20:40 +0000514
515==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +00005168. Variables and Options *netrw-options* *netrw-var*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000517
Bram Moolenaar9964e462007-05-05 17:54:07 +0000518The <netrw.vim> script provides several variables which act as options to
519ffect <netrw.vim>'s behavior. These variables typically may be set in the
520user's <.vimrc> file:
521(see also: |netrw-settings| |netrw-browse-var| |netrw-protocol|
522|netrw-settings|) >
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000523
Bram Moolenaar9964e462007-05-05 17:54:07 +0000524 -------------
525 Netrw Options
526 -------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000527 Option Meaning
528 -------------- -----------------------------------------------
529<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000530 b:netrw_col Holds current cursor position (during NetWrite)
531 g:netrw_cygwin =1 assume scp under windows is from cygwin
532 (default/windows)
533 =0 assume scp under windows accepts windows
534 style paths (default/else)
535 g:netrw_ftp =0 use default ftp (uid password)
536 g:netrw_ftpmode ="binary" (default)
537 ="ascii" (your choice)
538 g:netrw_ignorenetrc =1 (default)
539 if you have a <.netrc> file but you don't
Bram Moolenaar071d4272004-06-13 20:20:40 +0000540 want it used, then set this variable. Its
541 mere existence is enough to cause <.netrc>
542 to be ignored.
Bram Moolenaar9964e462007-05-05 17:54:07 +0000543 b:netrw_lastfile Holds latest method/machine/path.
544 b:netrw_line Holds current line number (during NetWrite)
545 g:netrw_passwd Holds current password for ftp.
546 g:netrw_silent =0 transfers done normally
547 =1 transfers done silently
548 g:netrw_uid Holds current user-id for ftp.
549 =1 use alternate ftp (user uid password)
550 (see |netrw-options|)
551 g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
552 =1 use WinNT/2K/XP's rcp, binary mode
553 g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc
554 =1 use default method to do ftp >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000555 -----------------------------------------------------------------------
556<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000557The script will also make use of the following variables internally, albeit
558temporarily.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000559>
560 -------------------
561 Temporary Variables
562 -------------------
563 Variable Meaning
564 -------- ------------------------------------
565<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000566 g:netrw_method Index indicating rcp/ftp+.netrc/ftp
567 g:netrw_machine Holds machine name parsed from input
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000568 g:netrw_fname Holds filename being accessed >
569 ------------------------------------------------------------
570<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000571 *netrw-protocol*
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000572
573Netrw supports a number of protocols. These protocols are invoked using the
574variables listed below, and may be modified by the user.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000575>
576 ------------------------
Bram Moolenaar9964e462007-05-05 17:54:07 +0000577 Protocol Control Options
Bram Moolenaar071d4272004-06-13 20:20:40 +0000578 ------------------------
Bram Moolenaar9964e462007-05-05 17:54:07 +0000579 Option Type Setting Meaning
580 --------- -------- -------------- ---------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000581<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000582 netrw_ftp variable =doesn't exist userid set by "user userid"
583 =0 userid set by "user userid"
584 =1 userid set by "userid"
585 NetReadFixup function =doesn't exist no change
586 =exists Allows user to have files
587 read via ftp automatically
588 transformed however they wish
589 by NetReadFixup()
Bram Moolenaar071d4272004-06-13 20:20:40 +0000590 g:netrw_dav_cmd variable ="cadaver"
Bram Moolenaar9964e462007-05-05 17:54:07 +0000591 g:netrw_fetch_cmd variable ="fetch -o" if fetch is available
Bram Moolenaar071d4272004-06-13 20:20:40 +0000592 g:netrw_ftp_cmd variable ="ftp"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000593 g:netrw_http_cmd variable ="fetch -o" if fetch is available
594 g:netrw_http_cmd variable ="wget -O" else if wget is available
Bram Moolenaar9964e462007-05-05 17:54:07 +0000595 g:netrw_list_cmd variable ="ssh USEPORT HOSTNAME ls -Fa"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000596 g:netrw_rcp_cmd variable ="rcp"
597 g:netrw_rsync_cmd variable ="rsync -a"
598 g:netrw_scp_cmd variable ="scp -q"
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000599 g:netrw_sftp_cmd variable ="sftp" >
600 -------------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000601<
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000602 *netrw-ftp*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000603
Bram Moolenaar9964e462007-05-05 17:54:07 +0000604The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|)
605specify the external program to use handle the ftp protocol. They may
606include command line options (such as -p for passive mode).
Bram Moolenaar071d4272004-06-13 20:20:40 +0000607
Bram Moolenaar9964e462007-05-05 17:54:07 +0000608Browsing is supported by using the |g:netrw_list_cmd|; the substring
609"HOSTNAME" will be changed via substitution with whatever the current request
610is for a hostname.
611
612Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's
613that give trouble . In order to best understand how to use these options if
614ftp is giving you troubles, a bit of discussion is provided on how netrw does
615ftp reads.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000616
617For ftp, netrw typically builds up lines of one of the following formats in a
Bram Moolenaar071d4272004-06-13 20:20:40 +0000618temporary file:
619>
620 IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1
621 ---------------------------------- ------------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000622<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000623 open machine [port] open machine [port]
624 user userid password userid password
625 [g:netrw_ftpmode] password
626 [g:netrw_extracmd] [g:netrw_ftpmode]
627 get filename tempfile [g:netrw_extracmd]
628 get filename tempfile >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000629 ---------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000630<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000631The |g:netrw_ftpmode| and |g:netrw_extracmd| are optional.
632
Bram Moolenaar071d4272004-06-13 20:20:40 +0000633Netrw then executes the lines above by use of a filter:
634>
635 :%! {g:netrw_ftp_cmd} -i [-n]
636<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000637where
638 g:netrw_ftp_cmd is usually "ftp",
639 -i tells ftp not to be interactive
640 -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>)
641
642If <.netrc> exists it will be used to avoid having to query the user for
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000643userid and password. The transferred file is put into a temporary file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000644The temporary file is then read into the main editing session window that
645requested it and the temporary file deleted.
646
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000647If your ftp doesn't accept the "user" command and immediately just demands a
648userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000649
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000650 *netrw-cadaver*
651To handle the SSL certificate dialog for untrusted servers, one may pull
652down the certificate and place it into /usr/ssl/cert.pem. This operation
653renders the server treatment as "trusted".
654
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000655 *netrw-fixup* *netreadfixup*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000656If your ftp for whatever reason generates unwanted lines (such as AUTH
657messages) you may write a NetReadFixup(tmpfile) function:
658>
659 function! NetReadFixup(method,line1,line2)
660 " a:line1: first new line in current file
661 " a:line2: last new line in current file
662 if a:method == 1 "rcp
663 elseif a:method == 2 "ftp + <.netrc>
664 elseif a:method == 3 "ftp + machine,uid,password,filename
665 elseif a:method == 4 "scp
666 elseif a:method == 5 "http/wget
667 elseif a:method == 6 "dav/cadaver
668 elseif a:method == 7 "rsync
669 elseif a:method == 8 "fetch
670 elseif a:method == 9 "sftp
Bram Moolenaar9964e462007-05-05 17:54:07 +0000671 else " complain
Bram Moolenaar071d4272004-06-13 20:20:40 +0000672 endif
673 endfunction
674>
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000675The NetReadFixup() function will be called if it exists and thus allows you to
676customize your reading process. As a further example, <netrw.vim> contains
677just such a function to handle Windows 95 ftp. For whatever reason, Windows
67895's ftp dumps four blank lines at the end of a transfer, and so it is
679desirable to automate their removal. Here's some code taken from <netrw.vim>
680itself:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000681>
682 if has("win95") && g:netrw_win95ftp
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000683 fun! NetReadFixup(method, line1, line2)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000684 if method == 3 " ftp (no <.netrc>)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000685 let fourblanklines= line2 - 3
686 silent fourblanklines.",".line2."g/^\s*/d"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000687 endif
688 endfunction
689 endif
690>
691
692==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +00006939. Directory Browsing *netrw-browse* *netrw-dir* *netrw-list* *netrw-help*
Bram Moolenaar83bab712005-08-01 21:58:57 +0000694
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000695MAPS *netrw-maps*
696 <F1>.............Help.......................................|netrw-help|
Bram Moolenaar83bab712005-08-01 21:58:57 +0000697 <cr>.............Browsing...................................|netrw-cr|
698 <del>............Deleting Files or Directories..............|netrw-delete|
699 -................Going Up...................................|netrw--|
700 a................Hiding Files or Directories................|netrw-a|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000701 mb...............Bookmarking a Directory....................|netrw-mb|
702 gb...............Changing to a Bookmarked Directory.........|netrw-gb|
Bram Moolenaar83bab712005-08-01 21:58:57 +0000703 c................Make Browsing Directory The Current Dir....|netrw-c|
704 d................Make A New Directory.......................|netrw-d|
705 D................Deleting Files or Directories..............|netrw-D|
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000706 <c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000707 i................Change Listing Style.......................|netrw-i|
Bram Moolenaar83bab712005-08-01 21:58:57 +0000708 <c-l>............Refreshing the Listing.....................|netrw-ctrl-l|
709 o................Browsing with a Horizontal Split...........|netrw-o|
710 p................Preview Window.............................|netrw-p|
711 q................Listing Bookmarks and History..............|netrw-q|
712 r................Reversing Sorting Order....................|netrw-r|
713 R................Renaming Files or Directories..............|netrw-R|
714 s................Selecting Sorting Style....................|netrw-s|
715 S................Editing the Sorting Sequence...............|netrw-S|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000716 t................Browsing with a new tab....................|netrw-t|
Bram Moolenaar83bab712005-08-01 21:58:57 +0000717 u................Changing to a Predecessor Directory........|netrw-u|
718 U................Changing to a Successor Directory..........|netrw-U|
719 v................Browsing with a Vertical Split.............|netrw-v|
720 x................Customizing Browsing.......................|netrw-x|
721
722 COMMANDS *netrw-explore-cmds*
Bram Moolenaar488c6512005-08-11 20:09:58 +0000723 :Explore[!] [dir] Explore directory of current file........|netrw-explore|
724 :Sexplore[!] [dir] Split & Explore directory ...............|netrw-explore|
725 :Hexplore[!] [dir] Horizontal Split & Explore...............|netrw-explore|
726 :Vexplore[!] [dir] Vertical Split & Explore.................|netrw-explore|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000727 :Texplore[!] [dir] Tab & Explore............................|netrw-explore|
Bram Moolenaar488c6512005-08-11 20:09:58 +0000728 :Pexplore[!] [dir] Vertical Split & Explore.................|netrw-explore|
729 :Nexplore[!] [dir] Vertical Split & Explore.................|netrw-explore|
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000730 :NetrwSettings.............................................|netrw-settings|
Bram Moolenaar269ec652004-07-29 08:43:53 +0000731
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000732QUICK REFERENCE COMMANDS TABLE *netrw-browse-cmds*
Bram Moolenaar843ee412004-06-30 16:16:41 +0000733>
Bram Moolenaard68071d2006-05-02 22:08:30 +0000734 ------- -----------
Bram Moolenaar843ee412004-06-30 16:16:41 +0000735 Command Explanation
Bram Moolenaar9964e462007-05-05 17:54:07 +0000736 ------- -----------
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000737< <F1> Causes Netrw to issue help
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000738 <cr> Netrw will enter the directory or read the file |netrw-cr|
739 <del> Netrw will attempt to remove the file/directory |netrw-del|
740 - Makes Netrw go up one directory |netrw--|
741 a Toggles between normal display, |netrw-a|
742 hiding (suppress display of files matching g:netrw_list_hide)
743 showing (display only files which match g:netrw_list_hide)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000744 mb bookmark current directory
745 gb go to previous bookmarked directory
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000746 c Make current browsing directory the current directory |netrw-c|
747 d Make a directory |netrw-d|
748 D Netrw will attempt to remove the file(s)/directory(ies) |netrw-D|
749 <c-h> Edit file hiding list |netrw-ctrl-h|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000750 i Cycle between thin, long, wide, and tree listings|netrw-i|
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000751 <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
Bram Moolenaar843ee412004-06-30 16:16:41 +0000752 o Enter the file/directory under the cursor in a new browser
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000753 window. A horizontal split is used. |netrw-o|
754 O Obtain a file specified by cursor |netrw-O|
755 p Preview the file |netrw-p|
756 P Browse in the previously used window |netrw-P|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000757 q List bookmarked directories and history |netrw-q|
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000758 r Reverse sorting order |netrw-r|
759 R Rename the designed file(s)/directory(ies) |netrw-R|
760 s Select sorting style: by name, time, or file size |netrw-s|
761 S Specify suffix priority for name-sorting |netrw-S|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000762 t Enter the file/directory under the cursor in a new tab|netrw-t|
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000763 u Change to recently-visited directory |netrw-u|
764 U Change to subsequently-visited directory |netrw-U|
Bram Moolenaar843ee412004-06-30 16:16:41 +0000765 v Enter the file/directory under the cursor in a new browser
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000766 window. A vertical split is used. |netrw-v|
767 x Apply a function to a file. (special browsers) |netrw-x|
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000768
Bram Moolenaar269ec652004-07-29 08:43:53 +0000769NETRW BROWSER VARIABLES *netrw-browse-var*
Bram Moolenaar843ee412004-06-30 16:16:41 +0000770>
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000771 --- -----------
772 Var Explanation
773 --- -----------
774< *g:netrw_alto* change from above splitting to below splitting
775 by setting this variable (see |netrw-o|)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000776 default: =&sb (see |'sb'|)
Bram Moolenaar83bab712005-08-01 21:58:57 +0000777
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000778 *g:netrw_altv* change from left splitting to right splitting
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000779 by setting this variable (see |netrw-v|)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000780 default: =&spr (see |'spr'|)
Bram Moolenaar83bab712005-08-01 21:58:57 +0000781
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000782 *g:netrw_browse_split* when browsing, <cr> will open the file by:
783 =0: re-using the same window
Bram Moolenaar9964e462007-05-05 17:54:07 +0000784 =1: horizontally splitting the window first
785 =2: vertically splitting the window first
786 =3: open file in new tab
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000787
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000788 *g:netrw_browsex_viewer* specify user's preference for a viewer: >
789 "kfmclient exec"
790 "gnome-open"
791< If >
792 "-"
793< is used, then netrwFileHandler() will look for
794 a script/function to handle the given
795 extension. (see |netrw_filehandler|).
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000796
797 *g:netrw_fastbrowse* =0: slow speed browsing, never re-use
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000798 directory listings; always obtain
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000799 directory listings.
800 =1: medium speed browsing, re-use directory
801 listings only when remote browsing.
802 (default value)
803 =2: fast browsing, only obtains directory
804 listings when the directory hasn't been
805 seen before (or |netrw-ctrl-l| is used).
806 Fast browsing retains old directory listing
807 buffers so that they don't need to be
808 re-acquired. This feature is especially
809 important for remote browsing. However, if
810 a file is introduced or deleted into or from
811 such directories, the old directory buffer
812 becomes out-of-date. One may always refresh
813 such a directory listing with |netrw-ctrl-l|.
814 This option gives the choice of the trade-off
815 between accuracy and speed to the user.
816
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000817 *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
818 that can show up as "directories" and "files"
819 in the listing. This pattern is used to
820 remove such embedded messages. By default its
821 value is:
822 '^total\s\+\d\+$\|
823 ^Trying\s\+\d\+.*$\|
824 ^KERBEROS_V\d rejected\|
825 ^Security extensions not\|
826 No such file\|
827 : connect to address [0-9a-fA-F:]*
828 : No route to host$'
Bram Moolenaar83bab712005-08-01 21:58:57 +0000829
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000830 *g:netrw_ftp_list_cmd* options for passing along to ftp for directory
831 listing. Defaults:
832 unix or g:netrw_cygwin set: : "ls -lF"
Bram Moolenaar9964e462007-05-05 17:54:07 +0000833 otherwise "dir"
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000834
Bram Moolenaar9964e462007-05-05 17:54:07 +0000835
836 *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory
837 listing, sorted by size of file.
838 Defaults:
839 unix or g:netrw_cygwin set: : "ls -slF"
840 otherwise "dir"
841
842 *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory
843 listing, sorted by time of last modification.
844 Defaults:
845 unix or g:netrw_cygwin set: : "ls -tlF"
846 otherwise "dir"
847
848 *g:netrw_hide* if true, the hiding list is used
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000849 default: =0
Bram Moolenaar83bab712005-08-01 21:58:57 +0000850
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000851 *g:netrw_keepdir* =1 (default) keep current directory immune from
852 the browsing directory.
853 =0 keep the current directory the same as the
854 browsing directory.
855 The current browsing directory is contained in
Bram Moolenaar57657d82006-04-21 22:12:41 +0000856 b:netrw_curdir (also see |netrw-c|)
Bram Moolenaar83bab712005-08-01 21:58:57 +0000857
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000858 *g:netrw_list_cmd* command for listing remote directories
859 default: (if ssh is executable)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000860 "ssh HOSTNAME ls -FLa"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000861
Bram Moolenaar9964e462007-05-05 17:54:07 +0000862 *g:netrw_liststyle* Set the default listing style:
863 = 0: thin listing (one file per line)
864 = 1: long listing (one file per line with time
865 stamp information and file size)
866 = 2: wide listing (multiple files in columns)
867 = 3: tree style listing
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000868 *g:netrw_list_hide* comma separated pattern list for hiding files
869 default: ""
Bram Moolenaar83bab712005-08-01 21:58:57 +0000870
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000871 *g:netrw_local_mkdir* command for making a local directory
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000872 default: "mkdir"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000873
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000874 *g:netrw_local_rmdir* remove directory command (rmdir)
875 default: "rmdir"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000876
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000877 *g:netrw_maxfilenamelen* =32 by default, selected so as to make long
878 listings fit on 80 column displays.
879 If your screen is wider, and you have file
880 or directory names longer than 32 bytes,
881 you may set this option to keep listings
882 columnar.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000883
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000884 *g:netrw_mkdir_cmd* command for making a remote directory
Bram Moolenaar9964e462007-05-05 17:54:07 +0000885 default: "ssh USEPORT HOSTNAME mkdir"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000886
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000887 *g:netrw_rm_cmd* command for removing files
Bram Moolenaar9964e462007-05-05 17:54:07 +0000888 default: "ssh USEPORT HOSTNAME rm"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000889
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000890 *g:netrw_rmdir_cmd* command for removing directories
Bram Moolenaar9964e462007-05-05 17:54:07 +0000891 default: "ssh USEPORT HOSTNAME rmdir"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000892
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000893 *g:netrw_rmf_cmd* command for removing softlinks
Bram Moolenaar9964e462007-05-05 17:54:07 +0000894 default: "ssh USEPORT HOSTNAME rm -f"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000895
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000896 *g:netrw_sort_by* sort by "name", "time", or "size"
897 default: "name"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000898
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000899 *g:netrw_sort_direction* sorting direction: "normal" or "reverse"
900 default: "normal"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000901
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000902 *g:netrw_sort_sequence* when sorting by name, first sort by the
903 comma-separated pattern sequence
904 default: '[\/]$,*,\.bak$,\.o$,\.h$,
Bram Moolenaar9964e462007-05-05 17:54:07 +0000905 \.info$,\.swp$,\.obj$'
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000906
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000907 *g:netrw_ssh_cmd* One may specify an executable command
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000908 to use instead of ssh for remote actions
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000909 such as listing, file removal, etc.
910 default: ssh
911
912 *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines,
913 messages, banners, and whatnot that one doesn't
914 want masquerading as "directories" and "files".
915 Use this pattern to remove such embedded
916 messages. By default its value is:
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000917 '^total\s\+\d\+$'
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000918
Bram Moolenaar9964e462007-05-05 17:54:07 +0000919 *g:netrw_use_noswf* netrw normally avoids writing swapfiles
920 for browser buffers. However, under some
921 systems this apparently is causing nasty
922 ml_get errors to appear; if you're getting
923 ml_get errors, try putting
924 let g:netrw_use_noswf= 0
925 in your .vimrc.
926
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000927 *g:netrw_timefmt* specify format string to strftime() (%c)
928 default: "%c"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000929
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000930 *g:netrw_winsize* specify initial size of new o/v windows
931 default: ""
Bram Moolenaar83bab712005-08-01 21:58:57 +0000932
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000933 *g:NetrwTopLvlMenu* This variable specifies the top level
934 menu name; by default, its "Netrw.". If
935 you wish to change this, do so in your
936 .vimrc.
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000937
Bram Moolenaar83bab712005-08-01 21:58:57 +0000938INTRODUCTION TO DIRECTORY BROWSING *netrw-browse-intro*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000939
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000940Netrw supports the browsing of directories on the local system and on remote
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000941hosts, including listing files and directories, entering directories, editing
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000942files therein, deleting files/directories, making new directories, and moving
943(renaming) files and directories. The Netrw browser generally implements the
944previous explorer maps and commands for remote directories, although details
945(such as pertinent global variable names) necessarily differ.
946
947The Netrw remote file and directory browser handles two protocols: ssh and
948ftp. The protocol in the url, if it is ftp, will cause netrw to use ftp
949in its remote browsing. Any other protocol will be used for file transfers,
950but otherwise the ssh protocol will be used to do remote directory browsing.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000951
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000952To use Netrw's remote directory browser, simply attempt to read a "file" with a
Bram Moolenaar843ee412004-06-30 16:16:41 +0000953trailing slash and it will be interpreted as a request to list a directory:
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000954
955 vim [protocol]://[user@]hostname/path/
956
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000957For local directories, the trailing slash is not required.
958
959If you'd like to avoid entering the password in for remote directory listings
960with ssh or scp, see |netrw-listhack|.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000961
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000962
963NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible*
964
965Netrw will not work properly with >
966
967 :set acd
968 :set fo=...ta...
969<
970If either of these options are present when browsing is attempted, netrw
971will change them by using noacd and removing the ta suboptions from the
Bram Moolenaara94bc432006-03-10 21:42:59 +0000972|'formatoptions'|.
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000973
Bram Moolenaar9964e462007-05-05 17:54:07 +0000974 *netrw-explore* *netrw-pexplore* *netrw-texplore*
975 *netrw-hexplore* *netrw-sexplore* *netrw-nexplore*
976 *netrw-vexplore*
977DIRECTORY EXPLORING COMMANDS
Bram Moolenaar83bab712005-08-01 21:58:57 +0000978
Bram Moolenaar488c6512005-08-11 20:09:58 +0000979 :Explore[!] [dir]... Explore directory of current file *:Explore*
980 :Sexplore[!] [dir]... Split&Explore directory of current file *:Sexplore*
Bram Moolenaar9964e462007-05-05 17:54:07 +0000981 :Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
982 :Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
983 :Texplore [dir]... Tab & Explore *:Texplore*
Bram Moolenaar83bab712005-08-01 21:58:57 +0000984
Bram Moolenaar9964e462007-05-05 17:54:07 +0000985 Used with :Explore **/pattern : (also see |netrw-starstar|)
986 :Nexplore............. go to next matching file *:Nexplore*
987 :Pexplore............. go to previous matching file *:Pexplore*
Bram Moolenaar83bab712005-08-01 21:58:57 +0000988
Bram Moolenaar488c6512005-08-11 20:09:58 +0000989:Explore will open the local-directory browser on the current file's
Bram Moolenaar9964e462007-05-05 17:54:07 +0000990 directory (or on directory [dir] if specified). The window will be
Bram Moolenaar488c6512005-08-11 20:09:58 +0000991 split only if the file has been modified, otherwise the browsing
992 window will take over that window. Normally the splitting is taken
993 horizontally.
994:Explore! is like :Explore, but will use vertical splitting.
995:Sexplore will always split the window before invoking the local-directory
Bram Moolenaar9964e462007-05-05 17:54:07 +0000996 browser. As with Explore, the splitting is normally done
Bram Moolenaar488c6512005-08-11 20:09:58 +0000997 horizontally.
998:Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically.
999:Hexplore [dir] does an :Explore with |:belowright| horizontal splitting.
1000:Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting.
1001:Vexplore [dir] does an :Explore with |:leftabove| vertical splitting.
1002:Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting.
Bram Moolenaar9964e462007-05-05 17:54:07 +00001003:Texplore [dir] does a tabnew before generating the browser window
Bram Moolenaar83bab712005-08-01 21:58:57 +00001004
Bram Moolenaar488c6512005-08-11 20:09:58 +00001005By default, these commands use the current file's directory. However, one
1006may explicitly provide a directory (path) to use.
Bram Moolenaar83bab712005-08-01 21:58:57 +00001007
Bram Moolenaar57657d82006-04-21 22:12:41 +00001008 *netrw-starstar*
1009When Explore, Sexplore, Hexplore, or Vexplore are used with a **/filepat,
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001010such as:
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001011>
1012 :Explore **/filename_pattern
1013<
Bram Moolenaar57657d82006-04-21 22:12:41 +00001014netrw will attempt to find a file in the current directory or any subdirectory
1015which matches the filename pattern. Internally, it produces a list of files
1016which match the pattern and their paths; to that extent it resembles the Unix
1017operation:
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001018>
1019 find $(pwd) -name "$1" -exec "echo" "{}" ";" 2> /dev/null
1020<
1021The directory display is updated to show the subdirectory containing a
1022matching file. One may then proceed to the next (or previous) matching files'
1023directories by using Nexplore or Pexplore, respectively. If your console or
1024gui produces recognizable shift-up or shift-down sequences, then you'll likely
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001025find using shift-downarrow and shift-uparrow convenient. They're mapped by
1026netrw:
Bram Moolenaar572cb562005-08-05 21:35:02 +00001027
1028 <s-down> == Nexplore, and
1029 <s-up> == Pexplore.
1030
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001031As an example, consider
1032>
Bram Moolenaar572cb562005-08-05 21:35:02 +00001033 :Explore **/*.c
1034 :Nexplore
1035 :Nexplore
1036 :Pexplore
1037<
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001038The status line will show, on the right hand side of the status line, a
1039message like "Match 3 of 20".
1040
Bram Moolenaar57657d82006-04-21 22:12:41 +00001041 *netrw-starpat*
1042When Explore, Sexplore, Hexplore, or Vexplore are used with a */pattern,
1043such as:
1044>
1045 :Explore */pattern
1046<
1047netrw will use |:vimgrep| to find files which contain the given pattern.
1048Like what happens with |netrw-starstar|, a list of files which contain
1049matches to the given pattern is generated. The cursor will then jump
1050to the first file with the given pattern; |:Nexplore|, |:Pexplore|, and
1051the shifted-down and -up arrows work with the list to move to the next
1052or previous files in that list.
Bram Moolenaar83bab712005-08-01 21:58:57 +00001053
Bram Moolenaar4a85b412006-04-23 22:40:29 +00001054 *netrw-starstarpat*
1055When Explore, Sexplore, Hexplore, or Vexplore are used with a **//pattern,
1056such as:
1057>
1058 :Explore **//pattern
1059<
1060then Explore will use |:vimgrep| to find files like |netrw-starpat|;
1061however, Explore will also search subdirectories as well as the current
1062directory.
1063
1064
Bram Moolenaar9964e462007-05-05 17:54:07 +00001065REFRESHING THE LISTING *netrw-ctrl-l* *netrw-ctrl_l*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001066
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001067To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
1068hit the <cr> when atop the ./ directory entry in the listing. One may also
1069refresh a local directory by using ":e .".
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001070
1071
1072GOING UP *netrw--*
1073
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001074To go up a directory, press "-" or press the <cr> when atop the ../ directory
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001075entry in the listing.
1076
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001077Netrw will use the command in |g:netrw_list_cmd| to perform the directory
1078listing operation after changing HOSTNAME to the host specified by the
1079user-provided url. By default netrw provides the command as:
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001080
Bram Moolenaar843ee412004-06-30 16:16:41 +00001081 ssh HOSTNAME ls -FLa
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001082
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001083where the HOSTNAME becomes the [user@]hostname as requested by the attempt to
1084read. Naturally, the user may override this command with whatever is
1085preferred. The NetList function which implements remote directory browsing
1086expects that directories will be flagged by a trailing slash.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001087
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001088
Bram Moolenaar433f7c82006-03-21 21:29:36 +00001089BROWSING *netrw-cr*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001090
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001091Browsing is simple: move the cursor onto a file or directory of interest.
Bram Moolenaar843ee412004-06-30 16:16:41 +00001092Hitting the <cr> (the return key) will select the file or directory.
1093Directories will themselves be listed, and files will be opened using the
Bram Moolenaar9964e462007-05-05 17:54:07 +00001094protocol given in the original read request.
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001095
Bram Moolenaar9964e462007-05-05 17:54:07 +00001096 CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001097 that two or more spaces delimit filenames and directory names for the long
1098 and wide listing formats. Thus, if your filename or directory name has two
1099 or more spaces embedded in it, or any trailing spaces, then you'll need to
1100 use the "thin" format to select it.
Bram Moolenaar843ee412004-06-30 16:16:41 +00001101
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001102The |g:netrw_browse_split| option, which is zero by default, may be used to
Bram Moolenaar9964e462007-05-05 17:54:07 +00001103cause the opening of files to be done in a new window or tab. When the option
1104is one or two, the splitting will be taken horizontally or vertically,
1105respectively. When the option is set to three, a <cr> will cause the file
1106to appear in a new tab.
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001107
Bram Moolenaar83bab712005-08-01 21:58:57 +00001108
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001109OBTAINING A FILE *netrw-O*
1110
1111When browsing a remote directory, one may obtain a file under the cursor (ie.
1112get a copy on your local machine, but not edit it) by pressing the O key.
1113Only ftp and scp are supported for this operation (but since these two are
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001114available for browsing, that shouldn't be a problem). The status bar
1115will then show, on its right hand side, a message like "Obtaining filename".
1116The statusline will be restored after the transfer is complete.
1117
1118Netrw can also "obtain" a file using the local browser. Netrw's display
1119of a directory is not necessarily the same as Vim's "current directory",
1120unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select
1121a file using the local browser (by putting the cursor on it) and pressing
1122"O" will then "obtain" the file; ie. copy it to Vim's current directory.
1123
1124Related topics:
1125 * To see what the current directory is, use |:pwd|
1126 * To make the currently browsed directory the current directory, see |netrw-c|
1127 * To automatically make the currently browsed directory the current
1128 directory, see |g:netrw_keepdir|.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001129
1130
Bram Moolenaar9964e462007-05-05 17:54:07 +00001131CHANGE LISTING STYLE *netrw-i*
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001132
Bram Moolenaar9964e462007-05-05 17:54:07 +00001133The "i" map cycles between the thin, long, wide, and tree listing formats.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001134
Bram Moolenaar8299df92004-07-10 09:47:34 +00001135The short listing format gives just the files' and directories' names.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001136
Bram Moolenaar8299df92004-07-10 09:47:34 +00001137The long listing is either based on the "ls" command via ssh for remote
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001138directories or displays the filename, file size (in bytes), and the time and
1139date of last modification for local directories. With the long listing
1140format, netrw is not able to recognize filenames which have trailing spaces.
1141Use the thin listing format for such files.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001142
Bram Moolenaar9964e462007-05-05 17:54:07 +00001143The wide listing format uses two or more contiguous spaces to delineate
1144filenames; when using that format, netrw won't be able to recognize or use
1145filenames which have two or more contiguous spaces embedded in the name or any
1146trailing spaces. The thin listing format will, however, work with such files.
1147This listing format is the most compact.
1148
1149The tree listing format has a top directory followed by files and directories
1150preceded by a "|". One may open and close directories by pressing the <cr>
1151key while atop the directory name. There is only one tree listing buffer;
1152hence, using "v" or "o" on a subdirectory will only show the same buffer,
1153twice.
Bram Moolenaar8299df92004-07-10 09:47:34 +00001154
1155
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001156MAKING A NEW DIRECTORY *netrw-d*
Bram Moolenaar8299df92004-07-10 09:47:34 +00001157
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001158With the "d" map one may make a new directory either remotely (which depends
1159on the global variable g:netrw_mkdir_cmd) or locally (which depends on the
1160global variable g:netrw_local_mkdir). Netrw will issue a request for the new
1161directory's name. A bare <CR> at that point will abort the making of the
Bram Moolenaar8299df92004-07-10 09:47:34 +00001162directory. Attempts to make a local directory that already exists (as either
1163a file or a directory) will be detected, reported on, and ignored.
1164
Bram Moolenaar83bab712005-08-01 21:58:57 +00001165
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001166DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del*
Bram Moolenaar843ee412004-06-30 16:16:41 +00001167
1168Deleting/removing files and directories involves moving the cursor to the
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001169file/directory to be deleted and pressing "D". Directories must be empty
1170first before they can be successfully removed. If the directory is a softlink
1171to a directory, then netrw will make two requests to remove the directory
1172before succeeding. Netrw will ask for confirmation before doing the
1173removal(s). You may select a range of lines with the "V" command (visual
1174selection), and then pressing "D".
Bram Moolenaar843ee412004-06-30 16:16:41 +00001175
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001176The g:netrw_rm_cmd, g:netrw_rmf_cmd, and g:netrw_rmdir_cmd variables are used
1177to control the attempts to remove files and directories. The g:netrw_rm_cmd
1178is used with files, and its default value is:
Bram Moolenaar843ee412004-06-30 16:16:41 +00001179
1180 g:netrw_rm_cmd: ssh HOSTNAME rm
1181
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001182The g:netrw_rmdir_cmd variable is used to support the removal of directories.
1183Its default value is:
Bram Moolenaar843ee412004-06-30 16:16:41 +00001184
1185 g:netrw_rmdir_cmd: ssh HOSTNAME rmdir
1186
1187If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001188to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
Bram Moolenaar843ee412004-06-30 16:16:41 +00001189
1190 g:netrw_rmf_cmd: ssh HOSTNAME rm -f
1191
Bram Moolenaar843ee412004-06-30 16:16:41 +00001192
Bram Moolenaar8299df92004-07-10 09:47:34 +00001193RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R*
Bram Moolenaar843ee412004-06-30 16:16:41 +00001194
1195Renaming/moving files and directories involves moving the cursor to the
1196file/directory to be moved (renamed) and pressing "R". You will then be
1197queried for where you want the file/directory to be moved. You may select a
1198range of lines with the "V" command (visual selection), and then pressing "R".
1199
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001200The g:netrw_rename_cmd variable is used to implement renaming. By default its
Bram Moolenaar843ee412004-06-30 16:16:41 +00001201value is:
1202
1203 ssh HOSTNAME mv
1204
Bram Moolenaar269ec652004-07-29 08:43:53 +00001205One may rename a block of files and directories by selecting them with
1206the V (|linewise-visual|).
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001207
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001208
Bram Moolenaar9964e462007-05-05 17:54:07 +00001209HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001210
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001211Netrw's browsing facility allows one to use the hiding list in one of three
1212ways: ignore it, hide files which match, and show only those files which
1213match. The "a" map allows the user to cycle about these three ways.
Bram Moolenaar83bab712005-08-01 21:58:57 +00001214
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001215The g:netrw_list_hide variable holds a comma delimited list of patterns (ex.
Bram Moolenaar9964e462007-05-05 17:54:07 +00001216\.obj) which specify the hiding list. (also see |netrw-ctrl-h|) To set the
1217hiding list, use the <c-h> map. As an example, to hide files which begin with
1218a ".", one may use the <c-h> map to set the hiding list to '^\..*' (or one may
1219put let g:netrw_list_hide= '^\..*' in one's <.vimrc>). One may then use the
1220"a" key to show all files, hide matching files, or to show only the matching
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001221files.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001222
Bram Moolenaar9964e462007-05-05 17:54:07 +00001223 Example: ^.*\.[ch]
1224 This hiding list command will hide/show all *.c and *.h files.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001225
Bram Moolenaar9964e462007-05-05 17:54:07 +00001226 Example: ^.*\.c,^.*\.h
1227 This hiding list command will also hide/show all *.c and *.h
1228 files.
1229
1230Don't forget to use the "a" map to select the normal/hiding/show mode you want!
1231
1232 *netrw-ctrl_h*
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001233EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001234
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001235The "<ctrl-h>" map brings up a requestor allowing the user to change the
Bram Moolenaar269ec652004-07-29 08:43:53 +00001236file/directory hiding list. The hiding list consists of one or more patterns
1237delimited by commas. Files and/or directories satisfying these patterns will
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001238either be hidden (ie. not shown) or be the only ones displayed (see
1239|netrw-a|).
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001240
1241
Bram Moolenaar83bab712005-08-01 21:58:57 +00001242BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001243
Bram Moolenaar269ec652004-07-29 08:43:53 +00001244Normally one enters a file or directory using the <cr>. However, the "o" map
1245allows one to open a new window to hold the new directory listing or file. A
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001246horizontal split is used. (for vertical splitting, see |netrw-v|)
1247
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001248Normally, the o key splits the window horizontally with the new window and
1249cursor at the top. To change to splitting the window horizontally with the
1250new window and cursor at the bottom, have
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001251
1252 let g:netrw_alto = 1
1253
Bram Moolenaar9964e462007-05-05 17:54:07 +00001254in your <.vimrc>. (also see |netrw-t| |netrw-v| |g:netrw_alto|)
1255
1256There is only one tree listing buffer; using "o" on a displayed subdirectory
1257will split the screen, but the same buffer will be shown twice.
1258
1259
1260BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v*
1261
1262Normally one enters a file or directory using the <cr>. However, the "v" map
1263allows one to open a new window to hold the new directory listing or file. A
1264vertical split is used. (for horizontal splitting, see |netrw-o|)
1265
1266Normally, the v key splits the window vertically with the new window and
1267cursor at the left. To change to splitting the window vertically with the new
1268window and cursor at the right, have
1269
1270 let g:netrw_altv = 1
1271
1272in your <.vimrc>. (also see: |netrw-o| |netrw-t| |g:netrw_altv|)
1273
1274There is only one tree listing buffer; using "v" on a displayed subdirectory
1275will split the screen, but the same buffer will be shown twice.
1276
1277
1278BROWSING WITH A NEW TAB *netrw-t*
1279
1280Normally one enters a file or directory using the <cr>. The "t" map
1281allows one to open a new window hold the new directory listing or file in a
1282new tab. (also see: |netrw-o| |netrw-v|)
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001283
Bram Moolenaar83bab712005-08-01 21:58:57 +00001284
1285PREVIEW WINDOW *netrw-p* *netrw-preview*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001286
Bram Moolenaar9964e462007-05-05 17:54:07 +00001287One may use a preview window by using the "p" key when the cursor is atop the
1288desired filename to be previewed.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001289
1290
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001291PREVIOUS WINDOW *netrw-P* *netrw-prvwin*
1292
Bram Moolenaara94bc432006-03-10 21:42:59 +00001293To edit a file or directory in the previously used window (see :he |CTRL-W_P|),
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001294press a "P". If there's only one window, then the one window will be
Bram Moolenaara94bc432006-03-10 21:42:59 +00001295horizontally split (above/below splitting is controlled by |g:netrw_alto|,
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001296and its initial size is controlled by |g:netrw_winsize|).
1297
1298If there's more than one window, the previous window will be re-used on
1299the selected file/directory. If the previous window's associated buffer
1300has been modified, and there's only one window with that buffer, then
1301the user will be asked if s/he wishes to save the buffer first (yes,
1302no, or cancel).
1303
1304
Bram Moolenaar83bab712005-08-01 21:58:57 +00001305SELECTING SORTING STYLE *netrw-s* *netrw-sort*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001306
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001307One may select the sorting style by name, time, or (file) size. The "s" map
1308allows one to circulate amongst the three choices; the directory listing will
1309automatically be refreshed to reflect the selected style.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001310
1311
Bram Moolenaar83bab712005-08-01 21:58:57 +00001312EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence*
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001313
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001314When "Sorted by" is name, one may specify priority via the sorting sequence
1315(g:netrw_sort_sequence). The sorting sequence typically prioritizes the
1316name-listing by suffix, although any pattern will do. Patterns are delimited
1317by commas. The default sorting sequence is:
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001318>
Bram Moolenaar488c6512005-08-11 20:09:58 +00001319 [\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001320<
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001321The lone * is where all filenames not covered by one of the other patterns
1322will end up. One may change the sorting sequence by modifying the
1323g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by
1324using the "S" map.
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001325
1326
Bram Moolenaar83bab712005-08-01 21:58:57 +00001327REVERSING SORTING ORDER *netrw-r* *netrw-reverse*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001328
1329One may toggle between normal and reverse sorting order by pressing the
1330"r" key.
1331
1332
Bram Moolenaar83bab712005-08-01 21:58:57 +00001333CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir*
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001334
1335Every time you change to a new directory (new for the current session),
1336netrw will save the directory in a recently-visited directory history
1337list (unless g:netrw_dirhistmax is zero; by default, its ten). With the
1338"u" map, one can change to an earlier directory (predecessor). To do
1339the opposite, see |netrw-U|.
1340
1341
Bram Moolenaar83bab712005-08-01 21:58:57 +00001342CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir*
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001343
1344With the "U" map, one can change to a later directory (successor).
1345This map is the opposite of the "u" map. (see |netrw-u|) Use the
1346q map to list both the bookmarks and history. (see |netrw-q|)
1347
Bram Moolenaar9964e462007-05-05 17:54:07 +00001348 *netrw-gx*
1349CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler*
1350 (also see |netrw_filehandler|)
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001351
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001352Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
1353best seen with a special handler (ie. a tool provided with your computer).
1354Netrw allows one to invoke such special handlers by: >
1355
1356 * when Exploring, hit the "x" key
1357 * when editing, hit gx with the cursor atop the special filename
Bram Moolenaar9964e462007-05-05 17:54:07 +00001358< (not available if the |g:netrw_nogx| variable exists)
1359
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001360Netrw determines which special handler by the following method:
1361
1362 * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
1363 view files. Examples of useful settings (place into your <.vimrc>): >
1364
1365 :let g:netrw_browsex_viewer= "kfmclient exec"
1366< or >
1367 :let g:netrw_browsex_viewer= "gnome-open"
1368<
1369 If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
1370 invoked first (see |netrw_filehandler|).
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001371
Bram Moolenaar9964e462007-05-05 17:54:07 +00001372 * for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001373 * for Gnome (with gnome-open): gnome-open is used.
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001374 * for KDE (with kfmclient): kfmclient is used.
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001375 * otherwise the netrwFileHandler plugin is used.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001376
1377The file's suffix is used by these various approaches to determine an
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001378appropriate application to use to "handle" these files. Such things as
1379OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
1380*.eps) can be handled.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001381
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001382 *netrw_filehandler*
Bram Moolenaar9964e462007-05-05 17:54:07 +00001383
1384The "x" map applies a function to a file, based on its extension. Of course,
1385the handler function must exist for it to be called!
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001386>
1387 Ex. mypgm.html x ->
Bram Moolenaar9964e462007-05-05 17:54:07 +00001388 NFH_html("scp://user@host/some/path/mypgm.html")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001389<
Bram Moolenaar9964e462007-05-05 17:54:07 +00001390Users may write their own netrw File Handler functions to support more
1391suffixes with special handling. See <plugin/netrwFileHandlers.vim> for
1392examples on how to make file handler functions. As an example: >
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001393
Bram Moolenaar9964e462007-05-05 17:54:07 +00001394 " NFH_suffix(filename)
1395 fun! NFH_suffix(filename)
1396 ..do something special with filename..
1397 endfun
1398<
1399These functions need to be defined in some file in your .vim/plugin
1400(vimfiles\plugin) directory. Vim's function names may not have punctuation
1401characters (except for the underscore) in them. To support suffices that
1402contain such characters, netrw will first convert the suffix using the
1403following table: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001404
Bram Moolenaar9964e462007-05-05 17:54:07 +00001405 @ -> AT ! -> EXCLAMATION % -> PERCENT
1406 : -> COLON = -> EQUAL ? -> QUESTION
1407 , -> COMMA - -> MINUS ; -> SEMICOLON
1408 $ -> DOLLAR + -> PLUS ~ -> TILDE
1409<
1410So, for example: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001411
Bram Moolenaar9964e462007-05-05 17:54:07 +00001412 file.rcs,v -> NFH_rcsCOMMAv()
1413<
1414If more such translations are necessary, please send me email: >
1415 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
1416with a request.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001417
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001418
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001419MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* *netrw-curdir*
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001420
Bram Moolenaar57657d82006-04-21 22:12:41 +00001421By default, |g:netrw_keepdir| is 1. This setting means that the current
Bram Moolenaar9964e462007-05-05 17:54:07 +00001422directory will not track the browsing directory.
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001423
Bram Moolenaar9964e462007-05-05 17:54:07 +00001424Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory to
1425track netrw's browsing directory.
1426
1427However, given the default setting for g:netrw_keepdir of 1 where netrw
Bram Moolenaar57657d82006-04-21 22:12:41 +00001428maintains its own separate notion of the current directory, in order to make
1429the two directories the same, use the "c" map (just type c). That map will
Bram Moolenaar9964e462007-05-05 17:54:07 +00001430set Vim's notion of the current directory to netrw's current browsing
Bram Moolenaar57657d82006-04-21 22:12:41 +00001431directory.
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001432
1433
Bram Moolenaar9964e462007-05-05 17:54:07 +00001434BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks*
Bram Moolenaar572cb562005-08-05 21:35:02 +00001435One may easily "bookmark" a directory by using >
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001436
Bram Moolenaar9964e462007-05-05 17:54:07 +00001437 {cnt}mb
Bram Moolenaar572cb562005-08-05 21:35:02 +00001438<
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001439Any count may be used. One may use viminfo's "!" option to retain bookmarks
Bram Moolenaar9964e462007-05-05 17:54:07 +00001440between vim sessions. See |netrw-gb| for how to return to a bookmark and
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001441|netrw-q| for how to list them.
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001442
1443
Bram Moolenaar9964e462007-05-05 17:54:07 +00001444CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb*
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001445
1446To change directory back to a bookmarked directory, use
1447
Bram Moolenaar9964e462007-05-05 17:54:07 +00001448 {cnt}gb
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001449
Bram Moolenaar9964e462007-05-05 17:54:07 +00001450Any count may be used to reference any of the bookmarks. See |netrw-mb| on
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001451how to bookmark a directory and |netrw-q| on how to list bookmarks.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001452
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001453
Bram Moolenaar83bab712005-08-01 21:58:57 +00001454LISTING BOOKMARKS AND HISTORY *netrw-q* *netrw-listbookmark*
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001455
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001456Pressing "q" will list the bookmarked directories and directory traversal
Bram Moolenaar9964e462007-05-05 17:54:07 +00001457history (query). (see |netrw-mb|, |netrw-gb|, |netrw-u|, and |netrw-U|)
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001458
1459
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001460IMPROVING DIRECTORY BROWSING *netrw-listhack*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001461
1462Especially with the remote directory browser, constantly entering the password
1463is tedious.
1464
Bram Moolenaar9964e462007-05-05 17:54:07 +00001465For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength
1466tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3), gives a tip
1467for setting up no-password ssh and scp, plus discusses associated security
1468issues. It used to be available at http://hacks.oreilly.com/pub/h/66 ,
1469but apparently that address is now being redirected to some "hackzine".
1470I'll attempt a summary:
Bram Moolenaar843ee412004-06-30 16:16:41 +00001471
Bram Moolenaar9964e462007-05-05 17:54:07 +00001472 1. Generate a public/private key pair on the ssh server:
1473 ssh-keygen -t rsa
1474 (saving the file in ~/.ssh/id_rsa is ok)
1475 2. Just hit the <CR> when asked for passphrase (twice).
1476 3. This creates two files:
1477 ~/.ssh/id_rsa
1478 ~/.ssh/id_rsa.pub
1479 4. On the client:
1480 cd
1481 mkdir .ssh
1482 chmod 0700 .ssh
1483 scp {serverhostname}:.ssh/id_rsa.pub .
1484 cat id_rsa.pub >> .ssh/authorized_keys2
Bram Moolenaar843ee412004-06-30 16:16:41 +00001485
Bram Moolenaar9964e462007-05-05 17:54:07 +00001486For Windows, folks on the vim mailing list have mentioned that Pageant helps
1487with avoiding the constant need to enter the password.
Bram Moolenaar433f7c82006-03-21 21:29:36 +00001488
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001489
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001490NETRW SETTINGS *netrw-settings*
1491
1492With the NetrwSettings.vim plugin, >
1493 :NetrwSettings
1494will bring up a window with the many variables that netrw uses for its
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001495settings. You may change any of their values; when you save the file, the
1496settings therein will be used. One may also press "?" on any of the lines for
1497help on what each of the variables do.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001498
Bram Moolenaar9964e462007-05-05 17:54:07 +00001499(see also: |netrw-browse-var| |netrw-protocol| |netrw-var| |netrw-variables|)
1500
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001501
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001502==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000150310. Problems and Fixes *netrw-problems*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001504
1505 (This section is likely to grow as I get feedback)
1506 (also see |netrw-debug|)
Bram Moolenaar488c6512005-08-11 20:09:58 +00001507 *netrw-p1*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001508 P1. I use windows 95, and my ftp dumps four blank lines at the
1509 end of every read.
1510
1511 See |netrw-fixup|, and put the following into your
1512 <.vimrc> file:
1513
1514 let g:netrw_win95ftp= 1
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001515
Bram Moolenaar488c6512005-08-11 20:09:58 +00001516 *netrw-p2*
Bram Moolenaar9964e462007-05-05 17:54:07 +00001517 P2. I use Windows, and my network browsing with ftp doesn't sort by
1518 time or size! -or- The remote system is a Windows server; why
1519 don't I get sorts by time or size?
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001520
1521 Windows' ftp has a minimal support for ls (ie. it doesn't
1522 accept sorting options). It doesn't support the -F which
1523 gives an explanatory character (ABC/ for "ABC is a directory").
Bram Moolenaar9964e462007-05-05 17:54:07 +00001524 Netrw then uses "dir" to get both its short and long listings.
1525 If you think your ftp does support a full-up ls, put the
1526 following into your <.vimrc>: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001527
Bram Moolenaar9964e462007-05-05 17:54:07 +00001528 let g:netrw_ftp_list_cmd = "ls -lF"
1529 let g:netrw_ftp_timelist_cmd= "ls -tlF"
1530 let g:netrw_ftp_sizelist_cmd= "ls -slF"
1531<
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001532 Alternatively, if you have cygwin on your Windows box, put
Bram Moolenaar9964e462007-05-05 17:54:07 +00001533 into your <.vimrc>: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001534
1535 let g:netrw_cygwin= 1
Bram Moolenaar9964e462007-05-05 17:54:07 +00001536<
1537 This problem also occurs when the remote system is Windows.
1538 In this situation, the various g:netrw_ftp_[time|size]list_cmds
1539 are as shown above, but the remote system will not correctly
1540 modify its listing behavior.
1541
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001542
Bram Moolenaar488c6512005-08-11 20:09:58 +00001543 *netrw-p3*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001544 P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw
1545 used ssh! That wasn't what I asked for...
1546
1547 Netrw has two methods for browsing remote directories: ssh
1548 and ftp. Unless you specify ftp specifically, ssh is used.
1549 When it comes time to do download a file (not just a directory
1550 listing), netrw will use the given protocol to do so.
1551
Bram Moolenaar488c6512005-08-11 20:09:58 +00001552 *netrw-p4*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001553 P4. I would like long listings to be the default.
1554
Bram Moolenaar9964e462007-05-05 17:54:07 +00001555 let g:netrw_liststyle= 1
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001556
1557 Check out |netrw-browse-var| for more customizations that
1558 you can set.
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001559
Bram Moolenaar488c6512005-08-11 20:09:58 +00001560 *netrw-p5*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001561 P5. My times come up oddly in local browsing
1562
1563 Does your system's strftime() accept the "%c" to yield dates
1564 such as "Sun Apr 27 11:49:23 1997"? If not, do a "man strftime"
1565 and find out what option should be used. Then put it into
1566 your <.vimrc>:
1567 let g:netrw_timefmt= "%X" (where X is the option)
1568
Bram Moolenaar488c6512005-08-11 20:09:58 +00001569 *netrw-p6*
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001570 P6. I want my current directory to track my browsing.
1571 How do I do that?
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001572
Bram Moolenaar433f7c82006-03-21 21:29:36 +00001573 let g:netrw_keepdir= 0
Bram Moolenaar9964e462007-05-05 17:54:07 +00001574
1575 *netrw-p7*
1576 P7. I use Chinese (or other non-ascii) characters in my filenames, and
1577 netrw (Explore, Sexplore, Hexplore, etc) doesn't display them!
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001578
Bram Moolenaar9964e462007-05-05 17:54:07 +00001579 (taken from an answer provided by Wu Yongwei on the vim
1580 mailing list)
1581 I now see the problem. You code page is not 936, right? Vim
1582 seems only able to open files with names that are valid in the
1583 current code page, as are many other applications that do not
1584 use the Unicode version of Windows APIs. This is an OS-related
1585 issue. You should not have such problems when the system
1586 locale uses UTF-8, such as modern Linux distros.
1587
1588 (...it is one more reason to recommend that people use utf-8!)
1589
1590 *netrw-p8*
1591 P8. I'm getting "ssh is not executable on your system" -- what do I
1592 do?
1593
1594 (Dudley Fox) Most people I know use putty for windows ssh. It
1595 is a free ssh/telnet application. You can read more about it
1596 here:
1597
1598 http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also:
1599
1600 (Marlin Unruh) This program also works for me. It's a single
1601 executable, so he/she can copy it into the Windows\System32
1602 folder and create a shortcut to it.
1603
1604 (Dudley Fox) You might also wish to consider plink, as it
1605 sounds most similar to what you are looking for. plink is an
1606 application in the putty suite.
1607
1608 http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink
1609
1610 (Vissale Neang) Maybe you can try OpenSSH for windows, which
1611 can be obtained from:
1612
1613 http://sshwindows.sourceforge.net/
1614
1615 It doesn't need the full Cygwin package.
1616
1617 (Antoine Mechelynck) For individual Unix-like programs needed
1618 for work in a native-Windows environment, I recommend getting
1619 them from the GnuWin32 project on sourceforge if it has them:
1620
1621 http://gnuwin32.sourceforge.net/
1622
1623 Unlike Cygwin, which sets up a Unix-like virtual machine on
1624 top of Windows, GnuWin32 is a rewrite of Unix utilities with
1625 Windows system calls, and its programs works quite well in the
1626 cmd.exe "Dos box".
1627
1628 (dave) Download WinSCP and use that to connect to the server.
1629 In Preferences > Editors, set gvim as your editor:
1630
1631 - Click "Add..."
1632 - Set External Editor (adjust path as needed, include
1633 the quotes and !.! at the end):
1634 "c:\Program Files\Vim\vim70\gvim.exe" !.!
1635 - Check that the filetype in the box below is
1636 {asterisk}.{asterisk} (all files), or whatever types
1637 you want (cec: change {asterisk} to * ; I had to
1638 write it that way because otherwise the helptags
1639 system thinks its a tag)
1640 - Make sure its at the top of the listbox (click it,
1641 then click "Up" if its not)
1642 If using the Norton Commander style, you just have to hit <F4>
1643 to edit a file in a local copy of gvim.
1644
1645 (Vit Gottwald) How to generate public/private key and save
1646 public key it on server: >
1647 http://www.tartarus.org/~simon/puttydoc/Chapter8.html#pubkey-gettingready
1648 8.3 Getting ready for public key authentication
1649<
1650 How to use private key with 'pscp': >
1651 http://www.tartarus.org/~simon/puttydoc/Chapter5.html
1652 5.2.4 Using public key authentication with PSCP
1653<
1654 (cec) To make proper use of these suggestions above, you will
1655 need to modify the following user-settable variables in your
1656 .vimrc:
1657
1658 |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd|
1659 |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd|
1660
1661 The first one (|g:netrw_ssh_cmd|) is the most important; most
1662 of the others will use the string in g:netrw_ssh_cmd by
1663 default.
1664 *netrw-p9* *netrw-ml_get*
1665 P9. I'm browsing, changing directory, and bang! ml_get errors
1666 appear and I have to kill vim. Any way around this?
1667
1668 Normally netrw attempts to avoid writing swapfiles for
1669 its temporary directory buffers. However, on some systems
1670 this attempt appears to be causing ml_get errors to
1671 appear. Please try setting |g:netrw_use_noswf| to 0
1672 in your <.vimrc>: >
1673 let g:netrw_use_noswf= 0
1674<
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001675
1676==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000167711. Debugging *netrw-debug*
Bram Moolenaar071d4272004-06-13 20:20:40 +00001678
1679The <netrw.vim> script is typically available as:
Bram Moolenaar488c6512005-08-11 20:09:58 +00001680>
Bram Moolenaar071d4272004-06-13 20:20:40 +00001681 /usr/local/share/vim/vim6x/plugin/netrw.vim
Bram Moolenaar488c6512005-08-11 20:09:58 +00001682< -or- >
1683 /usr/local/share/vim/vim7x/plugin/netrw.vim
1684<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001685which is loaded automatically at startup (assuming :set nocp).
1686
1687 1. Get the <Decho.vim> script, available as:
1688
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00001689 http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_scripts
1690 as "Decho, a vimL debugging aid"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001691 or
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00001692 http://vim.sourceforge.net/scripts/script.php?script_id=120
Bram Moolenaar071d4272004-06-13 20:20:40 +00001693
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001694 and put it into your local plugin directory.
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001695
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001696 2. <Decho.vim> itself needs the <cecutil.vim> script, so you'll need
1697 to put it into your .vim/plugin, too. You may obtain it from:
Bram Moolenaar071d4272004-06-13 20:20:40 +00001698
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001699 http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs
1700 as "DrC's Utilities"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001701
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001702 3. Edit the <netrw.vim> file by typing:
1703
1704 vim netrw.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +00001705 :DechoOn
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001706 :wq
Bram Moolenaar071d4272004-06-13 20:20:40 +00001707
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001708 To restore to normal non-debugging behavior, edit <netrw.vim>
1709 by typing
Bram Moolenaar071d4272004-06-13 20:20:40 +00001710
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001711 vim netrw.vim
1712 :DechoOff
1713 :wq
1714
1715 This command, provided by <Decho.vim>, will comment out all
1716 Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()).
1717
Bram Moolenaar9964e462007-05-05 17:54:07 +00001718 4. Then bring up vim and attempt a transfer or do browsing. A set of
1719 messages should appear concerning the steps that <netrw.vim> took
1720 in attempting to read/write your file over the network.
Bram Moolenaar071d4272004-06-13 20:20:40 +00001721
Bram Moolenaar9964e462007-05-05 17:54:07 +00001722 To save the file, use >
1723 :wincmd j
1724 :set bt=
1725 :w! DBG
1726< Please send that information to <netrw.vim>'s maintainer, >
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001727 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
Bram Moolenaar9964e462007-05-05 17:54:07 +00001728<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001729==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000173012. History *netrw-history* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00001731
Bram Moolenaar9964e462007-05-05 17:54:07 +00001732 v108: Jan 03, 2007 * included preview map (|netrw-p|), supporting
1733 remote browsing
1734 * netrw can now source remote files
1735 Jan 26, 2007 * Colton Jamieson noted that remote directory
1736 browsing did not support alternate port
1737 selection. This feature has now been extended
1738 to apply to all remote browsing commands via ssh.
1739 (list, remove/delete, rename)
1740 Jan 31, 2007 * Luis Florit reported that @* was an invalid
1741 register. The @* register is now only saved and
1742 restored if 'guioptions' contains "a".
1743 Feb 02, 2007 * Fixed a bug that cropped up when writing files
1744 via scp using cygwin
1745 Feb 08, 2007 * tree listing mode managed to stop working again;
1746 fixed again!
1747 Feb 15, 2007 * Guido Van Hoecke reported that netrw didn't
1748 handle browsing well with M$ ftp servers. He even
1749 set up a temporary account for me to test with
1750 (thanks!). Netrw now can browse M$ ftp servers.
1751 v107: Oct 12, 2006 * bypassed the autowrite option
1752 Oct 24, 2006 * handles automatic decompression of *.gz and *.bz2
1753 files
1754 Nov 03, 2006 * Explore will highlight matching files when
1755 **/pattern is used (and if the |'hls'| option
1756 is set)
1757 Nov 09, 2006 * a debugging line, when enabled, was inadvertently
1758 bringing up help instead of simply reporting on
1759 list contents
1760 Nov 21, 2006 * tree listing improved (cursor remains put)
1761 Nov 27, 2006 * fixed b:netrw_curdir bug when repeated "i"s were
1762 pressed.
1763 Dec 15, 2006 * considerable qty of changes, mostly to share more
1764 code between local and remote browsing. Includes
1765 support for tree-style listing for both remote
1766 and local browsing.
1767 Dec 15, 2006 * Included Peter Bengtsson's modifications to
1768 support the Amiga.
1769 v106: Sep 21, 2006 * removed old v:version<700 code as netrw now
1770 requires vim 7.0
1771 * worked around a bug where register * was
1772 overwritten during local browsing
1773 v104: Sep 05, 2006 * as suggested by Rodolfo Borges, :Explore and
1774 variants will position the cursor on the file
1775 just having been edited
1776 * changed default |g:netrw_sort_sequence| order
1777 * changed b, Nb to simply mb (see |netrw-mb|)
1778 * changed B, NB to simply gb (see |netrw-gb|)
1779 * tree listing style (see |g:netrw_liststyle|)
1780 * attempts to retain the alternate file
1781 v103: Jul 26, 2006 * used Yakov Lerner's tip#1289 to improve netrw
1782 error message display
1783 * wide listings didn't handle files with backslashes
1784 in their names properly. A symptom was an
1785 inability to open files.
1786 Aug 09, 2006 * included "t" mapping for opening tabbed windows,
1787 both for remote and local browsing
1788 * changed netrw_longlist to netrw_liststyle
1789 Aug 15, 2006 * fixed one of the NB maps
1790 Aug 22, 2006 * changed *Explore commands to use -nargs=* instead
1791 of -nargs=?. Allows both -complete=dir _and_ the
1792 starstar arguments to work (-nargs=? seems to
1793 require one or the other).
1794 Aug 23, 2006 * copied all w:.. variables across splits to
1795 new windows
1796 Aug 25, 2006 * when g:netrw_browsex_viewer was '-'
1797 (see |g:netrw_browsex_viewer|) it wasn't causing
1798 netrwFileHandlers#Invoke() to be called as it
1799 was expected to. (tnx Steve Dugaro)
1800 Aug 29, 2006 * changed NetBrowseX() to use "setlocal ... noswf"
1801 instead of "set ... noswf" (tnx Benji Fisher)
1802 Aug 31, 2006 * tabs and fastbrowse<=1 didn't work together.
1803 v102: Jun 15, 2006 * chgd netrwPlugin to call netrw#LocalBrowseCheck()
1804 * bugfix: g:netrw_keepdir==0 had stopped working
1805 Jul 06, 2006 * bugfix: NetOptionSave/Restore now saves/restores
1806 the unnamed register (|registers|)
1807 Jul 07, 2006 * |g:netrw_menu| support included
1808 Jul 13, 2006 * :Texplore command implemented
1809 Jul 17, 2006 * NetSplit and (Local|Net)BrowseChgDir() were both
1810 splitting windows. This affected o, v, and
1811 g:netrw_browse_split.
1812 Jul 20, 2006 * works around wildignore setting (was causing
1813 netrw's local browser not to list wildignore'd
1814 files)
1815 Jul 24, 2006 * <leftmouse> acts as a <cr> for selecting a file
1816 <rightmouse> acts as a <del> for deleting a file
1817 v100: May 14, 2006 * when using Windows and shell==cmd.exe, the
1818 default for g:netrw_ignorenetrc is now 1
1819 * bugfix: unwanted ^Ms now removed
1820 (affected shell==cmd.exe - Windows)
1821 * added Bookmarks and History to the menu
1822 * an error message about non-existing
1823 w:netrw_longlist was appearing during attempts to
1824 Explore (fixed)
1825 * g:netrw_shq now available to make netrw use
1826 specified style of quotes for commands
1827 May 29, 2006 * user NFH_*() functions were inadvertently being
1828 ignored
1829 * fixed a Windows non-cygwin ftp handling problem.
1830 * hiding pattern candidate separators included some
1831 characters it shouldn't have (tnx to Osei Poku)
1832 Jun 01, 2006 * for browsing, netrw was supposed to use "dir"
1833 instead of "ls -lF" when using
1834 ftp+non-cygwin+windows. Fixed.
1835 * an inadvertently left-in-place debugging statement
1836 was preventing use of the "x" key with browsing.
1837 Jun 05, 2006 * g:netrw_nogx available to prevent making the gx
1838 map (see |g:netrw_nogx|)
1839 * bugfix, Explore woulnd't change directory
1840 properly (vim ., :Explore subdirname)
1841 Jun 06, 2006 * moved history to 2nd line in Netrw menu
1842 * fixed delete for unix-based systems
1843 Jun 07, 2006 * x key now works for windows-noncygwin-ftp
1844 Jun 08, 2006 * Explore */pat and **//pat now wraps
1845 v99: May 09, 2006 * g:netrw_browse_split=3 for opening files in new
1846 tabs implemented.
1847 May 12, 2006 * deletes temporary file at end of NetRead()
1848 * visual mode based Obtain implemented
1849 * added -complete=dir to the various Explore
1850 commands
1851 v98: May 02, 2006 * the "p" key didn't work properly when the browsing
1852 directory name had spaces in it.
1853 v97: May 01, 2006 * exists("&acd") now used to determine if
1854 the 'acd' option exists
1855 * "obtain" now works again under Windows
Bram Moolenaard68071d2006-05-02 22:08:30 +00001856 v96: * bugfix - the |'acd'| option is not always defined but is
1857 now bypassed only when it is
Bram Moolenaar5a305422006-04-28 22:38:25 +00001858 v95: * bugfix - Hiding mode worked correctly (don't show any file
1859 matching any of the g:netrw_hide patterns), but
1860 but showing mode was showing only those files that didn't
1861 match any of the g:netrw_hide patterns. Instead, it now
1862 shows all files that match any of the g:netrw_hide patterns
1863 (the difference between a logical and and logical or).
Bram Moolenaarf193fff2006-04-27 00:02:13 +00001864 v94: * bugfix - a Decho() had a missing quote; only affects things
1865 when debugging was enabled.
1866 v93: * bugfix - removed FocusGained event from causing a slow-browser
1867 refresh for Windows
1868 v92: * :Explore **//pattern implemented (**/filepattern already taken)
Bram Moolenaar57657d82006-04-21 22:12:41 +00001869 v91: * :Explore */pattern implemented
1870 * |'acd'| option bypassed
1871 v90: * mark ', as suggested by Yegappan Lakshmanan, used to help
1872 guarantee entry into the jump list when appropriate.
1873 * <s-down> and <s-up> are no longer defined until a
1874 :Explore **/pattern is used (if the user already has a map
1875 for them). They will be defined for new browser windows
1876 from that point forward.
1877 v89: * A <s-down>, <s-up>, :Nexplore, or a :Pexplore without having
1878 first done an :Explore **/pattern (see |netrw-starstar|) caused
1879 a lot of unhelpful error messages to appear
Bram Moolenaar9e54a0e2006-04-14 20:42:25 +00001880 v88: * moved DrChip.Netrw menu to Netrw. Now has priority 80 by
1881 default. g:NetrwTopLvlMenu == "Netrw" and can be changed
1882 by the user to suit. The priority is g:NetrwMenuPriority.
1883 * Changed filetype for browser displays from netrwlist to netrw.
Bram Moolenaar7fc904b2006-04-13 20:37:35 +00001884 v87: * bug fix -- menus were partially disappearing
Bram Moolenaar8dff8182006-04-06 20:18:50 +00001885 v85: * bug fix -- missing an endif
1886 * bug fix -- handles spaces in names and directories when using
1887 ftp-based browsing
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001888 v83: * disabled stop-acd handling; the change in directory handling
1889 may allow acd to be used again. Awaiting feedback.
1890 * D was refusing to delete remote files/directories in wide
1891 listing mode.
Bram Moolenaar7d47b6e2006-03-15 22:59:18 +00001892 v81: * FocusGained also used to refresh/wipe local browser directory
1893 buffers
1894 * (bugfix) netrw was leaving [Scratch] buffers behind when the
1895 the user had the "hidden" option set. The 'hidden' option is
1896 now bypassed.
1897 v80: * ShellCmdPost event used in conjunction with g:netrw_fastbrowse
1898 to refresh/wipe local browser directory buffers.
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +00001899 v79: * directories are now displayed with nowrap
1900 * (bugfix) if the column width was smaller than the largest
1901 file's name, then netrw would hang when using wide-listing
1902 mode - fixed
1903 * g:netrw_fastbrowse introduced
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001904 v78: * progress has been made on allowing spaces inside directory
1905 names for remote work (reading, writing, browsing). (scp)
1906 v77: * Mikolaj Machowski fixed a bug in a substitute command
1907 * g:netrw_browsex_viewer implemented
1908 * Mikolaj Machowski pointed out that gnome-open is often
1909 executable under KDE systems, although it is effectively
Bram Moolenaar9964e462007-05-05 17:54:07 +00001910 not functional. NetBrowseX now looks for "kicker" as
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001911 a running process to determine if KDE is actually the
1912 really running.
1913 * Explorer's O functionality was inadvertently left out.
1914 Netrw now does the same thing, but with the "P" key.
1915 * added g:netrw_browse_split option
1916 * fixed a bug where the directory contained a "." but
1917 the file didn't (was treating the dirname from "."
1918 onwards as a suffix)
Bram Moolenaar36c31f72005-11-28 23:01:53 +00001919 v76: * "directory is missing" error message now restores echo
1920 highlighting
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001921 v75: * file://... now conforms to RFC2396 (thanks to S. Zacchiroli)
1922 * if the binary option is set, then NetWrite() will only write
1923 the whole file (line numbers don't make sense with this).
1924 Supports writing of tar and zip files.
1925 v74: * bugfix (vim, then :Explore) now works
1926 * ctrl-L keeps cursor at same screen location (both local and
1927 remote browsing)
1928 * netrw now can read remote zip and tar files
1929 * Obtain now uses WinXP ftp+.netrc successfully
1930 v73: * bugfix -- scp://host/path/file was getting named incorrectly
1931 * netrw detects use of earlier-than-7.0 version of vim and issues
1932 a pertinent error message.
1933 * netrwSettings.vim is now uses autoloading. Only
1934 <netrwPlugin.vim> is needed as a pure plugin
1935 (ie. always loaded).
1936 v72: * bugfix -- formerly, one could prevent the loading of netrw
1937 by "let g:loaded_netrw=1"; when autoloading became supported,
1938 this feature was lost. It is now restored.
1939 v71: * bugfix -- made some "set nomodifiable"s into setlocal variants
1940 (allows :e somenewfile to be modifiable as usual)
1941 * NetrwSettings calls a netrw function, thereby assuring that
1942 netrw has loaded. However, if netrw does not load for whatever
1943 reason, then NetrwSettings will now issue a warning message.
1944 * For what reason I don't recall, when wget and fetch are both
1945 not present, and an attempt to read a http://... url is made,
1946 netrw exited. It now only returns.
1947 * When ch=1, on the second and subsequent uses of browsing Netrw
1948 would issue a blank line to clear the echo'd messages. This
1949 caused an annoying "Hit-Enter" prompt; now a blank line message
1950 is echo'd only if &ch>1.
1951 v70: * when using |netrw-O|, the "Obtaining filename" message is now
1952 shown using |hl-User9|. If User9 has not been defined, netrw
1953 will define it.
1954 v69: * Bugfix: win95/98 machines were experiencing a
1955 "E121: Undefined variable: g:netrw_win95ftp" message
1956 v68: * double-click-leftmouse selects word under mouse
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00001957 v67: * Passwords which contain blanks will now be surrounded by
1958 double-quotes automatically (Yongwei)
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001959 v66: * Netrw now seems to work with a few more Windows situations
1960 * O now obtains a file: remote browsing file -> local copy,
1961 locally browsing file -> current directory (see :pwd)
1962 * i now cycles between thin, long, and wide listing styles
1963 * NB and Nb are maps that are always available; corresponding
1964 B and b maps are only available when not using wide listing
1965 in order to allow them to be used for motions
1966 v65: * Browser functions now use NetOptionSave/Restore; in particular,
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001967 netrw now works around the report setting
Bram Moolenaar9964e462007-05-05 17:54:07 +00001968 v64: * Bugfix - browsing a "/" directory (Unix) yielded buffers
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001969 named "[Scratch]" instead of "/"
1970 * Bugfix - remote browsing with ftp was omitting the ./ and ../
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001971 v63: * netrw now takes advantage of autoload (and requires 7.0)
1972 * Bugfix - using r (to reverse sort) working again
1973 v62: * Bugfix - spaces allowed again in directory names with
1974 g:netrw_keepdir=0. In fact, I've tested netrw (again)
1975 with most ANSI punctuation marks for directory names.
1976 * Bugfix - NetrwSettings gave errors when g:netrw_silent
1977 had not be set.
Bram Moolenaar90cfdbe2005-08-12 19:59:19 +00001978 v61: * document upgrade -- netrw variable-based settings all should
1979 have tags. Supports NetrwSettings command.
1980 * several important variables are window-oriented. Netrw has
1981 to transfer these across a window split. See s:BufWinVars()
1982 and s:UseBufWinVars().
Bram Moolenaar488c6512005-08-11 20:09:58 +00001983 v60: * when using the i map to switch between long and short listings,
1984 netrw will now keep cursor on same line
1985 * "Match # of #" now uses status line
1986 * :Explore **/*.c will now work from a non-netrw-browser window
1987 * :Explore **/patterns can now be run in separate browser windows
1988 * active banner (hit <cr> will cause various things to happen)
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001989 v59: * bugfix -- another keepalt work-around installed (for vim6.3)
1990 * "Match # of #" for Explore **/pattern matches
Bram Moolenaar572cb562005-08-05 21:35:02 +00001991 v58: * Explore and relatives can now handle **/somefilepattern (v7)
1992 * Nexplore and Pexplore introduced (v7). shift-down and shift-up
1993 cursor keys will invoke Nexplore and Pexplore, respectively.
1994 * bug fixed with o and v
1995 * autochdir only worked around for vim when it has been
1996 compiled with either |+netbeans_intg| or |+sun_workshop|
1997 * Under Windows, all directories and files were being preceded
1998 with a "/" when local browsing. Fixed.
1999 * When: syntax highlighting is off, laststatus=2, and remote
2000 browsing is used, sometimes the laststatus highlighting
2001 bleeds into the entire display. Work around - do an extra
2002 redraw in that case.
2003 * Bugfix: when g:netrw_keepdir=0, due to re-use of buffers,
2004 netrw didn't change the directory when it should've
2005 * Bugfix: D and R commands work again
Bram Moolenaar1d94f9b2005-08-04 21:29:45 +00002006 v57: * Explore and relatives can now handle RO files
2007 * reverse sort restored with vim7's sort command
2008 * g:netrw_keepdir now being used to keep the current directory
2009 unchanged as intended (sense change)
2010 * vim 6.3 still supported
Bram Moolenaar83bab712005-08-01 21:58:57 +00002011 v56: * LocalBrowse now saves autochdir setting, unsets it, and
2012 restores it before returning.
2013 * using vim's rename() instead of system + local_rename variable
Bram Moolenaar1d94f9b2005-08-04 21:29:45 +00002014 * avoids changing directory when g:netrw_keepdir is false
Bram Moolenaar83bab712005-08-01 21:58:57 +00002015 v55: * -bar used with :Explore :Sexplore etc to allow multiple
2016 commands to be separated by |s
2017 * browser listings now use the "nowrap" option
2018 * browser: some unuseful error messages now suppressed
2019 v54: * For backwards compatibility, Explore and Sexplore have been
2020 implemented. In addition, Hexplore and Vexplore commands
2021 are available, too.
2022 * <amatch> used instead of <afile> in the transparency
2023 support (BufReadCmd, FileReadCmd, FileWriteCmd)
2024 * ***netrw*** prepended to various error messages netrw may emit
2025 * g:netrw_port used instead of b:netrw_port for scp
2026 * any leading [:#] is removed from port numbers
2027 v53: * backslashes as well as slashes placed in various patterns
2028 (ex. g:netrw_sort_sequence) to better support Windows
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00002029 v52: * nonumber'ing now set for browsing buffers
2030 * when the hiding list hid all files, error messages ensued. Fixed
2031 * when browsing, swf is set, but directory is not set, when netrw
2032 was attempting to restore options, vim wanted to save a swapfile
2033 to a local directory using an url-style path. Fixed
2034 v51: * cygwin detection now automated (using windows and &shell is bash)
2035 * customizable browser "file" rejection patterns
2036 * directory history
2037 * :[range]w url now supported (ie. netrw has a FileWriteCmd event)
2038 * error messages have a "Press <cr> to continue" to allow them
2039 to be seen
2040 * directory browser displays no longer bother the swapfile
2041 * u/U commands to go up and down the history stack
2042 * history stack may be saved with viminfo with its "!" option
2043 * bugfixes associated with unwanted [No Files] entries
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002044 v50: * directories now displayed using buftype=nofile; should keep the
2045 directory names as-is
2046 * attempts to remove empty "[No File]" buffers leftover
2047 from :file ..name.. commands
2048 * bugfix: a "caps-lock" editing difficulty left in v49 was fixed
2049 * syntax highlighting for "Showing:" the hiding list included
2050 * bookmarks can now be retained if "!" is in the viminfo option
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00002051 v49: * will use ftp for http://.../ browsing v48:
2052 * One may use ftp to do remote host file browsing
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002053 * (windows and !cygwin) remote browsing with ftp can now use
2054 the "dir" command internally to provide listings
2055 * g:netrw_keepdir now allows one to keep the initial current
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002056 directory as the current directory (normally the local file
2057 browser makes the currently viewed directory the current
2058 directory)
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002059 * g:netrw_alto and g:netrw_altv now support alternate placement
2060 of windows started with o or v
2061 * Nread ? and Nwrite ? now uses echomsg (instead of echo) so
2062 :messages can repeat showing the help
2063 * bugfix: avoids problems with partial matches of directory names
2064 to prior buffers with longer names
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002065 * one can suppress error messages with g:netrw_quiet ctrl-h used
2066 * instead of <Leader>h for editing hiding list one may edit the
2067 * sorting sequence with the S map now allows confirmation of
2068 * deletion with [y(es) n(o) a(ll) q(uit)] the "x" map now handles
2069 * special file viewing with:
2070 (windows) rundll32 url.dll (gnome) gnome-open (kde)
2071 kfmclient If none of these are on the executable path, then
Bram Moolenaar1afcace2005-11-25 19:54:28 +00002072 netrwFileHandlers.vim is used.
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002073 * directory bookmarking during both local and remote browsing
2074 implemented
2075 * one may view all, use the hiding list to suppress, or use the
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002076 hiding list to show-only remote and local file/directory
2077 listings
2078 * improved unusual file and directory name handling preview
2079 * window support
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00002080 v47: * now handles local directory browsing.
2081 v46: * now handles remote directory browsing
2082 * g:netrw_silent (if 1) will cause all transfers to be silent
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002083 v45: * made the [user@]hostname:path form a bit more restrictive to
2084 better handle errors in using protocols (e.g. scp:usr@host:file
2085 was being recognized as an rcp request) v44: * changed from
2086 "rsync -a" to just "rsync"
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00002087 * somehow an editing error messed up the test to recognize
2088 use of the fetch method for NetRead.
2089 * more debugging statements included
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002090 v43: * moved "Explanation" comments to <pi_netrw.txt> help file as
2091 "Network Reference" (|netrw-ref|)
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00002092 * <netrw.vim> now uses Dfunc() Decho() and Dret() for debugging
2093 * removed superfluous NetRestorePosn() calls
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002094 v42: * now does BufReadPre and BufReadPost events on file:///* and
2095 file://localhost/* v41: * installed file:///* and
2096 file://localhost/* handling v40: * prevents redraw when a
2097 protocol error occurs so that the user may see it v39: * sftp
2098 support v38: * Now uses NetRestorePosn() calls with
2099 Nread/Nwrite commands
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00002100 * Temporary files now removed via bwipe! instead of bwipe
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002101 (thanks to Dave Roberts) v37: * Claar's modifications which
2102 test if ftp is successful, otherwise give an error message
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00002103 * After a read, the alternate file was pointing to the temp file.
2104 The temp file buffer is now wiped out.
2105 * removed silent from transfer methods so user can see what's
2106 happening
Bram Moolenaar071d4272004-06-13 20:20:40 +00002107
2108
2109==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000211012. Credits *netrw-credits* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00002111
2112 Vim editor by Bram Moolenaar (Thanks, Bram!)
2113 dav support by C Campbell
2114 fetch support by Bram Moolenaar and C Campbell
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00002115 ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM>
Bram Moolenaar071d4272004-06-13 20:20:40 +00002116 http support by Bram Moolenaar <bram@moolenaar.net>
2117 rcp
2118 rsync support by C Campbell (suggested by Erik Warendorph)
2119 scp support by raf <raf@comdyn.com.au>
2120 sftp support by C Campbell
2121
2122 inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell
2123
2124 Jérôme Augé -- also using new buffer method with ftp+.netrc
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00002125 Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use,
Bram Moolenaarc9b4b052006-04-30 18:54:39 +00002126 fetch,...
Bram Moolenaar071d4272004-06-13 20:20:40 +00002127 Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution
2128 Erik Warendorph -- for several suggestions (g:netrw_..._cmd
2129 variables, rsync etc)
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00002130 Doug Claar -- modifications to test for success with ftp
Bram Moolenaarc9b4b052006-04-30 18:54:39 +00002131 operation
Bram Moolenaar071d4272004-06-13 20:20:40 +00002132
2133==============================================================================
Bram Moolenaar83bab712005-08-01 21:58:57 +00002134 vim:tw=78:ts=8:ft=help:norl:fdm=marker