blob: 0f32bee5b8e2e849eb0a63082b920b60fde54c63 [file] [log] [blame]
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00001*pi_netrw.txt* For Vim version 7.1b. Last change: 2007 May 08
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 Moolenaar7aa9f6a2007-05-10 18:00:30 +0000198
Bram Moolenaar071d4272004-06-13 20:20:40 +0000199 Attempts to use ftp will prompt you for a user-id and a password.
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000200 These will be saved in global variables g:netrw_uid and
201 g:netrw_passwd; subsequent uses of ftp will re-use those two items to
202 simplify the further use of ftp. However, if you need to use a
203 different user id and/or password, you'll want to call NetUserPass()
204 first. To work around the need to enter passwords, check if your ftp
205 supports a <.netrc> file in your home directory. Also see
206 |netrw-passwd| (and if you're using ssh/scp hoping to figure out how
207 to not need to use passwords, look at |netrw-listhack|).
Bram Moolenaar071d4272004-06-13 20:20:40 +0000208
209 :NetUserPass [uid [password]] -- prompts as needed
210 :call NetUserPass() -- prompts for uid and password
211 :call NetUserPass("uid") -- prompts for password
212 :call NetUserPass("uid","password") -- sets global uid and password
213
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000214VARIABLES *netrw-variables*
Bram Moolenaar9964e462007-05-05 17:54:07 +0000215
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000216(also see: |netrw-browse-var| |netrw-protocol| |netrw-settings| |netrw-var|)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000217
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000218 *b:netrw_lastfile* last file Network-read/written retained on a per-buffer
219 basis (supports plain :Nw )
Bram Moolenaar071d4272004-06-13 20:20:40 +0000220
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000221 *g:netrw_ftp* if it doesn't exist, use default ftp
222 =0 use default ftp (uid password)
223 =1 use alternate ftp method (user uid password)
224 If you're having trouble with ftp, try changing the
225 value of this variable to see if the alternate ftp
226 method works for your setup.
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000227
Bram Moolenaar9964e462007-05-05 17:54:07 +0000228 *g:netrw_extracmd* default: doesn't exist
229 If this variable exists, then any string it contains
230 will be placed into the commands set to your ftp
231 client. As an example:
232 ="passive"
233
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000234 *g:netrw_ftpmode* ="binary" (default)
235 ="ascii"
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000236
Bram Moolenaar9964e462007-05-05 17:54:07 +0000237 *g:netrw_ignorenetrc* =0 (default for linux, cygwin)
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000238 =1 If you have a <.netrc> file but it doesn't work and
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000239 you want it ignored, then set this variable as shown.
Bram Moolenaar9964e462007-05-05 17:54:07 +0000240 (default for Windows + cmd.exe)
241
242 *g:netrw_menu* =0 disable netrw's menu
243 =1 (default) netrw's menu enabled
244
245 *g:netrw_nogx* if this variable exists, then the "gx" map will not
246 be available (see |netrw-gx|)
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000247
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000248 *g:netrw_uid* (ftp) user-id, retained on a per-session basis
249 *g:netrw_passwd* (ftp) password, retained on a per-session basis
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000250
Bram Moolenaar9964e462007-05-05 17:54:07 +0000251 *g:netrw_shq* = "'" for Unix/Linux systems (ie. a single quote)
252 = "'" for Windows + cygwin systems (ie. a single quote)
253 = '"' for Windows systems, not using cygwin
254 (ie. a double quote)
255 Controls the quoting character used during scp and ftp
256 commands.
257
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000258 *g:netrw_scpport* = "-P" : option to use to set port for scp
259 *g:netrw_sshport* = "-p" : option to use to set port for ssh
260
261 *g:netrw_use_errorwindow* =1 : messages from netrw will use a separate one
262 line window. This window provides reliable
263 delivery of messages. (default)
264 =0 : messages from netrw will use echoerr ;
265 messages don't always seem to show up this
266 way, but one doesn't have to quit the window.
267
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000268 *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank
269 lines that o/s's ftp "provides" on transfers
270 =0 force normal ftp behavior (no trailing line removal)
271
272 *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also
273 permits network browsing to use ls with time and
274 size sorting (default if windows)
275 =0 assume Windows' scp accepts windows-style paths
276 Network browsing uses dir instead of ls
277 This option is ignored if you're using unix
278
279 *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP
Bram Moolenaar9964e462007-05-05 17:54:07 +0000280 =1 use WinNT's rcp in binary mode (default)
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000281
282PATHS *netrw-path*
283
284Paths to files are generally user-directory relative for most protocols.
285It is possible that some protocol will make paths relative to some
286associated directory, however.
287>
288 example: vim scp://user@host/somefile
289 example: vim scp://user@host/subdir1/subdir2/somefile
290<
291where "somefile" is the "user"'s home directory. If you wish to get a
292file using root-relative paths, use the full path:
293>
294 example: vim scp://user@host//somefile
295 example: vim scp://user@host//subdir1/subdir2/somefile
296<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000297
298==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +00002994. Network-Oriented File Transfer *netrw-xfer*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000300
301Network-oriented file transfer under Vim is implemented by a VimL-based script
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000302(<netrw.vim>) using plugin techniques. It currently supports both reading and
303writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch,
Bram Moolenaar071d4272004-06-13 20:20:40 +0000304dav/cadaver, rsync, or sftp.
305
306http is currently supported read-only via use of wget or fetch.
307
308<netrw.vim> is a standard plugin which acts as glue between Vim and the
309various file transfer programs. It uses autocommand events (BufReadCmd,
310FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. >
311
312 ex. vim ftp://hostname/path/to/file
313<
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000314The characters preceding the colon specify the protocol to use; in the
315example, its ftp. The <netrw.vim> script then formulates a command or a
316series of commands (typically ftp) which it issues to an external program
317(ftp, scp, etc) which does the actual file transfer/protocol. Files are read
318from/written to a temporary file (under Unix/Linux, /tmp/...) which the
319<netrw.vim> script will clean up.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000320
Bram Moolenaar9964e462007-05-05 17:54:07 +0000321 *netrw-putty* *netrw-pscp* *netrw-psftp*
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000322One may modify any protocol's implementing external application by setting a
323variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000324"scp -q"). As an example, consider using PuTTY: >
Bram Moolenaar9964e462007-05-05 17:54:07 +0000325
326 let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch'
327 let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"'
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000328<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000329See |netrw-p8| for more about putty, pscp, psftp, etc.
330
Bram Moolenaar071d4272004-06-13 20:20:40 +0000331Ftp, an old protocol, seems to be blessed by numerous implementations.
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000332Unfortunately, some implementations are noisy (ie., add junk to the end of the
333file). Thus, concerned users may decide to write a NetReadFixup() function
334that will clean up after reading with their ftp. Some Unix systems (ie.,
335FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is
336not noisy and more convenient, actually, for <netrw.vim> to use.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000337Consequently, if "fetch" is executable, it will be used to do reads for
338ftp://... (and http://...) . See |netrw-var| for more about this.
339
340For rcp, scp, sftp, and http, one may use network-oriented file transfers
Bram Moolenaar83bab712005-08-01 21:58:57 +0000341transparently; ie.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000342>
343 vim rcp://[user@]machine/path
344 vim scp://[user@]machine/path
345<
346If your ftp supports <.netrc>, then it too can be just as transparently used
347if the needed triad of machine name, user id, and password are present in
348that file. Your ftp must be able to use the <.netrc> file on its own, however.
349>
350 vim ftp://[user@]machine[[:#]portnumber]/path
351<
352However, ftp will often need to query the user for the userid and password.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000353The latter will be done "silently"; ie. asterisks will show up instead of
Bram Moolenaar071d4272004-06-13 20:20:40 +0000354the actually-typed-in password. Netrw will retain the userid and password
355for subsequent read/writes from the most recent transfer so subsequent
356transfers (read/write) to or from that machine will take place without
357additional prompting.
358
359 *netrw-urls*
360 +=================================+============================+============+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000361 | Reading | Writing | Uses |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000362 +=================================+============================+============+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000363 | DAV: | | |
364 | dav://host/path | | cadaver |
365 | :Nread dav://host/path | :Nwrite dav://host/path | cadaver |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000366 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000367 | FETCH: | | |
368 | fetch://[user@]host/path | | |
369 | fetch://[user@]host:http/path | Not Available | fetch |
370 | :Nread fetch://[user@]host/path| | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000371 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000372 | FILE: | | |
373 | file:///* | file:///* | |
374 | file://localhost/* | file://localhost/* | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000375 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000376 | FTP: (*3) | (*3) | |
377 | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) |
378 | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc |
379 | :Nread host path | :Nwrite host path | ftp+.netrc |
380 | :Nread host uid pass path | :Nwrite host uid pass path | ftp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000381 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000382 | HTTP: wget is executable: (*4) | | |
383 | http://[user@]host/path | Not Available | wget |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000384 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000385 | HTTP: fetch is executable (*4) | | |
386 | http://[user@]host/path | Not Available | fetch |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000387 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000388 | RCP: | | |
389 | rcp://[user@]host/path | rcp://[user@]host/path | rcp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000390 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000391 | RSYNC: | | |
392 | rsync://[user@]host/path | rsync://[user@]host/path | rsync |
393 | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync |
394 | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000395 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000396 | SCP: | | |
397 | scp://[user@]host/path | scp://[user@]host/path | scp |
398 | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000399 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000400 | SFTP: | | |
401 | sftp://[user@]host/path | sftp://[user@]host/path | sftp |
402 | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000403 +=================================+============================+============+
404
405 (*1) For an absolute path use scp://machine//path.
406
407 (*2) if <.netrc> is present, it is assumed that it will
408 work with your ftp client. Otherwise the script will
Bram Moolenaar9964e462007-05-05 17:54:07 +0000409 prompt for user-id and password.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000410
Bram Moolenaar9964e462007-05-05 17:54:07 +0000411 (*3) for ftp, "machine" may be machine#port or machine:port
Bram Moolenaar071d4272004-06-13 20:20:40 +0000412 if a different port is needed than the standard ftp port
413
414 (*4) for http:..., if wget is available it will be used. Otherwise,
415 if fetch is available it will be used.
416
417Both the :Nread and the :Nwrite ex-commands can accept multiple filenames.
418
419
420NETRC *netrw-netrc*
421
422The typical syntax for lines in a <.netrc> file is given as shown below.
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000423Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000424>
425 machine {full machine name} login {user-id} password "{password}"
426 default login {user-id} password "{password}"
427
428Your ftp client must handle the use of <.netrc> on its own, but if the
429<.netrc> file exists, an ftp transfer will not ask for the user-id or
430password.
431
432 Note:
433 Since this file contains passwords, make very sure nobody else can
434 read this file! Most programs will refuse to use a .netrc that is
435 readable for others. Don't forget that the system administrator can
436 still read the file!
437
438
439PASSWORD *netrw-passwd*
440
441The script attempts to get passwords for ftp invisibly using |inputsecret()|,
442a built-in Vim function. See |netrw-uidpass| for how to change the password
443after one has set it.
444
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000445Unfortunately there doesn't appear to be a way for netrw to feed a password to
446scp. Thus every transfer via scp will require re-entry of the password.
447However, |netrw-listhack| can help with this problem.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000448
449
450==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +00004515. Activation *netrw-activate*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000452
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000453Network-oriented file transfers are available by default whenever Vim's
Bram Moolenaar071d4272004-06-13 20:20:40 +0000454|'nocompatible'| mode is enabled. The <netrw.vim> file resides in your
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000455system's vim-plugin directory and is sourced automatically whenever you bring
456up vim. I suggest that, at a minimum, you have at least the following in your
457<.vimrc> customization file: >
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000458
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000459 set nocp
460 if version >= 600
461 filetype plugin indent on
462 endif
463<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000464
465==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +00004666. Transparent File Transfer *netrw-transparent*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000467
468Transparent file transfers occur whenever a regular file read or write
469(invoked via an |:autocmd| for |BufReadCmd| or |BufWriteCmd| events) is made.
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000470Thus one may use files across networks just as simply as if they were local. >
Bram Moolenaar071d4272004-06-13 20:20:40 +0000471
472 vim ftp://[user@]machine/path
473 ...
474 :wq
475
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000476See |netrw-activate| for more on how to encourage your vim to use plugins
477such as netrw.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000478
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000479
Bram Moolenaar071d4272004-06-13 20:20:40 +0000480==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +00004817. Ex Commands *netrw-ex*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000482
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000483The usual read/write commands are supported. There are also a few
484additional commands available. Often you won't need to use Nw or
Bram Moolenaar9964e462007-05-05 17:54:07 +0000485Nread as shown in |netrw-transparent| (ie. simply use >
486 :e url
487 :r url
488 :w url
489instead, as appropriate) -- see |netrw-urls|. In the explanations
490below, a {netfile} is an url to a remote file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000491
492:[range]Nw Write the specified lines to the current
493 file as specified in b:netrw_lastfile.
494
495:[range]Nw {netfile} [{netfile}]...
496 Write the specified lines to the {netfile}.
497
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000498:Nread Read the specified lines into the current
Bram Moolenaar071d4272004-06-13 20:20:40 +0000499 buffer from the file specified in
500 b:netrw_lastfile.
501
502:Nread {netfile} {netfile}...
503 Read the {netfile} after the current line.
504
Bram Moolenaar9964e462007-05-05 17:54:07 +0000505:Nsource {netfile}
506 Source the {netfile}.
507 To start up vim using a remote .vimrc, one may use
508 the following (all on one line) (tnx to Antoine Mechelynck) >
509 vim -u NORC -N
510 --cmd "runtime plugin/netrwPlugin.vim"
511 --cmd "source scp://HOSTNAME/.vimrc"
512< *netrw-uidpass*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000513:call NetUserPass()
514 If b:netrw_uid and b:netrw_passwd don't exist,
515 this function query the user for them.
516
517:call NetUserPass("userid")
518 This call will set the b:netrw_uid and, if
519 the password doesn't exist, will query the user for it.
520
521:call NetUserPass("userid","passwd")
522 This call will set both the b:netrw_uid and b:netrw_passwd.
523 The user-id and password are used by ftp transfers. One may
524 effectively remove the user-id and password by using ""
525 strings.
526
Bram Moolenaar9964e462007-05-05 17:54:07 +0000527:NetrwSettings This command is described in |netrw-settings| -- used to
528 display netrw settings and change netrw behavior.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000529
Bram Moolenaar071d4272004-06-13 20:20:40 +0000530
531==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +00005328. Variables and Options *netrw-options* *netrw-var*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000533
Bram Moolenaar9964e462007-05-05 17:54:07 +0000534The <netrw.vim> script provides several variables which act as options to
535ffect <netrw.vim>'s behavior. These variables typically may be set in the
536user's <.vimrc> file:
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000537(also see:
538|netrw-settings| |netrw-browse-var| |netrw-protocol| |netrw-settings|) >
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000539
Bram Moolenaar9964e462007-05-05 17:54:07 +0000540 -------------
541 Netrw Options
542 -------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000543 Option Meaning
544 -------------- -----------------------------------------------
545<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000546 b:netrw_col Holds current cursor position (during NetWrite)
547 g:netrw_cygwin =1 assume scp under windows is from cygwin
548 (default/windows)
549 =0 assume scp under windows accepts windows
550 style paths (default/else)
551 g:netrw_ftp =0 use default ftp (uid password)
552 g:netrw_ftpmode ="binary" (default)
553 ="ascii" (your choice)
554 g:netrw_ignorenetrc =1 (default)
555 if you have a <.netrc> file but you don't
Bram Moolenaar071d4272004-06-13 20:20:40 +0000556 want it used, then set this variable. Its
557 mere existence is enough to cause <.netrc>
558 to be ignored.
Bram Moolenaar9964e462007-05-05 17:54:07 +0000559 b:netrw_lastfile Holds latest method/machine/path.
560 b:netrw_line Holds current line number (during NetWrite)
561 g:netrw_passwd Holds current password for ftp.
562 g:netrw_silent =0 transfers done normally
563 =1 transfers done silently
564 g:netrw_uid Holds current user-id for ftp.
565 =1 use alternate ftp (user uid password)
566 (see |netrw-options|)
567 g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
568 =1 use WinNT/2K/XP's rcp, binary mode
569 g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc
570 =1 use default method to do ftp >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000571 -----------------------------------------------------------------------
572<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000573The script will also make use of the following variables internally, albeit
574temporarily.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000575>
576 -------------------
577 Temporary Variables
578 -------------------
579 Variable Meaning
580 -------- ------------------------------------
581<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000582 g:netrw_method Index indicating rcp/ftp+.netrc/ftp
583 g:netrw_machine Holds machine name parsed from input
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000584 g:netrw_fname Holds filename being accessed >
585 ------------------------------------------------------------
586<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000587 *netrw-protocol*
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000588
589Netrw supports a number of protocols. These protocols are invoked using the
590variables listed below, and may be modified by the user.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000591>
592 ------------------------
Bram Moolenaar9964e462007-05-05 17:54:07 +0000593 Protocol Control Options
Bram Moolenaar071d4272004-06-13 20:20:40 +0000594 ------------------------
Bram Moolenaar9964e462007-05-05 17:54:07 +0000595 Option Type Setting Meaning
596 --------- -------- -------------- ---------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000597<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000598 netrw_ftp variable =doesn't exist userid set by "user userid"
599 =0 userid set by "user userid"
600 =1 userid set by "userid"
601 NetReadFixup function =doesn't exist no change
602 =exists Allows user to have files
603 read via ftp automatically
604 transformed however they wish
605 by NetReadFixup()
Bram Moolenaar071d4272004-06-13 20:20:40 +0000606 g:netrw_dav_cmd variable ="cadaver"
Bram Moolenaar9964e462007-05-05 17:54:07 +0000607 g:netrw_fetch_cmd variable ="fetch -o" if fetch is available
Bram Moolenaar071d4272004-06-13 20:20:40 +0000608 g:netrw_ftp_cmd variable ="ftp"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000609 g:netrw_http_cmd variable ="fetch -o" if fetch is available
610 g:netrw_http_cmd variable ="wget -O" else if wget is available
Bram Moolenaar9964e462007-05-05 17:54:07 +0000611 g:netrw_list_cmd variable ="ssh USEPORT HOSTNAME ls -Fa"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000612 g:netrw_rcp_cmd variable ="rcp"
613 g:netrw_rsync_cmd variable ="rsync -a"
614 g:netrw_scp_cmd variable ="scp -q"
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000615 g:netrw_sftp_cmd variable ="sftp" >
616 -------------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000617<
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000618 *netrw-ftp*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000619
Bram Moolenaar9964e462007-05-05 17:54:07 +0000620The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|)
621specify the external program to use handle the ftp protocol. They may
622include command line options (such as -p for passive mode).
Bram Moolenaar071d4272004-06-13 20:20:40 +0000623
Bram Moolenaar9964e462007-05-05 17:54:07 +0000624Browsing is supported by using the |g:netrw_list_cmd|; the substring
625"HOSTNAME" will be changed via substitution with whatever the current request
626is for a hostname.
627
628Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's
629that give trouble . In order to best understand how to use these options if
630ftp is giving you troubles, a bit of discussion is provided on how netrw does
631ftp reads.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000632
633For ftp, netrw typically builds up lines of one of the following formats in a
Bram Moolenaar071d4272004-06-13 20:20:40 +0000634temporary file:
635>
636 IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1
637 ---------------------------------- ------------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000638<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000639 open machine [port] open machine [port]
640 user userid password userid password
641 [g:netrw_ftpmode] password
642 [g:netrw_extracmd] [g:netrw_ftpmode]
643 get filename tempfile [g:netrw_extracmd]
644 get filename tempfile >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000645 ---------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000646<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000647The |g:netrw_ftpmode| and |g:netrw_extracmd| are optional.
648
Bram Moolenaar071d4272004-06-13 20:20:40 +0000649Netrw then executes the lines above by use of a filter:
650>
651 :%! {g:netrw_ftp_cmd} -i [-n]
652<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000653where
654 g:netrw_ftp_cmd is usually "ftp",
655 -i tells ftp not to be interactive
656 -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>)
657
658If <.netrc> exists it will be used to avoid having to query the user for
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000659userid and password. The transferred file is put into a temporary file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000660The temporary file is then read into the main editing session window that
661requested it and the temporary file deleted.
662
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000663If your ftp doesn't accept the "user" command and immediately just demands a
664userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000665
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000666 *netrw-cadaver*
667To handle the SSL certificate dialog for untrusted servers, one may pull
668down the certificate and place it into /usr/ssl/cert.pem. This operation
669renders the server treatment as "trusted".
670
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000671 *netrw-fixup* *netreadfixup*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000672If your ftp for whatever reason generates unwanted lines (such as AUTH
673messages) you may write a NetReadFixup(tmpfile) function:
674>
675 function! NetReadFixup(method,line1,line2)
676 " a:line1: first new line in current file
677 " a:line2: last new line in current file
678 if a:method == 1 "rcp
679 elseif a:method == 2 "ftp + <.netrc>
680 elseif a:method == 3 "ftp + machine,uid,password,filename
681 elseif a:method == 4 "scp
682 elseif a:method == 5 "http/wget
683 elseif a:method == 6 "dav/cadaver
684 elseif a:method == 7 "rsync
685 elseif a:method == 8 "fetch
686 elseif a:method == 9 "sftp
Bram Moolenaar9964e462007-05-05 17:54:07 +0000687 else " complain
Bram Moolenaar071d4272004-06-13 20:20:40 +0000688 endif
689 endfunction
690>
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000691The NetReadFixup() function will be called if it exists and thus allows you to
692customize your reading process. As a further example, <netrw.vim> contains
693just such a function to handle Windows 95 ftp. For whatever reason, Windows
69495's ftp dumps four blank lines at the end of a transfer, and so it is
695desirable to automate their removal. Here's some code taken from <netrw.vim>
696itself:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000697>
698 if has("win95") && g:netrw_win95ftp
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000699 fun! NetReadFixup(method, line1, line2)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000700 if method == 3 " ftp (no <.netrc>)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000701 let fourblanklines= line2 - 3
702 silent fourblanklines.",".line2."g/^\s*/d"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000703 endif
704 endfunction
705 endif
706>
707
708==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +00007099. Directory Browsing *netrw-browse* *netrw-dir* *netrw-list* *netrw-help*
Bram Moolenaar83bab712005-08-01 21:58:57 +0000710
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000711MAPS *netrw-maps*
712 <F1>.............Help.......................................|netrw-help|
Bram Moolenaar83bab712005-08-01 21:58:57 +0000713 <cr>.............Browsing...................................|netrw-cr|
714 <del>............Deleting Files or Directories..............|netrw-delete|
715 -................Going Up...................................|netrw--|
716 a................Hiding Files or Directories................|netrw-a|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000717 mb...............Bookmarking a Directory....................|netrw-mb|
718 gb...............Changing to a Bookmarked Directory.........|netrw-gb|
Bram Moolenaar83bab712005-08-01 21:58:57 +0000719 c................Make Browsing Directory The Current Dir....|netrw-c|
720 d................Make A New Directory.......................|netrw-d|
721 D................Deleting Files or Directories..............|netrw-D|
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000722 <c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000723 i................Change Listing Style.......................|netrw-i|
Bram Moolenaar83bab712005-08-01 21:58:57 +0000724 <c-l>............Refreshing the Listing.....................|netrw-ctrl-l|
725 o................Browsing with a Horizontal Split...........|netrw-o|
726 p................Preview Window.............................|netrw-p|
727 q................Listing Bookmarks and History..............|netrw-q|
728 r................Reversing Sorting Order....................|netrw-r|
729 R................Renaming Files or Directories..............|netrw-R|
730 s................Selecting Sorting Style....................|netrw-s|
731 S................Editing the Sorting Sequence...............|netrw-S|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000732 t................Browsing with a new tab....................|netrw-t|
Bram Moolenaar83bab712005-08-01 21:58:57 +0000733 u................Changing to a Predecessor Directory........|netrw-u|
734 U................Changing to a Successor Directory..........|netrw-U|
735 v................Browsing with a Vertical Split.............|netrw-v|
736 x................Customizing Browsing.......................|netrw-x|
737
738 COMMANDS *netrw-explore-cmds*
Bram Moolenaar488c6512005-08-11 20:09:58 +0000739 :Explore[!] [dir] Explore directory of current file........|netrw-explore|
740 :Sexplore[!] [dir] Split & Explore directory ...............|netrw-explore|
741 :Hexplore[!] [dir] Horizontal Split & Explore...............|netrw-explore|
742 :Vexplore[!] [dir] Vertical Split & Explore.................|netrw-explore|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000743 :Texplore[!] [dir] Tab & Explore............................|netrw-explore|
Bram Moolenaar488c6512005-08-11 20:09:58 +0000744 :Pexplore[!] [dir] Vertical Split & Explore.................|netrw-explore|
745 :Nexplore[!] [dir] Vertical Split & Explore.................|netrw-explore|
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000746 :NetrwSettings.............................................|netrw-settings|
Bram Moolenaar269ec652004-07-29 08:43:53 +0000747
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000748QUICK REFERENCE COMMANDS TABLE *netrw-browse-cmds*
Bram Moolenaar843ee412004-06-30 16:16:41 +0000749>
Bram Moolenaard68071d2006-05-02 22:08:30 +0000750 ------- -----------
Bram Moolenaar843ee412004-06-30 16:16:41 +0000751 Command Explanation
Bram Moolenaar9964e462007-05-05 17:54:07 +0000752 ------- -----------
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000753< <F1> Causes Netrw to issue help
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000754 <cr> Netrw will enter the directory or read the file |netrw-cr|
755 <del> Netrw will attempt to remove the file/directory |netrw-del|
756 - Makes Netrw go up one directory |netrw--|
757 a Toggles between normal display, |netrw-a|
758 hiding (suppress display of files matching g:netrw_list_hide)
759 showing (display only files which match g:netrw_list_hide)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000760 mb bookmark current directory
761 gb go to previous bookmarked directory
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000762 c Make current browsing directory the current directory |netrw-c|
763 d Make a directory |netrw-d|
764 D Netrw will attempt to remove the file(s)/directory(ies) |netrw-D|
765 <c-h> Edit file hiding list |netrw-ctrl-h|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000766 i Cycle between thin, long, wide, and tree listings|netrw-i|
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000767 <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
Bram Moolenaar843ee412004-06-30 16:16:41 +0000768 o Enter the file/directory under the cursor in a new browser
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000769 window. A horizontal split is used. |netrw-o|
770 O Obtain a file specified by cursor |netrw-O|
771 p Preview the file |netrw-p|
772 P Browse in the previously used window |netrw-P|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000773 q List bookmarked directories and history |netrw-q|
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000774 r Reverse sorting order |netrw-r|
775 R Rename the designed file(s)/directory(ies) |netrw-R|
776 s Select sorting style: by name, time, or file size |netrw-s|
777 S Specify suffix priority for name-sorting |netrw-S|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000778 t Enter the file/directory under the cursor in a new tab|netrw-t|
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000779 u Change to recently-visited directory |netrw-u|
780 U Change to subsequently-visited directory |netrw-U|
Bram Moolenaar843ee412004-06-30 16:16:41 +0000781 v Enter the file/directory under the cursor in a new browser
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000782 window. A vertical split is used. |netrw-v|
783 x Apply a function to a file. (special browsers) |netrw-x|
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000784
Bram Moolenaar269ec652004-07-29 08:43:53 +0000785NETRW BROWSER VARIABLES *netrw-browse-var*
Bram Moolenaar843ee412004-06-30 16:16:41 +0000786>
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000787 --- -----------
788 Var Explanation
789 --- -----------
790< *g:netrw_alto* change from above splitting to below splitting
791 by setting this variable (see |netrw-o|)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000792 default: =&sb (see |'sb'|)
Bram Moolenaar83bab712005-08-01 21:58:57 +0000793
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000794 *g:netrw_altv* change from left splitting to right splitting
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000795 by setting this variable (see |netrw-v|)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000796 default: =&spr (see |'spr'|)
Bram Moolenaar83bab712005-08-01 21:58:57 +0000797
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000798 *g:netrw_browse_split* when browsing, <cr> will open the file by:
799 =0: re-using the same window
Bram Moolenaar9964e462007-05-05 17:54:07 +0000800 =1: horizontally splitting the window first
801 =2: vertically splitting the window first
802 =3: open file in new tab
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000803
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000804 *g:netrw_browsex_viewer* specify user's preference for a viewer: >
805 "kfmclient exec"
806 "gnome-open"
807< If >
808 "-"
809< is used, then netrwFileHandler() will look for
810 a script/function to handle the given
811 extension. (see |netrw_filehandler|).
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000812
813 *g:netrw_fastbrowse* =0: slow speed browsing, never re-use
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000814 directory listings; always obtain
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000815 directory listings.
816 =1: medium speed browsing, re-use directory
817 listings only when remote browsing.
818 (default value)
819 =2: fast browsing, only obtains directory
820 listings when the directory hasn't been
821 seen before (or |netrw-ctrl-l| is used).
822 Fast browsing retains old directory listing
823 buffers so that they don't need to be
824 re-acquired. This feature is especially
825 important for remote browsing. However, if
826 a file is introduced or deleted into or from
827 such directories, the old directory buffer
828 becomes out-of-date. One may always refresh
829 such a directory listing with |netrw-ctrl-l|.
830 This option gives the choice of the trade-off
831 between accuracy and speed to the user.
832
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000833 *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
834 that can show up as "directories" and "files"
835 in the listing. This pattern is used to
836 remove such embedded messages. By default its
837 value is:
838 '^total\s\+\d\+$\|
839 ^Trying\s\+\d\+.*$\|
840 ^KERBEROS_V\d rejected\|
841 ^Security extensions not\|
842 No such file\|
843 : connect to address [0-9a-fA-F:]*
844 : No route to host$'
Bram Moolenaar83bab712005-08-01 21:58:57 +0000845
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000846 *g:netrw_ftp_list_cmd* options for passing along to ftp for directory
847 listing. Defaults:
848 unix or g:netrw_cygwin set: : "ls -lF"
Bram Moolenaar9964e462007-05-05 17:54:07 +0000849 otherwise "dir"
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000850
Bram Moolenaar9964e462007-05-05 17:54:07 +0000851
852 *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory
853 listing, sorted by size of file.
854 Defaults:
855 unix or g:netrw_cygwin set: : "ls -slF"
856 otherwise "dir"
857
858 *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory
859 listing, sorted by time of last modification.
860 Defaults:
861 unix or g:netrw_cygwin set: : "ls -tlF"
862 otherwise "dir"
863
864 *g:netrw_hide* if true, the hiding list is used
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000865 default: =0
Bram Moolenaar83bab712005-08-01 21:58:57 +0000866
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000867 *g:netrw_keepdir* =1 (default) keep current directory immune from
868 the browsing directory.
869 =0 keep the current directory the same as the
870 browsing directory.
871 The current browsing directory is contained in
Bram Moolenaar57657d82006-04-21 22:12:41 +0000872 b:netrw_curdir (also see |netrw-c|)
Bram Moolenaar83bab712005-08-01 21:58:57 +0000873
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000874 *g:netrw_list_cmd* command for listing remote directories
875 default: (if ssh is executable)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000876 "ssh HOSTNAME ls -FLa"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000877
Bram Moolenaar9964e462007-05-05 17:54:07 +0000878 *g:netrw_liststyle* Set the default listing style:
879 = 0: thin listing (one file per line)
880 = 1: long listing (one file per line with time
881 stamp information and file size)
882 = 2: wide listing (multiple files in columns)
883 = 3: tree style listing
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000884 *g:netrw_list_hide* comma separated pattern list for hiding files
885 default: ""
Bram Moolenaar83bab712005-08-01 21:58:57 +0000886
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000887 *g:netrw_local_mkdir* command for making a local directory
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000888 default: "mkdir"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000889
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000890 *g:netrw_local_rmdir* remove directory command (rmdir)
891 default: "rmdir"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000892
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000893 *g:netrw_maxfilenamelen* =32 by default, selected so as to make long
894 listings fit on 80 column displays.
895 If your screen is wider, and you have file
896 or directory names longer than 32 bytes,
897 you may set this option to keep listings
898 columnar.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000899
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000900 *g:netrw_mkdir_cmd* command for making a remote directory
Bram Moolenaar9964e462007-05-05 17:54:07 +0000901 default: "ssh USEPORT HOSTNAME mkdir"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000902
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000903 *g:netrw_rm_cmd* command for removing files
Bram Moolenaar9964e462007-05-05 17:54:07 +0000904 default: "ssh USEPORT HOSTNAME rm"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000905
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000906 *g:netrw_rmdir_cmd* command for removing directories
Bram Moolenaar9964e462007-05-05 17:54:07 +0000907 default: "ssh USEPORT HOSTNAME rmdir"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000908
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000909 *g:netrw_rmf_cmd* command for removing softlinks
Bram Moolenaar9964e462007-05-05 17:54:07 +0000910 default: "ssh USEPORT HOSTNAME rm -f"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000911
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000912 *g:netrw_sort_by* sort by "name", "time", or "size"
913 default: "name"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000914
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000915 *g:netrw_sort_direction* sorting direction: "normal" or "reverse"
916 default: "normal"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000917
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000918 *g:netrw_sort_sequence* when sorting by name, first sort by the
919 comma-separated pattern sequence
920 default: '[\/]$,*,\.bak$,\.o$,\.h$,
Bram Moolenaar9964e462007-05-05 17:54:07 +0000921 \.info$,\.swp$,\.obj$'
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000922
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000923 *g:netrw_ssh_cmd* One may specify an executable command
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000924 to use instead of ssh for remote actions
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000925 such as listing, file removal, etc.
926 default: ssh
927
928 *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines,
929 messages, banners, and whatnot that one doesn't
930 want masquerading as "directories" and "files".
931 Use this pattern to remove such embedded
932 messages. By default its value is:
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000933 '^total\s\+\d\+$'
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000934
Bram Moolenaar9964e462007-05-05 17:54:07 +0000935 *g:netrw_use_noswf* netrw normally avoids writing swapfiles
936 for browser buffers. However, under some
937 systems this apparently is causing nasty
938 ml_get errors to appear; if you're getting
939 ml_get errors, try putting
940 let g:netrw_use_noswf= 0
941 in your .vimrc.
942
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000943 *g:netrw_timefmt* specify format string to strftime() (%c)
944 default: "%c"
Bram Moolenaar83bab712005-08-01 21:58:57 +0000945
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000946 *g:netrw_winsize* specify initial size of new o/v windows
947 default: ""
Bram Moolenaar83bab712005-08-01 21:58:57 +0000948
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000949 *g:NetrwTopLvlMenu* This variable specifies the top level
950 menu name; by default, its "Netrw.". If
951 you wish to change this, do so in your
952 .vimrc.
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000953
Bram Moolenaar83bab712005-08-01 21:58:57 +0000954INTRODUCTION TO DIRECTORY BROWSING *netrw-browse-intro*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000955
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000956Netrw supports the browsing of directories on the local system and on remote
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000957hosts, including listing files and directories, entering directories, editing
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000958files therein, deleting files/directories, making new directories, and moving
959(renaming) files and directories. The Netrw browser generally implements the
960previous explorer maps and commands for remote directories, although details
961(such as pertinent global variable names) necessarily differ.
962
963The Netrw remote file and directory browser handles two protocols: ssh and
964ftp. The protocol in the url, if it is ftp, will cause netrw to use ftp
965in its remote browsing. Any other protocol will be used for file transfers,
966but otherwise the ssh protocol will be used to do remote directory browsing.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000967
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000968To use Netrw's remote directory browser, simply attempt to read a "file" with a
Bram Moolenaar843ee412004-06-30 16:16:41 +0000969trailing slash and it will be interpreted as a request to list a directory:
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000970
971 vim [protocol]://[user@]hostname/path/
972
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000973For local directories, the trailing slash is not required.
974
975If you'd like to avoid entering the password in for remote directory listings
976with ssh or scp, see |netrw-listhack|.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000977
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000978
979NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible*
980
981Netrw will not work properly with >
982
983 :set acd
984 :set fo=...ta...
985<
986If either of these options are present when browsing is attempted, netrw
987will change them by using noacd and removing the ta suboptions from the
Bram Moolenaara94bc432006-03-10 21:42:59 +0000988|'formatoptions'|.
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000989
Bram Moolenaar9964e462007-05-05 17:54:07 +0000990 *netrw-explore* *netrw-pexplore* *netrw-texplore*
991 *netrw-hexplore* *netrw-sexplore* *netrw-nexplore*
992 *netrw-vexplore*
993DIRECTORY EXPLORING COMMANDS
Bram Moolenaar83bab712005-08-01 21:58:57 +0000994
Bram Moolenaar488c6512005-08-11 20:09:58 +0000995 :Explore[!] [dir]... Explore directory of current file *:Explore*
996 :Sexplore[!] [dir]... Split&Explore directory of current file *:Sexplore*
Bram Moolenaar9964e462007-05-05 17:54:07 +0000997 :Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
998 :Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
999 :Texplore [dir]... Tab & Explore *:Texplore*
Bram Moolenaar83bab712005-08-01 21:58:57 +00001000
Bram Moolenaar9964e462007-05-05 17:54:07 +00001001 Used with :Explore **/pattern : (also see |netrw-starstar|)
1002 :Nexplore............. go to next matching file *:Nexplore*
1003 :Pexplore............. go to previous matching file *:Pexplore*
Bram Moolenaar83bab712005-08-01 21:58:57 +00001004
Bram Moolenaar488c6512005-08-11 20:09:58 +00001005:Explore will open the local-directory browser on the current file's
Bram Moolenaar9964e462007-05-05 17:54:07 +00001006 directory (or on directory [dir] if specified). The window will be
Bram Moolenaar488c6512005-08-11 20:09:58 +00001007 split only if the file has been modified, otherwise the browsing
1008 window will take over that window. Normally the splitting is taken
1009 horizontally.
1010:Explore! is like :Explore, but will use vertical splitting.
1011:Sexplore will always split the window before invoking the local-directory
Bram Moolenaar9964e462007-05-05 17:54:07 +00001012 browser. As with Explore, the splitting is normally done
Bram Moolenaar488c6512005-08-11 20:09:58 +00001013 horizontally.
1014:Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically.
1015:Hexplore [dir] does an :Explore with |:belowright| horizontal splitting.
1016:Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting.
1017:Vexplore [dir] does an :Explore with |:leftabove| vertical splitting.
1018:Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting.
Bram Moolenaar9964e462007-05-05 17:54:07 +00001019:Texplore [dir] does a tabnew before generating the browser window
Bram Moolenaar83bab712005-08-01 21:58:57 +00001020
Bram Moolenaar488c6512005-08-11 20:09:58 +00001021By default, these commands use the current file's directory. However, one
1022may explicitly provide a directory (path) to use.
Bram Moolenaar83bab712005-08-01 21:58:57 +00001023
Bram Moolenaar57657d82006-04-21 22:12:41 +00001024 *netrw-starstar*
1025When Explore, Sexplore, Hexplore, or Vexplore are used with a **/filepat,
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001026such as:
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001027>
1028 :Explore **/filename_pattern
1029<
Bram Moolenaar57657d82006-04-21 22:12:41 +00001030netrw will attempt to find a file in the current directory or any subdirectory
1031which matches the filename pattern. Internally, it produces a list of files
1032which match the pattern and their paths; to that extent it resembles the Unix
1033operation:
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001034>
1035 find $(pwd) -name "$1" -exec "echo" "{}" ";" 2> /dev/null
1036<
1037The directory display is updated to show the subdirectory containing a
1038matching file. One may then proceed to the next (or previous) matching files'
1039directories by using Nexplore or Pexplore, respectively. If your console or
1040gui produces recognizable shift-up or shift-down sequences, then you'll likely
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001041find using shift-downarrow and shift-uparrow convenient. They're mapped by
1042netrw:
Bram Moolenaar572cb562005-08-05 21:35:02 +00001043
1044 <s-down> == Nexplore, and
1045 <s-up> == Pexplore.
1046
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001047As an example, consider
1048>
Bram Moolenaar572cb562005-08-05 21:35:02 +00001049 :Explore **/*.c
1050 :Nexplore
1051 :Nexplore
1052 :Pexplore
1053<
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001054The status line will show, on the right hand side of the status line, a
1055message like "Match 3 of 20".
1056
Bram Moolenaar57657d82006-04-21 22:12:41 +00001057 *netrw-starpat*
1058When Explore, Sexplore, Hexplore, or Vexplore are used with a */pattern,
1059such as:
1060>
1061 :Explore */pattern
1062<
1063netrw will use |:vimgrep| to find files which contain the given pattern.
1064Like what happens with |netrw-starstar|, a list of files which contain
1065matches to the given pattern is generated. The cursor will then jump
1066to the first file with the given pattern; |:Nexplore|, |:Pexplore|, and
1067the shifted-down and -up arrows work with the list to move to the next
1068or previous files in that list.
Bram Moolenaar83bab712005-08-01 21:58:57 +00001069
Bram Moolenaar4a85b412006-04-23 22:40:29 +00001070 *netrw-starstarpat*
1071When Explore, Sexplore, Hexplore, or Vexplore are used with a **//pattern,
1072such as:
1073>
1074 :Explore **//pattern
1075<
1076then Explore will use |:vimgrep| to find files like |netrw-starpat|;
1077however, Explore will also search subdirectories as well as the current
1078directory.
1079
1080
Bram Moolenaar9964e462007-05-05 17:54:07 +00001081REFRESHING THE LISTING *netrw-ctrl-l* *netrw-ctrl_l*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001082
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001083To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
1084hit the <cr> when atop the ./ directory entry in the listing. One may also
1085refresh a local directory by using ":e .".
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001086
1087
1088GOING UP *netrw--*
1089
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001090To go up a directory, press "-" or press the <cr> when atop the ../ directory
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001091entry in the listing.
1092
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001093Netrw will use the command in |g:netrw_list_cmd| to perform the directory
1094listing operation after changing HOSTNAME to the host specified by the
1095user-provided url. By default netrw provides the command as:
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001096
Bram Moolenaar843ee412004-06-30 16:16:41 +00001097 ssh HOSTNAME ls -FLa
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001098
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001099where the HOSTNAME becomes the [user@]hostname as requested by the attempt to
1100read. Naturally, the user may override this command with whatever is
1101preferred. The NetList function which implements remote directory browsing
1102expects that directories will be flagged by a trailing slash.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001103
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001104
Bram Moolenaar433f7c82006-03-21 21:29:36 +00001105BROWSING *netrw-cr*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001106
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001107Browsing is simple: move the cursor onto a file or directory of interest.
Bram Moolenaar843ee412004-06-30 16:16:41 +00001108Hitting the <cr> (the return key) will select the file or directory.
1109Directories will themselves be listed, and files will be opened using the
Bram Moolenaar9964e462007-05-05 17:54:07 +00001110protocol given in the original read request.
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001111
Bram Moolenaar9964e462007-05-05 17:54:07 +00001112 CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001113 that two or more spaces delimit filenames and directory names for the long
1114 and wide listing formats. Thus, if your filename or directory name has two
1115 or more spaces embedded in it, or any trailing spaces, then you'll need to
1116 use the "thin" format to select it.
Bram Moolenaar843ee412004-06-30 16:16:41 +00001117
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001118The |g:netrw_browse_split| option, which is zero by default, may be used to
Bram Moolenaar9964e462007-05-05 17:54:07 +00001119cause the opening of files to be done in a new window or tab. When the option
1120is one or two, the splitting will be taken horizontally or vertically,
1121respectively. When the option is set to three, a <cr> will cause the file
1122to appear in a new tab.
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001123
Bram Moolenaar83bab712005-08-01 21:58:57 +00001124
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001125OBTAINING A FILE *netrw-O*
1126
1127When browsing a remote directory, one may obtain a file under the cursor (ie.
1128get a copy on your local machine, but not edit it) by pressing the O key.
1129Only ftp and scp are supported for this operation (but since these two are
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001130available for browsing, that shouldn't be a problem). The status bar
1131will then show, on its right hand side, a message like "Obtaining filename".
1132The statusline will be restored after the transfer is complete.
1133
1134Netrw can also "obtain" a file using the local browser. Netrw's display
1135of a directory is not necessarily the same as Vim's "current directory",
1136unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select
1137a file using the local browser (by putting the cursor on it) and pressing
1138"O" will then "obtain" the file; ie. copy it to Vim's current directory.
1139
1140Related topics:
1141 * To see what the current directory is, use |:pwd|
1142 * To make the currently browsed directory the current directory, see |netrw-c|
1143 * To automatically make the currently browsed directory the current
1144 directory, see |g:netrw_keepdir|.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001145
1146
Bram Moolenaar9964e462007-05-05 17:54:07 +00001147CHANGE LISTING STYLE *netrw-i*
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001148
Bram Moolenaar9964e462007-05-05 17:54:07 +00001149The "i" map cycles between the thin, long, wide, and tree listing formats.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001150
Bram Moolenaar8299df92004-07-10 09:47:34 +00001151The short listing format gives just the files' and directories' names.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001152
Bram Moolenaar8299df92004-07-10 09:47:34 +00001153The long listing is either based on the "ls" command via ssh for remote
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001154directories or displays the filename, file size (in bytes), and the time and
1155date of last modification for local directories. With the long listing
1156format, netrw is not able to recognize filenames which have trailing spaces.
1157Use the thin listing format for such files.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001158
Bram Moolenaar9964e462007-05-05 17:54:07 +00001159The wide listing format uses two or more contiguous spaces to delineate
1160filenames; when using that format, netrw won't be able to recognize or use
1161filenames which have two or more contiguous spaces embedded in the name or any
1162trailing spaces. The thin listing format will, however, work with such files.
1163This listing format is the most compact.
1164
1165The tree listing format has a top directory followed by files and directories
1166preceded by a "|". One may open and close directories by pressing the <cr>
1167key while atop the directory name. There is only one tree listing buffer;
1168hence, using "v" or "o" on a subdirectory will only show the same buffer,
1169twice.
Bram Moolenaar8299df92004-07-10 09:47:34 +00001170
1171
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001172MAKING A NEW DIRECTORY *netrw-d*
Bram Moolenaar8299df92004-07-10 09:47:34 +00001173
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001174With the "d" map one may make a new directory either remotely (which depends
1175on the global variable g:netrw_mkdir_cmd) or locally (which depends on the
1176global variable g:netrw_local_mkdir). Netrw will issue a request for the new
1177directory's name. A bare <CR> at that point will abort the making of the
Bram Moolenaar8299df92004-07-10 09:47:34 +00001178directory. Attempts to make a local directory that already exists (as either
1179a file or a directory) will be detected, reported on, and ignored.
1180
Bram Moolenaar83bab712005-08-01 21:58:57 +00001181
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001182DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del*
Bram Moolenaar843ee412004-06-30 16:16:41 +00001183
1184Deleting/removing files and directories involves moving the cursor to the
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001185file/directory to be deleted and pressing "D". Directories must be empty
1186first before they can be successfully removed. If the directory is a softlink
1187to a directory, then netrw will make two requests to remove the directory
1188before succeeding. Netrw will ask for confirmation before doing the
1189removal(s). You may select a range of lines with the "V" command (visual
1190selection), and then pressing "D".
Bram Moolenaar843ee412004-06-30 16:16:41 +00001191
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001192The g:netrw_rm_cmd, g:netrw_rmf_cmd, and g:netrw_rmdir_cmd variables are used
1193to control the attempts to remove files and directories. The g:netrw_rm_cmd
1194is used with files, and its default value is:
Bram Moolenaar843ee412004-06-30 16:16:41 +00001195
1196 g:netrw_rm_cmd: ssh HOSTNAME rm
1197
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001198The g:netrw_rmdir_cmd variable is used to support the removal of directories.
1199Its default value is:
Bram Moolenaar843ee412004-06-30 16:16:41 +00001200
1201 g:netrw_rmdir_cmd: ssh HOSTNAME rmdir
1202
1203If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001204to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
Bram Moolenaar843ee412004-06-30 16:16:41 +00001205
1206 g:netrw_rmf_cmd: ssh HOSTNAME rm -f
1207
Bram Moolenaar843ee412004-06-30 16:16:41 +00001208
Bram Moolenaar8299df92004-07-10 09:47:34 +00001209RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R*
Bram Moolenaar843ee412004-06-30 16:16:41 +00001210
1211Renaming/moving files and directories involves moving the cursor to the
1212file/directory to be moved (renamed) and pressing "R". You will then be
1213queried for where you want the file/directory to be moved. You may select a
1214range of lines with the "V" command (visual selection), and then pressing "R".
1215
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001216The g:netrw_rename_cmd variable is used to implement renaming. By default its
Bram Moolenaar843ee412004-06-30 16:16:41 +00001217value is:
1218
1219 ssh HOSTNAME mv
1220
Bram Moolenaar269ec652004-07-29 08:43:53 +00001221One may rename a block of files and directories by selecting them with
1222the V (|linewise-visual|).
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001223
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001224
Bram Moolenaar9964e462007-05-05 17:54:07 +00001225HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001226
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001227Netrw's browsing facility allows one to use the hiding list in one of three
1228ways: ignore it, hide files which match, and show only those files which
1229match. The "a" map allows the user to cycle about these three ways.
Bram Moolenaar83bab712005-08-01 21:58:57 +00001230
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001231The g:netrw_list_hide variable holds a comma delimited list of patterns (ex.
Bram Moolenaar9964e462007-05-05 17:54:07 +00001232\.obj) which specify the hiding list. (also see |netrw-ctrl-h|) To set the
1233hiding list, use the <c-h> map. As an example, to hide files which begin with
1234a ".", one may use the <c-h> map to set the hiding list to '^\..*' (or one may
1235put let g:netrw_list_hide= '^\..*' in one's <.vimrc>). One may then use the
1236"a" key to show all files, hide matching files, or to show only the matching
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001237files.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001238
Bram Moolenaar9964e462007-05-05 17:54:07 +00001239 Example: ^.*\.[ch]
1240 This hiding list command will hide/show all *.c and *.h files.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001241
Bram Moolenaar9964e462007-05-05 17:54:07 +00001242 Example: ^.*\.c,^.*\.h
1243 This hiding list command will also hide/show all *.c and *.h
1244 files.
1245
1246Don't forget to use the "a" map to select the normal/hiding/show mode you want!
1247
1248 *netrw-ctrl_h*
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001249EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001250
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001251The "<ctrl-h>" map brings up a requestor allowing the user to change the
Bram Moolenaar269ec652004-07-29 08:43:53 +00001252file/directory hiding list. The hiding list consists of one or more patterns
1253delimited by commas. Files and/or directories satisfying these patterns will
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001254either be hidden (ie. not shown) or be the only ones displayed (see
1255|netrw-a|).
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001256
1257
Bram Moolenaar83bab712005-08-01 21:58:57 +00001258BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001259
Bram Moolenaar269ec652004-07-29 08:43:53 +00001260Normally one enters a file or directory using the <cr>. However, the "o" map
1261allows one to open a new window to hold the new directory listing or file. A
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001262horizontal split is used. (for vertical splitting, see |netrw-v|)
1263
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001264Normally, the o key splits the window horizontally with the new window and
1265cursor at the top. To change to splitting the window horizontally with the
1266new window and cursor at the bottom, have
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001267
1268 let g:netrw_alto = 1
1269
Bram Moolenaar9964e462007-05-05 17:54:07 +00001270in your <.vimrc>. (also see |netrw-t| |netrw-v| |g:netrw_alto|)
1271
1272There is only one tree listing buffer; using "o" on a displayed subdirectory
1273will split the screen, but the same buffer will be shown twice.
1274
1275
1276BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v*
1277
1278Normally one enters a file or directory using the <cr>. However, the "v" map
1279allows one to open a new window to hold the new directory listing or file. A
1280vertical split is used. (for horizontal splitting, see |netrw-o|)
1281
1282Normally, the v key splits the window vertically with the new window and
1283cursor at the left. To change to splitting the window vertically with the new
1284window and cursor at the right, have
1285
1286 let g:netrw_altv = 1
1287
1288in your <.vimrc>. (also see: |netrw-o| |netrw-t| |g:netrw_altv|)
1289
1290There is only one tree listing buffer; using "v" on a displayed subdirectory
1291will split the screen, but the same buffer will be shown twice.
1292
1293
1294BROWSING WITH A NEW TAB *netrw-t*
1295
1296Normally one enters a file or directory using the <cr>. The "t" map
1297allows one to open a new window hold the new directory listing or file in a
1298new tab. (also see: |netrw-o| |netrw-v|)
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001299
Bram Moolenaar83bab712005-08-01 21:58:57 +00001300
1301PREVIEW WINDOW *netrw-p* *netrw-preview*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001302
Bram Moolenaar9964e462007-05-05 17:54:07 +00001303One may use a preview window by using the "p" key when the cursor is atop the
1304desired filename to be previewed.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001305
1306
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001307PREVIOUS WINDOW *netrw-P* *netrw-prvwin*
1308
Bram Moolenaara94bc432006-03-10 21:42:59 +00001309To edit a file or directory in the previously used window (see :he |CTRL-W_P|),
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001310press a "P". If there's only one window, then the one window will be
Bram Moolenaara94bc432006-03-10 21:42:59 +00001311horizontally split (above/below splitting is controlled by |g:netrw_alto|,
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001312and its initial size is controlled by |g:netrw_winsize|).
1313
1314If there's more than one window, the previous window will be re-used on
1315the selected file/directory. If the previous window's associated buffer
1316has been modified, and there's only one window with that buffer, then
1317the user will be asked if s/he wishes to save the buffer first (yes,
1318no, or cancel).
1319
1320
Bram Moolenaar83bab712005-08-01 21:58:57 +00001321SELECTING SORTING STYLE *netrw-s* *netrw-sort*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001322
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001323One may select the sorting style by name, time, or (file) size. The "s" map
1324allows one to circulate amongst the three choices; the directory listing will
1325automatically be refreshed to reflect the selected style.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001326
1327
Bram Moolenaar83bab712005-08-01 21:58:57 +00001328EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence*
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001329
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001330When "Sorted by" is name, one may specify priority via the sorting sequence
1331(g:netrw_sort_sequence). The sorting sequence typically prioritizes the
1332name-listing by suffix, although any pattern will do. Patterns are delimited
1333by commas. The default sorting sequence is:
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001334>
Bram Moolenaar488c6512005-08-11 20:09:58 +00001335 [\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001336<
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001337The lone * is where all filenames not covered by one of the other patterns
1338will end up. One may change the sorting sequence by modifying the
1339g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by
1340using the "S" map.
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001341
1342
Bram Moolenaar83bab712005-08-01 21:58:57 +00001343REVERSING SORTING ORDER *netrw-r* *netrw-reverse*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001344
1345One may toggle between normal and reverse sorting order by pressing the
1346"r" key.
1347
1348
Bram Moolenaar83bab712005-08-01 21:58:57 +00001349CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir*
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001350
1351Every time you change to a new directory (new for the current session),
1352netrw will save the directory in a recently-visited directory history
1353list (unless g:netrw_dirhistmax is zero; by default, its ten). With the
1354"u" map, one can change to an earlier directory (predecessor). To do
1355the opposite, see |netrw-U|.
1356
1357
Bram Moolenaar83bab712005-08-01 21:58:57 +00001358CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir*
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001359
1360With the "U" map, one can change to a later directory (successor).
1361This map is the opposite of the "u" map. (see |netrw-u|) Use the
1362q map to list both the bookmarks and history. (see |netrw-q|)
1363
Bram Moolenaar9964e462007-05-05 17:54:07 +00001364 *netrw-gx*
1365CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler*
1366 (also see |netrw_filehandler|)
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001367
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001368Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
1369best seen with a special handler (ie. a tool provided with your computer).
1370Netrw allows one to invoke such special handlers by: >
1371
1372 * when Exploring, hit the "x" key
1373 * when editing, hit gx with the cursor atop the special filename
Bram Moolenaar9964e462007-05-05 17:54:07 +00001374< (not available if the |g:netrw_nogx| variable exists)
1375
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001376Netrw determines which special handler by the following method:
1377
1378 * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
1379 view files. Examples of useful settings (place into your <.vimrc>): >
1380
1381 :let g:netrw_browsex_viewer= "kfmclient exec"
1382< or >
1383 :let g:netrw_browsex_viewer= "gnome-open"
1384<
1385 If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
1386 invoked first (see |netrw_filehandler|).
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001387
Bram Moolenaar9964e462007-05-05 17:54:07 +00001388 * for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001389 * for Gnome (with gnome-open): gnome-open is used.
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001390 * for KDE (with kfmclient): kfmclient is used.
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001391 * otherwise the netrwFileHandler plugin is used.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001392
1393The file's suffix is used by these various approaches to determine an
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001394appropriate application to use to "handle" these files. Such things as
1395OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
1396*.eps) can be handled.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001397
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001398 *netrw_filehandler*
Bram Moolenaar9964e462007-05-05 17:54:07 +00001399
1400The "x" map applies a function to a file, based on its extension. Of course,
1401the handler function must exist for it to be called!
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001402>
1403 Ex. mypgm.html x ->
Bram Moolenaar9964e462007-05-05 17:54:07 +00001404 NFH_html("scp://user@host/some/path/mypgm.html")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001405<
Bram Moolenaar9964e462007-05-05 17:54:07 +00001406Users may write their own netrw File Handler functions to support more
1407suffixes with special handling. See <plugin/netrwFileHandlers.vim> for
1408examples on how to make file handler functions. As an example: >
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001409
Bram Moolenaar9964e462007-05-05 17:54:07 +00001410 " NFH_suffix(filename)
1411 fun! NFH_suffix(filename)
1412 ..do something special with filename..
1413 endfun
1414<
1415These functions need to be defined in some file in your .vim/plugin
1416(vimfiles\plugin) directory. Vim's function names may not have punctuation
1417characters (except for the underscore) in them. To support suffices that
1418contain such characters, netrw will first convert the suffix using the
1419following table: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001420
Bram Moolenaar9964e462007-05-05 17:54:07 +00001421 @ -> AT ! -> EXCLAMATION % -> PERCENT
1422 : -> COLON = -> EQUAL ? -> QUESTION
1423 , -> COMMA - -> MINUS ; -> SEMICOLON
1424 $ -> DOLLAR + -> PLUS ~ -> TILDE
1425<
1426So, for example: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001427
Bram Moolenaar9964e462007-05-05 17:54:07 +00001428 file.rcs,v -> NFH_rcsCOMMAv()
1429<
1430If more such translations are necessary, please send me email: >
1431 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
1432with a request.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001433
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001434
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001435MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* *netrw-curdir*
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001436
Bram Moolenaar57657d82006-04-21 22:12:41 +00001437By default, |g:netrw_keepdir| is 1. This setting means that the current
Bram Moolenaar9964e462007-05-05 17:54:07 +00001438directory will not track the browsing directory.
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001439
Bram Moolenaar9964e462007-05-05 17:54:07 +00001440Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory to
1441track netrw's browsing directory.
1442
1443However, given the default setting for g:netrw_keepdir of 1 where netrw
Bram Moolenaar57657d82006-04-21 22:12:41 +00001444maintains its own separate notion of the current directory, in order to make
1445the two directories the same, use the "c" map (just type c). That map will
Bram Moolenaar9964e462007-05-05 17:54:07 +00001446set Vim's notion of the current directory to netrw's current browsing
Bram Moolenaar57657d82006-04-21 22:12:41 +00001447directory.
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001448
1449
Bram Moolenaar9964e462007-05-05 17:54:07 +00001450BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks*
Bram Moolenaar572cb562005-08-05 21:35:02 +00001451One may easily "bookmark" a directory by using >
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001452
Bram Moolenaar9964e462007-05-05 17:54:07 +00001453 {cnt}mb
Bram Moolenaar572cb562005-08-05 21:35:02 +00001454<
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001455Any count may be used. One may use viminfo's "!" option to retain bookmarks
Bram Moolenaar9964e462007-05-05 17:54:07 +00001456between vim sessions. See |netrw-gb| for how to return to a bookmark and
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001457|netrw-q| for how to list them.
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001458
1459
Bram Moolenaar9964e462007-05-05 17:54:07 +00001460CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb*
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001461
1462To change directory back to a bookmarked directory, use
1463
Bram Moolenaar9964e462007-05-05 17:54:07 +00001464 {cnt}gb
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001465
Bram Moolenaar9964e462007-05-05 17:54:07 +00001466Any count may be used to reference any of the bookmarks. See |netrw-mb| on
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001467how to bookmark a directory and |netrw-q| on how to list bookmarks.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001468
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001469
Bram Moolenaar83bab712005-08-01 21:58:57 +00001470LISTING BOOKMARKS AND HISTORY *netrw-q* *netrw-listbookmark*
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001471
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001472Pressing "q" will list the bookmarked directories and directory traversal
Bram Moolenaar9964e462007-05-05 17:54:07 +00001473history (query). (see |netrw-mb|, |netrw-gb|, |netrw-u|, and |netrw-U|)
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001474
1475
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001476IMPROVING DIRECTORY BROWSING *netrw-listhack*
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001477
1478Especially with the remote directory browser, constantly entering the password
1479is tedious.
1480
Bram Moolenaar9964e462007-05-05 17:54:07 +00001481For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00001482tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip
1483for setting up no-password ssh and scp and discusses associated security
Bram Moolenaar9964e462007-05-05 17:54:07 +00001484issues. It used to be available at http://hacks.oreilly.com/pub/h/66 ,
1485but apparently that address is now being redirected to some "hackzine".
1486I'll attempt a summary:
Bram Moolenaar843ee412004-06-30 16:16:41 +00001487
Bram Moolenaar9964e462007-05-05 17:54:07 +00001488 1. Generate a public/private key pair on the ssh server:
1489 ssh-keygen -t rsa
1490 (saving the file in ~/.ssh/id_rsa is ok)
1491 2. Just hit the <CR> when asked for passphrase (twice).
1492 3. This creates two files:
1493 ~/.ssh/id_rsa
1494 ~/.ssh/id_rsa.pub
1495 4. On the client:
1496 cd
1497 mkdir .ssh
1498 chmod 0700 .ssh
1499 scp {serverhostname}:.ssh/id_rsa.pub .
1500 cat id_rsa.pub >> .ssh/authorized_keys2
Bram Moolenaar843ee412004-06-30 16:16:41 +00001501
Bram Moolenaar9964e462007-05-05 17:54:07 +00001502For Windows, folks on the vim mailing list have mentioned that Pageant helps
1503with avoiding the constant need to enter the password.
Bram Moolenaar433f7c82006-03-21 21:29:36 +00001504
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001505
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001506NETRW SETTINGS *netrw-settings*
1507
1508With the NetrwSettings.vim plugin, >
1509 :NetrwSettings
1510will bring up a window with the many variables that netrw uses for its
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001511settings. You may change any of their values; when you save the file, the
1512settings therein will be used. One may also press "?" on any of the lines for
1513help on what each of the variables do.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001514
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00001515(also see: |netrw-browse-var| |netrw-protocol| |netrw-var| |netrw-variables|)
Bram Moolenaar9964e462007-05-05 17:54:07 +00001516
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001517
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001518==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000151910. Problems and Fixes *netrw-problems*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001520
1521 (This section is likely to grow as I get feedback)
1522 (also see |netrw-debug|)
Bram Moolenaar488c6512005-08-11 20:09:58 +00001523 *netrw-p1*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001524 P1. I use windows 95, and my ftp dumps four blank lines at the
1525 end of every read.
1526
1527 See |netrw-fixup|, and put the following into your
1528 <.vimrc> file:
1529
1530 let g:netrw_win95ftp= 1
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001531
Bram Moolenaar488c6512005-08-11 20:09:58 +00001532 *netrw-p2*
Bram Moolenaar9964e462007-05-05 17:54:07 +00001533 P2. I use Windows, and my network browsing with ftp doesn't sort by
1534 time or size! -or- The remote system is a Windows server; why
1535 don't I get sorts by time or size?
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001536
1537 Windows' ftp has a minimal support for ls (ie. it doesn't
1538 accept sorting options). It doesn't support the -F which
1539 gives an explanatory character (ABC/ for "ABC is a directory").
Bram Moolenaar9964e462007-05-05 17:54:07 +00001540 Netrw then uses "dir" to get both its short and long listings.
1541 If you think your ftp does support a full-up ls, put the
1542 following into your <.vimrc>: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001543
Bram Moolenaar9964e462007-05-05 17:54:07 +00001544 let g:netrw_ftp_list_cmd = "ls -lF"
1545 let g:netrw_ftp_timelist_cmd= "ls -tlF"
1546 let g:netrw_ftp_sizelist_cmd= "ls -slF"
1547<
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001548 Alternatively, if you have cygwin on your Windows box, put
Bram Moolenaar9964e462007-05-05 17:54:07 +00001549 into your <.vimrc>: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001550
1551 let g:netrw_cygwin= 1
Bram Moolenaar9964e462007-05-05 17:54:07 +00001552<
1553 This problem also occurs when the remote system is Windows.
1554 In this situation, the various g:netrw_ftp_[time|size]list_cmds
1555 are as shown above, but the remote system will not correctly
1556 modify its listing behavior.
1557
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001558
Bram Moolenaar488c6512005-08-11 20:09:58 +00001559 *netrw-p3*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001560 P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw
1561 used ssh! That wasn't what I asked for...
1562
1563 Netrw has two methods for browsing remote directories: ssh
1564 and ftp. Unless you specify ftp specifically, ssh is used.
1565 When it comes time to do download a file (not just a directory
1566 listing), netrw will use the given protocol to do so.
1567
Bram Moolenaar488c6512005-08-11 20:09:58 +00001568 *netrw-p4*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001569 P4. I would like long listings to be the default.
1570
Bram Moolenaar9964e462007-05-05 17:54:07 +00001571 let g:netrw_liststyle= 1
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001572
1573 Check out |netrw-browse-var| for more customizations that
1574 you can set.
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001575
Bram Moolenaar488c6512005-08-11 20:09:58 +00001576 *netrw-p5*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001577 P5. My times come up oddly in local browsing
1578
1579 Does your system's strftime() accept the "%c" to yield dates
1580 such as "Sun Apr 27 11:49:23 1997"? If not, do a "man strftime"
1581 and find out what option should be used. Then put it into
1582 your <.vimrc>:
1583 let g:netrw_timefmt= "%X" (where X is the option)
1584
Bram Moolenaar488c6512005-08-11 20:09:58 +00001585 *netrw-p6*
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001586 P6. I want my current directory to track my browsing.
1587 How do I do that?
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001588
Bram Moolenaar433f7c82006-03-21 21:29:36 +00001589 let g:netrw_keepdir= 0
Bram Moolenaar9964e462007-05-05 17:54:07 +00001590
1591 *netrw-p7*
1592 P7. I use Chinese (or other non-ascii) characters in my filenames, and
1593 netrw (Explore, Sexplore, Hexplore, etc) doesn't display them!
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001594
Bram Moolenaar9964e462007-05-05 17:54:07 +00001595 (taken from an answer provided by Wu Yongwei on the vim
1596 mailing list)
1597 I now see the problem. You code page is not 936, right? Vim
1598 seems only able to open files with names that are valid in the
1599 current code page, as are many other applications that do not
1600 use the Unicode version of Windows APIs. This is an OS-related
1601 issue. You should not have such problems when the system
1602 locale uses UTF-8, such as modern Linux distros.
1603
1604 (...it is one more reason to recommend that people use utf-8!)
1605
1606 *netrw-p8*
1607 P8. I'm getting "ssh is not executable on your system" -- what do I
1608 do?
1609
1610 (Dudley Fox) Most people I know use putty for windows ssh. It
1611 is a free ssh/telnet application. You can read more about it
1612 here:
1613
1614 http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also:
1615
1616 (Marlin Unruh) This program also works for me. It's a single
1617 executable, so he/she can copy it into the Windows\System32
1618 folder and create a shortcut to it.
1619
1620 (Dudley Fox) You might also wish to consider plink, as it
1621 sounds most similar to what you are looking for. plink is an
1622 application in the putty suite.
1623
1624 http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink
1625
1626 (Vissale Neang) Maybe you can try OpenSSH for windows, which
1627 can be obtained from:
1628
1629 http://sshwindows.sourceforge.net/
1630
1631 It doesn't need the full Cygwin package.
1632
1633 (Antoine Mechelynck) For individual Unix-like programs needed
1634 for work in a native-Windows environment, I recommend getting
1635 them from the GnuWin32 project on sourceforge if it has them:
1636
1637 http://gnuwin32.sourceforge.net/
1638
1639 Unlike Cygwin, which sets up a Unix-like virtual machine on
1640 top of Windows, GnuWin32 is a rewrite of Unix utilities with
1641 Windows system calls, and its programs works quite well in the
1642 cmd.exe "Dos box".
1643
1644 (dave) Download WinSCP and use that to connect to the server.
1645 In Preferences > Editors, set gvim as your editor:
1646
1647 - Click "Add..."
1648 - Set External Editor (adjust path as needed, include
1649 the quotes and !.! at the end):
1650 "c:\Program Files\Vim\vim70\gvim.exe" !.!
1651 - Check that the filetype in the box below is
1652 {asterisk}.{asterisk} (all files), or whatever types
1653 you want (cec: change {asterisk} to * ; I had to
1654 write it that way because otherwise the helptags
1655 system thinks its a tag)
1656 - Make sure its at the top of the listbox (click it,
1657 then click "Up" if its not)
1658 If using the Norton Commander style, you just have to hit <F4>
1659 to edit a file in a local copy of gvim.
1660
1661 (Vit Gottwald) How to generate public/private key and save
1662 public key it on server: >
1663 http://www.tartarus.org/~simon/puttydoc/Chapter8.html#pubkey-gettingready
1664 8.3 Getting ready for public key authentication
1665<
1666 How to use private key with 'pscp': >
1667 http://www.tartarus.org/~simon/puttydoc/Chapter5.html
1668 5.2.4 Using public key authentication with PSCP
1669<
1670 (cec) To make proper use of these suggestions above, you will
1671 need to modify the following user-settable variables in your
1672 .vimrc:
1673
1674 |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd|
1675 |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd|
1676
1677 The first one (|g:netrw_ssh_cmd|) is the most important; most
1678 of the others will use the string in g:netrw_ssh_cmd by
1679 default.
1680 *netrw-p9* *netrw-ml_get*
1681 P9. I'm browsing, changing directory, and bang! ml_get errors
1682 appear and I have to kill vim. Any way around this?
1683
1684 Normally netrw attempts to avoid writing swapfiles for
1685 its temporary directory buffers. However, on some systems
1686 this attempt appears to be causing ml_get errors to
1687 appear. Please try setting |g:netrw_use_noswf| to 0
1688 in your <.vimrc>: >
1689 let g:netrw_use_noswf= 0
1690<
Bram Moolenaarc0197e22004-09-13 20:26:32 +00001691
1692==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000169311. Debugging *netrw-debug*
Bram Moolenaar071d4272004-06-13 20:20:40 +00001694
1695The <netrw.vim> script is typically available as:
Bram Moolenaar488c6512005-08-11 20:09:58 +00001696>
Bram Moolenaar071d4272004-06-13 20:20:40 +00001697 /usr/local/share/vim/vim6x/plugin/netrw.vim
Bram Moolenaar488c6512005-08-11 20:09:58 +00001698< -or- >
1699 /usr/local/share/vim/vim7x/plugin/netrw.vim
1700<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001701which is loaded automatically at startup (assuming :set nocp).
1702
1703 1. Get the <Decho.vim> script, available as:
1704
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00001705 http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_scripts
1706 as "Decho, a vimL debugging aid"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001707 or
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00001708 http://vim.sourceforge.net/scripts/script.php?script_id=120
Bram Moolenaar071d4272004-06-13 20:20:40 +00001709
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001710 and put it into your local plugin directory.
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001711
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001712 2. <Decho.vim> itself needs the <cecutil.vim> script, so you'll need
1713 to put it into your .vim/plugin, too. You may obtain it from:
Bram Moolenaar071d4272004-06-13 20:20:40 +00001714
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001715 http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs
1716 as "DrC's Utilities"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001717
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001718 3. Edit the <netrw.vim> file by typing:
1719
1720 vim netrw.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +00001721 :DechoOn
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001722 :wq
Bram Moolenaar071d4272004-06-13 20:20:40 +00001723
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001724 To restore to normal non-debugging behavior, edit <netrw.vim>
1725 by typing
Bram Moolenaar071d4272004-06-13 20:20:40 +00001726
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001727 vim netrw.vim
1728 :DechoOff
1729 :wq
1730
1731 This command, provided by <Decho.vim>, will comment out all
1732 Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()).
1733
Bram Moolenaar9964e462007-05-05 17:54:07 +00001734 4. Then bring up vim and attempt a transfer or do browsing. A set of
1735 messages should appear concerning the steps that <netrw.vim> took
1736 in attempting to read/write your file over the network.
Bram Moolenaar071d4272004-06-13 20:20:40 +00001737
Bram Moolenaar9964e462007-05-05 17:54:07 +00001738 To save the file, use >
1739 :wincmd j
1740 :set bt=
1741 :w! DBG
1742< Please send that information to <netrw.vim>'s maintainer, >
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001743 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
Bram Moolenaar9964e462007-05-05 17:54:07 +00001744<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001745==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000174612. History *netrw-history* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00001747
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00001748 v109: Mar 26, 2007 * if a directory name includes a "$" character,
1749 Explore() will use expand() in an attempt to
1750 decipher the name.
1751 May 07, 2007 * g:netrw_use_errorwindow now allows one to
1752 have error messages go to a reliable window
1753 or to use a less reliable but recallable
1754 echoerr method
1755 May 07, 2007 * g:netrw_scpport and g:netrw_sshport support
1756 use of -P and -p, respectively, to set port
1757 for scp/ssh.
Bram Moolenaar9964e462007-05-05 17:54:07 +00001758 v108: Jan 03, 2007 * included preview map (|netrw-p|), supporting
1759 remote browsing
1760 * netrw can now source remote files
1761 Jan 26, 2007 * Colton Jamieson noted that remote directory
1762 browsing did not support alternate port
1763 selection. This feature has now been extended
1764 to apply to all remote browsing commands via ssh.
1765 (list, remove/delete, rename)
1766 Jan 31, 2007 * Luis Florit reported that @* was an invalid
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00001767 register. The @* register is now only saved and
1768 restored if |'guioptions'| contains "a".
Bram Moolenaar9964e462007-05-05 17:54:07 +00001769 Feb 02, 2007 * Fixed a bug that cropped up when writing files
1770 via scp using cygwin
1771 Feb 08, 2007 * tree listing mode managed to stop working again;
1772 fixed again!
1773 Feb 15, 2007 * Guido Van Hoecke reported that netrw didn't
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00001774 handle browsing well with M$ ftp servers. He even
Bram Moolenaar9964e462007-05-05 17:54:07 +00001775 set up a temporary account for me to test with
1776 (thanks!). Netrw now can browse M$ ftp servers.
1777 v107: Oct 12, 2006 * bypassed the autowrite option
1778 Oct 24, 2006 * handles automatic decompression of *.gz and *.bz2
1779 files
1780 Nov 03, 2006 * Explore will highlight matching files when
1781 **/pattern is used (and if the |'hls'| option
1782 is set)
1783 Nov 09, 2006 * a debugging line, when enabled, was inadvertently
1784 bringing up help instead of simply reporting on
1785 list contents
1786 Nov 21, 2006 * tree listing improved (cursor remains put)
1787 Nov 27, 2006 * fixed b:netrw_curdir bug when repeated "i"s were
1788 pressed.
1789 Dec 15, 2006 * considerable qty of changes, mostly to share more
1790 code between local and remote browsing. Includes
1791 support for tree-style listing for both remote
1792 and local browsing.
1793 Dec 15, 2006 * Included Peter Bengtsson's modifications to
1794 support the Amiga.
1795 v106: Sep 21, 2006 * removed old v:version<700 code as netrw now
1796 requires vim 7.0
1797 * worked around a bug where register * was
1798 overwritten during local browsing
1799 v104: Sep 05, 2006 * as suggested by Rodolfo Borges, :Explore and
1800 variants will position the cursor on the file
1801 just having been edited
1802 * changed default |g:netrw_sort_sequence| order
1803 * changed b, Nb to simply mb (see |netrw-mb|)
1804 * changed B, NB to simply gb (see |netrw-gb|)
1805 * tree listing style (see |g:netrw_liststyle|)
1806 * attempts to retain the alternate file
1807 v103: Jul 26, 2006 * used Yakov Lerner's tip#1289 to improve netrw
1808 error message display
1809 * wide listings didn't handle files with backslashes
1810 in their names properly. A symptom was an
1811 inability to open files.
1812 Aug 09, 2006 * included "t" mapping for opening tabbed windows,
1813 both for remote and local browsing
1814 * changed netrw_longlist to netrw_liststyle
1815 Aug 15, 2006 * fixed one of the NB maps
1816 Aug 22, 2006 * changed *Explore commands to use -nargs=* instead
1817 of -nargs=?. Allows both -complete=dir _and_ the
1818 starstar arguments to work (-nargs=? seems to
1819 require one or the other).
1820 Aug 23, 2006 * copied all w:.. variables across splits to
1821 new windows
1822 Aug 25, 2006 * when g:netrw_browsex_viewer was '-'
1823 (see |g:netrw_browsex_viewer|) it wasn't causing
1824 netrwFileHandlers#Invoke() to be called as it
1825 was expected to. (tnx Steve Dugaro)
1826 Aug 29, 2006 * changed NetBrowseX() to use "setlocal ... noswf"
1827 instead of "set ... noswf" (tnx Benji Fisher)
1828 Aug 31, 2006 * tabs and fastbrowse<=1 didn't work together.
1829 v102: Jun 15, 2006 * chgd netrwPlugin to call netrw#LocalBrowseCheck()
1830 * bugfix: g:netrw_keepdir==0 had stopped working
1831 Jul 06, 2006 * bugfix: NetOptionSave/Restore now saves/restores
1832 the unnamed register (|registers|)
1833 Jul 07, 2006 * |g:netrw_menu| support included
1834 Jul 13, 2006 * :Texplore command implemented
1835 Jul 17, 2006 * NetSplit and (Local|Net)BrowseChgDir() were both
1836 splitting windows. This affected o, v, and
1837 g:netrw_browse_split.
1838 Jul 20, 2006 * works around wildignore setting (was causing
1839 netrw's local browser not to list wildignore'd
1840 files)
1841 Jul 24, 2006 * <leftmouse> acts as a <cr> for selecting a file
1842 <rightmouse> acts as a <del> for deleting a file
1843 v100: May 14, 2006 * when using Windows and shell==cmd.exe, the
1844 default for g:netrw_ignorenetrc is now 1
1845 * bugfix: unwanted ^Ms now removed
1846 (affected shell==cmd.exe - Windows)
1847 * added Bookmarks and History to the menu
1848 * an error message about non-existing
1849 w:netrw_longlist was appearing during attempts to
1850 Explore (fixed)
1851 * g:netrw_shq now available to make netrw use
1852 specified style of quotes for commands
1853 May 29, 2006 * user NFH_*() functions were inadvertently being
1854 ignored
1855 * fixed a Windows non-cygwin ftp handling problem.
1856 * hiding pattern candidate separators included some
1857 characters it shouldn't have (tnx to Osei Poku)
1858 Jun 01, 2006 * for browsing, netrw was supposed to use "dir"
1859 instead of "ls -lF" when using
1860 ftp+non-cygwin+windows. Fixed.
1861 * an inadvertently left-in-place debugging statement
1862 was preventing use of the "x" key with browsing.
1863 Jun 05, 2006 * g:netrw_nogx available to prevent making the gx
1864 map (see |g:netrw_nogx|)
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00001865 * bugfix, Explore wouldn't change directory
Bram Moolenaar9964e462007-05-05 17:54:07 +00001866 properly (vim ., :Explore subdirname)
1867 Jun 06, 2006 * moved history to 2nd line in Netrw menu
1868 * fixed delete for unix-based systems
1869 Jun 07, 2006 * x key now works for windows-noncygwin-ftp
1870 Jun 08, 2006 * Explore */pat and **//pat now wraps
1871 v99: May 09, 2006 * g:netrw_browse_split=3 for opening files in new
1872 tabs implemented.
1873 May 12, 2006 * deletes temporary file at end of NetRead()
1874 * visual mode based Obtain implemented
1875 * added -complete=dir to the various Explore
1876 commands
1877 v98: May 02, 2006 * the "p" key didn't work properly when the browsing
1878 directory name had spaces in it.
1879 v97: May 01, 2006 * exists("&acd") now used to determine if
1880 the 'acd' option exists
1881 * "obtain" now works again under Windows
Bram Moolenaard68071d2006-05-02 22:08:30 +00001882 v96: * bugfix - the |'acd'| option is not always defined but is
1883 now bypassed only when it is
Bram Moolenaar5a305422006-04-28 22:38:25 +00001884 v95: * bugfix - Hiding mode worked correctly (don't show any file
1885 matching any of the g:netrw_hide patterns), but
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00001886 showing mode was showing only those files that didn't
Bram Moolenaar5a305422006-04-28 22:38:25 +00001887 match any of the g:netrw_hide patterns. Instead, it now
1888 shows all files that match any of the g:netrw_hide patterns
1889 (the difference between a logical and and logical or).
Bram Moolenaarf193fff2006-04-27 00:02:13 +00001890 v94: * bugfix - a Decho() had a missing quote; only affects things
1891 when debugging was enabled.
1892 v93: * bugfix - removed FocusGained event from causing a slow-browser
1893 refresh for Windows
1894 v92: * :Explore **//pattern implemented (**/filepattern already taken)
Bram Moolenaar57657d82006-04-21 22:12:41 +00001895 v91: * :Explore */pattern implemented
1896 * |'acd'| option bypassed
1897 v90: * mark ', as suggested by Yegappan Lakshmanan, used to help
1898 guarantee entry into the jump list when appropriate.
1899 * <s-down> and <s-up> are no longer defined until a
1900 :Explore **/pattern is used (if the user already has a map
1901 for them). They will be defined for new browser windows
1902 from that point forward.
1903 v89: * A <s-down>, <s-up>, :Nexplore, or a :Pexplore without having
1904 first done an :Explore **/pattern (see |netrw-starstar|) caused
1905 a lot of unhelpful error messages to appear
Bram Moolenaar9e54a0e2006-04-14 20:42:25 +00001906 v88: * moved DrChip.Netrw menu to Netrw. Now has priority 80 by
1907 default. g:NetrwTopLvlMenu == "Netrw" and can be changed
1908 by the user to suit. The priority is g:NetrwMenuPriority.
1909 * Changed filetype for browser displays from netrwlist to netrw.
Bram Moolenaar7fc904b2006-04-13 20:37:35 +00001910 v87: * bug fix -- menus were partially disappearing
Bram Moolenaar8dff8182006-04-06 20:18:50 +00001911 v85: * bug fix -- missing an endif
1912 * bug fix -- handles spaces in names and directories when using
1913 ftp-based browsing
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001914 v83: * disabled stop-acd handling; the change in directory handling
1915 may allow acd to be used again. Awaiting feedback.
1916 * D was refusing to delete remote files/directories in wide
1917 listing mode.
Bram Moolenaar7d47b6e2006-03-15 22:59:18 +00001918 v81: * FocusGained also used to refresh/wipe local browser directory
1919 buffers
1920 * (bugfix) netrw was leaving [Scratch] buffers behind when the
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00001921 user had the "hidden" option set. The 'hidden' option is
Bram Moolenaar7d47b6e2006-03-15 22:59:18 +00001922 now bypassed.
1923 v80: * ShellCmdPost event used in conjunction with g:netrw_fastbrowse
1924 to refresh/wipe local browser directory buffers.
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +00001925 v79: * directories are now displayed with nowrap
1926 * (bugfix) if the column width was smaller than the largest
1927 file's name, then netrw would hang when using wide-listing
1928 mode - fixed
1929 * g:netrw_fastbrowse introduced
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001930 v78: * progress has been made on allowing spaces inside directory
1931 names for remote work (reading, writing, browsing). (scp)
1932 v77: * Mikolaj Machowski fixed a bug in a substitute command
1933 * g:netrw_browsex_viewer implemented
1934 * Mikolaj Machowski pointed out that gnome-open is often
1935 executable under KDE systems, although it is effectively
Bram Moolenaar9964e462007-05-05 17:54:07 +00001936 not functional. NetBrowseX now looks for "kicker" as
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001937 a running process to determine if KDE is actually the
1938 really running.
1939 * Explorer's O functionality was inadvertently left out.
1940 Netrw now does the same thing, but with the "P" key.
1941 * added g:netrw_browse_split option
1942 * fixed a bug where the directory contained a "." but
1943 the file didn't (was treating the dirname from "."
1944 onwards as a suffix)
Bram Moolenaar36c31f72005-11-28 23:01:53 +00001945 v76: * "directory is missing" error message now restores echo
1946 highlighting
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001947 v75: * file://... now conforms to RFC2396 (thanks to S. Zacchiroli)
1948 * if the binary option is set, then NetWrite() will only write
1949 the whole file (line numbers don't make sense with this).
1950 Supports writing of tar and zip files.
1951 v74: * bugfix (vim, then :Explore) now works
1952 * ctrl-L keeps cursor at same screen location (both local and
1953 remote browsing)
1954 * netrw now can read remote zip and tar files
1955 * Obtain now uses WinXP ftp+.netrc successfully
1956 v73: * bugfix -- scp://host/path/file was getting named incorrectly
1957 * netrw detects use of earlier-than-7.0 version of vim and issues
1958 a pertinent error message.
1959 * netrwSettings.vim is now uses autoloading. Only
1960 <netrwPlugin.vim> is needed as a pure plugin
1961 (ie. always loaded).
1962 v72: * bugfix -- formerly, one could prevent the loading of netrw
1963 by "let g:loaded_netrw=1"; when autoloading became supported,
1964 this feature was lost. It is now restored.
1965 v71: * bugfix -- made some "set nomodifiable"s into setlocal variants
1966 (allows :e somenewfile to be modifiable as usual)
1967 * NetrwSettings calls a netrw function, thereby assuring that
1968 netrw has loaded. However, if netrw does not load for whatever
1969 reason, then NetrwSettings will now issue a warning message.
1970 * For what reason I don't recall, when wget and fetch are both
1971 not present, and an attempt to read a http://... url is made,
1972 netrw exited. It now only returns.
1973 * When ch=1, on the second and subsequent uses of browsing Netrw
1974 would issue a blank line to clear the echo'd messages. This
1975 caused an annoying "Hit-Enter" prompt; now a blank line message
1976 is echo'd only if &ch>1.
1977 v70: * when using |netrw-O|, the "Obtaining filename" message is now
1978 shown using |hl-User9|. If User9 has not been defined, netrw
1979 will define it.
1980 v69: * Bugfix: win95/98 machines were experiencing a
1981 "E121: Undefined variable: g:netrw_win95ftp" message
1982 v68: * double-click-leftmouse selects word under mouse
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00001983 v67: * Passwords which contain blanks will now be surrounded by
1984 double-quotes automatically (Yongwei)
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001985 v66: * Netrw now seems to work with a few more Windows situations
1986 * O now obtains a file: remote browsing file -> local copy,
1987 locally browsing file -> current directory (see :pwd)
1988 * i now cycles between thin, long, and wide listing styles
1989 * NB and Nb are maps that are always available; corresponding
1990 B and b maps are only available when not using wide listing
1991 in order to allow them to be used for motions
1992 v65: * Browser functions now use NetOptionSave/Restore; in particular,
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001993 netrw now works around the report setting
Bram Moolenaar9964e462007-05-05 17:54:07 +00001994 v64: * Bugfix - browsing a "/" directory (Unix) yielded buffers
Bram Moolenaar8aff23a2005-08-19 20:40:30 +00001995 named "[Scratch]" instead of "/"
1996 * Bugfix - remote browsing with ftp was omitting the ./ and ../
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001997 v63: * netrw now takes advantage of autoload (and requires 7.0)
1998 * Bugfix - using r (to reverse sort) working again
1999 v62: * Bugfix - spaces allowed again in directory names with
2000 g:netrw_keepdir=0. In fact, I've tested netrw (again)
2001 with most ANSI punctuation marks for directory names.
2002 * Bugfix - NetrwSettings gave errors when g:netrw_silent
2003 had not be set.
Bram Moolenaar90cfdbe2005-08-12 19:59:19 +00002004 v61: * document upgrade -- netrw variable-based settings all should
2005 have tags. Supports NetrwSettings command.
2006 * several important variables are window-oriented. Netrw has
2007 to transfer these across a window split. See s:BufWinVars()
2008 and s:UseBufWinVars().
Bram Moolenaar488c6512005-08-11 20:09:58 +00002009 v60: * when using the i map to switch between long and short listings,
2010 netrw will now keep cursor on same line
2011 * "Match # of #" now uses status line
2012 * :Explore **/*.c will now work from a non-netrw-browser window
2013 * :Explore **/patterns can now be run in separate browser windows
2014 * active banner (hit <cr> will cause various things to happen)
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00002015 v59: * bugfix -- another keepalt work-around installed (for vim6.3)
2016 * "Match # of #" for Explore **/pattern matches
Bram Moolenaar572cb562005-08-05 21:35:02 +00002017 v58: * Explore and relatives can now handle **/somefilepattern (v7)
2018 * Nexplore and Pexplore introduced (v7). shift-down and shift-up
2019 cursor keys will invoke Nexplore and Pexplore, respectively.
2020 * bug fixed with o and v
2021 * autochdir only worked around for vim when it has been
2022 compiled with either |+netbeans_intg| or |+sun_workshop|
2023 * Under Windows, all directories and files were being preceded
2024 with a "/" when local browsing. Fixed.
2025 * When: syntax highlighting is off, laststatus=2, and remote
2026 browsing is used, sometimes the laststatus highlighting
2027 bleeds into the entire display. Work around - do an extra
2028 redraw in that case.
2029 * Bugfix: when g:netrw_keepdir=0, due to re-use of buffers,
2030 netrw didn't change the directory when it should've
2031 * Bugfix: D and R commands work again
Bram Moolenaar1d94f9b2005-08-04 21:29:45 +00002032 v57: * Explore and relatives can now handle RO files
2033 * reverse sort restored with vim7's sort command
2034 * g:netrw_keepdir now being used to keep the current directory
2035 unchanged as intended (sense change)
2036 * vim 6.3 still supported
Bram Moolenaar83bab712005-08-01 21:58:57 +00002037 v56: * LocalBrowse now saves autochdir setting, unsets it, and
2038 restores it before returning.
2039 * using vim's rename() instead of system + local_rename variable
Bram Moolenaar1d94f9b2005-08-04 21:29:45 +00002040 * avoids changing directory when g:netrw_keepdir is false
Bram Moolenaar83bab712005-08-01 21:58:57 +00002041 v55: * -bar used with :Explore :Sexplore etc to allow multiple
2042 commands to be separated by |s
2043 * browser listings now use the "nowrap" option
2044 * browser: some unuseful error messages now suppressed
2045 v54: * For backwards compatibility, Explore and Sexplore have been
2046 implemented. In addition, Hexplore and Vexplore commands
2047 are available, too.
2048 * <amatch> used instead of <afile> in the transparency
2049 support (BufReadCmd, FileReadCmd, FileWriteCmd)
2050 * ***netrw*** prepended to various error messages netrw may emit
2051 * g:netrw_port used instead of b:netrw_port for scp
2052 * any leading [:#] is removed from port numbers
2053 v53: * backslashes as well as slashes placed in various patterns
2054 (ex. g:netrw_sort_sequence) to better support Windows
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00002055 v52: * nonumber'ing now set for browsing buffers
2056 * when the hiding list hid all files, error messages ensued. Fixed
2057 * when browsing, swf is set, but directory is not set, when netrw
2058 was attempting to restore options, vim wanted to save a swapfile
2059 to a local directory using an url-style path. Fixed
2060 v51: * cygwin detection now automated (using windows and &shell is bash)
2061 * customizable browser "file" rejection patterns
2062 * directory history
2063 * :[range]w url now supported (ie. netrw has a FileWriteCmd event)
2064 * error messages have a "Press <cr> to continue" to allow them
2065 to be seen
2066 * directory browser displays no longer bother the swapfile
2067 * u/U commands to go up and down the history stack
2068 * history stack may be saved with viminfo with its "!" option
2069 * bugfixes associated with unwanted [No Files] entries
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002070 v50: * directories now displayed using buftype=nofile; should keep the
2071 directory names as-is
2072 * attempts to remove empty "[No File]" buffers leftover
2073 from :file ..name.. commands
2074 * bugfix: a "caps-lock" editing difficulty left in v49 was fixed
2075 * syntax highlighting for "Showing:" the hiding list included
2076 * bookmarks can now be retained if "!" is in the viminfo option
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00002077 v49: * will use ftp for http://.../ browsing v48:
2078 * One may use ftp to do remote host file browsing
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002079 * (windows and !cygwin) remote browsing with ftp can now use
2080 the "dir" command internally to provide listings
2081 * g:netrw_keepdir now allows one to keep the initial current
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002082 directory as the current directory (normally the local file
2083 browser makes the currently viewed directory the current
2084 directory)
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002085 * g:netrw_alto and g:netrw_altv now support alternate placement
2086 of windows started with o or v
2087 * Nread ? and Nwrite ? now uses echomsg (instead of echo) so
2088 :messages can repeat showing the help
2089 * bugfix: avoids problems with partial matches of directory names
2090 to prior buffers with longer names
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002091 * one can suppress error messages with g:netrw_quiet ctrl-h used
2092 * instead of <Leader>h for editing hiding list one may edit the
2093 * sorting sequence with the S map now allows confirmation of
2094 * deletion with [y(es) n(o) a(ll) q(uit)] the "x" map now handles
2095 * special file viewing with:
2096 (windows) rundll32 url.dll (gnome) gnome-open (kde)
2097 kfmclient If none of these are on the executable path, then
Bram Moolenaar1afcace2005-11-25 19:54:28 +00002098 netrwFileHandlers.vim is used.
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002099 * directory bookmarking during both local and remote browsing
2100 implemented
2101 * one may view all, use the hiding list to suppress, or use the
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002102 hiding list to show-only remote and local file/directory
2103 listings
2104 * improved unusual file and directory name handling preview
2105 * window support
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00002106 v47: * now handles local directory browsing.
2107 v46: * now handles remote directory browsing
2108 * g:netrw_silent (if 1) will cause all transfers to be silent
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002109 v45: * made the [user@]hostname:path form a bit more restrictive to
2110 better handle errors in using protocols (e.g. scp:usr@host:file
2111 was being recognized as an rcp request) v44: * changed from
2112 "rsync -a" to just "rsync"
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00002113 * somehow an editing error messed up the test to recognize
2114 use of the fetch method for NetRead.
2115 * more debugging statements included
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002116 v43: * moved "Explanation" comments to <pi_netrw.txt> help file as
2117 "Network Reference" (|netrw-ref|)
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00002118 * <netrw.vim> now uses Dfunc() Decho() and Dret() for debugging
2119 * removed superfluous NetRestorePosn() calls
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002120 v42: * now does BufReadPre and BufReadPost events on file:///* and
2121 file://localhost/* v41: * installed file:///* and
2122 file://localhost/* handling v40: * prevents redraw when a
2123 protocol error occurs so that the user may see it v39: * sftp
2124 support v38: * Now uses NetRestorePosn() calls with
2125 Nread/Nwrite commands
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00002126 * Temporary files now removed via bwipe! instead of bwipe
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002127 (thanks to Dave Roberts) v37: * Claar's modifications which
2128 test if ftp is successful, otherwise give an error message
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00002129 * After a read, the alternate file was pointing to the temp file.
2130 The temp file buffer is now wiped out.
2131 * removed silent from transfer methods so user can see what's
2132 happening
Bram Moolenaar071d4272004-06-13 20:20:40 +00002133
2134
2135==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000213612. Credits *netrw-credits* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00002137
2138 Vim editor by Bram Moolenaar (Thanks, Bram!)
2139 dav support by C Campbell
2140 fetch support by Bram Moolenaar and C Campbell
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00002141 ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM>
Bram Moolenaar071d4272004-06-13 20:20:40 +00002142 http support by Bram Moolenaar <bram@moolenaar.net>
2143 rcp
2144 rsync support by C Campbell (suggested by Erik Warendorph)
2145 scp support by raf <raf@comdyn.com.au>
2146 sftp support by C Campbell
2147
2148 inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell
2149
2150 Jérôme Augé -- also using new buffer method with ftp+.netrc
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00002151 Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use,
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00002152 fetch,...
Bram Moolenaar071d4272004-06-13 20:20:40 +00002153 Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution
2154 Erik Warendorph -- for several suggestions (g:netrw_..._cmd
2155 variables, rsync etc)
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00002156 Doug Claar -- modifications to test for success with ftp
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00002157 operation
Bram Moolenaar071d4272004-06-13 20:20:40 +00002158
2159==============================================================================
Bram Moolenaar83bab712005-08-01 21:58:57 +00002160 vim:tw=78:ts=8:ft=help:norl:fdm=marker