blob: 68a0299ce6e8c38a29bdb9fd22292dd559c11840 [file] [log] [blame]
Bram Moolenaar446cb832008-06-24 21:56:24 +00001*pi_netrw.txt* For Vim version 7.2a. Last change: 2008 Jun 21
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 Moolenaar446cb832008-06-24 21:56:24 +00008*dav* *ftp* *netrw-file* *Nread* *rcp* *scp*
9*davs* *http* *netrw.vim* *Nsource* *rsync* *sftp*
10*fetch* *netrw* *network* *Nwrite*
Bram Moolenaar071d4272004-06-13 20:20:40 +000011
12==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +0000131. Contents *netrw-contents* {{{1
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 Moolenaar446cb832008-06-24 21:56:24 +000018 EXTERNAL APPLICATIONS AND PROTOCOLS................|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|
Bram Moolenaar446cb832008-06-24 21:56:24 +000023 VARIABLES AND SETTINGS.............................|netrw-variables|
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000024 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|
Bram Moolenaar446cb832008-06-24 21:56:24 +0000296. Transparent File Editing.............................|netrw-transparent|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000307. Ex Commands..........................................|netrw-ex|
318. Variables and Options................................|netrw-var|
Bram Moolenaar446cb832008-06-24 21:56:24 +0000329. Browsing.............................................|netrw-browse|
33 Introduction To Browsing...........................|netrw-intro-browse|
34 Quick Reference: Maps..............................|netrw-browse-maps|
35 Quick Reference: Commands..........................|netrw-browse-cmds|
36 Bookmarking A Directory............................|netrw-mb|
Bram Moolenaar83bab712005-08-01 21:58:57 +000037 Browsing...........................................|netrw-cr|
Bram Moolenaar83bab712005-08-01 21:58:57 +000038 Browsing With A Horizontally Split Window..........|netrw-o|
Bram Moolenaar9964e462007-05-05 17:54:07 +000039 Browsing With A New Tab............................|netrw-t|
Bram Moolenaar446cb832008-06-24 21:56:24 +000040 Browsing With A Vertically Split Window............|netrw-v|
41 Change Listing Style...............................|netrw-i|
42 Changing To A Bookmarked Directory.................|netrw-gb|
Bram Moolenaar83bab712005-08-01 21:58:57 +000043 Changing To A Predecessor Directory................|netrw-u|
44 Changing To A Successor Directory..................|netrw-U|
Bram Moolenaar83bab712005-08-01 21:58:57 +000045 Customizing Browsing With A User Function..........|netrw-x|
Bram Moolenaar446cb832008-06-24 21:56:24 +000046 Deleting Files Or Directories......................|netrw-D|
47 Directory Exploring Commands.......................|netrw-explore|
48 Exploring With Stars and Patterns..................|netrw-star|
49 Displaying Information About File..................|netrw-qf|
50 Edit File Or Directory Hiding List.................|netrw-ctrl-h|
51 Editing The Sorting Sequence.......................|netrw-S|
52 Going Up...........................................|netrw--|
53 Hiding Files Or Directories........................|netrw-a|
54 Improving Browsing.................................|netrw-ssh-hack|
55 Listing Bookmarks And History......................|netrw-qb|
56 Making A New Directory.............................|netrw-d|
Bram Moolenaar83bab712005-08-01 21:58:57 +000057 Making The Browsing Directory The Current Directory|netrw-c|
Bram Moolenaar446cb832008-06-24 21:56:24 +000058 Marking Files......................................|netrw-mf|
59 Marking Files By Regular Expression................|netrw-mr|
60 Marked Files: Arbitrary Command....................|netrw-mx|
61 Marked Files: Compression And Decompression........|netrw-mz|
62 Marked Files: Copying..............................|netrw-mc|
63 Marked Files: Diff.................................|netrw-md|
64 Marked Files: Editing..............................|netrw-me|
65 Marked Files: Grep.................................|netrw-mg|
66 Marked Files: Hiding and Unhiding by Suffix........|netrw-mh|
67 Marked Files: Moving...............................|netrw-mm|
68 Marked Files: Printing.............................|netrw-mp|
69 Marked Files: Sourcing.............................|netrw-ms|
70 Marked Files: Tagging..............................|netrw-mT|
71 Marked Files: Setting the Target Directory.........|netrw-mt|
72 Marked Files: Unmarking............................|netrw-mu|
73 Netrw Browser Variables............................|netrw-browser-var|
74 Netrw Browsing And Option Incompatibilities........|netrw-incompatible|
75 Netrw Settings.....................................|netrw-settings|
76 Obtaining A File...................................|netrw-O|
77 Preview Window.....................................|netrw-p|
78 Previous Window....................................|netrw-P|
79 Refreshing The Listing.............................|netrw-ctrl-l|
80 Renaming Files Or Directories......................|netrw-move|
81 Reversing Sorting Order............................|netrw-r|
82 Selecting Sorting Style............................|netrw-s|
Bram Moolenaar9964e462007-05-05 17:54:07 +00008310. Problems and Fixes...................................|netrw-problems|
Bram Moolenaar446cb832008-06-24 21:56:24 +00008411. Debugging Netrw Itself...............................|netrw-debug|
Bram Moolenaar9964e462007-05-05 17:54:07 +00008512. History..............................................|netrw-history|
8613. Credits..............................................|netrw-credits|
Bram Moolenaar071d4272004-06-13 20:20:40 +000087
Bram Moolenaar071d4272004-06-13 20:20:40 +000088{Vi does not have any of this}
89
90==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +0000912. Starting With Netrw *netrw-start* {{{1
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +000092
Bram Moolenaar446cb832008-06-24 21:56:24 +000093Netrw makes reading files, writing files, browsing over a network, and
94browsing locally easy! First, make sure that you have plugins enabled, so
95you'll need to have at least the following in your <.vimrc>:
96(or see |netrw-activate|) >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +000097
Bram Moolenaar9964e462007-05-05 17:54:07 +000098 set nocp " 'compatible' is not set
99 filetype plugin on " plugins are enabled
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000100<
101(see |'cp'| and |:filetype-plugin-on|)
102
103Netrw supports "transparent" editing of files on other machines using urls
104(see |netrw-transparent|). As an example of this, let's assume you have an
Bram Moolenaar446cb832008-06-24 21:56:24 +0000105account on some other machine; if you can use scp, try: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000106
107 vim scp://hostname/path/to/file
108<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000109Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|!
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000110
Bram Moolenaar446cb832008-06-24 21:56:24 +0000111So, what if you have ftp, not ssh/scp? That's easy, too; try >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000112
113 vim ftp://hostname/path/to/file
114<
115Want to make ftp simpler to use? See if your ftp supports a file called
116<.netrc> -- typically it goes in your home directory, has read/write
117permissions for only the user to read (ie. not group, world, other, etc),
118and has lines resembling >
119
120 machine HOSTNAME login USERID password "PASSWORD"
121 machine HOSTNAME login USERID password "PASSWORD"
122 ...
Bram Moolenaar9964e462007-05-05 17:54:07 +0000123 default login USERID password "PASSWORD"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000124<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000125Now about browsing -- when you just want to look around before editing a
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000126file. For browsing on your current host, just "edit" a directory: >
127
128 vim .
129 vim /home/userid/path
130<
131For browsing on a remote host, "edit" a directory (but make sure that
132the directory name is followed by a "/"): >
133
134 vim scp://hostname/
135 vim ftp://hostname/path/to/dir/
136<
137See |netrw-browse| for more!
138
Bram Moolenaar446cb832008-06-24 21:56:24 +0000139There are more protocols supported by netrw just than scp and ftp, too: see the
140next section, |netrw-externapp|, for how to use these external applications.
141
142If you want to use plugins, but for some reason don't wish to use netrw, then
143you need to avoid loading both the plugin and the autoload portions of netrw.
144You may do so by placing the following two lines in your <.vimrc>: >
145
146 :let g:loaded_netrw = 1
147 :let g:loaded_netrwPlugin = 1
148<
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000149
150==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00001513. Netrw Reference *netrw-ref* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000152
Bram Moolenaar446cb832008-06-24 21:56:24 +0000153 Netrw supports several protocols in addition to scp and ftp mentioned
154 in |netrw-start|. These include dav, fetch, http,... well, just look
155 at the list in |netrw-externapp|. Each protocol is associated with a
156 variable which holds the default command supporting that protocol.
157
158EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000159
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000160 Protocol Variable Default Value
161 -------- ---------------- -------------
162 dav: *g:netrw_dav_cmd* = "cadaver"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000163 fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000164 ftp: *g:netrw_ftp_cmd* = "ftp"
Bram Moolenaar446cb832008-06-24 21:56:24 +0000165 http: *g:netrw_http_cmd* = "curl -o" if curl is available
166 http: g:netrw_http_cmd = "wget -q -O" elseif wget is available
167 http: g:netrw_http_cmd = "fetch -o" elseif fetch is available
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000168 rcp: *g:netrw_rcp_cmd* = "rcp"
169 rsync: *g:netrw_rsync_cmd* = "rsync -a"
170 scp: *g:netrw_scp_cmd* = "scp -q"
171 sftp: *g:netrw_sftp_cmd* = "sftp"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000172
Bram Moolenaar446cb832008-06-24 21:56:24 +0000173READING *netrw-read* *netrw-nread* {{{2
174
175 Generally, one may just use the url notation with a normal editing
176 command, such as >
177
178 :e ftp://[user@]machine/path
179<
180 Netrw also provides the Nread command:
181
Bram Moolenaar071d4272004-06-13 20:20:40 +0000182 :Nread ? give help
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000183 :Nread "machine:path" uses rcp
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000184 :Nread "machine path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000185 :Nread "machine id password path" uses ftp
186 :Nread "dav://machine[:port]/path" uses cadaver
187 :Nread "fetch://[user@]machine/path" uses fetch
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000188 :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000189 :Nread "http://[user@]machine/path" uses http uses wget
190 :Nread "rcp://[user@]machine/path" uses rcp
191 :Nread "rsync://[user@]machine[:port]/path" uses rsync
192 :Nread "scp://[user@]machine[[:#]port]/path" uses scp
193 :Nread "sftp://[user@]machine/path" uses sftp
Bram Moolenaar071d4272004-06-13 20:20:40 +0000194
Bram Moolenaar446cb832008-06-24 21:56:24 +0000195WRITING *netrw-write* *netrw-nwrite* {{{2
196
197 One may just use the url notation with a normal file writing
198 command, such as >
199
200 :w ftp://[user@]machine/path
201<
202 Netrw also provides the Nwrite command:
203
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000204 :Nwrite ? give help
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000205 :Nwrite "machine:path" uses rcp
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000206 :Nwrite "machine path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000207 :Nwrite "machine id password path" uses ftp
208 :Nwrite "dav://machine[:port]/path" uses cadaver
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000209 :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000210 :Nwrite "rcp://[user@]machine/path" uses rcp
211 :Nwrite "rsync://[user@]machine[:port]/path" uses rsync
212 :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp
213 :Nwrite "sftp://[user@]machine/path" uses sftp
Bram Moolenaar071d4272004-06-13 20:20:40 +0000214 http: not supported!
215
Bram Moolenaar446cb832008-06-24 21:56:24 +0000216SOURCING *netrw-source* {{{2
217
218 One may just use the url notation with the normal file sourcing
219 command, such as >
220
221 :so ftp://[user@]machine/path
222<
223 Netrw also provides the Nsource command:
224
Bram Moolenaar9964e462007-05-05 17:54:07 +0000225 :Nsource ? give help
226 :Nsource "dav://machine[:port]/path" uses cadaver
227 :Nsource "fetch://[user@]machine/path" uses fetch
228 :Nsource "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
229 :Nsource "http://[user@]machine/path" uses http uses wget
230 :Nsource "rcp://[user@]machine/path" uses rcp
231 :Nsource "rsync://[user@]machine[:port]/path" uses rsync
232 :Nsource "scp://[user@]machine[[:#]port]/path" uses scp
233 :Nsource "sftp://[user@]machine/path" uses sftp
234
Bram Moolenaar446cb832008-06-24 21:56:24 +0000235DIRECTORY LISTING *netrw-dirlist* {{{2
236
237 One may browse a directory to get a listing by simply attempting to
238 edit the directory: >
239
240 :e scp://[user]@hostname/path/
241 :e ftp://[user]@hostname/path/
242<
243 For remote directories (ie. those using scp or ftp), that trailing
244 "/" is necessary (it tells netrw that its to treat it as a directory
245 to browse instead of a file to download).
246
247 However, the Nread command can also be used to accomplish this:
248
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000249 :Nread [protocol]://[user]@hostname/path/
250
Bram Moolenaar446cb832008-06-24 21:56:24 +0000251 *netrw-login* *netrw-password*
252CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000253
Bram Moolenaar071d4272004-06-13 20:20:40 +0000254 Attempts to use ftp will prompt you for a user-id and a password.
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000255 These will be saved in global variables g:netrw_uid and
Bram Moolenaar446cb832008-06-24 21:56:24 +0000256 s:netrw_passwd; subsequent uses of ftp will re-use those two items to
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000257 simplify the further use of ftp. However, if you need to use a
258 different user id and/or password, you'll want to call NetUserPass()
259 first. To work around the need to enter passwords, check if your ftp
260 supports a <.netrc> file in your home directory. Also see
261 |netrw-passwd| (and if you're using ssh/scp hoping to figure out how
Bram Moolenaar446cb832008-06-24 21:56:24 +0000262 to not need to use passwords, look at |netrw-ssh-hack|).
Bram Moolenaar071d4272004-06-13 20:20:40 +0000263
264 :NetUserPass [uid [password]] -- prompts as needed
265 :call NetUserPass() -- prompts for uid and password
266 :call NetUserPass("uid") -- prompts for password
267 :call NetUserPass("uid","password") -- sets global uid and password
268
Bram Moolenaar446cb832008-06-24 21:56:24 +0000269NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2
270(also see: |netrw-browser-var| |netrw-protocol| |netrw-settings| |netrw-var|)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000271
Bram Moolenaar446cb832008-06-24 21:56:24 +0000272Netrw provides a lot of variables which allow you to customize netrw to your
273preferences. One way to look at them is via the command :NetrwSettings (see
274|netrw-settings|) which will display your current netrw settings. Most such
275settings are described below, in |netrw-browser-options|, and in
276|netrw-externapp|:
Bram Moolenaar9964e462007-05-05 17:54:07 +0000277
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000278 *b:netrw_lastfile* last file Network-read/written retained on a per-buffer
279 basis (supports plain :Nw )
Bram Moolenaar071d4272004-06-13 20:20:40 +0000280
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000281 *g:netrw_ftp* if it doesn't exist, use default ftp
282 =0 use default ftp (uid password)
283 =1 use alternate ftp method (user uid password)
284 If you're having trouble with ftp, try changing the
285 value of this variable to see if the alternate ftp
286 method works for your setup.
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000287
Bram Moolenaar9964e462007-05-05 17:54:07 +0000288 *g:netrw_extracmd* default: doesn't exist
289 If this variable exists, then any string it contains
290 will be placed into the commands set to your ftp
291 client. As an example:
292 ="passive"
293
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000294 *g:netrw_ftpmode* ="binary" (default)
295 ="ascii"
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000296
Bram Moolenaar9964e462007-05-05 17:54:07 +0000297 *g:netrw_ignorenetrc* =0 (default for linux, cygwin)
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000298 =1 If you have a <.netrc> file but it doesn't work and
Bram Moolenaar446cb832008-06-24 21:56:24 +0000299 you want it ignored, then set this variable as
300 shown. (default for Windows + cmd.exe)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000301
302 *g:netrw_menu* =0 disable netrw's menu
303 =1 (default) netrw's menu enabled
304
305 *g:netrw_nogx* if this variable exists, then the "gx" map will not
306 be available (see |netrw-gx|)
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000307
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000308 *g:netrw_uid* (ftp) user-id, retained on a per-session basis
Bram Moolenaar446cb832008-06-24 21:56:24 +0000309 *s:netrw_passwd* (ftp) password, retained on a per-session basis
310
311 *g:netrw_preview* =0 (default) preview window shown in a horizontally
312 split window
313 =1 preview window shown in a vertically split window.
314 Also affects the "previous window" (see |netrw-P|) in
315 the same way.
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000316
Bram Moolenaar9964e462007-05-05 17:54:07 +0000317 *g:netrw_shq* = "'" for Unix/Linux systems (ie. a single quote)
318 = "'" for Windows + cygwin systems (ie. a single quote)
319 = '"' for Windows systems, not using cygwin
320 (ie. a double quote)
321 Controls the quoting character used during scp and ftp
322 commands.
323
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000324 *g:netrw_scpport* = "-P" : option to use to set port for scp
325 *g:netrw_sshport* = "-p" : option to use to set port for ssh
326
Bram Moolenaar446cb832008-06-24 21:56:24 +0000327 *g:netrw_silent* =0 : transfers done normally
328 =1 : transfers done silently
329
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000330 *g:netrw_use_errorwindow* =1 : messages from netrw will use a separate one
331 line window. This window provides reliable
332 delivery of messages. (default)
333 =0 : messages from netrw will use echoerr ;
334 messages don't always seem to show up this
335 way, but one doesn't have to quit the window.
336
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000337 *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank
338 lines that o/s's ftp "provides" on transfers
339 =0 force normal ftp behavior (no trailing line removal)
340
341 *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also
342 permits network browsing to use ls with time and
343 size sorting (default if windows)
344 =0 assume Windows' scp accepts windows-style paths
345 Network browsing uses dir instead of ls
346 This option is ignored if you're using unix
347
348 *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP
Bram Moolenaar9964e462007-05-05 17:54:07 +0000349 =1 use WinNT's rcp in binary mode (default)
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000350
Bram Moolenaar446cb832008-06-24 21:56:24 +0000351PATHS *netrw-path* {{{2
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000352
353Paths to files are generally user-directory relative for most protocols.
354It is possible that some protocol will make paths relative to some
355associated directory, however.
356>
357 example: vim scp://user@host/somefile
358 example: vim scp://user@host/subdir1/subdir2/somefile
359<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000360where "somefile" is in the "user"'s home directory. If you wish to get a
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000361file using root-relative paths, use the full path:
362>
363 example: vim scp://user@host//somefile
364 example: vim scp://user@host//subdir1/subdir2/somefile
365<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000366
367==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00003684. Network-Oriented File Transfer *netrw-xfer* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000369
370Network-oriented file transfer under Vim is implemented by a VimL-based script
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000371(<netrw.vim>) using plugin techniques. It currently supports both reading and
372writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch,
Bram Moolenaar071d4272004-06-13 20:20:40 +0000373dav/cadaver, rsync, or sftp.
374
375http is currently supported read-only via use of wget or fetch.
376
377<netrw.vim> is a standard plugin which acts as glue between Vim and the
378various file transfer programs. It uses autocommand events (BufReadCmd,
379FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. >
380
381 ex. vim ftp://hostname/path/to/file
382<
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000383The characters preceding the colon specify the protocol to use; in the
Bram Moolenaar446cb832008-06-24 21:56:24 +0000384example, it's ftp. The <netrw.vim> script then formulates a command or a
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000385series of commands (typically ftp) which it issues to an external program
386(ftp, scp, etc) which does the actual file transfer/protocol. Files are read
387from/written to a temporary file (under Unix/Linux, /tmp/...) which the
388<netrw.vim> script will clean up.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000389
Bram Moolenaar9964e462007-05-05 17:54:07 +0000390 *netrw-putty* *netrw-pscp* *netrw-psftp*
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000391One may modify any protocol's implementing external application by setting a
392variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000393"scp -q"). As an example, consider using PuTTY: >
Bram Moolenaar9964e462007-05-05 17:54:07 +0000394
395 let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch'
396 let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"'
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000397<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000398See |netrw-p8| for more about putty, pscp, psftp, etc.
399
Bram Moolenaar071d4272004-06-13 20:20:40 +0000400Ftp, an old protocol, seems to be blessed by numerous implementations.
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000401Unfortunately, some implementations are noisy (ie., add junk to the end of the
402file). Thus, concerned users may decide to write a NetReadFixup() function
403that will clean up after reading with their ftp. Some Unix systems (ie.,
404FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is
405not noisy and more convenient, actually, for <netrw.vim> to use.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000406Consequently, if "fetch" is executable, it will be used to do reads for
407ftp://... (and http://...) . See |netrw-var| for more about this.
408
409For rcp, scp, sftp, and http, one may use network-oriented file transfers
Bram Moolenaar83bab712005-08-01 21:58:57 +0000410transparently; ie.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000411>
412 vim rcp://[user@]machine/path
413 vim scp://[user@]machine/path
414<
415If your ftp supports <.netrc>, then it too can be just as transparently used
416if the needed triad of machine name, user id, and password are present in
417that file. Your ftp must be able to use the <.netrc> file on its own, however.
418>
419 vim ftp://[user@]machine[[:#]portnumber]/path
420<
421However, ftp will often need to query the user for the userid and password.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000422The latter will be done "silently"; ie. asterisks will show up instead of
Bram Moolenaar071d4272004-06-13 20:20:40 +0000423the actually-typed-in password. Netrw will retain the userid and password
424for subsequent read/writes from the most recent transfer so subsequent
425transfers (read/write) to or from that machine will take place without
426additional prompting.
427
428 *netrw-urls*
429 +=================================+============================+============+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000430 | Reading | Writing | Uses |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000431 +=================================+============================+============+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000432 | DAV: | | |
433 | dav://host/path | | cadaver |
434 | :Nread dav://host/path | :Nwrite dav://host/path | cadaver |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000435 +---------------------------------+----------------------------+------------+
Bram Moolenaar446cb832008-06-24 21:56:24 +0000436 | DAV + SSL: | | |
437 | davs://host/path | | cadaver |
438 | :Nread davs://host/path | :Nwrite davs://host/path | cadaver |
439 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000440 | FETCH: | | |
441 | fetch://[user@]host/path | | |
442 | fetch://[user@]host:http/path | Not Available | fetch |
443 | :Nread fetch://[user@]host/path| | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000444 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000445 | FILE: | | |
446 | file:///* | file:///* | |
447 | file://localhost/* | file://localhost/* | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000448 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000449 | FTP: (*3) | (*3) | |
450 | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) |
451 | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc |
452 | :Nread host path | :Nwrite host path | ftp+.netrc |
453 | :Nread host uid pass path | :Nwrite host uid pass path | ftp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000454 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000455 | HTTP: wget is executable: (*4) | | |
456 | http://[user@]host/path | Not Available | wget |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000457 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000458 | HTTP: fetch is executable (*4) | | |
459 | http://[user@]host/path | Not Available | fetch |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000460 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000461 | RCP: | | |
462 | rcp://[user@]host/path | rcp://[user@]host/path | rcp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000463 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000464 | RSYNC: | | |
465 | rsync://[user@]host/path | rsync://[user@]host/path | rsync |
466 | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync |
467 | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000468 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000469 | SCP: | | |
470 | scp://[user@]host/path | scp://[user@]host/path | scp |
471 | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000472 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000473 | SFTP: | | |
474 | sftp://[user@]host/path | sftp://[user@]host/path | sftp |
475 | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000476 +=================================+============================+============+
477
478 (*1) For an absolute path use scp://machine//path.
479
480 (*2) if <.netrc> is present, it is assumed that it will
481 work with your ftp client. Otherwise the script will
Bram Moolenaar9964e462007-05-05 17:54:07 +0000482 prompt for user-id and password.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000483
Bram Moolenaar9964e462007-05-05 17:54:07 +0000484 (*3) for ftp, "machine" may be machine#port or machine:port
Bram Moolenaar071d4272004-06-13 20:20:40 +0000485 if a different port is needed than the standard ftp port
486
487 (*4) for http:..., if wget is available it will be used. Otherwise,
488 if fetch is available it will be used.
489
490Both the :Nread and the :Nwrite ex-commands can accept multiple filenames.
491
492
493NETRC *netrw-netrc*
494
Bram Moolenaar446cb832008-06-24 21:56:24 +0000495The <.netrc> file, typically located in your home directory, contains lines
496therein which map a hostname (machine name) to the user id and password you
497prefer to use with it.
498
Bram Moolenaar071d4272004-06-13 20:20:40 +0000499The typical syntax for lines in a <.netrc> file is given as shown below.
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000500Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000501>
502 machine {full machine name} login {user-id} password "{password}"
503 default login {user-id} password "{password}"
504
505Your ftp client must handle the use of <.netrc> on its own, but if the
506<.netrc> file exists, an ftp transfer will not ask for the user-id or
507password.
508
509 Note:
510 Since this file contains passwords, make very sure nobody else can
511 read this file! Most programs will refuse to use a .netrc that is
512 readable for others. Don't forget that the system administrator can
Bram Moolenaar446cb832008-06-24 21:56:24 +0000513 still read the file! Ie. for Linux/Unix: chmod 600 .netrc
Bram Moolenaar071d4272004-06-13 20:20:40 +0000514
515
516PASSWORD *netrw-passwd*
517
518The script attempts to get passwords for ftp invisibly using |inputsecret()|,
519a built-in Vim function. See |netrw-uidpass| for how to change the password
520after one has set it.
521
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000522Unfortunately there doesn't appear to be a way for netrw to feed a password to
523scp. Thus every transfer via scp will require re-entry of the password.
Bram Moolenaar446cb832008-06-24 21:56:24 +0000524However, |netrw-ssh-hack| can help with this problem.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000525
526
527==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00005285. Activation *netrw-activate* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000529
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000530Network-oriented file transfers are available by default whenever Vim's
Bram Moolenaar446cb832008-06-24 21:56:24 +0000531|'nocompatible'| mode is enabled. Netrw's script files reside in your
532system's plugin, autoload, and syntax directories; just the
533plugin/netrwPlugin.vim script is sourced automatically whenever you bring up
534vim. The main script in autoload/netrw.vim is only loaded when you actually
535use netrw. I suggest that, at a minimum, you have at least the following in
536your <.vimrc> customization file: >
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000537
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000538 set nocp
539 if version >= 600
540 filetype plugin indent on
541 endif
542<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000543
544==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00005456. Transparent File Editing *netrw-transparent* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000546
547Transparent file transfers occur whenever a regular file read or write
Bram Moolenaar446cb832008-06-24 21:56:24 +0000548(invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd|
549events) is made. Thus one may read, write, or source files across networks
550just as easily as if they were local files! >
Bram Moolenaar071d4272004-06-13 20:20:40 +0000551
552 vim ftp://[user@]machine/path
553 ...
554 :wq
555
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000556See |netrw-activate| for more on how to encourage your vim to use plugins
557such as netrw.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000558
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000559
Bram Moolenaar071d4272004-06-13 20:20:40 +0000560==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00005617. Ex Commands *netrw-ex* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000562
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000563The usual read/write commands are supported. There are also a few
Bram Moolenaar446cb832008-06-24 21:56:24 +0000564additional commands available. Often you won't need to use Nwrite or
Bram Moolenaar9964e462007-05-05 17:54:07 +0000565Nread as shown in |netrw-transparent| (ie. simply use >
566 :e url
567 :r url
568 :w url
569instead, as appropriate) -- see |netrw-urls|. In the explanations
570below, a {netfile} is an url to a remote file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000571
Bram Moolenaar446cb832008-06-24 21:56:24 +0000572:[range]Nw[rite] Write the specified lines to the current
Bram Moolenaar071d4272004-06-13 20:20:40 +0000573 file as specified in b:netrw_lastfile.
574
Bram Moolenaar446cb832008-06-24 21:56:24 +0000575:[range]Nw[rite] {netfile} [{netfile}]...
Bram Moolenaar071d4272004-06-13 20:20:40 +0000576 Write the specified lines to the {netfile}.
577
Bram Moolenaar446cb832008-06-24 21:56:24 +0000578:Nr[ead] Read the specified lines into the current
Bram Moolenaar071d4272004-06-13 20:20:40 +0000579 buffer from the file specified in
580 b:netrw_lastfile.
581
Bram Moolenaar446cb832008-06-24 21:56:24 +0000582:Nr[ead] {netfile} {netfile}...
Bram Moolenaar071d4272004-06-13 20:20:40 +0000583 Read the {netfile} after the current line.
584
Bram Moolenaar446cb832008-06-24 21:56:24 +0000585:Ns[ource] {netfile}
Bram Moolenaar9964e462007-05-05 17:54:07 +0000586 Source the {netfile}.
587 To start up vim using a remote .vimrc, one may use
588 the following (all on one line) (tnx to Antoine Mechelynck) >
589 vim -u NORC -N
590 --cmd "runtime plugin/netrwPlugin.vim"
591 --cmd "source scp://HOSTNAME/.vimrc"
592< *netrw-uidpass*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000593:call NetUserPass()
Bram Moolenaar446cb832008-06-24 21:56:24 +0000594 If g:netrw_uid and s:netrw_passwd don't exist,
595 this function will query the user for them.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000596
597:call NetUserPass("userid")
Bram Moolenaar446cb832008-06-24 21:56:24 +0000598 This call will set the g:netrw_uid and, if
Bram Moolenaar071d4272004-06-13 20:20:40 +0000599 the password doesn't exist, will query the user for it.
600
601:call NetUserPass("userid","passwd")
Bram Moolenaar446cb832008-06-24 21:56:24 +0000602 This call will set both the g:netrw_uid and s:netrw_passwd.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000603 The user-id and password are used by ftp transfers. One may
Bram Moolenaar446cb832008-06-24 21:56:24 +0000604 effectively remove the user-id and password by using empty
605 strings (ie. "").
Bram Moolenaar071d4272004-06-13 20:20:40 +0000606
Bram Moolenaar9964e462007-05-05 17:54:07 +0000607:NetrwSettings This command is described in |netrw-settings| -- used to
608 display netrw settings and change netrw behavior.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000609
Bram Moolenaar071d4272004-06-13 20:20:40 +0000610
611==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00006128. Variables and Options *netrw-options* *netrw-var* {{{1
613
614(if you're interested in the netrw browser settings, see: |netrw-browser-var|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000615
Bram Moolenaar9964e462007-05-05 17:54:07 +0000616The <netrw.vim> script provides several variables which act as options to
Bram Moolenaar446cb832008-06-24 21:56:24 +0000617affect <netrw.vim>'s file transfer behavior. These variables typically may be
618set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|)
619
620>
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000621
Bram Moolenaar9964e462007-05-05 17:54:07 +0000622 -------------
623 Netrw Options
624 -------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000625 Option Meaning
626 -------------- -----------------------------------------------
627<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000628 b:netrw_col Holds current cursor position (during NetWrite)
629 g:netrw_cygwin =1 assume scp under windows is from cygwin
630 (default/windows)
631 =0 assume scp under windows accepts windows
632 style paths (default/else)
633 g:netrw_ftp =0 use default ftp (uid password)
634 g:netrw_ftpmode ="binary" (default)
635 ="ascii" (your choice)
636 g:netrw_ignorenetrc =1 (default)
637 if you have a <.netrc> file but you don't
Bram Moolenaar071d4272004-06-13 20:20:40 +0000638 want it used, then set this variable. Its
639 mere existence is enough to cause <.netrc>
640 to be ignored.
Bram Moolenaar9964e462007-05-05 17:54:07 +0000641 b:netrw_lastfile Holds latest method/machine/path.
642 b:netrw_line Holds current line number (during NetWrite)
643 g:netrw_passwd Holds current password for ftp.
644 g:netrw_silent =0 transfers done normally
645 =1 transfers done silently
646 g:netrw_uid Holds current user-id for ftp.
647 =1 use alternate ftp (user uid password)
648 (see |netrw-options|)
649 g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
650 =1 use WinNT/2K/XP's rcp, binary mode
651 g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc
652 =1 use default method to do ftp >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000653 -----------------------------------------------------------------------
654<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000655The script will also make use of the following variables internally, albeit
656temporarily.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000657>
658 -------------------
659 Temporary Variables
660 -------------------
661 Variable Meaning
662 -------- ------------------------------------
663<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000664 g:netrw_method Index indicating rcp/ftp+.netrc/ftp
665 g:netrw_machine Holds machine name parsed from input
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000666 g:netrw_fname Holds filename being accessed >
667 ------------------------------------------------------------
668<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000669 *netrw-protocol*
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000670
671Netrw supports a number of protocols. These protocols are invoked using the
672variables listed below, and may be modified by the user.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000673>
674 ------------------------
Bram Moolenaar9964e462007-05-05 17:54:07 +0000675 Protocol Control Options
Bram Moolenaar071d4272004-06-13 20:20:40 +0000676 ------------------------
Bram Moolenaar9964e462007-05-05 17:54:07 +0000677 Option Type Setting Meaning
678 --------- -------- -------------- ---------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000679<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000680 netrw_ftp variable =doesn't exist userid set by "user userid"
681 =0 userid set by "user userid"
682 =1 userid set by "userid"
683 NetReadFixup function =doesn't exist no change
684 =exists Allows user to have files
685 read via ftp automatically
686 transformed however they wish
687 by NetReadFixup()
Bram Moolenaar071d4272004-06-13 20:20:40 +0000688 g:netrw_dav_cmd variable ="cadaver"
Bram Moolenaar9964e462007-05-05 17:54:07 +0000689 g:netrw_fetch_cmd variable ="fetch -o" if fetch is available
Bram Moolenaar071d4272004-06-13 20:20:40 +0000690 g:netrw_ftp_cmd variable ="ftp"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000691 g:netrw_http_cmd variable ="fetch -o" if fetch is available
692 g:netrw_http_cmd variable ="wget -O" else if wget is available
Bram Moolenaar9964e462007-05-05 17:54:07 +0000693 g:netrw_list_cmd variable ="ssh USEPORT HOSTNAME ls -Fa"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000694 g:netrw_rcp_cmd variable ="rcp"
695 g:netrw_rsync_cmd variable ="rsync -a"
696 g:netrw_scp_cmd variable ="scp -q"
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000697 g:netrw_sftp_cmd variable ="sftp" >
698 -------------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000699<
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000700 *netrw-ftp*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000701
Bram Moolenaar9964e462007-05-05 17:54:07 +0000702The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|)
703specify the external program to use handle the ftp protocol. They may
704include command line options (such as -p for passive mode).
Bram Moolenaar071d4272004-06-13 20:20:40 +0000705
Bram Moolenaar9964e462007-05-05 17:54:07 +0000706Browsing is supported by using the |g:netrw_list_cmd|; the substring
707"HOSTNAME" will be changed via substitution with whatever the current request
708is for a hostname.
709
710Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's
711that give trouble . In order to best understand how to use these options if
712ftp is giving you troubles, a bit of discussion is provided on how netrw does
713ftp reads.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000714
715For ftp, netrw typically builds up lines of one of the following formats in a
Bram Moolenaar071d4272004-06-13 20:20:40 +0000716temporary file:
717>
718 IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1
719 ---------------------------------- ------------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000720<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000721 open machine [port] open machine [port]
722 user userid password userid password
723 [g:netrw_ftpmode] password
724 [g:netrw_extracmd] [g:netrw_ftpmode]
725 get filename tempfile [g:netrw_extracmd]
726 get filename tempfile >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000727 ---------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000728<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000729The |g:netrw_ftpmode| and |g:netrw_extracmd| are optional.
730
Bram Moolenaar071d4272004-06-13 20:20:40 +0000731Netrw then executes the lines above by use of a filter:
732>
733 :%! {g:netrw_ftp_cmd} -i [-n]
734<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000735where
736 g:netrw_ftp_cmd is usually "ftp",
737 -i tells ftp not to be interactive
738 -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>)
739
740If <.netrc> exists it will be used to avoid having to query the user for
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000741userid and password. The transferred file is put into a temporary file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000742The temporary file is then read into the main editing session window that
743requested it and the temporary file deleted.
744
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000745If your ftp doesn't accept the "user" command and immediately just demands a
746userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000747
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000748 *netrw-cadaver*
749To handle the SSL certificate dialog for untrusted servers, one may pull
750down the certificate and place it into /usr/ssl/cert.pem. This operation
751renders the server treatment as "trusted".
752
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000753 *netrw-fixup* *netreadfixup*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000754If your ftp for whatever reason generates unwanted lines (such as AUTH
755messages) you may write a NetReadFixup(tmpfile) function:
756>
757 function! NetReadFixup(method,line1,line2)
758 " a:line1: first new line in current file
759 " a:line2: last new line in current file
760 if a:method == 1 "rcp
761 elseif a:method == 2 "ftp + <.netrc>
762 elseif a:method == 3 "ftp + machine,uid,password,filename
763 elseif a:method == 4 "scp
764 elseif a:method == 5 "http/wget
765 elseif a:method == 6 "dav/cadaver
766 elseif a:method == 7 "rsync
767 elseif a:method == 8 "fetch
768 elseif a:method == 9 "sftp
Bram Moolenaar9964e462007-05-05 17:54:07 +0000769 else " complain
Bram Moolenaar071d4272004-06-13 20:20:40 +0000770 endif
771 endfunction
772>
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000773The NetReadFixup() function will be called if it exists and thus allows you to
774customize your reading process. As a further example, <netrw.vim> contains
775just such a function to handle Windows 95 ftp. For whatever reason, Windows
77695's ftp dumps four blank lines at the end of a transfer, and so it is
777desirable to automate their removal. Here's some code taken from <netrw.vim>
778itself:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000779>
780 if has("win95") && g:netrw_win95ftp
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000781 fun! NetReadFixup(method, line1, line2)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000782 if method == 3 " ftp (no <.netrc>)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000783 let fourblanklines= line2 - 3
784 silent fourblanklines.",".line2."g/^\s*/d"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000785 endif
786 endfunction
787 endif
788>
789
790==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00007919. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1
792 *netrw-browser* *netrw-dir* *netrw-list*
Bram Moolenaar83bab712005-08-01 21:58:57 +0000793
Bram Moolenaar446cb832008-06-24 21:56:24 +0000794INTRODUCTION TO BROWSING *netrw-intro-browse* {{{2
795 (Quick References: |netrw-quickmaps| |netrw-quickcoms|)
Bram Moolenaar83bab712005-08-01 21:58:57 +0000796
Bram Moolenaar446cb832008-06-24 21:56:24 +0000797Netrw supports the browsing of directories on your local system and on remote
798hosts; browsing includes listing files and directories, entering directories,
799editing files therein, deleting files/directories, making new directories,
800moving (renaming) files and directories, copying files and directories, etc.
801One may mark files and execute any system command on them! The Netrw browser
802generally implements the previous explorer's maps and commands for remote
803directories, although details (such as pertinent global variable names)
804necessarily differ. To browse a directory, simply "edit" it! >
Bram Moolenaar269ec652004-07-29 08:43:53 +0000805
Bram Moolenaar446cb832008-06-24 21:56:24 +0000806 vim /your/directory/
807 vim .
808 vim c:\your\directory\
809<
810(Related topics: |netrw-cr| |netrw-o| |netrw-p| |netrw-P| |netrw-t|
811 |netrw-mf| |netrw-mx| |netrw-D| |netrw-R| |netrw-v| )
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000812
813The Netrw remote file and directory browser handles two protocols: ssh and
Bram Moolenaar446cb832008-06-24 21:56:24 +0000814ftp. The protocol in the url, if it is ftp, will cause netrw also to use ftp
815in its remote browsing. Specifying any other protocol will cause it to be
816used for file transfers; but the ssh protocol will be used to do remote
817browsing.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000818
Bram Moolenaar446cb832008-06-24 21:56:24 +0000819To use Netrw's remote directory browser, simply attempt to read a "file" with
820a trailing slash and it will be interpreted as a request to list a directory:
821>
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000822 vim [protocol]://[user@]hostname/path/
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000823<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000824where [protocol] is typically scp or ftp. As an example, try: >
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000825
Bram Moolenaar446cb832008-06-24 21:56:24 +0000826 vim ftp://ftp.home.vim.org/pub/vim/
827<
828For local directories, the trailing slash is not required. Again, because its
829easy to miss: to browse remote directories, the url must terminate with a
830slash!
Bram Moolenaar83bab712005-08-01 21:58:57 +0000831
Bram Moolenaar446cb832008-06-24 21:56:24 +0000832If you'd like to avoid entering the password repeatedly for remote directory
833listings with ssh or scp, see |netrw-ssh-hack|. To avoid password entry with
834ftp, see |netrw-netrc| (if your ftp supports it).
Bram Moolenaar83bab712005-08-01 21:58:57 +0000835
Bram Moolenaar446cb832008-06-24 21:56:24 +0000836There are several things you can do to affect the browser's display of files:
Bram Moolenaar83bab712005-08-01 21:58:57 +0000837
Bram Moolenaar446cb832008-06-24 21:56:24 +0000838 * To change the listing style, press the "i" key (|netrw-i|).
839 Currently there are four styles: thin, long, wide, and tree.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000840
Bram Moolenaar446cb832008-06-24 21:56:24 +0000841 * To hide files (don't want to see those xyz~ files anymore?) see
842 |netrw-ctrl-h|.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000843
Bram Moolenaar446cb832008-06-24 21:56:24 +0000844 * Press s to sort files by name, time, or size.
845
846See |netrw-browse-cmds| for all the things you can do with netrw!
847
848
849QUICK HELP *netrw-quickhelp* {{{2
850 (Use ctrl-] to select a topic)~
851 Intro to Browsing...............................|netrw-intro-browse|
852 Quick Reference: Maps.........................|netrw-quickmap|
853 Quick Reference: Commands.....................|netrw-browse-cmds|
854 Hiding
855 Edit hiding list..............................|netrw-ctrl-h|
856 Hiding Files or Directories...................|netrw-a|
857 Hiding/Unhiding by suffix.....................|netrw-mh|
858 Hiding dot-files.............................|netrw-gh|
859 Listing Style
860 Select listing style (thin/long/wide/tree)....|netrw-i|
861 Associated setting variable...................|g:netrw_liststyle|
862 Shell command used to perform listing.........|g:netrw_list_cmd|
863 Quick file info...............................|netrw-qf|
864 Sorted by
865 Select sorting style (name/time/size).........|netrw-s|
866 Editing the sorting sequence..................|netrw-S|
867 Associated setting variable...................|g:netrw_sort_sequence|
868 Reverse sorting order.........................|netrw-r|
869
870
871 *netrw-quickmap* *netrw-quickmaps*
872QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000873>
Bram Moolenaar446cb832008-06-24 21:56:24 +0000874 --- ----------------- ----
875 Map Quick Explanation Link
876 --- ----------------- ----
877< <F1> Causes Netrw to issue help
878 <cr> Netrw will enter the directory or read the file |netrw-cr|
879 <del> Netrw will attempt to remove the file/directory |netrw-del|
880 - Makes Netrw go up one directory |netrw--|
881 a Toggles between normal display, |netrw-a|
882 hiding (suppress display of files matching g:netrw_list_hide)
883 showing (display only files which match g:netrw_list_hide)
884 c Make browsing directory the current directory |netrw-c|
885 d Make a directory |netrw-d|
886 D Attempt to remove the file(s)/directory(ies) |netrw-D|
887 gb Go to previous bookmarked directory |netrw-gb|
888 gh Quick hide/unhide of dot-files |netrw-gh|
889 gi Display information on file |netrw-qf|
890 <c-h> Edit file hiding list |netrw-ctrl-h|
891 i Cycle between thin, long, wide, and tree listings |netrw-i|
892 <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
893 mb Bookmark current directory |netrw-mb|
894 mc Copy marked files to marked-file target directory |netrw-mc|
895 md Apply diff to marked files (up to 3) |netrw-md|
896 me Place marked files on arg list and edit them |netrw-me|
897 mf Mark a file |netrw-mf|
898 mh Toggle marked file suffices' presence on hiding list |netrw-mh|
899 mm Move marked files to marked-file target directory |netrw-mm|
900 mp Print marked files |netrw-mp|
901 mr Mark files satisfying a |regexp| |netrw-mr|
902 mt Current browsing directory becomes markfile target |netrw-mt|
903 mT Apply ctags to marked files |netrw-mT|
904 mu Unmark all marked files |netrw-mu|
905 mx Apply arbitrary shell command to marked files |netrw-mx|
906 mz Compress/decompress marked files |netrw-mz|
907 o Enter the file/directory under the cursor in a new |netrw-o|
908 browser window. A horizontal split is used.
909 O Obtain a file specified by cursor |netrw-O|
910 p Preview the file |netrw-p|
911 P Browse in the previously used window |netrw-P|
912 q List bookmarked directories and history |netrw-qb|
913 r Reverse sorting order |netrw-r|
914 R Rename the designed file(s)/directory(ies) |netrw-R|
915 s Select sorting style: by name, time, or file size |netrw-s|
916 S Specify suffix priority for name-sorting |netrw-S|
917 t Enter the file/directory under the cursor in a new tab|netrw-t|
918 u Change to recently-visited directory |netrw-u|
919 U Change to subsequently-visited directory |netrw-U|
920 v Enter the file/directory under the cursor in a new |netrw-v|
921 browser window. A vertical split is used.
922 x View file with an associated program |netrw-x|
923
924 <leftmouse> (gvim only) selects word under mouse as if a <cr>
925 had been pressed (ie. edit file, change directory)
926 <middlemouse> (gvim only) same as P selecting word under mouse;
927 see |netrw-P|
928 <rightmouse> (gvim only) delete file/directory using word under
929 mouse
930 <2-leftmouse> (gvim only) when:
931 * in a netrw-selected file, AND
932 * |g:netrw_retmap| == 1 AND
933 * the user doesn't already have a <2-leftmouse> mapping
934 defined before netrw is autoloaded,
935 then a double clicked leftmouse button will return
936 to the netrw browser window.
937 <s-leftmouse> (gvim only) like mf, will mark files
938
939 *netrw-quickcom* *netrw-quickcoms*
940QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2
941 :NetrwClean[!] ...........................................|netrw-clean|
942 :NetrwSettings ...........................................|netrw-settings|
943 :Explore[!] [dir] Explore directory of current file......|netrw-explore|
944 :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore|
945 :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
946 :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
947 :Rexplore Return to Explorer.....................|netrw-explore|
948 :Sexplore[!] [dir] Split & Explore directory .............|netrw-explore|
949 :Texplore[!] [dir] Tab & Explore..........................|netrw-explore|
950 :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
951
952BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2
953One may easily "bookmark" a directory by using >
954
955 {cnt}mb
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000956<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000957Any count may be used. One may use viminfo's "!" option (|'viminfo'|) to
958retain bookmarks between vim sessions. See |netrw-gb| for how to return
959to a bookmark and |netrw-qb| for how to list them.
Bram Moolenaar4a85b412006-04-23 22:40:29 +0000960
961
Bram Moolenaar446cb832008-06-24 21:56:24 +0000962BROWSING *netrw-cr* {{{2
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000963
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000964Browsing is simple: move the cursor onto a file or directory of interest.
Bram Moolenaar843ee412004-06-30 16:16:41 +0000965Hitting the <cr> (the return key) will select the file or directory.
966Directories will themselves be listed, and files will be opened using the
Bram Moolenaar9964e462007-05-05 17:54:07 +0000967protocol given in the original read request.
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000968
Bram Moolenaar446cb832008-06-24 21:56:24 +0000969 CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that
970 two or more spaces delimit filenames and directory names for the long and
971 wide listing formats. Thus, if your filename or directory name has two or
972 more sequential spaces embedded in it, or any trailing spaces, then you'll
973 need to use the "thin" format to select it.
Bram Moolenaar843ee412004-06-30 16:16:41 +0000974
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000975The |g:netrw_browse_split| option, which is zero by default, may be used to
Bram Moolenaar446cb832008-06-24 21:56:24 +0000976cause the opening of files to be done in a new window or tab instead of the
977default. When the option is one or two, the splitting will be taken
978horizontally or vertically, respectively. When the option is set to three, a
979<cr> will cause the file to appear in a new tab.
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000980
Bram Moolenaar83bab712005-08-01 21:58:57 +0000981
Bram Moolenaar446cb832008-06-24 21:56:24 +0000982When using the gui (gvim) one may select a file by pressing the <leftmouse>
983button. In addtion, if
Bram Moolenaar578b49e2005-09-10 19:22:57 +0000984
Bram Moolenaar446cb832008-06-24 21:56:24 +0000985 *|g:netrw_retmap| == 1 AND (its default value is 0)
986 * in a netrw-selected file, AND
987 * the user doesn't already have a <2-leftmouse> mapping defined before
988 netrw is loaded
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000989
Bram Moolenaar446cb832008-06-24 21:56:24 +0000990then a doubly-clicked leftmouse button will return to the netrw browser
991window.
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000992
Bram Moolenaar446cb832008-06-24 21:56:24 +0000993Netrw attempts to speed up browsing, especially for remote browsing where one
994may have to enter passwords, by keeping and re-using previously obtained
995directory listing buffers. The |g:netrw_fastbrowse| variable is used to
996control this behavior; one may have slow browsing (no buffer re-use), medium
997speed browsing (re-use directory buffer listings only for remote directories),
998and fast browsing (re-use directory buffer listings as often as possible).
999The price for such re-use is that when changes are made (such as new files
1000are introduced into a directory), the listing may become out-of-date. One may
1001always refresh directory listing buffers by pressing ctrl-L (see
1002|netrw-ctrl-l|).
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001003
1004
Bram Moolenaar446cb832008-06-24 21:56:24 +00001005Related topics: |netrw-o| |netrw-p| |netrw-P| |netrw-t| |netrw-v|
1006Associated setting variables: |g:netrw_browse_split| |g:netrw_fastbrowse|
1007 |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
1008 |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_cmd|
1009 |g:netrw_ssh_browse_reject| |g:netrw_use_noswf|
1010
1011
1012BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2
1013
1014Normally one enters a file or directory using the <cr>. However, the "o" map
1015allows one to open a new window to hold the new directory listing or file. A
1016horizontal split is used. (for vertical splitting, see |netrw-v|)
1017
1018Normally, the o key splits the window horizontally with the new window and
1019cursor at the top. To change to splitting the window horizontally with the
1020new window and cursor at the bottom, have
1021
1022 let g:netrw_alto = 1
1023
1024in your <.vimrc>. (also see |netrw-t| |netrw-v|)
1025
1026There is only one tree listing buffer; using "o" on a displayed subdirectory
1027will split the screen, but the same buffer will be shown twice.
1028
1029Associated setting variables: |g:netrw_alto| |g:netrw_winsize|
1030
1031
1032BROWSING WITH A NEW TAB *netrw-t* {{{2
1033
1034Normally one enters a file or directory using the <cr>. The "t" map
1035allows one to open a new window hold the new directory listing or file in a
1036new tab. (also see: |netrw-o| |netrw-v|)
1037
1038
1039BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2
1040
1041Normally one enters a file or directory using the <cr>. However, the "v" map
1042allows one to open a new window to hold the new directory listing or file. A
1043vertical split is used. (for horizontal splitting, see |netrw-o|)
1044
1045Normally, the v key splits the window vertically with the new window and
1046cursor at the left. To change to splitting the window vertically with the new
1047window and cursor at the right, have
1048
1049 let g:netrw_altv = 1
1050
1051in your <.vimrc>. (also see: |netrw-o| |netrw-t|)
1052
1053There is only one tree listing buffer; using "v" on a displayed subdirectory
1054will split the screen, but the same buffer will be shown twice.
1055
1056Associated setting variable: |g:netrw_altv| |g:netrw_winsize|
1057
1058CHANGE LISTING STYLE *netrw-i* {{{2
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001059
Bram Moolenaar9964e462007-05-05 17:54:07 +00001060The "i" map cycles between the thin, long, wide, and tree listing formats.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001061
Bram Moolenaar8299df92004-07-10 09:47:34 +00001062The short listing format gives just the files' and directories' names.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001063
Bram Moolenaar8299df92004-07-10 09:47:34 +00001064The long listing is either based on the "ls" command via ssh for remote
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001065directories or displays the filename, file size (in bytes), and the time and
1066date of last modification for local directories. With the long listing
1067format, netrw is not able to recognize filenames which have trailing spaces.
1068Use the thin listing format for such files.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001069
Bram Moolenaar9964e462007-05-05 17:54:07 +00001070The wide listing format uses two or more contiguous spaces to delineate
1071filenames; when using that format, netrw won't be able to recognize or use
1072filenames which have two or more contiguous spaces embedded in the name or any
1073trailing spaces. The thin listing format will, however, work with such files.
1074This listing format is the most compact.
1075
1076The tree listing format has a top directory followed by files and directories
1077preceded by a "|". One may open and close directories by pressing the <cr>
1078key while atop the directory name. There is only one tree listing buffer;
1079hence, using "v" or "o" on a subdirectory will only show the same buffer,
1080twice.
Bram Moolenaar8299df92004-07-10 09:47:34 +00001081
Bram Moolenaar446cb832008-06-24 21:56:24 +00001082Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen|
1083 |g:netrw_timefmt| |g:netrw_list_cmd|
Bram Moolenaar8299df92004-07-10 09:47:34 +00001084
Bram Moolenaar83bab712005-08-01 21:58:57 +00001085
Bram Moolenaar446cb832008-06-24 21:56:24 +00001086CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2
Bram Moolenaar843ee412004-06-30 16:16:41 +00001087
Bram Moolenaar446cb832008-06-24 21:56:24 +00001088To change directory back to a bookmarked directory, use
Bram Moolenaar843ee412004-06-30 16:16:41 +00001089
Bram Moolenaar446cb832008-06-24 21:56:24 +00001090 {cnt}gb
Bram Moolenaar843ee412004-06-30 16:16:41 +00001091
Bram Moolenaar446cb832008-06-24 21:56:24 +00001092Any count may be used to reference any of the bookmarks. See |netrw-mb| on
1093how to bookmark a directory and |netrw-qb| on how to list bookmarks.
Bram Moolenaar843ee412004-06-30 16:16:41 +00001094
Bram Moolenaar843ee412004-06-30 16:16:41 +00001095
Bram Moolenaar446cb832008-06-24 21:56:24 +00001096CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001097
1098Every time you change to a new directory (new for the current session),
1099netrw will save the directory in a recently-visited directory history
Bram Moolenaar446cb832008-06-24 21:56:24 +00001100list (unless g:netrw_dirhistmax is zero; by default, it's ten). With the
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001101"u" map, one can change to an earlier directory (predecessor). To do
1102the opposite, see |netrw-U|.
1103
1104
Bram Moolenaar446cb832008-06-24 21:56:24 +00001105CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001106
1107With the "U" map, one can change to a later directory (successor).
1108This map is the opposite of the "u" map. (see |netrw-u|) Use the
Bram Moolenaar446cb832008-06-24 21:56:24 +00001109q map to list both the bookmarks and history. (see |netrw-qb|)
1110
1111
1112NETRW CLEAN *netrw-clean* *:NetrwClean*
1113
1114With :NetrwClean one may easily remove netrw from one's home directory;
1115more precisely, from the first directory on your |'runtimepath'|.
1116
1117With :NetrwClean!, netrw will remove netrw from all directories on your
1118|'runtimepath'|.
1119
1120With either form of the command, netrw will first ask for confirmation
1121that the removal is in fact what you want to do. If netrw doesn't have
1122permission to remove a file, it will issue an error message.
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001123
Bram Moolenaar9964e462007-05-05 17:54:07 +00001124 *netrw-gx*
Bram Moolenaar446cb832008-06-24 21:56:24 +00001125CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler* {{{2
Bram Moolenaar9964e462007-05-05 17:54:07 +00001126 (also see |netrw_filehandler|)
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001127
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001128Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
1129best seen with a special handler (ie. a tool provided with your computer).
1130Netrw allows one to invoke such special handlers by: >
1131
1132 * when Exploring, hit the "x" key
1133 * when editing, hit gx with the cursor atop the special filename
Bram Moolenaar9964e462007-05-05 17:54:07 +00001134< (not available if the |g:netrw_nogx| variable exists)
1135
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001136Netrw determines which special handler by the following method:
1137
1138 * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
1139 view files. Examples of useful settings (place into your <.vimrc>): >
1140
1141 :let g:netrw_browsex_viewer= "kfmclient exec"
1142< or >
1143 :let g:netrw_browsex_viewer= "gnome-open"
1144<
1145 If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
1146 invoked first (see |netrw_filehandler|).
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001147
Bram Moolenaar9964e462007-05-05 17:54:07 +00001148 * for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001149 * for Gnome (with gnome-open): gnome-open is used.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001150 * for KDE (with kfmclient) : kfmclient is used.
1151 * for Mac OS X : open is used.
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001152 * otherwise the netrwFileHandler plugin is used.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001153
1154The file's suffix is used by these various approaches to determine an
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001155appropriate application to use to "handle" these files. Such things as
1156OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
1157*.eps) can be handled.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001158
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001159 *netrw_filehandler*
Bram Moolenaar9964e462007-05-05 17:54:07 +00001160
1161The "x" map applies a function to a file, based on its extension. Of course,
1162the handler function must exist for it to be called!
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001163>
1164 Ex. mypgm.html x ->
Bram Moolenaar9964e462007-05-05 17:54:07 +00001165 NFH_html("scp://user@host/some/path/mypgm.html")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001166<
Bram Moolenaar9964e462007-05-05 17:54:07 +00001167Users may write their own netrw File Handler functions to support more
1168suffixes with special handling. See <plugin/netrwFileHandlers.vim> for
1169examples on how to make file handler functions. As an example: >
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001170
Bram Moolenaar9964e462007-05-05 17:54:07 +00001171 " NFH_suffix(filename)
1172 fun! NFH_suffix(filename)
1173 ..do something special with filename..
1174 endfun
1175<
1176These functions need to be defined in some file in your .vim/plugin
1177(vimfiles\plugin) directory. Vim's function names may not have punctuation
1178characters (except for the underscore) in them. To support suffices that
1179contain such characters, netrw will first convert the suffix using the
1180following table: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001181
Bram Moolenaar9964e462007-05-05 17:54:07 +00001182 @ -> AT ! -> EXCLAMATION % -> PERCENT
1183 : -> COLON = -> EQUAL ? -> QUESTION
1184 , -> COMMA - -> MINUS ; -> SEMICOLON
1185 $ -> DOLLAR + -> PLUS ~ -> TILDE
1186<
1187So, for example: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001188
Bram Moolenaar9964e462007-05-05 17:54:07 +00001189 file.rcs,v -> NFH_rcsCOMMAv()
1190<
1191If more such translations are necessary, please send me email: >
1192 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
1193with a request.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001194
Bram Moolenaar446cb832008-06-24 21:56:24 +00001195Associated setting variable: |g:netrw_browsex_viewer|
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001196
Bram Moolenaar446cb832008-06-24 21:56:24 +00001197 *netrw-curdir*
1198DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001199
Bram Moolenaar446cb832008-06-24 21:56:24 +00001200If files have not been marked with |netrw-mf|: (local marked file list)
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001201
Bram Moolenaar446cb832008-06-24 21:56:24 +00001202 Deleting/removing files and directories involves moving the cursor to the
1203 file/directory to be deleted and pressing "D". Directories must be empty
1204 first before they can be successfully removed. If the directory is a
1205 softlink to a directory, then netrw will make two requests to remove the
1206 directory before succeeding. Netrw will ask for confirmation before doing
1207 the removal(s). You may select a range of lines with the "V" command
1208 (visual selection), and then pressing "D".
Bram Moolenaar9964e462007-05-05 17:54:07 +00001209
Bram Moolenaar446cb832008-06-24 21:56:24 +00001210If files have been marked with |netrw-mf|: (local marked file list)
1211
1212 Marked files (and empty directories) will be deleted; again, you'll be
1213 asked to confirm the deletion before it actually takes place.
1214
1215The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are
1216used to control the attempts to remove files and directories. The
1217g:netrw_rm_cmd is used with files, and its default value is:
1218
1219 g:netrw_rm_cmd: ssh HOSTNAME rm
1220
1221The g:netrw_rmdir_cmd variable is used to support the removal of directories.
1222Its default value is:
1223
1224 g:netrw_rmdir_cmd: ssh HOSTNAME rmdir
1225
1226If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
1227to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
1228
1229 g:netrw_rmf_cmd: ssh HOSTNAME rm -f
1230
1231Associated setting variable: |g:netrw_local_rmdir| |g:netrw_rm_cmd|
1232 |g:netrw_rmdir_cmd| |g:netrw_ssh_cmd|
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001233
1234
Bram Moolenaar446cb832008-06-24 21:56:24 +00001235*netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore*
1236*netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore*
1237DIRECTORY EXPLORATION COMMANDS {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001238
Bram Moolenaar446cb832008-06-24 21:56:24 +00001239 :Explore[!] [dir]... Explore directory of current file *:Explore*
1240 :Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
1241 :Rexplore ... Return to Explorer *:Rexplore*
1242 :Sexplore[!] [dir]... Split&Explore directory of current file *:Sexplore*
1243 :Texplore [dir]... Tab & Explore *:Texplore*
1244 :Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
1245
1246 Used with :Explore **/pattern : (also see |netrw-starstar|)
1247 :Nexplore............. go to next matching file *:Nexplore*
1248 :Pexplore............. go to previous matching file *:Pexplore*
1249
1250:Explore will open the local-directory browser on the current file's
1251 directory (or on directory [dir] if specified). The window will be
1252 split only if the file has been modified, otherwise the browsing
1253 window will take over that window. Normally the splitting is taken
1254 horizontally.
1255:Explore! is like :Explore, but will use vertical splitting.
1256:Sexplore will always split the window before invoking the local-directory
1257 browser. As with Explore, the splitting is normally done
1258 horizontally.
1259:Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically.
1260:Hexplore [dir] does an :Explore with |:belowright| horizontal splitting.
1261:Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting.
1262:Vexplore [dir] does an :Explore with |:leftabove| vertical splitting.
1263:Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting.
1264:Texplore [dir] does a tabnew before generating the browser window
1265
1266By default, these commands use the current file's directory. However, one
1267may explicitly provide a directory (path) to use.
1268
1269The |g:netrw_winsize| variable also is used, if specified by the user, to
1270size Hexplore and Vexplore windows.
1271
1272:Rexplore This command is a little different from the others. When one
1273 edits a file, for example by pressing <cr> when atop a file in
1274 a netrw browser window, :Rexplore will return the display to
1275 that of the last netrw browser window. Its a command version
1276 of <2-leftmouse> (which is only available under gvim and
1277 cooperative terms).
1278
1279
1280*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat*
1281EXPLORING WITH STARS AND PATTERNS
1282
1283When Explore, Sexplore, Hexplore, or Vexplore are used with one of the
1284following four styles, Explore generates a list of files which satisfy
1285the request. >
1286
1287 */filepat files in current directory which satisfy filepat
1288 **/filepat files in current directory or below which satisfy the
1289 file pattern
1290 *//pattern files in the current directory which contain the
1291 pattern (vimgrep is used)
1292 **//pattern files in the current directory or below which contain
1293 the pattern (vimgrep is used)
Bram Moolenaar572cb562005-08-05 21:35:02 +00001294<
Bram Moolenaar446cb832008-06-24 21:56:24 +00001295The cursor will be placed on the first file in the list. One may then
1296continue to go to subsequent files on that list via |:Nexplore| or to
1297preceding files on that list with |:Pexplore|. Explore will update the
1298directory and place the cursor appropriately.
1299
1300A plain >
1301 :Explore
1302will clear the explore list.
1303
1304If your console or gui produces recognizable shift-up or shift-down sequences,
1305then you'll likely find using shift-downarrow and shift-uparrow convenient.
1306They're mapped by netrw:
1307
1308 <s-down> == Nexplore, and
1309 <s-up> == Pexplore.
1310
1311As an example, consider
1312>
1313 :Explore */*.c
1314 :Nexplore
1315 :Nexplore
1316 :Pexplore
1317<
1318The status line will show, on the right hand side of the status line, a
1319message like "Match 3 of 20".
1320
1321Associated setting variables: |g:netrw_keepdir| |g:netrw_browse_split|
1322 |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject|
1323 |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
1324 |g:netrw_ftp_timelist_cmd| |g:netrw_list_cmd|
1325 |g:netrw_liststyle|
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001326
1327
Bram Moolenaar446cb832008-06-24 21:56:24 +00001328DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001329
Bram Moolenaar446cb832008-06-24 21:56:24 +00001330With the cursor atop a filename, pressing "qf" will reveal the file's size
1331and last modification timestamp. Currently this capability is only available
1332for local files.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001333
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001334
Bram Moolenaar446cb832008-06-24 21:56:24 +00001335EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001336
Bram Moolenaar446cb832008-06-24 21:56:24 +00001337The "<ctrl-h>" map brings up a requestor allowing the user to change the
1338file/directory hiding list contained in |g:netrw_list_hide|. The hiding list
1339consists of one or more patterns delimited by commas. Files and/or
1340directories satisfying these patterns will either be hidden (ie. not shown) or
1341be the only ones displayed (see |netrw-a|).
1342
1343The "gh" mapping (see |netrw-gh|) quickly alternates between the usual
1344hiding list and the hiding of files or directories that begin with ".".
1345
1346Associated setting variables: |g:netrw_hide| |g:netrw_list_hide|
1347Associated topics: |netrw-a| |netrw-gh| |netrw-mh|
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001348
1349
Bram Moolenaar446cb832008-06-24 21:56:24 +00001350EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2
1351
1352When "Sorted by" is name, one may specify priority via the sorting sequence
1353(g:netrw_sort_sequence). The sorting sequence typically prioritizes the
1354name-listing by suffix, although any pattern will do. Patterns are delimited
1355by commas. The default sorting sequence is (all one line):
1356>
1357 '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,
1358 \.swp$,\.bak$,\~$'
1359<
1360The lone * is where all filenames not covered by one of the other patterns
1361will end up. One may change the sorting sequence by modifying the
1362g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by
1363using the "S" map.
1364
1365Related topics: |netrw-s|
1366Associated setting variable: |g:netrw_sort_sequence|
1367
1368
1369GOING UP *netrw--* {{{2
1370
1371To go up a directory, press "-" or press the <cr> when atop the ../ directory
1372entry in the listing.
1373
1374Netrw will use the command in |g:netrw_list_cmd| to perform the directory
1375listing operation after changing HOSTNAME to the host specified by the
1376user-provided url. By default netrw provides the command as:
1377
1378 ssh HOSTNAME ls -FLa
1379
1380where the HOSTNAME becomes the [user@]hostname as requested by the attempt to
1381read. Naturally, the user may override this command with whatever is
1382preferred. The NetList function which implements remote browsing
1383expects that directories will be flagged by a trailing slash.
1384
1385
1386HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2
1387
1388Netrw's browsing facility allows one to use the hiding list in one of three
1389ways: ignore it, hide files which match, and show only those files which
1390match.
1391
1392If no files have been marked via |netrw-mf|:
1393
1394The "a" map allows the user to cycle through the three hiding modes.
1395
1396The |g:netrw_list_hide| variable holds a comma delimited list of patterns
1397based on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list.
1398(also see |netrw-ctrl-h|) To set the hiding list, use the <c-h> map. As an
1399example, to hide files which begin with a ".", one may use the <c-h> map to
1400set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*'
1401in one's <.vimrc>). One may then use the "a" key to show all files, hide
1402matching files, or to show only the matching files.
1403
1404 Example: \.[ch]$
1405 This hiding list command will hide/show all *.c and *.h files.
1406
1407 Example: \.c$,\.h$
1408 This hiding list command will also hide/show all *.c and *.h
1409 files.
1410
1411Don't forget to use the "a" map to select the mode (normal/hiding/show) you
1412want!
1413
1414If files have been marked using |netrw-mf|, then this command will:
1415
1416 if showing all files or non-hidden files:
1417 modify the g:netrw_list_hide list by appending the marked files to it
1418 and showing only non-hidden files.
1419
1420 else if showing hidden files only:
1421 modify the g:netrw_list_hide list by removing the marked files from it
1422 and showing only non-hidden files.
1423 endif
1424
1425 *netrw-gh* *netrw-hide*
1426As a quick shortcut, one may press >
1427 gh
1428to toggle between hiding files which begin with a period (dot) and not hiding
1429them.
1430
1431Associated setting variable: |g:netrw_list_hide|
1432Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh|
1433
1434IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001435
1436Especially with the remote directory browser, constantly entering the password
1437is tedious.
1438
Bram Moolenaar9964e462007-05-05 17:54:07 +00001439For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00001440tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip
1441for setting up no-password ssh and scp and discusses associated security
Bram Moolenaar9964e462007-05-05 17:54:07 +00001442issues. It used to be available at http://hacks.oreilly.com/pub/h/66 ,
1443but apparently that address is now being redirected to some "hackzine".
1444I'll attempt a summary:
Bram Moolenaar843ee412004-06-30 16:16:41 +00001445
Bram Moolenaar9964e462007-05-05 17:54:07 +00001446 1. Generate a public/private key pair on the ssh server:
1447 ssh-keygen -t rsa
1448 (saving the file in ~/.ssh/id_rsa is ok)
1449 2. Just hit the <CR> when asked for passphrase (twice).
1450 3. This creates two files:
1451 ~/.ssh/id_rsa
1452 ~/.ssh/id_rsa.pub
1453 4. On the client:
1454 cd
1455 mkdir .ssh
1456 chmod 0700 .ssh
1457 scp {serverhostname}:.ssh/id_rsa.pub .
1458 cat id_rsa.pub >> .ssh/authorized_keys2
Bram Moolenaar843ee412004-06-30 16:16:41 +00001459
Bram Moolenaar9964e462007-05-05 17:54:07 +00001460For Windows, folks on the vim mailing list have mentioned that Pageant helps
1461with avoiding the constant need to enter the password.
Bram Moolenaar433f7c82006-03-21 21:29:36 +00001462
Bram Moolenaar446cb832008-06-24 21:56:24 +00001463Kingston Fung wrote about another way to avoid constantly needing to enter
1464passwords:
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001465
Bram Moolenaar446cb832008-06-24 21:56:24 +00001466 In order to avoid the need to type in the password for scp each time, you
1467 provide a hack in the docs to set up a non password ssh account. I found a
1468 better way to do that: I can use a regular ssh account which uses a
1469 password to access the material without the need to key-in the password
1470 each time. It's good for security and convenience. I tried ssh public key
1471 authorization + ssh-agent, implementing this, and it works! Here are two
1472 links with instructions:
1473
1474 http://www.ibm.com/developerworks/library/l-keyc2/
1475 http://sial.org/howto/openssh/publickey-auth/
1476
1477
1478LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2
1479
1480Pressing "qb" (query bookmarks) will list the bookmarked directories and
1481directory traversal history (query).
1482
1483(see |netrw-mb|, |netrw-gb|, |netrw-u|, and |netrw-U|)
1484
1485
1486MAKING A NEW DIRECTORY *netrw-d* {{{2
1487
1488With the "d" map one may make a new directory either remotely (which depends
1489on the global variable g:netrw_mkdir_cmd) or locally (which depends on the
1490global variable g:netrw_local_mkdir). Netrw will issue a request for the new
1491directory's name. A bare <CR> at that point will abort the making of the
1492directory. Attempts to make a local directory that already exists (as either
1493a file or a directory) will be detected, reported on, and ignored.
1494
1495Currently, making a directory via ftp is not supported.
1496
1497Associated setting variable: |g:netrw_local_mkdir| |g:netrw_mkdir_cmd|
1498
1499
1500MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* {{{2
1501
1502By default, |g:netrw_keepdir| is 1. This setting means that the current
1503directory will not track the browsing directory.
1504
1505Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory to
1506track netrw's browsing directory.
1507
1508However, given the default setting for g:netrw_keepdir of 1 where netrw
1509maintains its own separate notion of the current directory, in order to make
1510the two directories the same, use the "c" map (just type c). That map will
1511set Vim's notion of the current directory to netrw's current browsing
1512directory.
1513
1514Associated setting variable: |g:netrw_keepdir|
1515
1516MARKING FILES *netrw-mf* {{{2
1517 (also see |netrw-mr|)
1518
1519One may mark files with the cursor atop a filename and then pressing "mf".
1520With gvim, one may also mark files with <s-leftmouse>. The following netrw
1521maps make use of marked files:
1522
1523 |netrw-a| Hide marked files/directories
1524 |netrw-D| Delete marked files/directories
1525 |netrw-mc| Copy marked files to target
1526 |netrw-md| Apply vimdiff to marked files
1527 |netrw-me| Edit marked files
1528 |netrw-mg| Apply vimgrep to marked files
1529 |netrw-mm| Move marked files
1530 |netrw-mp| Print marked files
1531 |netrw-mt| Set target for |netrw-mm| and |netrw-mc|
1532 |netrw-mT| Generate tags using marked files
1533 |netrw-mx| Apply shell command to marked files
1534 |netrw-mz| Compress/Decompress marked files
1535 |netrw-O| Obtain marked files
1536 |netrw-R| Rename marked files
1537
1538One may unmark files one at a time the same way one marks them; ie. place
1539the cursor atop a marked file and press "mf". This process also works
1540with <s-leftmouse> using gvim. One may unmark all files by pressing
1541"mu" (see |netrw-mu|).
1542
1543*markfilelist* *global_markfilelist* *local_markfilelist*
1544All marked files are entered onto the global marked file list; there is only
1545one such list. In addition, every netrw buffer also has its own local marked
1546file list; since netrw buffers are associated with specific directories, this
1547means that each directory has its own local marked file list. The various
1548commands which operate on marked files use one or the other of the marked file
1549lists.
1550
1551
1552MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
1553 (also see |netrw-mf|)
1554
1555One may also mark files by pressing "mr"; netrw will then issue a prompt,
1556"Enter regexp: ". You may then enter a regular expression such as \.c$ .
1557All files in the current directory will then be marked. Note that the
1558regular expressions are vim-style |regexp| ones, not shell ones. So
1559entering *.c probably isn't what you want!
1560
1561
1562MARKED FILES: ARBITRARY COMMAND *netrw-mx* {{{2
1563 (See |netrw-mf| and |netrw-mr| for how to mark files)
1564 (uses the local marked-file list)
1565
1566Upon activation of the "mx" map, netrw will query the user for some (external)
1567command to be applied to all marked files. All "%"s in the command will be
1568substituted with the name of each marked file in turn. If no "%"s are in the
1569command, then the command will be followed by a space and a marked filename.
1570
1571
1572MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2
1573 (See |netrw-mf| and |netrw-mr| for how to mark files)
1574 (uses the local marked file list)
1575
1576If any marked files are compressed, then "mz" will decompress them.
1577If any marked files are decompressed, then "mz" will compress them
1578using the command specified by |g:netrw_compress|; by default,
1579that's "gzip".
1580
1581For decompression, netrw provides a |Dictionary| of suffices and their
1582associated decompressing utilities; see |g:netrw_decompress|.
1583
1584Associated setting variables: |g:netrw_compress| |g:netrw_decompress|
1585
1586MARKED FILES: COPYING *netrw-mc* {{{2
1587 (See |netrw-mf| and |netrw-mr| for how to mark files)
1588 (Uses the global marked file list)
1589
1590Select a target directory with mt (|netrw-mt|). Then change directory,
1591select file(s) (see |netrw-mf|), and press "mc".
1592
1593Associated setting variable: |g:netrw_localcopycmd| |g:netrw_ssh_cmd|
1594
1595MARKED FILES: DIFF *netrw-md* {{{2
1596 (See |netrw-mf| and |netrw-mr| for how to mark files)
1597 (uses the global marked file list)
1598
1599Use |vimdiff| to visualize difference between selected files (two or
1600three may be selected for this). Uses the global marked file list.
1601
1602MARKED FILES: EDITING *netrw-me* {{{2
1603 (See |netrw-mf| and |netrw-mr| for how to mark files)
1604 (uses the global marked file list)
1605
1606This command will place the marked files on the |arglist| and commence
1607editing them. One may return the to explorer window with |:Rexplore|.
1608
1609MARKED FILES: GREP *netrw-mg* {{{2
1610 (See |netrw-mf| and |netrw-mr| for how to mark files)
1611 (uses the global marked file list)
1612
1613This command will apply |:vimgrep| to the marked files. The command will ask
1614for the requested pattern; one may enter: >
1615 /pattern/[g][j]
1616 ! /pattern/[g][j]
1617 pattern
1618<
1619MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2
1620 (See |netrw-mf| and |netrw-mr| for how to mark files)
1621 (uses the local marked file list)
1622
1623This command extracts the suffices of the marked files and toggles their
1624presence on the hiding list. Please note that marking the same suffix
1625this way multiple times will result in the suffix's presence being toggled
1626for each file (so an even quantity of marked files having the same suffix
1627is the same as not having bothered to select them at all).
1628
1629Related topics: |netrw-a| |g:netrw_list_hide|
1630
1631MARKED FILES: MOVING *netrw-mm* {{{2
1632 (See |netrw-mf| and |netrw-mr| for how to mark files)
1633 (uses the global marked file list)
1634
1635Select a target directory with mT (|netrw-mt|). Then change directory,
1636select file(s) (see |netrw-mf|), and press "mm".
1637
1638Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|
1639
1640MARKED FILES: PRINTING *netrw-mp* {{{2
1641 (See |netrw-mf| and |netrw-mr| for how to mark files)
1642 (uses the local marked file list)
1643
1644Netrw will apply the |:hardcopy| command to marked files. What it does
1645is open each file in a one-line window, execute hardcopy, then close the
1646one-line window.
1647
1648
1649MARKED FILES: SOURCING *netrw-ms* {{{2
1650 (See |netrw-mf| and |netrw-mr| for how to mark files)
1651 (uses the local marked file list)
1652
1653Netrw will source the marked files (using vim's |:source| command)
1654
1655
1656MARKED FILES: TAGGING *netrw-mT* {{{2
1657 (See |netrw-mf| and |netrw-mr| for how to mark files)
1658 (uses the global marked file list)
1659
1660The "mt" mapping will apply the command in g:netrw_ctags (by default, its
1661"ctags") to marked files. For remote browsing, in order to create a tags file
1662netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for
1663this to work on remote systems. For your local system, see |ctags| on how to
1664get a version. I myself use hdrtags, currently available at
1665http://mysite.verizon.net/astronaut/src/index.html , and have >
1666
1667 let g:netrw_ctags= "hdrtag"
1668<
1669in my <.vimrc>.
1670
1671When a remote set of files are tagged, the resulting tags file is "obtained";
1672ie. a copy is transferred to the local system's directory. The local tags
1673file is then modified so that one may use it through the network. The
1674modification is concerns the names of the files in the tags; each filename is
1675preceded by the netrw-compatible url used to obtain it. When one subsequently
1676uses one of the go to tag actions (|tags|), the url will be used by netrw to
1677edit the desired file and go to the tag.
1678
1679Associated setting variables: |g:netrw_ssh_cmd|
1680
1681
1682MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2
1683 (See |netrw-mf| and |netrw-mr| for how to mark files)
1684
1685Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
1686
1687 * if the cursor is atop a file name, then the netrw window's currently
1688 displayed directory is used for the copy/move-to target.
1689
1690 * also, if the cursor is in the banner, then the netrw window's currently
1691 displayed directory is used for the copy/move-to target.
1692
1693 * however, if the cursor is atop a directory name, then that directory is
1694 used for the copy/move-to target
1695
1696There is only one copy/move-to target per vim session; ie. the target is a
1697script variable (see |s:var|) and is shared between all netrw windows (in an
1698instance of vim).
1699
1700MARKED FILES: UNMARKING *netrw-mu* {{{2
1701 (See |netrw-mf| and |netrw-mr| for how to mark files)
1702
1703The "mu" mapping will unmark all currently marked files.
1704
1705
1706NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2
1707
1708(if you're interestd in the netrw file transfer settings, see |netrw-options|)
1709
1710The <netrw.vim> browser provides settings in the form of variables which
1711you may modify; by placing these settings in your <.vimrc>, you may customize
1712your browsing preferences. (see also: |netrw-settings|)
1713>
1714 --- -----------
1715 Var Explanation
1716 --- -----------
1717< *g:netrw_alto* change from above splitting to below splitting
1718 by setting this variable (see |netrw-o|)
1719 default: =&sb (see |'sb'|)
1720
1721 *g:netrw_altv* change from left splitting to right splitting
1722 by setting this variable (see |netrw-v|)
1723 default: =&spr (see |'spr'|)
1724
1725 *g:netrw_browse_split* when browsing, <cr> will open the file by:
1726 =0: re-using the same window
1727 =1: horizontally splitting the window first
1728 =2: vertically splitting the window first
1729 =3: open file in new tab
1730 =4: act like "P" (ie. open previous window)
1731
1732 *g:netrw_browsex_viewer* specify user's preference for a viewer: >
1733 "kfmclient exec"
1734 "gnome-open"
1735< If >
1736 "-"
1737< is used, then netrwFileHandler() will look for
1738 a script/function to handle the given
1739 extension. (see |netrw_filehandler|).
1740
1741 *g:netrw_cd_escape* ="[]#*$%'\" ?`!&();<>\\"
1742 This option is used to escape directory names
1743 before changing directory to them.
1744
1745 *g:netrw_compress* ="gzip"
1746 Will compress marked files with this
1747 command
1748
1749 *g:netrw_decompress* = { ".gz" : "gunzip" ,
1750 ".bz2" : "bunzip2" ,
1751 ".zip" : "unzip" ,
1752 ".tar" : "tar -xf"}
1753 A dictionary mapping suffices to
1754 decompression programs.
1755
1756 *g:netrw_fastbrowse* =0: slow speed directory browsing;
1757 never re-uses directory listings,
1758 always obtains directory listings.
1759 =1: medium speed directory browsing;
1760 re-use directory listings only
1761 when remote directory browsing.
1762 (default value)
1763 =2: fast directory browsing;
1764 only obtains directory listings when the
1765 directory hasn't been seen before
1766 (or |netrw-ctrl-l| is used).
1767
1768 Fast browsing retains old directory listing
1769 buffers so that they don't need to be
1770 re-acquired. This feature is especially
1771 important for remote browsing. However, if
1772 a file is introduced or deleted into or from
1773 such directories, the old directory buffer
1774 becomes out-of-date. One may always refresh
1775 such a directory listing with |netrw-ctrl-l|.
1776 This option gives the user the choice of
1777 trading off accuracy (ie. up-to-date listing)
1778 versus speed.
1779
1780 *g:netrw_fname_escape* =' ?&;%'
1781 Used on filenames before remote reading/writing
1782
1783 *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
1784 that can show up as "directories" and "files"
1785 in the listing. This pattern is used to
1786 remove such embedded messages. By default its
1787 value is:
1788 '^total\s\+\d\+$\|
1789 ^Trying\s\+\d\+.*$\|
1790 ^KERBEROS_V\d rejected\|
1791 ^Security extensions not\|
1792 No such file\|
1793 : connect to address [0-9a-fA-F:]*
1794 : No route to host$'
1795
1796 *g:netrw_ftp_list_cmd* options for passing along to ftp for directory
1797 listing. Defaults:
1798 unix or g:netrw_cygwin set: : "ls -lF"
1799 otherwise "dir"
1800
1801
1802 *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory
1803 listing, sorted by size of file.
1804 Defaults:
1805 unix or g:netrw_cygwin set: : "ls -slF"
1806 otherwise "dir"
1807
1808 *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory
1809 listing, sorted by time of last modification.
1810 Defaults:
1811 unix or g:netrw_cygwin set: : "ls -tlF"
1812 otherwise "dir"
1813
1814 *g:netrw_glob_escape* ='[]*?`{~$'
1815 These characters in directory names are
1816 escaped before applying glob()
1817
1818 *g:netrw_hide* if true, the hiding list is used
1819 default: =0
1820
1821 *g:netrw_keepdir* =1 (default) keep current directory immune from
1822 the browsing directory.
1823 =0 keep the current directory the same as the
1824 browsing directory.
1825 The current browsing directory is contained in
1826 b:netrw_curdir (also see |netrw-c|)
1827
1828 *g:netrw_list_cmd* command for listing remote directories
1829 default: (if ssh is executable)
1830 "ssh HOSTNAME ls -FLa"
1831
1832 *g:netrw_liststyle* Set the default listing style:
1833 = 0: thin listing (one file per line)
1834 = 1: long listing (one file per line with time
1835 stamp information and file size)
1836 = 2: wide listing (multiple files in columns)
1837 = 3: tree style listing
1838 *g:netrw_list_hide* comma separated pattern list for hiding files
1839 Patterns are regular expressions (see |regexp|)
1840 Example: let g:netrw_list_hide= '.*\.swp$'
1841 default: ""
1842
1843 *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin
1844 ="copy" Windows
1845 Copies marked files (|netrw-mf|) to target
1846 directory (|netrw-mt|, |netrw-mc|)
1847
1848 *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin
1849 ="move" Windows
1850 Moves marked files (|netrw-mf|) to target
1851 directory (|netrw-mt|, |netrw-mm|)
1852
1853 *g:netrw_local_mkdir* command for making a local directory
1854 default: "mkdir"
1855
1856 *g:netrw_local_rmdir* remove directory command (rmdir)
1857 default: "rmdir"
1858
1859 *g:netrw_maxfilenamelen* =32 by default, selected so as to make long
1860 listings fit on 80 column displays.
1861 If your screen is wider, and you have file
1862 or directory names longer than 32 bytes,
1863 you may set this option to keep listings
1864 columnar.
1865
1866 *g:netrw_mkdir_cmd* command for making a remote directory
1867 default: "ssh USEPORT HOSTNAME mkdir"
1868
1869 *g:netrw_retmap* if it exists and is set to one, then
1870 <2-leftmouse> will be mapped for easy
1871 return to the netrw browser window.
1872 (example: click once to select and open
1873 a file, double-click to return)
1874 default: =0
1875
1876 *g:netrw_rm_cmd* command for removing files
1877 default: "ssh USEPORT HOSTNAME rm"
1878
1879 *g:netrw_rmdir_cmd* command for removing directories
1880 default: "ssh USEPORT HOSTNAME rmdir"
1881
1882 *g:netrw_rmf_cmd* command for removing softlinks
1883 default: "ssh USEPORT HOSTNAME rm -f"
1884
1885 *g:netrw_sort_by* sort by "name", "time", or "size"
1886 default: "name"
1887
1888 *g:netrw_sort_direction* sorting direction: "normal" or "reverse"
1889 default: "normal"
1890
1891 *g:netrw_sort_sequence* when sorting by name, first sort by the
1892 comma-separated pattern sequence
1893 default: '[\/]$,*,\.bak$,\.o$,\.h$,
1894 \.info$,\.swp$,\.obj$'
1895
1896 *g:netrw_special_syntax* If true, then certain files will be shown
1897 in special syntax in the browser:
1898
1899 netrwBak : *.bak
1900 netrwCompress: *.gz *.bz2 *.Z *.zip
1901 netrwData : *.dat
1902 netrwHdr : *.h
1903 netrwLib : *.a *.so *.lib *.dll
1904 netrwMakefile: [mM]akefile *.mak
1905 netrwObj : *.o *.obj
1906 netrwTags : tags ANmenu ANtags
1907 netrwTilde : *~
1908 netrwTmp : tmp* *tmp
1909
1910 These syntax highlighting groups are linked
1911 to Folded or DiffChange by default
1912 (see |hl-Folded| and |hl-DiffChange|), but
1913 one may put lines like >
1914 hi link netrwCompress Visual
1915< into one's <.vimrc> to use one's own
1916 preferences.
1917
1918 *g:netrw_ssh_cmd* One may specify an executable command
1919 to use instead of ssh for remote actions
1920 such as listing, file removal, etc.
1921 default: ssh
1922
1923 *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines,
1924 messages, banners, and whatnot that one doesn't
1925 want masquerading as "directories" and "files".
1926 Use this pattern to remove such embedded
1927 messages. By default its value is:
1928 '^total\s\+\d\+$'
1929
1930
1931 *g:netrw_tmpfile_escape* =' &;'
1932 escape() is applied to all temporary files
1933 to escape these characters.
1934
1935 *g:netrw_timefmt* specify format string to vim's strftime().
1936 The default, "%c", is "the preferred date
1937 and time representation for the current
1938 locale" according to my manpage entry for
1939 strftime(); however, not all are satisfied
1940 with it. Some alternatives:
1941 "%a %d %b %Y %T",
1942 " %a %Y-%m-%d %I-%M-%S %p"
1943 default: "%c"
1944
1945 *g:netrw_use_noswf* netrw normally avoids writing swapfiles
1946 for browser buffers. However, under some
1947 systems this apparently is causing nasty
1948 ml_get errors to appear; if you're getting
1949 ml_get errors, try putting
1950 let g:netrw_use_noswf= 0
1951 in your .vimrc.
1952
1953 *g:netrw_winsize* specify initial size of new windows made with
1954 "o" (see |netrw-o|), "v" (see |netrw-v|),
1955 |:Hexplore| or |:Vexplore|.
1956 default: ""
1957
1958 *g:netrw_xstrlen* Controls how netrw computes a string
1959 including multi-byte characters' string
1960 length. (thanks to N Weibull, T Mechelynck)
1961 =0: uses Vim's built-in strlen()
1962 =1: number of codepoints (Latin + a combining
1963 circumflex is two codepoints) (DEFAULT)
1964 =2: number of spacing codepoints (Latin a +
1965 combining circumflex is one spacing
1966 codepoint; a hard tab is one; wide and
1967 narrow CJK are one each; etc.)
1968 =3: virtual length (counting tabs as anything
1969 between 1 and |'tabstop'|, wide CJJK as 2
1970 rather than 1, Arabic alif as zero when
1971 immediately preceded by lam, one
1972 otherwise, etc)
1973
1974 *g:NetrwTopLvlMenu* This variable specifies the top level
1975 menu name; by default, it's "Netrw.". If
1976 you wish to change this, do so in your
1977 .vimrc.
1978
1979NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* {{{2
1980
1981Netrw has been designed to handle user options by saving them, setting the
1982options to something that's compatible with netrw's needs, and then restoring
1983them. However, the autochdir option: >
1984 :set acd
1985is problematical. Autochdir sets the current directory to that containing the
1986file you edit; this apparently also applies to directories. In other words,
1987autochdir sets the current directory to that containing the "file" (even if
1988that "file" is itself a directory).
1989
1990NETRW SETTINGS *netrw-settings* {{{2
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001991
1992With the NetrwSettings.vim plugin, >
1993 :NetrwSettings
1994will bring up a window with the many variables that netrw uses for its
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001995settings. You may change any of their values; when you save the file, the
1996settings therein will be used. One may also press "?" on any of the lines for
1997help on what each of the variables do.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001998
Bram Moolenaar446cb832008-06-24 21:56:24 +00001999(also see: |netrw-browser-var| |netrw-protocol| |netrw-var| |netrw-variables|)
Bram Moolenaar9964e462007-05-05 17:54:07 +00002000
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00002001
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00002002==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00002003OBTAINING A FILE *netrw-O* {{{2
2004
2005If there are no marked files:
2006
2007 When browsing a remote directory, one may obtain a file under the cursor
2008 (ie. get a copy on your local machine, but not edit it) by pressing the O
2009 key.
2010
2011If there are marked files:
2012
2013 The marked files will be obtained (ie. a copy will be transferred to your
2014 local machine, but not set up for editing).
2015
2016Only ftp and scp are supported for this operation (but since these two are
2017available for browsing, that shouldn't be a problem). The status bar will
2018then show, on its right hand side, a message like "Obtaining filename". The
2019statusline will be restored after the transfer is complete.
2020
2021Netrw can also "obtain" a file using the local browser. Netrw's display
2022of a directory is not necessarily the same as Vim's "current directory",
2023unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select
2024a file using the local browser (by putting the cursor on it) and pressing
2025"O" will then "obtain" the file; ie. copy it to Vim's current directory.
2026
2027Related topics:
2028 * To see what the current directory is, use |:pwd|
2029 * To make the currently browsed directory the current directory, see |netrw-c|
2030 * To automatically make the currently browsed directory the current
2031 directory, see |g:netrw_keepdir|.
2032
2033
2034PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2
2035
2036One may use a preview window by using the "p" key when the cursor is atop the
2037desired filename to be previewed. The display will then split to show both
2038the browser (where the cursor will remain) and the file (see |:pedit|).
2039By default, the split will be taken horizontally; one may use vertical
2040splitting if one has set |g:netrw_preview| first.
2041
2042
2043PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2
2044
2045To edit a file or directory in the previously used (last accessed) window (see
2046:he |CTRL-W_p|), press a "P". If there's only one window, then the one window
2047will be horizontally split (above/below splitting is controlled by
2048|g:netrw_alto|, and its initial size is controlled by |g:netrw_winsize|).
2049
2050If there's more than one window, the previous window will be re-used on
2051the selected file/directory. If the previous window's associated buffer
2052has been modified, and there's only one window with that buffer, then
2053the user will be asked if s/he wishes to save the buffer first (yes,
2054no, or cancel).
2055
2056
2057REFRESHING THE LISTING *netrw-ctrl-l* *netrw-ctrl_l* {{{2
2058
2059To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
2060hit the <cr> when atop the ./ directory entry in the listing. One may also
2061refresh a local directory by using ":e .".
2062
2063
2064RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2
2065
2066If there are no marked files: (see |netrw-mf|)
2067
2068 Renaming/moving files and directories involves moving the cursor to the
2069 file/directory to be moved (renamed) and pressing "R". You will then be
2070 queried for where you want the file/directory to be moved. You may select
2071 a range of lines with the "V" command (visual selection), and then
2072 pressing "R".
2073
2074If there are marked files: (see |netrw-mf|)
2075
2076 Marked files will be renamed (moved). You will be queried as above in
2077 order to specify where you want the file/directory to be moved.
2078
2079 WARNING:~
2080
2081 Note that moving files is a dangerous operation; copies are safer. That's
2082 because a "move" for remote files is actually a copy + delete -- and if
2083 the copy fails and the delete does not, you may lose the file.
2084
2085The g:netrw_rename_cmd variable is used to implement renaming. By default its
2086value is:
2087
2088 ssh HOSTNAME mv
2089
2090One may rename a block of files and directories by selecting them with
2091the V (|linewise-visual|).
2092
2093
2094REVERSING SORTING ORDER *netrw-r* *netrw-reverse* {{{2
2095
2096One may toggle between normal and reverse sorting order by pressing the
2097"r" key.
2098
2099Related topics: |netrw-s|
2100Associated setting variable: |g:netrw_sort_direction|
2101
2102
2103SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2
2104
2105One may select the sorting style by name, time, or (file) size. The "s" map
2106allows one to circulate amongst the three choices; the directory listing will
2107automatically be refreshed to reflect the selected style.
2108
2109Related topics: |netrw-r| |netrw-S|
2110Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
2111
2112
211310. Problems and Fixes *netrw-problems* {{{1
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002114
2115 (This section is likely to grow as I get feedback)
2116 (also see |netrw-debug|)
Bram Moolenaar488c6512005-08-11 20:09:58 +00002117 *netrw-p1*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002118 P1. I use windows 95, and my ftp dumps four blank lines at the
2119 end of every read.
2120
2121 See |netrw-fixup|, and put the following into your
2122 <.vimrc> file:
2123
2124 let g:netrw_win95ftp= 1
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00002125
Bram Moolenaar488c6512005-08-11 20:09:58 +00002126 *netrw-p2*
Bram Moolenaar9964e462007-05-05 17:54:07 +00002127 P2. I use Windows, and my network browsing with ftp doesn't sort by
2128 time or size! -or- The remote system is a Windows server; why
2129 don't I get sorts by time or size?
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002130
2131 Windows' ftp has a minimal support for ls (ie. it doesn't
2132 accept sorting options). It doesn't support the -F which
2133 gives an explanatory character (ABC/ for "ABC is a directory").
Bram Moolenaar9964e462007-05-05 17:54:07 +00002134 Netrw then uses "dir" to get both its short and long listings.
2135 If you think your ftp does support a full-up ls, put the
2136 following into your <.vimrc>: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002137
Bram Moolenaar9964e462007-05-05 17:54:07 +00002138 let g:netrw_ftp_list_cmd = "ls -lF"
2139 let g:netrw_ftp_timelist_cmd= "ls -tlF"
2140 let g:netrw_ftp_sizelist_cmd= "ls -slF"
2141<
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002142 Alternatively, if you have cygwin on your Windows box, put
Bram Moolenaar9964e462007-05-05 17:54:07 +00002143 into your <.vimrc>: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002144
2145 let g:netrw_cygwin= 1
Bram Moolenaar9964e462007-05-05 17:54:07 +00002146<
2147 This problem also occurs when the remote system is Windows.
2148 In this situation, the various g:netrw_ftp_[time|size]list_cmds
2149 are as shown above, but the remote system will not correctly
2150 modify its listing behavior.
2151
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002152
Bram Moolenaar488c6512005-08-11 20:09:58 +00002153 *netrw-p3*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002154 P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw
2155 used ssh! That wasn't what I asked for...
2156
2157 Netrw has two methods for browsing remote directories: ssh
2158 and ftp. Unless you specify ftp specifically, ssh is used.
2159 When it comes time to do download a file (not just a directory
2160 listing), netrw will use the given protocol to do so.
2161
Bram Moolenaar488c6512005-08-11 20:09:58 +00002162 *netrw-p4*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002163 P4. I would like long listings to be the default.
2164
Bram Moolenaar446cb832008-06-24 21:56:24 +00002165 Put the following statement into your |.vimrc|: >
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002166
Bram Moolenaar446cb832008-06-24 21:56:24 +00002167 let g:netrw_liststyle= 1
2168<
2169 Check out |netrw-browser-var| for more customizations that
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002170 you can set.
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002171
Bram Moolenaar488c6512005-08-11 20:09:58 +00002172 *netrw-p5*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002173 P5. My times come up oddly in local browsing
2174
2175 Does your system's strftime() accept the "%c" to yield dates
2176 such as "Sun Apr 27 11:49:23 1997"? If not, do a "man strftime"
2177 and find out what option should be used. Then put it into
Bram Moolenaar446cb832008-06-24 21:56:24 +00002178 your |.vimrc|: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002179
Bram Moolenaar446cb832008-06-24 21:56:24 +00002180 let g:netrw_timefmt= "%X" (where X is the option)
2181<
Bram Moolenaar488c6512005-08-11 20:09:58 +00002182 *netrw-p6*
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002183 P6. I want my current directory to track my browsing.
2184 How do I do that?
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002185
Bram Moolenaar446cb832008-06-24 21:56:24 +00002186 Put the following line in your |.vimrc|:
2187>
Bram Moolenaar433f7c82006-03-21 21:29:36 +00002188 let g:netrw_keepdir= 0
Bram Moolenaar446cb832008-06-24 21:56:24 +00002189<
Bram Moolenaar9964e462007-05-05 17:54:07 +00002190 *netrw-p7*
2191 P7. I use Chinese (or other non-ascii) characters in my filenames, and
2192 netrw (Explore, Sexplore, Hexplore, etc) doesn't display them!
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00002193
Bram Moolenaar9964e462007-05-05 17:54:07 +00002194 (taken from an answer provided by Wu Yongwei on the vim
2195 mailing list)
2196 I now see the problem. You code page is not 936, right? Vim
2197 seems only able to open files with names that are valid in the
2198 current code page, as are many other applications that do not
2199 use the Unicode version of Windows APIs. This is an OS-related
2200 issue. You should not have such problems when the system
2201 locale uses UTF-8, such as modern Linux distros.
2202
2203 (...it is one more reason to recommend that people use utf-8!)
2204
2205 *netrw-p8*
2206 P8. I'm getting "ssh is not executable on your system" -- what do I
2207 do?
2208
2209 (Dudley Fox) Most people I know use putty for windows ssh. It
2210 is a free ssh/telnet application. You can read more about it
2211 here:
2212
2213 http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also:
2214
2215 (Marlin Unruh) This program also works for me. It's a single
2216 executable, so he/she can copy it into the Windows\System32
2217 folder and create a shortcut to it.
2218
2219 (Dudley Fox) You might also wish to consider plink, as it
2220 sounds most similar to what you are looking for. plink is an
2221 application in the putty suite.
2222
2223 http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink
2224
2225 (Vissale Neang) Maybe you can try OpenSSH for windows, which
2226 can be obtained from:
2227
2228 http://sshwindows.sourceforge.net/
2229
2230 It doesn't need the full Cygwin package.
2231
2232 (Antoine Mechelynck) For individual Unix-like programs needed
2233 for work in a native-Windows environment, I recommend getting
2234 them from the GnuWin32 project on sourceforge if it has them:
2235
2236 http://gnuwin32.sourceforge.net/
2237
2238 Unlike Cygwin, which sets up a Unix-like virtual machine on
2239 top of Windows, GnuWin32 is a rewrite of Unix utilities with
2240 Windows system calls, and its programs works quite well in the
2241 cmd.exe "Dos box".
2242
2243 (dave) Download WinSCP and use that to connect to the server.
2244 In Preferences > Editors, set gvim as your editor:
2245
2246 - Click "Add..."
2247 - Set External Editor (adjust path as needed, include
2248 the quotes and !.! at the end):
2249 "c:\Program Files\Vim\vim70\gvim.exe" !.!
2250 - Check that the filetype in the box below is
2251 {asterisk}.{asterisk} (all files), or whatever types
2252 you want (cec: change {asterisk} to * ; I had to
2253 write it that way because otherwise the helptags
Bram Moolenaar446cb832008-06-24 21:56:24 +00002254 system thinks it's a tag)
2255 - Make sure it's at the top of the listbox (click it,
2256 then click "Up" if it's not)
Bram Moolenaar9964e462007-05-05 17:54:07 +00002257 If using the Norton Commander style, you just have to hit <F4>
2258 to edit a file in a local copy of gvim.
2259
2260 (Vit Gottwald) How to generate public/private key and save
2261 public key it on server: >
2262 http://www.tartarus.org/~simon/puttydoc/Chapter8.html#pubkey-gettingready
2263 8.3 Getting ready for public key authentication
2264<
Bram Moolenaar446cb832008-06-24 21:56:24 +00002265 How to use a private key with 'pscp': >
2266
Bram Moolenaar9964e462007-05-05 17:54:07 +00002267 http://www.tartarus.org/~simon/puttydoc/Chapter5.html
2268 5.2.4 Using public key authentication with PSCP
2269<
Bram Moolenaar446cb832008-06-24 21:56:24 +00002270 (Ben Schmidt) I find the ssh included with cwRsync is
2271 brilliant, and install cwRsync or cwRsyncServer on most
2272 Windows systems I come across these days. I guess COPSSH,
2273 packed by the same person, is probably even better for use as
2274 just ssh on Windows, and probably includes sftp, etc. which I
2275 suspect the cwRsync doesn't, though it might
2276
Bram Moolenaar9964e462007-05-05 17:54:07 +00002277 (cec) To make proper use of these suggestions above, you will
2278 need to modify the following user-settable variables in your
2279 .vimrc:
2280
Bram Moolenaar446cb832008-06-24 21:56:24 +00002281 |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd|
2282 |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd|
Bram Moolenaar9964e462007-05-05 17:54:07 +00002283
2284 The first one (|g:netrw_ssh_cmd|) is the most important; most
2285 of the others will use the string in g:netrw_ssh_cmd by
2286 default.
2287 *netrw-p9* *netrw-ml_get*
2288 P9. I'm browsing, changing directory, and bang! ml_get errors
2289 appear and I have to kill vim. Any way around this?
2290
2291 Normally netrw attempts to avoid writing swapfiles for
2292 its temporary directory buffers. However, on some systems
2293 this attempt appears to be causing ml_get errors to
2294 appear. Please try setting |g:netrw_use_noswf| to 0
2295 in your <.vimrc>: >
2296 let g:netrw_use_noswf= 0
2297<
Bram Moolenaar446cb832008-06-24 21:56:24 +00002298 *netrw-p10*
2299 P10. I'm being pestered with "[something] is a directory" and
2300 "Press ENTER or type command to continue" prompts...
2301
2302 The "[something] is a directory" prompt is issued by Vim,
2303 not by netrw, and there appears to be no way to work around
2304 it. Coupled with the default cmdheight of 1, this message
2305 causes the "Press ENTER..." prompt. So: read |hit-enter|;
2306 I also suggest that you set your |'cmdheight'| to 2 (or more) in
2307 your <.vimrc> file.
2308
2309 *netrw-p11*
2310 P11. I want to have two windows; a thin one on the left and my editing
2311 window on the right. How can I do this?
2312
2313 * Put the following line in your <.vimrc>:
2314 let g:netrw_altv = 1
2315 * Edit the current directory: :e .
2316 * Select some file, press v
2317 * Resize the windows as you wish (see |CTRL-W_<| and
2318 |CTRL-W_>|). If you're using gvim, you can drag
2319 the separating bar with your mouse.
2320 * When you want a new file, use ctrl-w h to go back to the
2321 netrw browser, select a file, then press P (see |CTRL-W_h|
2322 and |netrw-P|). If you're using gvim, you can press
2323 <leftmouse> in the browser window and then press the
2324 <middlemouse> to select the file.
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002325
2326==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +0000232711. Debugging Netrw Itself *netrw-debug* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00002328
2329The <netrw.vim> script is typically available as:
Bram Moolenaar488c6512005-08-11 20:09:58 +00002330>
Bram Moolenaar446cb832008-06-24 21:56:24 +00002331 /usr/local/share/vim/vim6x/plugin/netrwPlugin.vim
2332 /usr/local/share/vim/vim6x/autoload/netrw.vim
Bram Moolenaar488c6512005-08-11 20:09:58 +00002333< -or- >
Bram Moolenaar446cb832008-06-24 21:56:24 +00002334 /usr/local/share/vim/vim7x/plugin/netrwPlugin.vim
2335 /usr/local/share/vim/vim7x/autoload/netrw.vim
Bram Moolenaar488c6512005-08-11 20:09:58 +00002336<
Bram Moolenaar071d4272004-06-13 20:20:40 +00002337which is loaded automatically at startup (assuming :set nocp).
2338
2339 1. Get the <Decho.vim> script, available as:
2340
Bram Moolenaar446cb832008-06-24 21:56:24 +00002341 http://mysite.verizon.net/astronaut/vim/index.html#DECHO
Bram Moolenaar071d4272004-06-13 20:20:40 +00002342 or
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00002343 http://vim.sourceforge.net/scripts/script.php?script_id=120
Bram Moolenaar071d4272004-06-13 20:20:40 +00002344
Bram Moolenaar446cb832008-06-24 21:56:24 +00002345 It now comes as a "vimball"; if you're using vim 7.0 or earlier,
2346 you'll need to update vimball, too. See
2347 http://mysite.verizon.net/astronaut/vim/index.html#VIMBALL
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00002348
Bram Moolenaar446cb832008-06-24 21:56:24 +00002349 2. Edit the <netrw.vim> file by typing: >
Bram Moolenaard4755bb2004-09-02 19:12:26 +00002350
2351 vim netrw.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +00002352 :DechoOn
Bram Moolenaard4755bb2004-09-02 19:12:26 +00002353 :wq
Bram Moolenaar446cb832008-06-24 21:56:24 +00002354<
2355 To restore to normal non-debugging behavior, re-edit <netrw.vim>
2356 and type >
Bram Moolenaar071d4272004-06-13 20:20:40 +00002357
Bram Moolenaard4755bb2004-09-02 19:12:26 +00002358 vim netrw.vim
2359 :DechoOff
2360 :wq
Bram Moolenaar446cb832008-06-24 21:56:24 +00002361<
Bram Moolenaard4755bb2004-09-02 19:12:26 +00002362 This command, provided by <Decho.vim>, will comment out all
2363 Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()).
2364
Bram Moolenaar446cb832008-06-24 21:56:24 +00002365 3. Then bring up vim and attempt to evoke the problem by doing a
2366 transfer or doing some browsing. A set of messages should appear
2367 concerning the steps that <netrw.vim> took in attempting to
2368 read/write your file over the network in a separate tab.
Bram Moolenaar071d4272004-06-13 20:20:40 +00002369
Bram Moolenaar9964e462007-05-05 17:54:07 +00002370 To save the file, use >
2371 :wincmd j
2372 :set bt=
2373 :w! DBG
2374< Please send that information to <netrw.vim>'s maintainer, >
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00002375 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
Bram Moolenaar9964e462007-05-05 17:54:07 +00002376<
Bram Moolenaar071d4272004-06-13 20:20:40 +00002377==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000237812. History *netrw-history* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00002379
Bram Moolenaar446cb832008-06-24 21:56:24 +00002380 v125: Apr 07, 2008 * (Cristian Rigamonti) CR provides a patch; he
2381 noted that gx was failing since its call to
2382 netrw#NetBrowseX() wasn't updated to
2383 netrw#NetrwBrowseX().
2384 * (Stanis Trendelenburg) ST provides a patch to
2385 supports davs: (dav + ssl)
2386 * (Rick Choi) noted that directory names comprised
2387 of three digits were not being displayed by
2388 the internal browser. Fixed.
2389 * (Erik Falor) provided a patch to handle problems
2390 with changing directory and |'acd'| option.
2391 * (James Vega, Teemu Likonen) noted that netrw
2392 wasn't handling multi-byte filenames/directories
2393 correctly. Fixed.
2394 * (Rick) found problem with g:netrw_maxfilenamelen
2395 being overridden.
2396 * (James Vega) pointed out that netrw was
2397 misidentifying all files in a symbolically linked
2398 directory as being symbolically linked
2399 themselves. This particular problem was fixed;
2400 however, there are now situations where
2401 symbolically linked files will not be detected.
2402 Really need an internal vim function to do this
2403 identification.
2404 Apr 17, 2008 * When g:netrw_keepdir==0, current directory
2405 doesn't necessarily equal b:netrw_curdir
2406 initially. Problem is due to the patch directly
2407 above.
2408 * Fixed qf to handle case where b:netrw_curdir
2409 isn't the same as the current directory under
2410 linux/macosx.
2411 * New: |netrw-mg| (apply vimgrep to marked files)
2412 May 05, 2008 * (Rick) pointed out that a "setlocal ts=32" was
2413 interfering with g:netrw_maxfilenamelen
2414 May 05, 2008 * (James Vega) a file inside a linked directory
2415 was showing up as a symbolic link itself.
2416 May 22, 2008 * symbolic links, fifos, and sockets are now
2417 indicated by a trailing @, |, or =, respectively.
2418 Jun 06, 2008 * Removed numerous bugs from the marked file
2419 move and copy. Tested these changes under
2420 Unix only thus far.
2421 * :Rexplore returns to the screen position in the
2422 netrw listing from whence the file was edited
2423 v124: Apr 02, 2008 * (Adrian Rollett) change the line supporting the
2424 "x" action for mac to use g:netrw_shq
2425 v123: Feb 27, 2008 * Marked files now keeps a "global" marked file
2426 list. The global marked file list is used to
2427 support tag processing and vimdiff'ing
2428 (|netrw-md| |netrw-mt|)
2429 * Been insuring that mm and mc works with various
2430 combinations of local and remote directories
2431 * (Stefan Bittner) http://.../ should always have
2432 filetype "html" -- fixed.
2433 * (Stefan Bittner) a "?" in a http://.../ request
2434 wasn't being handled correctly. Fixed by
2435 removing ? from default |g:netrw_tmpfile_escape|.
2436 * (Nico Weber) % codes in http://.../ requests
2437 weren't being handled correctly. Fixed by
2438 including % in default |g:netrw_fname_escape|.
2439 * (Stefan Bittner) attempts to update Buffers.Refresh
2440 were failing because locale use changed the menu
2441 names. I implemented a workaround.
2442 v122: Feb 12, 2008 * bugfix - first sorting sequence match now has
2443 priority
2444 Feb 14, 2008 * bugfix - sorting sequence was effectively ignoring
2445 sequencing priority of anything following '*'
2446 * toggling a marked file was showing incorrect list
2447 (list was correct, but displayed matches weren't)
2448 * |g:netrw_special_syntax| implemented
2449 v121: Feb 11, 2008 * Bram M reported that :e file ... :e . would not
2450 retain the alternate file. Fixed -- I hope!
2451 * bugfix -- apparently v120 broke an explicit
2452 :Explore dirname
2453 v120: Jan 21, 2008 * |netrw-mt| changed to allow for target selection
2454 based on whether or not word under cursor is a
2455 directory or file, or if cursor is in banner
2456 area.
2457 * |netrw-mh| included (hiding by marked-file suffix)
2458 * functions moved about a bit (improved
2459 categorization)
2460 * executable files now displayed with trailing (*)
2461 * symbolically linked files now displayed with
2462 trailing (@)
2463 * Somewhen, s:NetrwMarkFileMove() got damaged. Its
2464 now restored (missing an endif, for example).
2465 * |netrw-mu| implemented (unmarking marked files)
2466 * many bugs have been removed from the marked file
2467 system (tnx to Mark S. for feedback)
2468 * |netrw-ms| implemented (sourcing marked files)
2469 * fixed use of P with tree listing style
2470 * multiple tree listing now supported
2471 * ./ suppressed
2472 * changed q -> qb (query bookmarks)
2473 * implemented |netrw-qf|
2474 * Explore now has four special list-generation
2475 modes: */filepat **/filepat
2476 *//pattern **//pattern
2477 * gh (|netrw-gh|) is a shortcut for toggling the
2478 hiding of files and directories beginning with a
2479 dot
2480 v119: Jan 10, 2008 * When g:netrw_keepdir is false,
2481 NetrwOptionsRestore() had a problem
2482 (Bill McCarthy)
2483 Jan 11, 2008 * Netrw now shows symbolic links with a trailing
2484 "@" and special highlighting.
2485 Jan 15, 2008 * Changed g:netrw_noretmap -> |g:netrw_retmap|.
2486 Changed: disabled by default at Bram's
2487 preference.
2488 v118: Jan 02, 2008 * Fixed a problem with Windows;
2489 :Explore c:/path/ would not work,
2490 but :Explore c:/path would.
2491 * Fixed a bug in s:NetrwOptionRestore() - lcd's
2492 argument wasn't being properly escaped so it
2493 wouldn't handle spaces in directory names.
2494 (Gary Johnson)
2495 v117: Jan 02, 2008 * Fixed a problem with P; had to include
2496 a b:netrw_curdir bypass (Bram Moolenaar)
2497 v116: Nov 27, 2007 * netrw#LocalBrowseCheck() has &ft=="netrw"
2498 check to prevent doing a directory listing
2499 (was getting unexpected directory refreshes
2500 in the middle of some function calls)
2501 * NetrwOptionRestore moved after e! filename
2502 in order to retain user options for editing
2503 in s:NetrwBrowseChgDir()
2504 Dec 12, 2007 * Bug fix -- netrw does a better job of retaining
2505 user options when editing files under the aegis
2506 of the browser
2507 v115: Oct 04, 2007 * Erik Remmelzwaal pointed out that the use of
2508 shellslash in s:GetTempfile() was incorrect
2509 Oct 11, 2007 * Tracked down and eliminated a bug with editing
2510 remote *.tar.gz and *.tar.bz2 files
2511 Oct 11, 2007 * g:netrw_localmovecmd wasn't being initialized
2512 properly, and g:netrw_localcopycmd was being
2513 overwritten.
2514 Oct 12, 2007 * Placed all :Rexplore and <2-leftmouse> setup
2515 in a new support function (s:SetRexDir()).
2516 Oct 15, 2007 * new: g:netrw_browse_split == 4; means <cr>
2517 based selection will use previous window
2518 Oct 20, 2007 * also checks on |'shellxquote'| to set g:netrw_shq
2519 Oct 24, 2007 * Explore handles path/**/filename
2520 Oct 27, 2007 * sourcing remote files often didn't work with ftp,
2521 turns out that b:netrw_method was undefined, so
2522 s:SaveBufVars and s:RestoreBufVars() fixed it.
2523 v114: Sep 28, 2007 * mT, the map that invokes tags, has been improved
2524 to support use of remote tags files.
2525 Oct 02, 2007 * changed Netrw menu to use more submenus
2526 v113: Sep 07, 2007 * worked out why the cursor position wasn't being
2527 saved and restored as intended after doing such
2528 things as deleting and renaming files.
2529 Sep 11, 2007 * Fixed bug which effectively disabled <c-l> and
2530 <c-h> maps
2531 Sep 18, 2007 * there used to be one NetrwOptionRestore() call at
2532 the end of the s:NetrwBrowseChgDir() function;
2533 they're now at the end of every if..elseif..else
2534 block. The edit-a-file one is not quite at the end
2535 of its block; instead, its just before the edit.
2536 Restores user options, then this new placement
2537 allows ftplugins, autocmds, etc to change settings
2538 (ex. ftplugin/cpp.vim sets cindent).
2539 Sep 19, 2007 * changed all strlen() calls to use s:Strlen(), a
2540 function which handles utf-8 wide characters
2541 correctly.
2542 Sep 20, 2007 * (Nico Weber) the "x" command has been extended
2543 to Mac's OS/X (macunix); it now uses open to
2544 handle |netrw-x| browsing with special files.
2545 Sep 22, 2007 * Added g:netrw_noretmap to netrw at Tony M's
2546 request.
2547 * Included path to NetrwRemoteRmFile()
2548 v112: Aug 18, 2007 * added mx (|netrw-mx|) for executing arbitrary
2549 commands on marked files
2550 Aug 22, 2007 * more option save/restore work for
2551 s:NetrwBrowseChgDir(); s:NetrwOptionSave()
2552 and s:NetrwOptionRestore() now take a parameter
2553 specifying the type of variables to be used for
2554 saving and restoring (either "w:" or "s:")
2555 Sep 04, 2007 * added the :NetrwClean[!] command
2556 v111: Jul 25, 2007 * using Windows but not using Cygwin, netrw does a
2557 "file bufname" where the bufname uses /s
2558 instead of \s; Vim "fixes" it by changing the
2559 bufname to use \s anyway. This meant that
2560 NetrwGetBuffer() didn't find the appropriately
2561 named buffer, and so would generate a new
2562 buffer listing; hence the cursor would appear
2563 to have been moved when doing a preview.
2564 * added <2-leftmouse> map to return to netrw's
2565 browser display
2566 Aug 16, 2007 * added the mark-file system, including
2567 maps for mf mp mt mz and mu. Modifications
2568 made to maps for a D O and R to support
2569 marked files.
2570 v110: May 10, 2007 * added [ and ] maps to NetrwTreeListing
2571 May 25, 2007 * |g:netrw_preview| included
2572 May 29, 2007 * modifed netrw#NetBrowseX to consistently use
2573 |g:netrw_shq| instead of hardcoded quotes,
2574 and modified the snippet that sets up redir
2575 so Windows machines use "nul" instead of
2576 "/dev/null".
2577 Jun 01, 2007 * fixed bug -- NetGetBuffer() wasn't always
2578 recognizing a buffer name match when it should,
2579 thus resulting in [Scratch] buffers.
2580 Jun 04, 2007 * Gary Johnson found a bugfix for the "c" mapping
2581 when the directory is to be made current but
2582 the name contains spaces.
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00002583 v109: Mar 26, 2007 * if a directory name includes a "$" character,
2584 Explore() will use expand() in an attempt to
2585 decipher the name.
2586 May 07, 2007 * g:netrw_use_errorwindow now allows one to
Bram Moolenaar446cb832008-06-24 21:56:24 +00002587 have error messages go to a reliable window
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00002588 or to use a less reliable but recallable
2589 echoerr method
2590 May 07, 2007 * g:netrw_scpport and g:netrw_sshport support
Bram Moolenaar446cb832008-06-24 21:56:24 +00002591 use of -P and -p, respectively, to set port
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00002592 for scp/ssh.
Bram Moolenaar9964e462007-05-05 17:54:07 +00002593 v108: Jan 03, 2007 * included preview map (|netrw-p|), supporting
2594 remote browsing
2595 * netrw can now source remote files
2596 Jan 26, 2007 * Colton Jamieson noted that remote directory
2597 browsing did not support alternate port
2598 selection. This feature has now been extended
2599 to apply to all remote browsing commands via ssh.
2600 (list, remove/delete, rename)
2601 Jan 31, 2007 * Luis Florit reported that @* was an invalid
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00002602 register. The @* register is now only saved and
2603 restored if |'guioptions'| contains "a".
Bram Moolenaar9964e462007-05-05 17:54:07 +00002604 Feb 02, 2007 * Fixed a bug that cropped up when writing files
2605 via scp using cygwin
2606 Feb 08, 2007 * tree listing mode managed to stop working again;
2607 fixed again!
2608 Feb 15, 2007 * Guido Van Hoecke reported that netrw didn't
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00002609 handle browsing well with M$ ftp servers. He even
Bram Moolenaar9964e462007-05-05 17:54:07 +00002610 set up a temporary account for me to test with
2611 (thanks!). Netrw now can browse M$ ftp servers.
2612 v107: Oct 12, 2006 * bypassed the autowrite option
2613 Oct 24, 2006 * handles automatic decompression of *.gz and *.bz2
2614 files
2615 Nov 03, 2006 * Explore will highlight matching files when
2616 **/pattern is used (and if the |'hls'| option
2617 is set)
2618 Nov 09, 2006 * a debugging line, when enabled, was inadvertently
2619 bringing up help instead of simply reporting on
2620 list contents
2621 Nov 21, 2006 * tree listing improved (cursor remains put)
2622 Nov 27, 2006 * fixed b:netrw_curdir bug when repeated "i"s were
2623 pressed.
2624 Dec 15, 2006 * considerable qty of changes, mostly to share more
2625 code between local and remote browsing. Includes
2626 support for tree-style listing for both remote
2627 and local browsing.
2628 Dec 15, 2006 * Included Peter Bengtsson's modifications to
2629 support the Amiga.
2630 v106: Sep 21, 2006 * removed old v:version<700 code as netrw now
2631 requires vim 7.0
2632 * worked around a bug where register * was
2633 overwritten during local browsing
2634 v104: Sep 05, 2006 * as suggested by Rodolfo Borges, :Explore and
2635 variants will position the cursor on the file
2636 just having been edited
2637 * changed default |g:netrw_sort_sequence| order
2638 * changed b, Nb to simply mb (see |netrw-mb|)
2639 * changed B, NB to simply gb (see |netrw-gb|)
2640 * tree listing style (see |g:netrw_liststyle|)
2641 * attempts to retain the alternate file
2642 v103: Jul 26, 2006 * used Yakov Lerner's tip#1289 to improve netrw
2643 error message display
2644 * wide listings didn't handle files with backslashes
2645 in their names properly. A symptom was an
2646 inability to open files.
2647 Aug 09, 2006 * included "t" mapping for opening tabbed windows,
2648 both for remote and local browsing
2649 * changed netrw_longlist to netrw_liststyle
2650 Aug 15, 2006 * fixed one of the NB maps
2651 Aug 22, 2006 * changed *Explore commands to use -nargs=* instead
2652 of -nargs=?. Allows both -complete=dir _and_ the
2653 starstar arguments to work (-nargs=? seems to
2654 require one or the other).
2655 Aug 23, 2006 * copied all w:.. variables across splits to
2656 new windows
2657 Aug 25, 2006 * when g:netrw_browsex_viewer was '-'
2658 (see |g:netrw_browsex_viewer|) it wasn't causing
2659 netrwFileHandlers#Invoke() to be called as it
2660 was expected to. (tnx Steve Dugaro)
2661 Aug 29, 2006 * changed NetBrowseX() to use "setlocal ... noswf"
2662 instead of "set ... noswf" (tnx Benji Fisher)
2663 Aug 31, 2006 * tabs and fastbrowse<=1 didn't work together.
2664 v102: Jun 15, 2006 * chgd netrwPlugin to call netrw#LocalBrowseCheck()
2665 * bugfix: g:netrw_keepdir==0 had stopped working
2666 Jul 06, 2006 * bugfix: NetOptionSave/Restore now saves/restores
2667 the unnamed register (|registers|)
2668 Jul 07, 2006 * |g:netrw_menu| support included
2669 Jul 13, 2006 * :Texplore command implemented
2670 Jul 17, 2006 * NetSplit and (Local|Net)BrowseChgDir() were both
2671 splitting windows. This affected o, v, and
2672 g:netrw_browse_split.
2673 Jul 20, 2006 * works around wildignore setting (was causing
2674 netrw's local browser not to list wildignore'd
2675 files)
2676 Jul 24, 2006 * <leftmouse> acts as a <cr> for selecting a file
2677 <rightmouse> acts as a <del> for deleting a file
2678 v100: May 14, 2006 * when using Windows and shell==cmd.exe, the
2679 default for g:netrw_ignorenetrc is now 1
2680 * bugfix: unwanted ^Ms now removed
2681 (affected shell==cmd.exe - Windows)
2682 * added Bookmarks and History to the menu
2683 * an error message about non-existing
2684 w:netrw_longlist was appearing during attempts to
2685 Explore (fixed)
2686 * g:netrw_shq now available to make netrw use
2687 specified style of quotes for commands
2688 May 29, 2006 * user NFH_*() functions were inadvertently being
2689 ignored
2690 * fixed a Windows non-cygwin ftp handling problem.
2691 * hiding pattern candidate separators included some
2692 characters it shouldn't have (tnx to Osei Poku)
2693 Jun 01, 2006 * for browsing, netrw was supposed to use "dir"
2694 instead of "ls -lF" when using
2695 ftp+non-cygwin+windows. Fixed.
2696 * an inadvertently left-in-place debugging statement
2697 was preventing use of the "x" key with browsing.
2698 Jun 05, 2006 * g:netrw_nogx available to prevent making the gx
2699 map (see |g:netrw_nogx|)
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00002700 * bugfix, Explore wouldn't change directory
Bram Moolenaar9964e462007-05-05 17:54:07 +00002701 properly (vim ., :Explore subdirname)
2702 Jun 06, 2006 * moved history to 2nd line in Netrw menu
2703 * fixed delete for unix-based systems
2704 Jun 07, 2006 * x key now works for windows-noncygwin-ftp
2705 Jun 08, 2006 * Explore */pat and **//pat now wraps
2706 v99: May 09, 2006 * g:netrw_browse_split=3 for opening files in new
2707 tabs implemented.
2708 May 12, 2006 * deletes temporary file at end of NetRead()
2709 * visual mode based Obtain implemented
2710 * added -complete=dir to the various Explore
2711 commands
2712 v98: May 02, 2006 * the "p" key didn't work properly when the browsing
2713 directory name had spaces in it.
2714 v97: May 01, 2006 * exists("&acd") now used to determine if
2715 the 'acd' option exists
2716 * "obtain" now works again under Windows
Bram Moolenaar446cb832008-06-24 21:56:24 +00002717 v96: * bugfix - the |'acd'| option is not always defined
2718 but is now bypassed only when it is
2719 v95: * bugfix - Hiding mode worked correctly (don't show
2720 any file matching any of the g:netrw_hide
2721 patterns), but showing mode was showing only those
2722 files that didn't match any of the g:netrw_hide
2723 patterns. Instead, it now shows all files that
2724 match any of the g:netrw_hide patterns (the
2725 difference between a logical and and logical or).
2726 v94: * bugfix - a Decho() had a missing quote; only
2727 affects things when debugging was enabled.
2728 v93: * bugfix - removed FocusGained event from causing a
2729 slow-browser refresh for Windows
2730 v92: * :Explore **//pattern implemented
2731 (**/filepattern was already taken)
2732 v91: * :Explore */pattern implemented
2733 * |'acd'| option bypassed
2734 v90: * mark ', as suggested by Yegappan Lakshmanan, used
2735 to help guarantee entry into the jump list when
2736 appropriate.
2737 * <s-down> and <s-up> are no longer defined until a
2738 :Explore **/pattern is used (if the user already
2739 has a map for them). They will be defined for new
2740 browser windows from that point forward.
2741 v89: * A <s-down>, <s-up>, :Nexplore, or a :Pexplore
2742 without having first done an :Explore **/pattern
2743 (see |netrw-starstar|) caused
2744 a lot of unhelpful error messages to appear
2745 v88: * moved DrChip.Netrw menu to Netrw. Now has
2746 priority 80 by default.
2747 g:NetrwTopLvlMenu == "Netrw" and can be changed
2748 by the user to suit. The priority is given by
2749 g:NetrwMenuPriority.
2750 * Changed filetype for browser displays from
2751 netrwlist to netrw.
2752 v87: * bug fix -- menus were partially disappearing
2753 v85: * bug fix -- missing an endif
2754 * bug fix -- handles spaces in names and directories
2755 when using ftp-based browsing
2756 v83: * disabled stop-acd handling; the change in directory
2757 handling may allow acd to be used again.
2758 * D was refusing to delete remote files/directories
2759 in wide listing mode.
2760 v81: * FocusGained also used to refresh/wipe local browser
2761 directory buffers
2762 * (bugfix) netrw was leaving [Scratch] buffers behind
2763 when the user had the "hidden" option set. The
2764 'hidden' option is now bypassed.
2765 v80: * ShellCmdPost event used in conjunction with
2766 g:netrw_fastbrowse to refresh/wipe local browser
2767 directory buffers.
2768 v79: * directories are now displayed with nowrap
2769 * (bugfix) if the column width was smaller than the
2770 largest file's name, then netrw would hang when
2771 using wide-listing mode - fixed
2772 * g:netrw_fastbrowse introduced
2773 v78: * progress has been made on allowing spaces inside
2774 directory names for remote work (reading, writing,
2775 browsing). (scp)
2776 v77: * Mikolaj Machowski fixed a bug in a substitute cmd
2777 * g:netrw_browsex_viewer implemented
2778 * Mikolaj Machowski pointed out that gnome-open is
2779 often executable under KDE systems, although it is
2780 effectively not functional. NetBrowseX now looks
2781 for "kicker" as a running process to determine if
2782 KDE is actually running.
2783 * Explorer's O functionality was inadvertently left
2784 out. Netrw now does the same thing, but with the
2785 "P" key.
2786 * added g:netrw_browse_split option
2787 * fixed a bug where the directory contained a "." but
2788 the file didn't (was treating the dirname from "."
2789 onwards as a suffix)
2790 v76: * "directory is missing" error message now restores
2791 echo highlighting
2792 v75: * file://... now conforms to RFC2396 (thanks to
2793 S. Zacchiroli)
2794 * if the binary option is set, then NetWrite() will
2795 only write the whole file (line numbers don't make
2796 sense with this). Supports writing of tar and zip
2797 files.
2798 v74: * bugfix (vim, then :Explore) now works
2799 * ctrl-L keeps cursor at same screen location (both
2800 local and remote browsing)
2801 * netrw now can read remote zip and tar files
2802 * Obtain now uses WinXP ftp+.netrc successfully
2803 v73: * bugfix -- scp://host/path/file was getting named
2804 incorrectly
2805 * netrw detects use of earlier-than-7.0 version of
2806 vim and issues a pertinent error message.
2807 * netrwSettings.vim is now uses autoloading. Only
2808 <netrwPlugin.vim> is needed as a pure plugin
2809 (ie. always loaded).
2810 v72: * bugfix -- formerly, one could prevent the loading
2811 of netrw by "let g:loaded_netrw=1"; when
2812 autoloading became supported, this feature was
2813 lost. It is now restored.
2814 v71: * bugfix -- made some "set nomodifiable"s into
2815 setlocal variants (allows :e somenewfile to be
2816 modifiable as usual)
2817 * NetrwSettings calls a netrw function, thereby
2818 assuring that netrw has loaded. However, if netrw
2819 does not load for whatever reason, then
2820 NetrwSettings will now issue a warning message.
2821 * For what reason I don't recall, when wget and fetch
2822 are both not present, and an attempt to read a
2823 http://... url is made, netrw exited. It now only
2824 returns.
2825 * When ch=1, on the second and subsequent uses of
2826 browsing Netrw would issue a blank line to clear
2827 the echo'd messages. This caused an annoying
2828 "Hit-Enter" prompt; now a blank line message
2829 is echo'd only if &ch>1.
2830 v70: * when using |netrw-O|, the "Obtaining filename"
2831 message is now shown using |hl-User9|. If User9
2832 has not been defined, netrw itself will define it.
2833 v69: * Bugfix: win95/98 machines were experiencing a
2834 "E121: Undefined variable: g:netrw_win95ftp"
2835 message
2836 v68: * double-click-leftmouse selects word under mouse
2837 v67: * Passwords which contain blanks will now be
2838 surrounded by double-quotes automatically (Yongwei)
2839 v66: * Netrw now seems to work with a few more Windows
2840 situations
2841 * O now obtains a file: remote browsing
2842 file -> local copy, locally browsing
2843 file -> current directory (see :pwd)
2844 * i now cycles between thin, long, and wide listing
2845 styles
2846 * NB and Nb are maps that are always available;
2847 corresponding B and b maps are only available when
2848 not using wide listing in order to allow them to
2849 be used for motions
2850 v65: * Browser functions now use NetOptionSave/Restore; in
2851 particular, netrw now works around the report
2852 setting
2853 v64: * Bugfix - browsing a "/" directory (Unix) yielded
2854 buffers named "[Scratch]" instead of "/"
2855 * Bugfix - remote browsing with ftp was omitting
2856 the ./ and ../
2857 v63: * netrw now takes advantage of autoload (needs 7.0)
2858 * Bugfix - using r (to reverse sort) working again
2859 v62: * Bugfix - spaces allowed again in directory names
2860 with g:netrw_keepdir=0. In fact, I've tested netrw
2861 with most ANSI punctuation marks for directory
2862 names.
2863 * Bugfix - NetrwSettings gave errors when
2864 g:netrw_silent had not be set.
2865 v61: * Document upgrade -- netrw variable-based settings
2866 all should have tags. Supports NetrwSettings cmd.
2867 * Several important variables are window-oriented.
2868 Netrw has to transfer these across a window split.
2869 See s:BufWinVars() and s:UseBufWinVars().
2870 v60: * When using the i map to switch between long and
2871 short listings, netrw will now keep cursor on same
2872 line
2873 * "Match # of #" now uses status line
2874 * :Explore **/*.c will now work from a
2875 non-netrw-browser window
2876 * :Explore **/patterns can now be run in separate
2877 browser windows
2878 * active banner (hit <cr> will cause various things
2879 to happen)
2880 v59: * bugfix -- another keepalt work-around installed
2881 (for vim6.3)
2882 * "Match # of #" for Explore **/pattern matches
2883 v58: * Explore and relatives can now handle
2884 **/somefilepattern (v7)
2885 * Nexplore and Pexplore introduced (v7). shift-down
2886 and shift-up cursor keys will invoke Nexplore and
2887 Pexplore, respectively.
2888 * bug fixed with o and v
2889 * autochdir only worked around for vim when it has
2890 been compiled with either
2891 |+netbeans_intg| or |+sun_workshop|
2892 * Under Windows, all directories and files were
2893 being preceded with a "/" when local browsing.
2894 Fixed.
2895 * When: syntax highlighting is off, laststatus=2, and
2896 remote browsing is used, sometimes the laststatus
2897 highlighting bleeds into the entire display. Work
2898 around - do an extra redraw in that case.
2899 * Bugfix: when g:netrw_keepdir=0, due to re-use of
2900 buffers, netrw didn't change the directory when it
2901 should've
2902 * Bugfix: D and R commands work again
2903 v57: * Explore and relatives can now handle RO files
2904 * reverse sort restored with vim7's sort command
2905 * g:netrw_keepdir now being used to keep the current
2906 directory unchanged as intended (sense change)
2907 * vim 6.3 still supported
2908 v56: * LocalBrowse now saves autochdir setting, unsets it,
2909 and restores it before returning.
2910 * using vim's rename() instead of system +
2911 local_rename variable
2912 * avoids changing directory when g:netrw_keepdir is
2913 false
2914 v55: * -bar used with :Explore :Sexplore etc to allow
2915 multiple commands to be separated by |s
2916 * browser listings now use the "nowrap" option
2917 * browser: some unuseful error messages now
2918 suppressed
2919 v54: * For backwards compatibility, Explore and Sexplore
2920 have been implemented. In addition, Hexplore and
2921 Vexplore commands are available, too.
2922 * <amatch> used instead of <afile> in the
2923 transparency support (BufReadCmd, FileReadCmd,
2924 FileWriteCmd)
2925 * ***netrw*** prepended to various error messages
2926 netrw may emit
2927 * g:netrw_port used instead of b:netrw_port for scp
2928 * any leading [:#] is removed from port numbers
2929 v53: * backslashes as well as slashes placed in various
2930 patterns (ex. g:netrw_sort_sequence) to better
2931 support Windows
2932 v52: * nonumber'ing now set for browsing buffers
2933 * when the hiding list hid all files, error messages
2934 ensued. Fixed
2935 * when browsing, swf is set, but directory is not
2936 set, when netrw was attempting to restore options,
2937 vim wanted to save a swapfile to a local directory
2938 using an url-style path. Fixed
2939 v51: * cygwin detection now automated
2940 (using windows and &shell is bash)
2941 * customizable browser "file" rejection patterns
2942 * directory history
2943 * :[range]w url now supported (ie. netrw uses a
2944 FileWriteCmd event)
2945 * error messages have a "Press <cr> to continue" to
2946 allow them to be seen
2947 * directory browser displays no longer bother the
2948 swapfile
2949 * u/U commands to go up and down the history stack
2950 * history stack may be saved with viminfo with it's
2951 "!" option
2952 * bugfixes associated with unwanted [No Files]
2953 entries
2954 v50: * directories now displayed using buftype=nofile;
2955 should keep the directory names as-is
2956 * attempts to remove empty "[No File]" buffers
2957 leftover from :file ..name.. commands
2958 * bugfix: a "caps-lock" editing difficulty left in
2959 v49 was fixed
2960 * syntax highlighting for "Showing:" the hiding list
2961 included
2962 * bookmarks can now be retained if "!" is in the
2963 viminfo option
2964 v49: * will use ftp for http://.../ browsing
2965 v48: * One may use ftp to do remote host file browsing
2966 * (windows and !cygwin) remote browsing with ftp can
2967 now use the "dir" command internally to provide
2968 listings
2969 * g:netrw_keepdir now allows one to keep the initial
2970 current directory as the current directory
2971 (normally the local file browser makes the
2972 currently viewed directory the current directory)
2973 * g:netrw_alto and g:netrw_altv now support
2974 alternate placement of windows started with o or v
2975 * Nread ? and Nwrite ? now uses echomsg (instead of
2976 echo) so :messages can repeat showing the help
2977 * bugfix: avoids problems with partial matches of
2978 directory names to prior buffers with longer names
2979 * one can suppress error messages with g:netrw_quiet
2980 ctrl-h used
2981 * instead of <Leader>h for editing hiding list one
2982 may edit the sorting sequence with the S map, which
2983 now allows confirmation of deletion with
2984 [y(es) n(o) a(ll) q(uit)]
2985 * the "x" map now handles special file viewing with:
2986 (windows) rundll32 url.dll (gnome) gnome-open (kde)
2987 kfmclient If none of these are on the executable
2988 path, then netrwFileHandlers.vim is used.
2989 * directory bookmarking during both local and remote
2990 browsing implemented
2991 * one may view all, use the hiding list to suppress,
2992 or use the hiding list to show-only remote and
2993 local file/directory listings
2994 * improved unusual file and directory name handling
2995 preview window support
2996 v47: * now handles local browsing.
2997 v46: * now handles remote browsing
2998 * g:netrw_silent (if 1) will cause all transfers to
2999 be silent
3000 v45: * made the [user@]hostname:path form a bit more
3001 restrictive to better handle errors in using
3002 protocols (e.g. scp:usr@host:file was being
3003 recognized as an rcp request)
3004 v44: * changed from "rsync -a" to just "rsync"
3005 * somehow an editing error messed up the test to
3006 recognize use of the fetch method for NetRead.
3007 * more debugging statements included
3008 v43: * moved "Explanation" comments to <pi_netrw.txt> help
3009 file as "Network Reference" (|netrw-ref|)
3010 * <netrw.vim> now uses Dfunc() Decho() and Dret() for
3011 debugging
3012 * removed superfluous NetRestorePosn() calls
3013 v42: * now does BufReadPre and BufReadPost events on
3014 file:///* and file://localhost/*
3015 v41: * installed file:///* and file://localhost/* handling
3016 v40: * prevents redraw when a protocol error occurs so
3017 that the user may see it
3018 v39: * sftp support
3019 v38: * Now uses NetRestorePosn() calls with Nread/Nwrite
3020 commands
3021 * Temporary files now removed via bwipe! instead of
3022 bwipe (thanks to Dave Roberts)
3023 v37: * Claar's modifications which test if ftp is
3024 successful, otherwise give an error message
3025 * After a read, the alternate file was pointing to
3026 the temp file. The temp file buffer is now wiped
3027 out.
3028 * removed silent from transfer methods so user can
3029 see what's happening
Bram Moolenaar071d4272004-06-13 20:20:40 +00003030
3031
3032==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000303312. Credits *netrw-credits* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00003034
3035 Vim editor by Bram Moolenaar (Thanks, Bram!)
3036 dav support by C Campbell
3037 fetch support by Bram Moolenaar and C Campbell
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00003038 ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM>
Bram Moolenaar071d4272004-06-13 20:20:40 +00003039 http support by Bram Moolenaar <bram@moolenaar.net>
3040 rcp
3041 rsync support by C Campbell (suggested by Erik Warendorph)
3042 scp support by raf <raf@comdyn.com.au>
3043 sftp support by C Campbell
3044
3045 inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell
3046
3047 Jérôme Augé -- also using new buffer method with ftp+.netrc
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00003048 Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use,
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003049 fetch,...
Bram Moolenaar071d4272004-06-13 20:20:40 +00003050 Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution
3051 Erik Warendorph -- for several suggestions (g:netrw_..._cmd
3052 variables, rsync etc)
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00003053 Doug Claar -- modifications to test for success with ftp
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003054 operation
Bram Moolenaar071d4272004-06-13 20:20:40 +00003055
3056==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00003057Modelines: {{{1
Bram Moolenaar83bab712005-08-01 21:58:57 +00003058 vim:tw=78:ts=8:ft=help:norl:fdm=marker