blob: 9f0955b18aaccd684bb8aa6a27b00dc79ac7442a [file] [log] [blame]
Bram Moolenaar00a927d2010-05-14 23:24:24 +02001*pi_netrw.txt* For Vim version 7.2. Last change: 2010 May 14
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 Moolenaar8f3f58f2010-01-06 20:52:26 +01006Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM>
7 (remove NOSPAM from Campbell's email first)
8
Bram Moolenaar00a927d2010-05-14 23:24:24 +02009Copyright: Copyright (C) 1999-2010 Charles E Campbell, Jr *netrw-copyright*
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010010 Permission is hereby granted to use and distribute this code, with
11 or without modifications, provided that this copyright notice is
12 copied with it. Like anything else that's free, netrw.vim,
13 netrwPlugin.vim, netrwFileHandlers.vim, netrwSettings.vim,
14 syntax/netrw.vim, and pi_netrw.txt are provided *as is* and comes
15 with no warranty of any kind, either expressed or implied. No
16 guarantees of merchantability. No guarantees of suitability for
17 any purpose. By using this plugin, you agree that in no event will
18 the copyright holder be liable for any damages resulting from the
19 use of this software.
Bram Moolenaar071d4272004-06-13 20:20:40 +000020
Bram Moolenaar1afcace2005-11-25 19:54:28 +000021
Bram Moolenaar00a927d2010-05-14 23:24:24 +020022 *dav* *ftp* *netrw-file* *rcp* *scp*
23 *davs* *http* *netrw.vim* *rsync* *sftp*
24 *fetch* *netrw* *network*
Bram Moolenaar071d4272004-06-13 20:20:40 +000025
26==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +0000271. Contents *netrw-contents* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +000028
Bram Moolenaar9964e462007-05-05 17:54:07 +0000291. Contents.............................................|netrw-contents|
302. Starting With Netrw..................................|netrw-start|
313. Netrw Reference......................................|netrw-ref|
Bram Moolenaar446cb832008-06-24 21:56:24 +000032 EXTERNAL APPLICATIONS AND PROTOCOLS................|netrw-externapp|
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000033 READING............................................|netrw-read|
34 WRITING............................................|netrw-write|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010035 SOURCING...........................................|netrw-source|
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000036 DIRECTORY LISTING..................................|netrw-dirlist|
37 CHANGING THE USERID AND PASSWORD...................|netrw-chgup|
Bram Moolenaar446cb832008-06-24 21:56:24 +000038 VARIABLES AND SETTINGS.............................|netrw-variables|
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +000039 PATHS..............................................|netrw-path|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000404. Network-Oriented File Transfer.......................|netrw-xfer|
Bram Moolenaar83bab712005-08-01 21:58:57 +000041 NETRC..............................................|netrw-netrc|
42 PASSWORD...........................................|netrw-passwd|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000435. Activation...........................................|netrw-activate|
Bram Moolenaar446cb832008-06-24 21:56:24 +0000446. Transparent File Editing.............................|netrw-transparent|
Bram Moolenaar9964e462007-05-05 17:54:07 +0000457. Ex Commands..........................................|netrw-ex|
468. Variables and Options................................|netrw-var|
Bram Moolenaar446cb832008-06-24 21:56:24 +0000479. Browsing.............................................|netrw-browse|
48 Introduction To Browsing...........................|netrw-intro-browse|
49 Quick Reference: Maps..............................|netrw-browse-maps|
50 Quick Reference: Commands..........................|netrw-browse-cmds|
51 Bookmarking A Directory............................|netrw-mb|
Bram Moolenaar83bab712005-08-01 21:58:57 +000052 Browsing...........................................|netrw-cr|
Bram Moolenaar83bab712005-08-01 21:58:57 +000053 Browsing With A Horizontally Split Window..........|netrw-o|
Bram Moolenaar9964e462007-05-05 17:54:07 +000054 Browsing With A New Tab............................|netrw-t|
Bram Moolenaar446cb832008-06-24 21:56:24 +000055 Browsing With A Vertically Split Window............|netrw-v|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010056 Change Listing Style.(thin wide long tree).........|netrw-i|
Bram Moolenaar446cb832008-06-24 21:56:24 +000057 Changing To A Bookmarked Directory.................|netrw-gb|
Bram Moolenaar83bab712005-08-01 21:58:57 +000058 Changing To A Predecessor Directory................|netrw-u|
59 Changing To A Successor Directory..................|netrw-U|
Bram Moolenaar83bab712005-08-01 21:58:57 +000060 Customizing Browsing With A User Function..........|netrw-x|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010061 Deleting Bookmarks.................................|netrw-mB|
Bram Moolenaar446cb832008-06-24 21:56:24 +000062 Deleting Files Or Directories......................|netrw-D|
63 Directory Exploring Commands.......................|netrw-explore|
64 Exploring With Stars and Patterns..................|netrw-star|
65 Displaying Information About File..................|netrw-qf|
66 Edit File Or Directory Hiding List.................|netrw-ctrl-h|
67 Editing The Sorting Sequence.......................|netrw-S|
68 Going Up...........................................|netrw--|
69 Hiding Files Or Directories........................|netrw-a|
70 Improving Browsing.................................|netrw-ssh-hack|
71 Listing Bookmarks And History......................|netrw-qb|
72 Making A New Directory.............................|netrw-d|
Bram Moolenaar83bab712005-08-01 21:58:57 +000073 Making The Browsing Directory The Current Directory|netrw-c|
Bram Moolenaar446cb832008-06-24 21:56:24 +000074 Marking Files......................................|netrw-mf|
75 Marking Files By Regular Expression................|netrw-mr|
76 Marked Files: Arbitrary Command....................|netrw-mx|
77 Marked Files: Compression And Decompression........|netrw-mz|
78 Marked Files: Copying..............................|netrw-mc|
79 Marked Files: Diff.................................|netrw-md|
80 Marked Files: Editing..............................|netrw-me|
81 Marked Files: Grep.................................|netrw-mg|
82 Marked Files: Hiding and Unhiding by Suffix........|netrw-mh|
83 Marked Files: Moving...............................|netrw-mm|
84 Marked Files: Printing.............................|netrw-mp|
85 Marked Files: Sourcing.............................|netrw-ms|
86 Marked Files: Tagging..............................|netrw-mT|
87 Marked Files: Setting the Target Directory.........|netrw-mt|
88 Marked Files: Unmarking............................|netrw-mu|
89 Netrw Browser Variables............................|netrw-browser-var|
90 Netrw Browsing And Option Incompatibilities........|netrw-incompatible|
91 Netrw Settings.....................................|netrw-settings|
92 Obtaining A File...................................|netrw-O|
93 Preview Window.....................................|netrw-p|
94 Previous Window....................................|netrw-P|
95 Refreshing The Listing.............................|netrw-ctrl-l|
96 Renaming Files Or Directories......................|netrw-move|
97 Reversing Sorting Order............................|netrw-r|
98 Selecting Sorting Style............................|netrw-s|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010099 Setting Editing Window.............................|netrw-C|
Bram Moolenaar9964e462007-05-05 17:54:07 +000010010. Problems and Fixes...................................|netrw-problems|
Bram Moolenaar446cb832008-06-24 21:56:24 +000010111. Debugging Netrw Itself...............................|netrw-debug|
Bram Moolenaar9964e462007-05-05 17:54:07 +000010212. History..............................................|netrw-history|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010010313. Todo.................................................|netrw-todo|
10414. Credits..............................................|netrw-credits|
Bram Moolenaar071d4272004-06-13 20:20:40 +0000105
Bram Moolenaar071d4272004-06-13 20:20:40 +0000106{Vi does not have any of this}
107
108==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00001092. Starting With Netrw *netrw-start* {{{1
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000110
Bram Moolenaar446cb832008-06-24 21:56:24 +0000111Netrw makes reading files, writing files, browsing over a network, and
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100112local browsing easy! First, make sure that you have plugins enabled, so
Bram Moolenaar446cb832008-06-24 21:56:24 +0000113you'll need to have at least the following in your <.vimrc>:
114(or see |netrw-activate|) >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000115
Bram Moolenaar9964e462007-05-05 17:54:07 +0000116 set nocp " 'compatible' is not set
117 filetype plugin on " plugins are enabled
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000118<
119(see |'cp'| and |:filetype-plugin-on|)
120
121Netrw supports "transparent" editing of files on other machines using urls
122(see |netrw-transparent|). As an example of this, let's assume you have an
Bram Moolenaar446cb832008-06-24 21:56:24 +0000123account on some other machine; if you can use scp, try: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000124
125 vim scp://hostname/path/to/file
126<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000127Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|!
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000128
Bram Moolenaar446cb832008-06-24 21:56:24 +0000129So, what if you have ftp, not ssh/scp? That's easy, too; try >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000130
131 vim ftp://hostname/path/to/file
132<
133Want to make ftp simpler to use? See if your ftp supports a file called
134<.netrc> -- typically it goes in your home directory, has read/write
135permissions for only the user to read (ie. not group, world, other, etc),
136and has lines resembling >
137
138 machine HOSTNAME login USERID password "PASSWORD"
139 machine HOSTNAME login USERID password "PASSWORD"
140 ...
Bram Moolenaar9964e462007-05-05 17:54:07 +0000141 default login USERID password "PASSWORD"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000142<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000143Now about browsing -- when you just want to look around before editing a
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000144file. For browsing on your current host, just "edit" a directory: >
145
146 vim .
147 vim /home/userid/path
148<
149For browsing on a remote host, "edit" a directory (but make sure that
150the directory name is followed by a "/"): >
151
152 vim scp://hostname/
153 vim ftp://hostname/path/to/dir/
154<
155See |netrw-browse| for more!
156
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100157There are more protocols supported by netrw than just scp and ftp, too: see the
158next section, |netrw-externapp|, on how to use these external applications with
159netrw and vim.
160
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200161PREVENTING LOADING *netrw-noload*
Bram Moolenaar446cb832008-06-24 21:56:24 +0000162
163If you want to use plugins, but for some reason don't wish to use netrw, then
164you need to avoid loading both the plugin and the autoload portions of netrw.
165You may do so by placing the following two lines in your <.vimrc>: >
166
167 :let g:loaded_netrw = 1
168 :let g:loaded_netrwPlugin = 1
169<
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000170
171==============================================================================
Bram Moolenaar00a927d2010-05-14 23:24:24 +02001723. Netrw Reference *netrw-ref* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000173
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100174 Netrw supports several protocols in addition to scp and ftp as mentioned
Bram Moolenaar446cb832008-06-24 21:56:24 +0000175 in |netrw-start|. These include dav, fetch, http,... well, just look
176 at the list in |netrw-externapp|. Each protocol is associated with a
177 variable which holds the default command supporting that protocol.
178
179EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000180
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000181 Protocol Variable Default Value
182 -------- ---------------- -------------
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100183 dav: *g:netrw_dav_cmd* = "cadaver" if cadaver is executable
184 dav: g:netrw_dav_cmd = "curl -o" elseif curl is available
185 fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available
186 ftp: *g:netrw_ftp_cmd* = "ftp"
187 http: *g:netrw_http_cmd* = "elinks" if elinks is available
188 http: g:netrw_http_cmd = "links" elseif links is available
189 http: g:netrw_http_cmd = "curl" elseif curl is available
190 http: g:netrw_http_cmd = "wget" elseif wget is available
191 http: g:netrw_http_cmd = "fetch" elseif fetch is available
192 rcp: *g:netrw_rcp_cmd* = "rcp"
193 rsync: *g:netrw_rsync_cmd* = "rsync -a"
194 scp: *g:netrw_scp_cmd* = "scp -q"
195 sftp: *g:netrw_sftp_cmd* = "sftp"
196
197 *g:netrw_http_xcmd* : the option string for http://... protocols are
198 specified via this variable and may be independently overridden. By
199 default, the option arguments for the http-handling commands are: >
200
201 elinks : "-source >"
202 links : "-source >"
203 curl : "-o"
204 wget : "-q -O"
205 fetch : "-o"
206<
207 For example, if your system has elinks, and you'd rather see the
208 page using an attempt at rendering the text, you may wish to have >
209 let g:netrw_http_xcmd= "-dump >"
210< in your .vimrc.
211
Bram Moolenaar071d4272004-06-13 20:20:40 +0000212
Bram Moolenaar446cb832008-06-24 21:56:24 +0000213READING *netrw-read* *netrw-nread* {{{2
214
215 Generally, one may just use the url notation with a normal editing
216 command, such as >
217
218 :e ftp://[user@]machine/path
219<
220 Netrw also provides the Nread command:
221
Bram Moolenaar071d4272004-06-13 20:20:40 +0000222 :Nread ? give help
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000223 :Nread "machine:path" uses rcp
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000224 :Nread "machine path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000225 :Nread "machine id password path" uses ftp
226 :Nread "dav://machine[:port]/path" uses cadaver
227 :Nread "fetch://[user@]machine/path" uses fetch
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000228 :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000229 :Nread "http://[user@]machine/path" uses http uses wget
230 :Nread "rcp://[user@]machine/path" uses rcp
231 :Nread "rsync://[user@]machine[:port]/path" uses rsync
232 :Nread "scp://[user@]machine[[:#]port]/path" uses scp
233 :Nread "sftp://[user@]machine/path" uses sftp
Bram Moolenaar071d4272004-06-13 20:20:40 +0000234
Bram Moolenaar446cb832008-06-24 21:56:24 +0000235WRITING *netrw-write* *netrw-nwrite* {{{2
236
237 One may just use the url notation with a normal file writing
238 command, such as >
239
240 :w ftp://[user@]machine/path
241<
242 Netrw also provides the Nwrite command:
243
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000244 :Nwrite ? give help
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000245 :Nwrite "machine:path" uses rcp
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000246 :Nwrite "machine path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000247 :Nwrite "machine id password path" uses ftp
248 :Nwrite "dav://machine[:port]/path" uses cadaver
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000249 :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000250 :Nwrite "rcp://[user@]machine/path" uses rcp
251 :Nwrite "rsync://[user@]machine[:port]/path" uses rsync
252 :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp
253 :Nwrite "sftp://[user@]machine/path" uses sftp
Bram Moolenaar071d4272004-06-13 20:20:40 +0000254 http: not supported!
255
Bram Moolenaar446cb832008-06-24 21:56:24 +0000256SOURCING *netrw-source* {{{2
257
258 One may just use the url notation with the normal file sourcing
259 command, such as >
260
261 :so ftp://[user@]machine/path
262<
263 Netrw also provides the Nsource command:
264
Bram Moolenaar9964e462007-05-05 17:54:07 +0000265 :Nsource ? give help
266 :Nsource "dav://machine[:port]/path" uses cadaver
267 :Nsource "fetch://[user@]machine/path" uses fetch
268 :Nsource "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
269 :Nsource "http://[user@]machine/path" uses http uses wget
270 :Nsource "rcp://[user@]machine/path" uses rcp
271 :Nsource "rsync://[user@]machine[:port]/path" uses rsync
272 :Nsource "scp://[user@]machine[[:#]port]/path" uses scp
273 :Nsource "sftp://[user@]machine/path" uses sftp
274
Bram Moolenaar446cb832008-06-24 21:56:24 +0000275DIRECTORY LISTING *netrw-dirlist* {{{2
276
277 One may browse a directory to get a listing by simply attempting to
278 edit the directory: >
279
280 :e scp://[user]@hostname/path/
281 :e ftp://[user]@hostname/path/
282<
283 For remote directories (ie. those using scp or ftp), that trailing
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100284 "/" is necessary (the slash tells netrw to treat the argument as a
285 directory to browse instead of a file to download).
Bram Moolenaar446cb832008-06-24 21:56:24 +0000286
287 However, the Nread command can also be used to accomplish this:
288
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000289 :Nread [protocol]://[user]@hostname/path/
290
Bram Moolenaar446cb832008-06-24 21:56:24 +0000291 *netrw-login* *netrw-password*
292CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000293
Bram Moolenaar071d4272004-06-13 20:20:40 +0000294 Attempts to use ftp will prompt you for a user-id and a password.
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000295 These will be saved in global variables g:netrw_uid and
Bram Moolenaar446cb832008-06-24 21:56:24 +0000296 s:netrw_passwd; subsequent uses of ftp will re-use those two items to
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000297 simplify the further use of ftp. However, if you need to use a
298 different user id and/or password, you'll want to call NetUserPass()
299 first. To work around the need to enter passwords, check if your ftp
300 supports a <.netrc> file in your home directory. Also see
301 |netrw-passwd| (and if you're using ssh/scp hoping to figure out how
Bram Moolenaar446cb832008-06-24 21:56:24 +0000302 to not need to use passwords, look at |netrw-ssh-hack|).
Bram Moolenaar071d4272004-06-13 20:20:40 +0000303
304 :NetUserPass [uid [password]] -- prompts as needed
305 :call NetUserPass() -- prompts for uid and password
306 :call NetUserPass("uid") -- prompts for password
307 :call NetUserPass("uid","password") -- sets global uid and password
308
Bram Moolenaar446cb832008-06-24 21:56:24 +0000309NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2
310(also see: |netrw-browser-var| |netrw-protocol| |netrw-settings| |netrw-var|)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000311
Bram Moolenaar446cb832008-06-24 21:56:24 +0000312Netrw provides a lot of variables which allow you to customize netrw to your
313preferences. One way to look at them is via the command :NetrwSettings (see
314|netrw-settings|) which will display your current netrw settings. Most such
315settings are described below, in |netrw-browser-options|, and in
316|netrw-externapp|:
Bram Moolenaar9964e462007-05-05 17:54:07 +0000317
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100318 *b:netrw_lastfile* last file Network-read/written retained on a
319 per-buffer basis (supports plain :Nw )
320
321 *g:netrw_chgwin* specifies a window number where file edits will take
322 place. (also see |netrw-C|)
323 (default) not defined
324
325 *g:Netrw_funcref* specifies a function to be called when netrw edits
326 a file. The file is first edited, and then the
327 function reference (|Funcref|) is called.
328 (default) not defined
Bram Moolenaar071d4272004-06-13 20:20:40 +0000329
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000330 *g:netrw_ftp* if it doesn't exist, use default ftp
331 =0 use default ftp (uid password)
332 =1 use alternate ftp method (user uid password)
333 If you're having trouble with ftp, try changing the
334 value of this variable to see if the alternate ftp
335 method works for your setup.
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000336
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100337 *g:netrw_ftpextracmd* default: doesn't exist
Bram Moolenaar9964e462007-05-05 17:54:07 +0000338 If this variable exists, then any string it contains
339 will be placed into the commands set to your ftp
340 client. As an example:
341 ="passive"
342
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000343 *g:netrw_ftpmode* ="binary" (default)
344 ="ascii"
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000345
Bram Moolenaar9964e462007-05-05 17:54:07 +0000346 *g:netrw_ignorenetrc* =0 (default for linux, cygwin)
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000347 =1 If you have a <.netrc> file but it doesn't work and
Bram Moolenaar446cb832008-06-24 21:56:24 +0000348 you want it ignored, then set this variable as
349 shown. (default for Windows + cmd.exe)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000350
351 *g:netrw_menu* =0 disable netrw's menu
352 =1 (default) netrw's menu enabled
353
354 *g:netrw_nogx* if this variable exists, then the "gx" map will not
355 be available (see |netrw-gx|)
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000356
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100357 *g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis
358 *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis
Bram Moolenaar446cb832008-06-24 21:56:24 +0000359
360 *g:netrw_preview* =0 (default) preview window shown in a horizontally
361 split window
362 =1 preview window shown in a vertically split window.
363 Also affects the "previous window" (see |netrw-P|) in
364 the same way.
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000365
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000366 *g:netrw_scpport* = "-P" : option to use to set port for scp
367 *g:netrw_sshport* = "-p" : option to use to set port for ssh
368
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100369 *g:netrw_sepchr* =\0xff
370 =\0x01 for enc == euc-jp (and perhaps it should be for
371 others, too, please let me
372 know)
373 Separates priority codes from filenames internally.
374 See |netrw-p12|.
375
Bram Moolenaar446cb832008-06-24 21:56:24 +0000376 *g:netrw_silent* =0 : transfers done normally
377 =1 : transfers done silently
378
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000379 *g:netrw_use_errorwindow* =1 : messages from netrw will use a separate one
380 line window. This window provides reliable
381 delivery of messages. (default)
382 =0 : messages from netrw will use echoerr ;
383 messages don't always seem to show up this
384 way, but one doesn't have to quit the window.
385
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000386 *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank
387 lines that o/s's ftp "provides" on transfers
388 =0 force normal ftp behavior (no trailing line removal)
389
390 *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also
391 permits network browsing to use ls with time and
392 size sorting (default if windows)
393 =0 assume Windows' scp accepts windows-style paths
394 Network browsing uses dir instead of ls
395 This option is ignored if you're using unix
396
397 *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP
Bram Moolenaar9964e462007-05-05 17:54:07 +0000398 =1 use WinNT's rcp in binary mode (default)
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000399
Bram Moolenaar446cb832008-06-24 21:56:24 +0000400PATHS *netrw-path* {{{2
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000401
402Paths to files are generally user-directory relative for most protocols.
403It is possible that some protocol will make paths relative to some
404associated directory, however.
405>
406 example: vim scp://user@host/somefile
407 example: vim scp://user@host/subdir1/subdir2/somefile
408<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000409where "somefile" is in the "user"'s home directory. If you wish to get a
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000410file using root-relative paths, use the full path:
411>
412 example: vim scp://user@host//somefile
413 example: vim scp://user@host//subdir1/subdir2/somefile
414<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000415
416==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00004174. Network-Oriented File Transfer *netrw-xfer* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000418
419Network-oriented file transfer under Vim is implemented by a VimL-based script
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000420(<netrw.vim>) using plugin techniques. It currently supports both reading and
421writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch,
Bram Moolenaar071d4272004-06-13 20:20:40 +0000422dav/cadaver, rsync, or sftp.
423
424http is currently supported read-only via use of wget or fetch.
425
426<netrw.vim> is a standard plugin which acts as glue between Vim and the
427various file transfer programs. It uses autocommand events (BufReadCmd,
428FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. >
429
430 ex. vim ftp://hostname/path/to/file
431<
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000432The characters preceding the colon specify the protocol to use; in the
Bram Moolenaar446cb832008-06-24 21:56:24 +0000433example, it's ftp. The <netrw.vim> script then formulates a command or a
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000434series of commands (typically ftp) which it issues to an external program
435(ftp, scp, etc) which does the actual file transfer/protocol. Files are read
436from/written to a temporary file (under Unix/Linux, /tmp/...) which the
437<netrw.vim> script will clean up.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000438
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100439Now, a word about Jan Minář's "FTP User Name and Password Disclosure"; first,
440ftp is not a secure protocol. User names and passwords are transmitted "in
441the clear" over the internet; any snooper tool can pick these up; this is not
442a netrw thing, this is a ftp thing. If you're concerned about this, please
443try to use scp or sftp instead.
444
445Netrw re-uses the user id and password during the same vim session and so long
446as the remote hostname remains the same.
447
448Jan seems to be a bit confused about how netrw handles ftp; normally multiple
449commands are performed in a "ftp session", and he seems to feel that the
450uid/password should only be retained over one ftp session. However, netrw
451does every ftp operation in a separate "ftp session"; so remembering the
452uid/password for just one "ftp session" would be the same as not remembering
453the uid/password at all. IMHO this would rapidly grow tiresome as one
454browsed remote directories, for example.
455
456On the other hand, thanks go to Jan M. for pointing out the many
457vulnerabilities that netrw (and vim itself) had had in handling "crafted"
458filenames. The |shellescape()| and |fnameescape()| functions were written in
459response by Bram Moolenaar to handle these sort of problems, and netrw has
460been modified to use them. Still, my advice is, if the "filename" looks like
461a vim command that you aren't comfortable with having executed, don't open it.
462
Bram Moolenaar9964e462007-05-05 17:54:07 +0000463 *netrw-putty* *netrw-pscp* *netrw-psftp*
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000464One may modify any protocol's implementing external application by setting a
465variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000466"scp -q"). As an example, consider using PuTTY: >
Bram Moolenaar9964e462007-05-05 17:54:07 +0000467
468 let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch'
469 let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"'
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000470<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000471See |netrw-p8| for more about putty, pscp, psftp, etc.
472
Bram Moolenaar071d4272004-06-13 20:20:40 +0000473Ftp, an old protocol, seems to be blessed by numerous implementations.
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000474Unfortunately, some implementations are noisy (ie., add junk to the end of the
475file). Thus, concerned users may decide to write a NetReadFixup() function
476that will clean up after reading with their ftp. Some Unix systems (ie.,
477FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is
478not noisy and more convenient, actually, for <netrw.vim> to use.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100479Consequently, if "fetch" is available (ie. executable), it may be preferable
480to use it for ftp://... based transfers.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000481
482For rcp, scp, sftp, and http, one may use network-oriented file transfers
Bram Moolenaar83bab712005-08-01 21:58:57 +0000483transparently; ie.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000484>
485 vim rcp://[user@]machine/path
486 vim scp://[user@]machine/path
487<
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100488If your ftp supports <.netrc>, then it too can be transparently used
Bram Moolenaar071d4272004-06-13 20:20:40 +0000489if the needed triad of machine name, user id, and password are present in
490that file. Your ftp must be able to use the <.netrc> file on its own, however.
491>
492 vim ftp://[user@]machine[[:#]portnumber]/path
493<
494However, ftp will often need to query the user for the userid and password.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000495The latter will be done "silently"; ie. asterisks will show up instead of
Bram Moolenaar071d4272004-06-13 20:20:40 +0000496the actually-typed-in password. Netrw will retain the userid and password
497for subsequent read/writes from the most recent transfer so subsequent
498transfers (read/write) to or from that machine will take place without
499additional prompting.
500
501 *netrw-urls*
502 +=================================+============================+============+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000503 | Reading | Writing | Uses |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000504 +=================================+============================+============+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000505 | DAV: | | |
506 | dav://host/path | | cadaver |
507 | :Nread dav://host/path | :Nwrite dav://host/path | cadaver |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000508 +---------------------------------+----------------------------+------------+
Bram Moolenaar446cb832008-06-24 21:56:24 +0000509 | DAV + SSL: | | |
510 | davs://host/path | | cadaver |
511 | :Nread davs://host/path | :Nwrite davs://host/path | cadaver |
512 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000513 | FETCH: | | |
514 | fetch://[user@]host/path | | |
515 | fetch://[user@]host:http/path | Not Available | fetch |
516 | :Nread fetch://[user@]host/path| | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000517 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000518 | FILE: | | |
519 | file:///* | file:///* | |
520 | file://localhost/* | file://localhost/* | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000521 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000522 | FTP: (*3) | (*3) | |
523 | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) |
524 | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc |
525 | :Nread host path | :Nwrite host path | ftp+.netrc |
526 | :Nread host uid pass path | :Nwrite host uid pass path | ftp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000527 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000528 | HTTP: wget is executable: (*4) | | |
529 | http://[user@]host/path | Not Available | wget |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000530 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000531 | HTTP: fetch is executable (*4) | | |
532 | http://[user@]host/path | Not Available | fetch |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000533 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000534 | RCP: | | |
535 | rcp://[user@]host/path | rcp://[user@]host/path | rcp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000536 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000537 | RSYNC: | | |
538 | rsync://[user@]host/path | rsync://[user@]host/path | rsync |
539 | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync |
540 | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000541 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000542 | SCP: | | |
543 | scp://[user@]host/path | scp://[user@]host/path | scp |
544 | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000545 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000546 | SFTP: | | |
547 | sftp://[user@]host/path | sftp://[user@]host/path | sftp |
548 | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000549 +=================================+============================+============+
550
551 (*1) For an absolute path use scp://machine//path.
552
553 (*2) if <.netrc> is present, it is assumed that it will
554 work with your ftp client. Otherwise the script will
Bram Moolenaar9964e462007-05-05 17:54:07 +0000555 prompt for user-id and password.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000556
Bram Moolenaar9964e462007-05-05 17:54:07 +0000557 (*3) for ftp, "machine" may be machine#port or machine:port
Bram Moolenaar071d4272004-06-13 20:20:40 +0000558 if a different port is needed than the standard ftp port
559
560 (*4) for http:..., if wget is available it will be used. Otherwise,
561 if fetch is available it will be used.
562
563Both the :Nread and the :Nwrite ex-commands can accept multiple filenames.
564
565
566NETRC *netrw-netrc*
567
Bram Moolenaar446cb832008-06-24 21:56:24 +0000568The <.netrc> file, typically located in your home directory, contains lines
569therein which map a hostname (machine name) to the user id and password you
570prefer to use with it.
571
Bram Moolenaar071d4272004-06-13 20:20:40 +0000572The typical syntax for lines in a <.netrc> file is given as shown below.
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000573Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000574>
575 machine {full machine name} login {user-id} password "{password}"
576 default login {user-id} password "{password}"
577
578Your ftp client must handle the use of <.netrc> on its own, but if the
579<.netrc> file exists, an ftp transfer will not ask for the user-id or
580password.
581
582 Note:
583 Since this file contains passwords, make very sure nobody else can
584 read this file! Most programs will refuse to use a .netrc that is
585 readable for others. Don't forget that the system administrator can
Bram Moolenaar446cb832008-06-24 21:56:24 +0000586 still read the file! Ie. for Linux/Unix: chmod 600 .netrc
Bram Moolenaar071d4272004-06-13 20:20:40 +0000587
588
589PASSWORD *netrw-passwd*
590
591The script attempts to get passwords for ftp invisibly using |inputsecret()|,
592a built-in Vim function. See |netrw-uidpass| for how to change the password
593after one has set it.
594
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000595Unfortunately there doesn't appear to be a way for netrw to feed a password to
596scp. Thus every transfer via scp will require re-entry of the password.
Bram Moolenaar446cb832008-06-24 21:56:24 +0000597However, |netrw-ssh-hack| can help with this problem.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000598
599
600==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00006015. Activation *netrw-activate* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000602
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000603Network-oriented file transfers are available by default whenever Vim's
Bram Moolenaar446cb832008-06-24 21:56:24 +0000604|'nocompatible'| mode is enabled. Netrw's script files reside in your
605system's plugin, autoload, and syntax directories; just the
606plugin/netrwPlugin.vim script is sourced automatically whenever you bring up
607vim. The main script in autoload/netrw.vim is only loaded when you actually
608use netrw. I suggest that, at a minimum, you have at least the following in
609your <.vimrc> customization file: >
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000610
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000611 set nocp
612 if version >= 600
613 filetype plugin indent on
614 endif
615<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000616
617==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00006186. Transparent File Editing *netrw-transparent* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000619
620Transparent file transfers occur whenever a regular file read or write
Bram Moolenaar446cb832008-06-24 21:56:24 +0000621(invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd|
622events) is made. Thus one may read, write, or source files across networks
623just as easily as if they were local files! >
Bram Moolenaar071d4272004-06-13 20:20:40 +0000624
625 vim ftp://[user@]machine/path
626 ...
627 :wq
628
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000629See |netrw-activate| for more on how to encourage your vim to use plugins
630such as netrw.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000631
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000632
Bram Moolenaar071d4272004-06-13 20:20:40 +0000633==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00006347. Ex Commands *netrw-ex* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000635
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000636The usual read/write commands are supported. There are also a few
Bram Moolenaar446cb832008-06-24 21:56:24 +0000637additional commands available. Often you won't need to use Nwrite or
Bram Moolenaar9964e462007-05-05 17:54:07 +0000638Nread as shown in |netrw-transparent| (ie. simply use >
639 :e url
640 :r url
641 :w url
642instead, as appropriate) -- see |netrw-urls|. In the explanations
643below, a {netfile} is an url to a remote file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000644
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200645 *:Nwrite* *:Nw*
Bram Moolenaar446cb832008-06-24 21:56:24 +0000646:[range]Nw[rite] Write the specified lines to the current
Bram Moolenaar071d4272004-06-13 20:20:40 +0000647 file as specified in b:netrw_lastfile.
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200648 (related: |netrw-nwrite|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000649
Bram Moolenaar446cb832008-06-24 21:56:24 +0000650:[range]Nw[rite] {netfile} [{netfile}]...
Bram Moolenaar071d4272004-06-13 20:20:40 +0000651 Write the specified lines to the {netfile}.
652
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200653 *:Nread* *:Nr*
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100654:Nr[ead] Read the lines from the file specified in b:netrw_lastfile
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200655 into the current buffer. (related: |netrw-nread|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000656
Bram Moolenaar446cb832008-06-24 21:56:24 +0000657:Nr[ead] {netfile} {netfile}...
Bram Moolenaar071d4272004-06-13 20:20:40 +0000658 Read the {netfile} after the current line.
659
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200660 *:Nsource* *:Ns*
Bram Moolenaar446cb832008-06-24 21:56:24 +0000661:Ns[ource] {netfile}
Bram Moolenaar9964e462007-05-05 17:54:07 +0000662 Source the {netfile}.
663 To start up vim using a remote .vimrc, one may use
664 the following (all on one line) (tnx to Antoine Mechelynck) >
665 vim -u NORC -N
666 --cmd "runtime plugin/netrwPlugin.vim"
667 --cmd "source scp://HOSTNAME/.vimrc"
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200668< (related: |netrw-source|)
669
670:call NetUserPass() *NetUserPass()*
Bram Moolenaar446cb832008-06-24 21:56:24 +0000671 If g:netrw_uid and s:netrw_passwd don't exist,
672 this function will query the user for them.
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200673 (related: |netrw-userpass|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000674
675:call NetUserPass("userid")
Bram Moolenaar446cb832008-06-24 21:56:24 +0000676 This call will set the g:netrw_uid and, if
Bram Moolenaar071d4272004-06-13 20:20:40 +0000677 the password doesn't exist, will query the user for it.
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200678 (related: |netrw-userpass|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000679
680:call NetUserPass("userid","passwd")
Bram Moolenaar446cb832008-06-24 21:56:24 +0000681 This call will set both the g:netrw_uid and s:netrw_passwd.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000682 The user-id and password are used by ftp transfers. One may
Bram Moolenaar446cb832008-06-24 21:56:24 +0000683 effectively remove the user-id and password by using empty
684 strings (ie. "").
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200685 (related: |netrw-userpass|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000686
Bram Moolenaar9964e462007-05-05 17:54:07 +0000687:NetrwSettings This command is described in |netrw-settings| -- used to
688 display netrw settings and change netrw behavior.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000689
Bram Moolenaar071d4272004-06-13 20:20:40 +0000690
691==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00006928. Variables and Options *netrw-options* *netrw-var* {{{1
693
694(if you're interested in the netrw browser settings, see: |netrw-browser-var|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000695
Bram Moolenaar9964e462007-05-05 17:54:07 +0000696The <netrw.vim> script provides several variables which act as options to
Bram Moolenaar446cb832008-06-24 21:56:24 +0000697affect <netrw.vim>'s file transfer behavior. These variables typically may be
698set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|)
Bram Moolenaar446cb832008-06-24 21:56:24 +0000699>
Bram Moolenaar9964e462007-05-05 17:54:07 +0000700 -------------
701 Netrw Options
702 -------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000703 Option Meaning
704 -------------- -----------------------------------------------
705<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000706 b:netrw_col Holds current cursor position (during NetWrite)
707 g:netrw_cygwin =1 assume scp under windows is from cygwin
708 (default/windows)
709 =0 assume scp under windows accepts windows
710 style paths (default/else)
711 g:netrw_ftp =0 use default ftp (uid password)
712 g:netrw_ftpmode ="binary" (default)
713 ="ascii" (your choice)
714 g:netrw_ignorenetrc =1 (default)
715 if you have a <.netrc> file but you don't
Bram Moolenaar071d4272004-06-13 20:20:40 +0000716 want it used, then set this variable. Its
717 mere existence is enough to cause <.netrc>
718 to be ignored.
Bram Moolenaar9964e462007-05-05 17:54:07 +0000719 b:netrw_lastfile Holds latest method/machine/path.
720 b:netrw_line Holds current line number (during NetWrite)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000721 g:netrw_silent =0 transfers done normally
722 =1 transfers done silently
723 g:netrw_uid Holds current user-id for ftp.
Bram Moolenaar9964e462007-05-05 17:54:07 +0000724 g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
725 =1 use WinNT/2K/XP's rcp, binary mode
726 g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc
727 =1 use default method to do ftp >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000728 -----------------------------------------------------------------------
729<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000730The script will also make use of the following variables internally, albeit
731temporarily.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000732>
733 -------------------
734 Temporary Variables
735 -------------------
736 Variable Meaning
737 -------- ------------------------------------
738<
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100739 b:netrw_method Index indicating rcp/ftp+.netrc/ftp
740 w:netrw_method (same as b:netrw_method)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000741 g:netrw_machine Holds machine name parsed from input
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100742 b:netrw_fname Holds filename being accessed >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000743 ------------------------------------------------------------
744<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000745 *netrw-protocol*
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000746
747Netrw supports a number of protocols. These protocols are invoked using the
748variables listed below, and may be modified by the user.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000749>
750 ------------------------
Bram Moolenaar9964e462007-05-05 17:54:07 +0000751 Protocol Control Options
Bram Moolenaar071d4272004-06-13 20:20:40 +0000752 ------------------------
Bram Moolenaar9964e462007-05-05 17:54:07 +0000753 Option Type Setting Meaning
754 --------- -------- -------------- ---------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000755<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000756 netrw_ftp variable =doesn't exist userid set by "user userid"
757 =0 userid set by "user userid"
758 =1 userid set by "userid"
759 NetReadFixup function =doesn't exist no change
760 =exists Allows user to have files
761 read via ftp automatically
762 transformed however they wish
763 by NetReadFixup()
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100764 g:netrw_dav_cmd variable ="cadaver" if cadaver is executable
765 g:netrw_dav_cmd variable ="curl -o" elseif curl is executable
Bram Moolenaar9964e462007-05-05 17:54:07 +0000766 g:netrw_fetch_cmd variable ="fetch -o" if fetch is available
Bram Moolenaar071d4272004-06-13 20:20:40 +0000767 g:netrw_ftp_cmd variable ="ftp"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000768 g:netrw_http_cmd variable ="fetch -o" if fetch is available
769 g:netrw_http_cmd variable ="wget -O" else if wget is available
Bram Moolenaar9964e462007-05-05 17:54:07 +0000770 g:netrw_list_cmd variable ="ssh USEPORT HOSTNAME ls -Fa"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000771 g:netrw_rcp_cmd variable ="rcp"
772 g:netrw_rsync_cmd variable ="rsync -a"
773 g:netrw_scp_cmd variable ="scp -q"
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000774 g:netrw_sftp_cmd variable ="sftp" >
775 -------------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000776<
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000777 *netrw-ftp*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000778
Bram Moolenaar9964e462007-05-05 17:54:07 +0000779The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|)
780specify the external program to use handle the ftp protocol. They may
781include command line options (such as -p for passive mode).
Bram Moolenaar071d4272004-06-13 20:20:40 +0000782
Bram Moolenaar9964e462007-05-05 17:54:07 +0000783Browsing is supported by using the |g:netrw_list_cmd|; the substring
784"HOSTNAME" will be changed via substitution with whatever the current request
785is for a hostname.
786
787Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's
788that give trouble . In order to best understand how to use these options if
789ftp is giving you troubles, a bit of discussion is provided on how netrw does
790ftp reads.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000791
792For ftp, netrw typically builds up lines of one of the following formats in a
Bram Moolenaar071d4272004-06-13 20:20:40 +0000793temporary file:
794>
795 IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1
796 ---------------------------------- ------------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000797<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000798 open machine [port] open machine [port]
799 user userid password userid password
800 [g:netrw_ftpmode] password
801 [g:netrw_extracmd] [g:netrw_ftpmode]
802 get filename tempfile [g:netrw_extracmd]
803 get filename tempfile >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000804 ---------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000805<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000806The |g:netrw_ftpmode| and |g:netrw_extracmd| are optional.
807
Bram Moolenaar071d4272004-06-13 20:20:40 +0000808Netrw then executes the lines above by use of a filter:
809>
810 :%! {g:netrw_ftp_cmd} -i [-n]
811<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000812where
813 g:netrw_ftp_cmd is usually "ftp",
814 -i tells ftp not to be interactive
815 -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>)
816
817If <.netrc> exists it will be used to avoid having to query the user for
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000818userid and password. The transferred file is put into a temporary file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000819The temporary file is then read into the main editing session window that
820requested it and the temporary file deleted.
821
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000822If your ftp doesn't accept the "user" command and immediately just demands a
823userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000824
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000825 *netrw-cadaver*
826To handle the SSL certificate dialog for untrusted servers, one may pull
827down the certificate and place it into /usr/ssl/cert.pem. This operation
828renders the server treatment as "trusted".
829
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000830 *netrw-fixup* *netreadfixup*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000831If your ftp for whatever reason generates unwanted lines (such as AUTH
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100832messages) you may write a NetReadFixup() function:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000833>
834 function! NetReadFixup(method,line1,line2)
835 " a:line1: first new line in current file
836 " a:line2: last new line in current file
837 if a:method == 1 "rcp
838 elseif a:method == 2 "ftp + <.netrc>
839 elseif a:method == 3 "ftp + machine,uid,password,filename
840 elseif a:method == 4 "scp
841 elseif a:method == 5 "http/wget
842 elseif a:method == 6 "dav/cadaver
843 elseif a:method == 7 "rsync
844 elseif a:method == 8 "fetch
845 elseif a:method == 9 "sftp
Bram Moolenaar9964e462007-05-05 17:54:07 +0000846 else " complain
Bram Moolenaar071d4272004-06-13 20:20:40 +0000847 endif
848 endfunction
849>
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000850The NetReadFixup() function will be called if it exists and thus allows you to
851customize your reading process. As a further example, <netrw.vim> contains
852just such a function to handle Windows 95 ftp. For whatever reason, Windows
85395's ftp dumps four blank lines at the end of a transfer, and so it is
854desirable to automate their removal. Here's some code taken from <netrw.vim>
855itself:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000856>
857 if has("win95") && g:netrw_win95ftp
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000858 fun! NetReadFixup(method, line1, line2)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000859 if method == 3 " ftp (no <.netrc>)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000860 let fourblanklines= line2 - 3
861 silent fourblanklines.",".line2."g/^\s*/d"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000862 endif
863 endfunction
864 endif
865>
866
867==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00008689. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100869 *netrw-browser* *netrw-dir* *netrw-list*
Bram Moolenaar83bab712005-08-01 21:58:57 +0000870
Bram Moolenaar446cb832008-06-24 21:56:24 +0000871INTRODUCTION TO BROWSING *netrw-intro-browse* {{{2
872 (Quick References: |netrw-quickmaps| |netrw-quickcoms|)
Bram Moolenaar83bab712005-08-01 21:58:57 +0000873
Bram Moolenaar446cb832008-06-24 21:56:24 +0000874Netrw supports the browsing of directories on your local system and on remote
875hosts; browsing includes listing files and directories, entering directories,
876editing files therein, deleting files/directories, making new directories,
877moving (renaming) files and directories, copying files and directories, etc.
878One may mark files and execute any system command on them! The Netrw browser
879generally implements the previous explorer's maps and commands for remote
880directories, although details (such as pertinent global variable names)
881necessarily differ. To browse a directory, simply "edit" it! >
Bram Moolenaar269ec652004-07-29 08:43:53 +0000882
Bram Moolenaar446cb832008-06-24 21:56:24 +0000883 vim /your/directory/
884 vim .
885 vim c:\your\directory\
886<
887(Related topics: |netrw-cr| |netrw-o| |netrw-p| |netrw-P| |netrw-t|
888 |netrw-mf| |netrw-mx| |netrw-D| |netrw-R| |netrw-v| )
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000889
890The Netrw remote file and directory browser handles two protocols: ssh and
Bram Moolenaar446cb832008-06-24 21:56:24 +0000891ftp. The protocol in the url, if it is ftp, will cause netrw also to use ftp
892in its remote browsing. Specifying any other protocol will cause it to be
893used for file transfers; but the ssh protocol will be used to do remote
894browsing.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000895
Bram Moolenaar446cb832008-06-24 21:56:24 +0000896To use Netrw's remote directory browser, simply attempt to read a "file" with
897a trailing slash and it will be interpreted as a request to list a directory:
898>
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000899 vim [protocol]://[user@]hostname/path/
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000900<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000901where [protocol] is typically scp or ftp. As an example, try: >
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000902
Bram Moolenaar446cb832008-06-24 21:56:24 +0000903 vim ftp://ftp.home.vim.org/pub/vim/
904<
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100905For local directories, the trailing slash is not required. Again, because it's
Bram Moolenaar446cb832008-06-24 21:56:24 +0000906easy to miss: to browse remote directories, the url must terminate with a
907slash!
Bram Moolenaar83bab712005-08-01 21:58:57 +0000908
Bram Moolenaar446cb832008-06-24 21:56:24 +0000909If you'd like to avoid entering the password repeatedly for remote directory
910listings with ssh or scp, see |netrw-ssh-hack|. To avoid password entry with
911ftp, see |netrw-netrc| (if your ftp supports it).
Bram Moolenaar83bab712005-08-01 21:58:57 +0000912
Bram Moolenaar446cb832008-06-24 21:56:24 +0000913There are several things you can do to affect the browser's display of files:
Bram Moolenaar83bab712005-08-01 21:58:57 +0000914
Bram Moolenaar446cb832008-06-24 21:56:24 +0000915 * To change the listing style, press the "i" key (|netrw-i|).
916 Currently there are four styles: thin, long, wide, and tree.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100917 To make that change "permanent", see |g:netrw_liststyle|.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000918
Bram Moolenaar446cb832008-06-24 21:56:24 +0000919 * To hide files (don't want to see those xyz~ files anymore?) see
920 |netrw-ctrl-h|.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000921
Bram Moolenaar446cb832008-06-24 21:56:24 +0000922 * Press s to sort files by name, time, or size.
923
924See |netrw-browse-cmds| for all the things you can do with netrw!
925
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100926 *netrw-getftype* *netrw-filigree* *netrw-ftype*
927The |getftype()| function is used to append a bit of filigree to indicate
928filetype to locally listed files:
929
930 directory : /
931 executable : *
932 fifo : |
933 links : @
934 sockets : =
935
936The filigree also affects the |g:netrw_sort_sequence|.
937
Bram Moolenaar446cb832008-06-24 21:56:24 +0000938
939QUICK HELP *netrw-quickhelp* {{{2
940 (Use ctrl-] to select a topic)~
941 Intro to Browsing...............................|netrw-intro-browse|
942 Quick Reference: Maps.........................|netrw-quickmap|
943 Quick Reference: Commands.....................|netrw-browse-cmds|
944 Hiding
945 Edit hiding list..............................|netrw-ctrl-h|
946 Hiding Files or Directories...................|netrw-a|
947 Hiding/Unhiding by suffix.....................|netrw-mh|
948 Hiding dot-files.............................|netrw-gh|
949 Listing Style
950 Select listing style (thin/long/wide/tree)....|netrw-i|
951 Associated setting variable...................|g:netrw_liststyle|
952 Shell command used to perform listing.........|g:netrw_list_cmd|
953 Quick file info...............................|netrw-qf|
954 Sorted by
955 Select sorting style (name/time/size).........|netrw-s|
956 Editing the sorting sequence..................|netrw-S|
Bram Moolenaarc236c162008-07-13 17:41:49 +0000957 Sorting options...............................|g:netrw_sort_options|
Bram Moolenaar446cb832008-06-24 21:56:24 +0000958 Associated setting variable...................|g:netrw_sort_sequence|
959 Reverse sorting order.........................|netrw-r|
960
961
962 *netrw-quickmap* *netrw-quickmaps*
963QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000964>
Bram Moolenaar446cb832008-06-24 21:56:24 +0000965 --- ----------------- ----
966 Map Quick Explanation Link
967 --- ----------------- ----
968< <F1> Causes Netrw to issue help
969 <cr> Netrw will enter the directory or read the file |netrw-cr|
970 <del> Netrw will attempt to remove the file/directory |netrw-del|
971 - Makes Netrw go up one directory |netrw--|
972 a Toggles between normal display, |netrw-a|
973 hiding (suppress display of files matching g:netrw_list_hide)
974 showing (display only files which match g:netrw_list_hide)
975 c Make browsing directory the current directory |netrw-c|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100976 C Setting the editing window |netrw-C|
Bram Moolenaar446cb832008-06-24 21:56:24 +0000977 d Make a directory |netrw-d|
978 D Attempt to remove the file(s)/directory(ies) |netrw-D|
979 gb Go to previous bookmarked directory |netrw-gb|
980 gh Quick hide/unhide of dot-files |netrw-gh|
Bram Moolenaar446cb832008-06-24 21:56:24 +0000981 <c-h> Edit file hiding list |netrw-ctrl-h|
982 i Cycle between thin, long, wide, and tree listings |netrw-i|
983 <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
984 mb Bookmark current directory |netrw-mb|
985 mc Copy marked files to marked-file target directory |netrw-mc|
986 md Apply diff to marked files (up to 3) |netrw-md|
987 me Place marked files on arg list and edit them |netrw-me|
988 mf Mark a file |netrw-mf|
989 mh Toggle marked file suffices' presence on hiding list |netrw-mh|
990 mm Move marked files to marked-file target directory |netrw-mm|
991 mp Print marked files |netrw-mp|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100992 mr Mark files satisfying a shell-style |regexp| |netrw-mr|
Bram Moolenaar446cb832008-06-24 21:56:24 +0000993 mt Current browsing directory becomes markfile target |netrw-mt|
994 mT Apply ctags to marked files |netrw-mT|
995 mu Unmark all marked files |netrw-mu|
996 mx Apply arbitrary shell command to marked files |netrw-mx|
997 mz Compress/decompress marked files |netrw-mz|
998 o Enter the file/directory under the cursor in a new |netrw-o|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100999 browser window. A horizontal split is used.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001000 O Obtain a file specified by cursor |netrw-O|
1001 p Preview the file |netrw-p|
1002 P Browse in the previously used window |netrw-P|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001003 qb List bookmarked directories and history |netrw-qb|
1004 qf Display information on file |netrw-qf|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001005 r Reverse sorting order |netrw-r|
1006 R Rename the designed file(s)/directory(ies) |netrw-R|
1007 s Select sorting style: by name, time, or file size |netrw-s|
1008 S Specify suffix priority for name-sorting |netrw-S|
1009 t Enter the file/directory under the cursor in a new tab|netrw-t|
1010 u Change to recently-visited directory |netrw-u|
1011 U Change to subsequently-visited directory |netrw-U|
1012 v Enter the file/directory under the cursor in a new |netrw-v|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001013 browser window. A vertical split is used.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001014 x View file with an associated program |netrw-x|
1015
Bram Moolenaarc236c162008-07-13 17:41:49 +00001016 % Open a new file in netrw's current directory |netrw-%|
1017
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001018 *netrw-mouse* *netrw-leftmouse* *netrw-middlemouse* *netrw-rightmouse*
Bram Moolenaar446cb832008-06-24 21:56:24 +00001019 <leftmouse> (gvim only) selects word under mouse as if a <cr>
1020 had been pressed (ie. edit file, change directory)
1021 <middlemouse> (gvim only) same as P selecting word under mouse;
1022 see |netrw-P|
1023 <rightmouse> (gvim only) delete file/directory using word under
1024 mouse
1025 <2-leftmouse> (gvim only) when:
1026 * in a netrw-selected file, AND
1027 * |g:netrw_retmap| == 1 AND
1028 * the user doesn't already have a <2-leftmouse> mapping
1029 defined before netrw is autoloaded,
1030 then a double clicked leftmouse button will return
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001031 to the netrw browser window. See |g:netrw_retmap|.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001032 <s-leftmouse> (gvim only) like mf, will mark files
1033
Bram Moolenaar00a927d2010-05-14 23:24:24 +02001034 (to disable mouse buttons while browsing: |g:netrw_mousemaps|)
1035
Bram Moolenaar446cb832008-06-24 21:56:24 +00001036 *netrw-quickcom* *netrw-quickcoms*
1037QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2
1038 :NetrwClean[!] ...........................................|netrw-clean|
1039 :NetrwSettings ...........................................|netrw-settings|
1040 :Explore[!] [dir] Explore directory of current file......|netrw-explore|
1041 :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore|
1042 :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
1043 :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
1044 :Rexplore Return to Explorer.....................|netrw-explore|
1045 :Sexplore[!] [dir] Split & Explore directory .............|netrw-explore|
1046 :Texplore[!] [dir] Tab & Explore..........................|netrw-explore|
1047 :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
1048
1049BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001050
Bram Moolenaar446cb832008-06-24 21:56:24 +00001051One may easily "bookmark" a directory by using >
1052
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001053 mb
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001054<
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001055Bookmarks are retained in between sessions in a $HOME/.netrwbook file, and are
1056kept in sorted order.
1057
1058Related Topics:
1059 |netrw-gb| how to return (go) to a bookmark
1060 |netrw-mB| how to delete bookmarks
1061 |netrw-qb| how to list bookmarks
Bram Moolenaar4a85b412006-04-23 22:40:29 +00001062
1063
Bram Moolenaar446cb832008-06-24 21:56:24 +00001064BROWSING *netrw-cr* {{{2
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001065
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001066Browsing is simple: move the cursor onto a file or directory of interest.
Bram Moolenaar843ee412004-06-30 16:16:41 +00001067Hitting the <cr> (the return key) will select the file or directory.
1068Directories will themselves be listed, and files will be opened using the
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001069protocol given in the original read request.
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001070
Bram Moolenaar446cb832008-06-24 21:56:24 +00001071 CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that
1072 two or more spaces delimit filenames and directory names for the long and
1073 wide listing formats. Thus, if your filename or directory name has two or
1074 more sequential spaces embedded in it, or any trailing spaces, then you'll
1075 need to use the "thin" format to select it.
Bram Moolenaar843ee412004-06-30 16:16:41 +00001076
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001077The |g:netrw_browse_split| option, which is zero by default, may be used to
Bram Moolenaar446cb832008-06-24 21:56:24 +00001078cause the opening of files to be done in a new window or tab instead of the
1079default. When the option is one or two, the splitting will be taken
1080horizontally or vertically, respectively. When the option is set to three, a
1081<cr> will cause the file to appear in a new tab.
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001082
Bram Moolenaar83bab712005-08-01 21:58:57 +00001083
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001084When using the gui (gvim), one may select a file by pressing the <leftmouse>
1085button. In addition, if
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001086
Bram Moolenaar446cb832008-06-24 21:56:24 +00001087 *|g:netrw_retmap| == 1 AND (its default value is 0)
1088 * in a netrw-selected file, AND
1089 * the user doesn't already have a <2-leftmouse> mapping defined before
1090 netrw is loaded
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001091
Bram Moolenaar446cb832008-06-24 21:56:24 +00001092then a doubly-clicked leftmouse button will return to the netrw browser
1093window.
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001094
Bram Moolenaar446cb832008-06-24 21:56:24 +00001095Netrw attempts to speed up browsing, especially for remote browsing where one
1096may have to enter passwords, by keeping and re-using previously obtained
1097directory listing buffers. The |g:netrw_fastbrowse| variable is used to
1098control this behavior; one may have slow browsing (no buffer re-use), medium
1099speed browsing (re-use directory buffer listings only for remote directories),
1100and fast browsing (re-use directory buffer listings as often as possible).
1101The price for such re-use is that when changes are made (such as new files
1102are introduced into a directory), the listing may become out-of-date. One may
1103always refresh directory listing buffers by pressing ctrl-L (see
1104|netrw-ctrl-l|).
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001105
1106
Bram Moolenaar446cb832008-06-24 21:56:24 +00001107Related topics: |netrw-o| |netrw-p| |netrw-P| |netrw-t| |netrw-v|
1108Associated setting variables: |g:netrw_browse_split| |g:netrw_fastbrowse|
1109 |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
1110 |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_cmd|
1111 |g:netrw_ssh_browse_reject| |g:netrw_use_noswf|
1112
1113
1114BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2
1115
1116Normally one enters a file or directory using the <cr>. However, the "o" map
1117allows one to open a new window to hold the new directory listing or file. A
1118horizontal split is used. (for vertical splitting, see |netrw-v|)
1119
1120Normally, the o key splits the window horizontally with the new window and
1121cursor at the top. To change to splitting the window horizontally with the
1122new window and cursor at the bottom, have
1123
1124 let g:netrw_alto = 1
1125
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001126in your <.vimrc>. (also see |netrw-t| |netrw-T| |netrw-v|)
Bram Moolenaar446cb832008-06-24 21:56:24 +00001127
1128Associated setting variables: |g:netrw_alto| |g:netrw_winsize|
1129
1130
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001131BROWSING WITH A NEW TAB *netrw-t* *netrw-T* {{{2
Bram Moolenaar446cb832008-06-24 21:56:24 +00001132
1133Normally one enters a file or directory using the <cr>. The "t" map
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001134allows one to open a new window holding the new directory listing or file in
1135a new tab. The "T" version puts the file or directory into a background tab
1136(see |gT|)
1137
1138Related actions: |netrw-o| |netrw-v|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001139
1140
1141BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2
1142
1143Normally one enters a file or directory using the <cr>. However, the "v" map
1144allows one to open a new window to hold the new directory listing or file. A
1145vertical split is used. (for horizontal splitting, see |netrw-o|)
1146
1147Normally, the v key splits the window vertically with the new window and
1148cursor at the left. To change to splitting the window vertically with the new
1149window and cursor at the right, have
1150
1151 let g:netrw_altv = 1
1152
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001153in your <.vimrc>. (also see: |netrw-o| |netrw-t| |netrw-T|)
Bram Moolenaar446cb832008-06-24 21:56:24 +00001154
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001155There is only one tree listing buffer; using "v" on a displayed subdirectory
Bram Moolenaar446cb832008-06-24 21:56:24 +00001156will split the screen, but the same buffer will be shown twice.
1157
1158Associated setting variable: |g:netrw_altv| |g:netrw_winsize|
1159
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001160
1161CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001162
Bram Moolenaar9964e462007-05-05 17:54:07 +00001163The "i" map cycles between the thin, long, wide, and tree listing formats.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001164
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001165The thin listing format gives just the files' and directories' names.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001166
Bram Moolenaar8299df92004-07-10 09:47:34 +00001167The long listing is either based on the "ls" command via ssh for remote
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001168directories or displays the filename, file size (in bytes), and the time and
1169date of last modification for local directories. With the long listing
1170format, netrw is not able to recognize filenames which have trailing spaces.
1171Use the thin listing format for such files.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001172
Bram Moolenaar9964e462007-05-05 17:54:07 +00001173The wide listing format uses two or more contiguous spaces to delineate
1174filenames; when using that format, netrw won't be able to recognize or use
1175filenames which have two or more contiguous spaces embedded in the name or any
1176trailing spaces. The thin listing format will, however, work with such files.
1177This listing format is the most compact.
1178
1179The tree listing format has a top directory followed by files and directories
1180preceded by a "|". One may open and close directories by pressing the <cr>
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001181key while atop the directory name.
1182
1183One may make a preferred listing style your default; see |g:netrw_liststyle|.
1184As an example, by putting the following line in your .vimrc, >
1185 let g:netrw_liststyle= 4
1186the tree style will become your default listing style.
Bram Moolenaar8299df92004-07-10 09:47:34 +00001187
Bram Moolenaar446cb832008-06-24 21:56:24 +00001188Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen|
1189 |g:netrw_timefmt| |g:netrw_list_cmd|
Bram Moolenaar8299df92004-07-10 09:47:34 +00001190
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001191CHANGE FILE PERMISSION *netrw-gp* {{{2
1192
1193"gp" will ask you for a new permission for the file named under the cursor.
1194Currently, this only works for local files.
1195
1196Associated setting variables: |g:netrw_chgperm|
1197
Bram Moolenaar83bab712005-08-01 21:58:57 +00001198
Bram Moolenaar446cb832008-06-24 21:56:24 +00001199CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2
Bram Moolenaar843ee412004-06-30 16:16:41 +00001200
Bram Moolenaar446cb832008-06-24 21:56:24 +00001201To change directory back to a bookmarked directory, use
Bram Moolenaar843ee412004-06-30 16:16:41 +00001202
Bram Moolenaar446cb832008-06-24 21:56:24 +00001203 {cnt}gb
Bram Moolenaar843ee412004-06-30 16:16:41 +00001204
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001205Any count may be used to reference any of the bookmarks.
1206
1207Related Topics:
1208 |netrw-mB| how to delete bookmarks
1209 |netrw-mb| how to make a bookmark
1210 |netrw-qb| how to list bookmarks
Bram Moolenaar843ee412004-06-30 16:16:41 +00001211
Bram Moolenaar843ee412004-06-30 16:16:41 +00001212
Bram Moolenaar00a927d2010-05-14 23:24:24 +02001213CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001214
1215Every time you change to a new directory (new for the current session),
1216netrw will save the directory in a recently-visited directory history
Bram Moolenaar446cb832008-06-24 21:56:24 +00001217list (unless g:netrw_dirhistmax is zero; by default, it's ten). With the
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001218"u" map, one can change to an earlier directory (predecessor). To do
1219the opposite, see |netrw-U|.
1220
1221
Bram Moolenaar446cb832008-06-24 21:56:24 +00001222CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001223
1224With the "U" map, one can change to a later directory (successor).
1225This map is the opposite of the "u" map. (see |netrw-u|) Use the
Bram Moolenaar446cb832008-06-24 21:56:24 +00001226q map to list both the bookmarks and history. (see |netrw-qb|)
1227
1228
1229NETRW CLEAN *netrw-clean* *:NetrwClean*
1230
1231With :NetrwClean one may easily remove netrw from one's home directory;
1232more precisely, from the first directory on your |'runtimepath'|.
1233
1234With :NetrwClean!, netrw will remove netrw from all directories on your
1235|'runtimepath'|.
1236
1237With either form of the command, netrw will first ask for confirmation
1238that the removal is in fact what you want to do. If netrw doesn't have
1239permission to remove a file, it will issue an error message.
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001240
Bram Moolenaar9964e462007-05-05 17:54:07 +00001241 *netrw-gx*
Bram Moolenaar446cb832008-06-24 21:56:24 +00001242CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler* {{{2
Bram Moolenaar9964e462007-05-05 17:54:07 +00001243 (also see |netrw_filehandler|)
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001244
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001245Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
1246best seen with a special handler (ie. a tool provided with your computer).
1247Netrw allows one to invoke such special handlers by: >
1248
1249 * when Exploring, hit the "x" key
1250 * when editing, hit gx with the cursor atop the special filename
Bram Moolenaar9964e462007-05-05 17:54:07 +00001251< (not available if the |g:netrw_nogx| variable exists)
1252
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001253Netrw determines which special handler by the following method:
1254
1255 * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
1256 view files. Examples of useful settings (place into your <.vimrc>): >
1257
1258 :let g:netrw_browsex_viewer= "kfmclient exec"
1259< or >
1260 :let g:netrw_browsex_viewer= "gnome-open"
1261<
1262 If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
1263 invoked first (see |netrw_filehandler|).
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001264
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001265 * for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001266 * for Gnome (with gnome-open): gnome-open is used.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001267 * for KDE (with kfmclient) : kfmclient is used.
1268 * for Mac OS X : open is used.
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001269 * otherwise the netrwFileHandler plugin is used.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001270
1271The file's suffix is used by these various approaches to determine an
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001272appropriate application to use to "handle" these files. Such things as
1273OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
1274*.eps) can be handled.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001275
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001276 *netrw_filehandler*
Bram Moolenaar9964e462007-05-05 17:54:07 +00001277
1278The "x" map applies a function to a file, based on its extension. Of course,
1279the handler function must exist for it to be called!
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001280>
1281 Ex. mypgm.html x ->
Bram Moolenaar9964e462007-05-05 17:54:07 +00001282 NFH_html("scp://user@host/some/path/mypgm.html")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001283<
Bram Moolenaar9964e462007-05-05 17:54:07 +00001284Users may write their own netrw File Handler functions to support more
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001285suffixes with special handling. See <autoload/netrwFileHandlers.vim> for
Bram Moolenaar9964e462007-05-05 17:54:07 +00001286examples on how to make file handler functions. As an example: >
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001287
Bram Moolenaar9964e462007-05-05 17:54:07 +00001288 " NFH_suffix(filename)
1289 fun! NFH_suffix(filename)
1290 ..do something special with filename..
1291 endfun
1292<
1293These functions need to be defined in some file in your .vim/plugin
1294(vimfiles\plugin) directory. Vim's function names may not have punctuation
1295characters (except for the underscore) in them. To support suffices that
1296contain such characters, netrw will first convert the suffix using the
1297following table: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001298
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001299 @ -> AT ! -> EXCLAMATION % -> PERCENT
1300 : -> COLON = -> EQUAL ? -> QUESTION
Bram Moolenaar9964e462007-05-05 17:54:07 +00001301 , -> COMMA - -> MINUS ; -> SEMICOLON
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001302 $ -> DOLLAR + -> PLUS ~ -> TILDE
1303<
Bram Moolenaar9964e462007-05-05 17:54:07 +00001304So, for example: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001305
Bram Moolenaar9964e462007-05-05 17:54:07 +00001306 file.rcs,v -> NFH_rcsCOMMAv()
1307<
1308If more such translations are necessary, please send me email: >
1309 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
1310with a request.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001311
Bram Moolenaar446cb832008-06-24 21:56:24 +00001312Associated setting variable: |g:netrw_browsex_viewer|
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001313
Bram Moolenaar446cb832008-06-24 21:56:24 +00001314 *netrw-curdir*
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001315DELETING BOOKMARKS *netrw-mB* {{{2
1316
1317To delete a bookmark, use >
1318
1319 {cnt}mB
1320<
1321Related Topics:
1322 |netrw-gb| how to return (go) to a bookmark
1323 |netrw-mb| how to make a bookmark
1324 |netrw-qb| how to list bookmarks
1325
1326
Bram Moolenaar446cb832008-06-24 21:56:24 +00001327DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001328
Bram Moolenaar446cb832008-06-24 21:56:24 +00001329If files have not been marked with |netrw-mf|: (local marked file list)
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001330
Bram Moolenaar446cb832008-06-24 21:56:24 +00001331 Deleting/removing files and directories involves moving the cursor to the
1332 file/directory to be deleted and pressing "D". Directories must be empty
1333 first before they can be successfully removed. If the directory is a
1334 softlink to a directory, then netrw will make two requests to remove the
1335 directory before succeeding. Netrw will ask for confirmation before doing
1336 the removal(s). You may select a range of lines with the "V" command
1337 (visual selection), and then pressing "D".
Bram Moolenaar9964e462007-05-05 17:54:07 +00001338
Bram Moolenaar446cb832008-06-24 21:56:24 +00001339If files have been marked with |netrw-mf|: (local marked file list)
1340
1341 Marked files (and empty directories) will be deleted; again, you'll be
1342 asked to confirm the deletion before it actually takes place.
1343
1344The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are
1345used to control the attempts to remove files and directories. The
1346g:netrw_rm_cmd is used with files, and its default value is:
1347
1348 g:netrw_rm_cmd: ssh HOSTNAME rm
1349
1350The g:netrw_rmdir_cmd variable is used to support the removal of directories.
1351Its default value is:
1352
1353 g:netrw_rmdir_cmd: ssh HOSTNAME rmdir
1354
1355If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
1356to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
1357
1358 g:netrw_rmf_cmd: ssh HOSTNAME rm -f
1359
1360Associated setting variable: |g:netrw_local_rmdir| |g:netrw_rm_cmd|
1361 |g:netrw_rmdir_cmd| |g:netrw_ssh_cmd|
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001362
1363
Bram Moolenaar446cb832008-06-24 21:56:24 +00001364*netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore*
1365*netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore*
1366DIRECTORY EXPLORATION COMMANDS {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001367
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001368 :[N]Explore[!] [dir]... Explore directory of current file *:Explore*
1369 :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
1370 :Rexplore ... Return to Explorer *:Rexplore*
1371 :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore*
1372 :Texplore [dir]... Tab & Explore *:Texplore*
1373 :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
Bram Moolenaar446cb832008-06-24 21:56:24 +00001374
1375 Used with :Explore **/pattern : (also see |netrw-starstar|)
1376 :Nexplore............. go to next matching file *:Nexplore*
1377 :Pexplore............. go to previous matching file *:Pexplore*
1378
1379:Explore will open the local-directory browser on the current file's
1380 directory (or on directory [dir] if specified). The window will be
1381 split only if the file has been modified, otherwise the browsing
1382 window will take over that window. Normally the splitting is taken
1383 horizontally.
1384:Explore! is like :Explore, but will use vertical splitting.
1385:Sexplore will always split the window before invoking the local-directory
1386 browser. As with Explore, the splitting is normally done
1387 horizontally.
1388:Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically.
1389:Hexplore [dir] does an :Explore with |:belowright| horizontal splitting.
1390:Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting.
1391:Vexplore [dir] does an :Explore with |:leftabove| vertical splitting.
1392:Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting.
1393:Texplore [dir] does a tabnew before generating the browser window
1394
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001395By default, these commands use the current file's directory. However, one may
1396explicitly provide a directory (path) to use.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001397
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001398The [N] will override |g:netrw_winsize| to specify the quantity of rows and/or
1399columns the new explorer window should have.
1400
1401Otherwise, the |g:netrw_winsize| variable, if it has been specified by the
1402user, is used to control the quantity of rows and/or columns new explorer
1403windows should have.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001404
1405:Rexplore This command is a little different from the others. When one
1406 edits a file, for example by pressing <cr> when atop a file in
1407 a netrw browser window, :Rexplore will return the display to
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001408 that of the last netrw browser window. It is a command version
1409 of the <2-leftmouse> map (which is only available under gvim and
Bram Moolenaar446cb832008-06-24 21:56:24 +00001410 cooperative terms).
1411
1412
1413*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat*
1414EXPLORING WITH STARS AND PATTERNS
1415
1416When Explore, Sexplore, Hexplore, or Vexplore are used with one of the
1417following four styles, Explore generates a list of files which satisfy
1418the request. >
1419
1420 */filepat files in current directory which satisfy filepat
1421 **/filepat files in current directory or below which satisfy the
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001422 file pattern
Bram Moolenaar446cb832008-06-24 21:56:24 +00001423 *//pattern files in the current directory which contain the
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001424 pattern (vimgrep is used)
Bram Moolenaar446cb832008-06-24 21:56:24 +00001425 **//pattern files in the current directory or below which contain
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001426 the pattern (vimgrep is used)
Bram Moolenaar572cb562005-08-05 21:35:02 +00001427<
Bram Moolenaar446cb832008-06-24 21:56:24 +00001428The cursor will be placed on the first file in the list. One may then
1429continue to go to subsequent files on that list via |:Nexplore| or to
1430preceding files on that list with |:Pexplore|. Explore will update the
1431directory and place the cursor appropriately.
1432
1433A plain >
1434 :Explore
1435will clear the explore list.
1436
1437If your console or gui produces recognizable shift-up or shift-down sequences,
1438then you'll likely find using shift-downarrow and shift-uparrow convenient.
1439They're mapped by netrw:
1440
1441 <s-down> == Nexplore, and
1442 <s-up> == Pexplore.
1443
1444As an example, consider
1445>
1446 :Explore */*.c
1447 :Nexplore
1448 :Nexplore
1449 :Pexplore
1450<
1451The status line will show, on the right hand side of the status line, a
1452message like "Match 3 of 20".
1453
1454Associated setting variables: |g:netrw_keepdir| |g:netrw_browse_split|
1455 |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject|
1456 |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
1457 |g:netrw_ftp_timelist_cmd| |g:netrw_list_cmd|
1458 |g:netrw_liststyle|
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001459
1460
Bram Moolenaar446cb832008-06-24 21:56:24 +00001461DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001462
Bram Moolenaar446cb832008-06-24 21:56:24 +00001463With the cursor atop a filename, pressing "qf" will reveal the file's size
1464and last modification timestamp. Currently this capability is only available
1465for local files.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001466
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001467
Bram Moolenaar446cb832008-06-24 21:56:24 +00001468EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001469
Bram Moolenaar446cb832008-06-24 21:56:24 +00001470The "<ctrl-h>" map brings up a requestor allowing the user to change the
1471file/directory hiding list contained in |g:netrw_list_hide|. The hiding list
1472consists of one or more patterns delimited by commas. Files and/or
1473directories satisfying these patterns will either be hidden (ie. not shown) or
1474be the only ones displayed (see |netrw-a|).
1475
1476The "gh" mapping (see |netrw-gh|) quickly alternates between the usual
1477hiding list and the hiding of files or directories that begin with ".".
1478
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001479As an example, >
1480 let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+'
1481Effectively, this makes the effect of a |netrw-gh| command the initial setting.
1482What it means:
1483
1484 \(^\|\s\s\) : if the line begins with the following, -or-
1485 two consecutive spaces are encountered
1486 \zs : start the hiding match now
1487 \. : if it now begins with a dot
1488 \S\+ : and is followed by one or more non-whitespace
1489 characters
1490
Bram Moolenaar446cb832008-06-24 21:56:24 +00001491Associated setting variables: |g:netrw_hide| |g:netrw_list_hide|
1492Associated topics: |netrw-a| |netrw-gh| |netrw-mh|
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001493
1494
Bram Moolenaar446cb832008-06-24 21:56:24 +00001495EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2
1496
1497When "Sorted by" is name, one may specify priority via the sorting sequence
1498(g:netrw_sort_sequence). The sorting sequence typically prioritizes the
1499name-listing by suffix, although any pattern will do. Patterns are delimited
1500by commas. The default sorting sequence is (all one line):
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001501
1502For Unix: >
1503 '[\/]$,\<core\%(\.\d\+\)\=,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,
1504 \.info$,\.swp$,\.bak$,\~$'
1505<
1506Otherwise: >
Bram Moolenaar446cb832008-06-24 21:56:24 +00001507 '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,
1508 \.swp$,\.bak$,\~$'
1509<
1510The lone * is where all filenames not covered by one of the other patterns
1511will end up. One may change the sorting sequence by modifying the
1512g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by
1513using the "S" map.
1514
Bram Moolenaarc236c162008-07-13 17:41:49 +00001515Related topics: |netrw-s| |netrw-S|
1516Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001517
1518
1519GOING UP *netrw--* {{{2
1520
1521To go up a directory, press "-" or press the <cr> when atop the ../ directory
1522entry in the listing.
1523
1524Netrw will use the command in |g:netrw_list_cmd| to perform the directory
1525listing operation after changing HOSTNAME to the host specified by the
1526user-provided url. By default netrw provides the command as:
1527
1528 ssh HOSTNAME ls -FLa
1529
1530where the HOSTNAME becomes the [user@]hostname as requested by the attempt to
1531read. Naturally, the user may override this command with whatever is
1532preferred. The NetList function which implements remote browsing
1533expects that directories will be flagged by a trailing slash.
1534
1535
1536HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2
1537
1538Netrw's browsing facility allows one to use the hiding list in one of three
1539ways: ignore it, hide files which match, and show only those files which
1540match.
1541
1542If no files have been marked via |netrw-mf|:
1543
1544The "a" map allows the user to cycle through the three hiding modes.
1545
1546The |g:netrw_list_hide| variable holds a comma delimited list of patterns
1547based on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list.
1548(also see |netrw-ctrl-h|) To set the hiding list, use the <c-h> map. As an
1549example, to hide files which begin with a ".", one may use the <c-h> map to
1550set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*'
1551in one's <.vimrc>). One may then use the "a" key to show all files, hide
1552matching files, or to show only the matching files.
1553
1554 Example: \.[ch]$
1555 This hiding list command will hide/show all *.c and *.h files.
1556
1557 Example: \.c$,\.h$
1558 This hiding list command will also hide/show all *.c and *.h
1559 files.
1560
1561Don't forget to use the "a" map to select the mode (normal/hiding/show) you
1562want!
1563
1564If files have been marked using |netrw-mf|, then this command will:
1565
1566 if showing all files or non-hidden files:
1567 modify the g:netrw_list_hide list by appending the marked files to it
1568 and showing only non-hidden files.
1569
1570 else if showing hidden files only:
1571 modify the g:netrw_list_hide list by removing the marked files from it
1572 and showing only non-hidden files.
1573 endif
1574
1575 *netrw-gh* *netrw-hide*
1576As a quick shortcut, one may press >
1577 gh
1578to toggle between hiding files which begin with a period (dot) and not hiding
1579them.
1580
1581Associated setting variable: |g:netrw_list_hide|
1582Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh|
1583
1584IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001585
1586Especially with the remote directory browser, constantly entering the password
1587is tedious.
1588
Bram Moolenaar9964e462007-05-05 17:54:07 +00001589For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00001590tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip
1591for setting up no-password ssh and scp and discusses associated security
Bram Moolenaar9964e462007-05-05 17:54:07 +00001592issues. It used to be available at http://hacks.oreilly.com/pub/h/66 ,
1593but apparently that address is now being redirected to some "hackzine".
Bram Moolenaare37d50a2008-08-06 17:06:04 +00001594I'll attempt a summary based on that article and on a communication from
1595Ben Schmidt:
Bram Moolenaar843ee412004-06-30 16:16:41 +00001596
Bram Moolenaare37d50a2008-08-06 17:06:04 +00001597 1. Generate a public/private key pair on the local machine
1598 (ssh client): >
1599 ssh-keygen -t rsa
1600 (saving the file in ~/.ssh/id_rsa as prompted)
1601<
1602 2. Just hit the <CR> when asked for passphrase (twice) for no
1603 passphrase. If you do use a passphrase, you will also need to use
1604 ssh-agent so you only have to type the passphrase once per session.
1605 If you don't use a passphrase, simply logging onto your local
1606 computer or getting access to the keyfile in any way will suffice
1607 to access any ssh servers which have that key authorized for login.
1608
1609 3. This creates two files: >
1610 ~/.ssh/id_rsa
1611 ~/.ssh/id_rsa.pub
1612<
1613 4. On the target machine (ssh server): >
1614 cd
1615 mkdir -p .ssh
1616 chmod 0700 .ssh
1617<
1618 5. On your local machine (ssh client): (one line) >
1619 ssh {serverhostname}
1620 cat '>>' '~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub
1621<
1622 or, for OpenSSH, (one line) >
1623 ssh {serverhostname}
1624 cat '>>' '~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub
1625<
1626You can test it out with >
1627 ssh {serverhostname}
1628and you should be log onto the server machine without further need to type
1629anything.
1630
1631If you decided to use a passphrase, do: >
1632 ssh-agent $SHELL
1633 ssh-add
1634 ssh {serverhostname}
1635You will be prompted for your key passphrase when you use ssh-add, but not
1636subsequently when you use ssh. For use with vim, you can use >
1637 ssh-agent vim
1638and, when next within vim, use >
1639 :!ssh-add
1640Alternatively, you can apply ssh-agent to the terminal you're planning on
1641running vim in: >
1642 ssh-agent xterm &
1643and do ssh-add whenever you need.
Bram Moolenaar843ee412004-06-30 16:16:41 +00001644
Bram Moolenaar9964e462007-05-05 17:54:07 +00001645For Windows, folks on the vim mailing list have mentioned that Pageant helps
1646with avoiding the constant need to enter the password.
Bram Moolenaar433f7c82006-03-21 21:29:36 +00001647
Bram Moolenaar446cb832008-06-24 21:56:24 +00001648Kingston Fung wrote about another way to avoid constantly needing to enter
1649passwords:
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001650
Bram Moolenaar446cb832008-06-24 21:56:24 +00001651 In order to avoid the need to type in the password for scp each time, you
1652 provide a hack in the docs to set up a non password ssh account. I found a
1653 better way to do that: I can use a regular ssh account which uses a
1654 password to access the material without the need to key-in the password
1655 each time. It's good for security and convenience. I tried ssh public key
1656 authorization + ssh-agent, implementing this, and it works! Here are two
1657 links with instructions:
1658
1659 http://www.ibm.com/developerworks/library/l-keyc2/
1660 http://sial.org/howto/openssh/publickey-auth/
1661
1662
1663LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2
1664
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001665Pressing "qb" (query bookmarks) will list both the bookmarked directories and
1666directory traversal history.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001667
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001668Related Topics:
1669 |netrw-gb| how to return (go) to a bookmark
1670 |netrw-mb| how to make a bookmark
1671 |netrw-mB| how to delete bookmarks
1672 |netrw-u| change to a predecessor directory via the history stack
1673 |netrw-U| change to a successor directory via the history stack
Bram Moolenaar446cb832008-06-24 21:56:24 +00001674
1675MAKING A NEW DIRECTORY *netrw-d* {{{2
1676
1677With the "d" map one may make a new directory either remotely (which depends
1678on the global variable g:netrw_mkdir_cmd) or locally (which depends on the
1679global variable g:netrw_local_mkdir). Netrw will issue a request for the new
1680directory's name. A bare <CR> at that point will abort the making of the
1681directory. Attempts to make a local directory that already exists (as either
1682a file or a directory) will be detected, reported on, and ignored.
1683
1684Currently, making a directory via ftp is not supported.
1685
1686Associated setting variable: |g:netrw_local_mkdir| |g:netrw_mkdir_cmd|
1687
1688
1689MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* {{{2
1690
1691By default, |g:netrw_keepdir| is 1. This setting means that the current
1692directory will not track the browsing directory.
1693
1694Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory to
1695track netrw's browsing directory.
1696
1697However, given the default setting for g:netrw_keepdir of 1 where netrw
1698maintains its own separate notion of the current directory, in order to make
1699the two directories the same, use the "c" map (just type c). That map will
1700set Vim's notion of the current directory to netrw's current browsing
1701directory.
1702
1703Associated setting variable: |g:netrw_keepdir|
1704
1705MARKING FILES *netrw-mf* {{{2
1706 (also see |netrw-mr|)
1707
1708One may mark files with the cursor atop a filename and then pressing "mf".
1709With gvim, one may also mark files with <s-leftmouse>. The following netrw
1710maps make use of marked files:
1711
1712 |netrw-a| Hide marked files/directories
1713 |netrw-D| Delete marked files/directories
1714 |netrw-mc| Copy marked files to target
1715 |netrw-md| Apply vimdiff to marked files
1716 |netrw-me| Edit marked files
1717 |netrw-mg| Apply vimgrep to marked files
1718 |netrw-mm| Move marked files
1719 |netrw-mp| Print marked files
1720 |netrw-mt| Set target for |netrw-mm| and |netrw-mc|
1721 |netrw-mT| Generate tags using marked files
1722 |netrw-mx| Apply shell command to marked files
1723 |netrw-mz| Compress/Decompress marked files
1724 |netrw-O| Obtain marked files
1725 |netrw-R| Rename marked files
1726
1727One may unmark files one at a time the same way one marks them; ie. place
1728the cursor atop a marked file and press "mf". This process also works
1729with <s-leftmouse> using gvim. One may unmark all files by pressing
1730"mu" (see |netrw-mu|).
1731
1732*markfilelist* *global_markfilelist* *local_markfilelist*
1733All marked files are entered onto the global marked file list; there is only
1734one such list. In addition, every netrw buffer also has its own local marked
1735file list; since netrw buffers are associated with specific directories, this
1736means that each directory has its own local marked file list. The various
1737commands which operate on marked files use one or the other of the marked file
1738lists.
1739
1740
1741MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
1742 (also see |netrw-mf|)
1743
1744One may also mark files by pressing "mr"; netrw will then issue a prompt,
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001745"Enter regexp: ". You may then enter a shell-style regular expression such
1746as *.c$ (see |glob()|). For remote systems, glob() doesn't work -- so netrw
1747converts "*" into ".*" (see |regexp|) and marks files based on that. In the
1748future I may make it possible to use |regexp|s instead of glob()-style
1749expressions (yet-another-option).
Bram Moolenaar446cb832008-06-24 21:56:24 +00001750
1751
1752MARKED FILES: ARBITRARY COMMAND *netrw-mx* {{{2
1753 (See |netrw-mf| and |netrw-mr| for how to mark files)
1754 (uses the local marked-file list)
1755
1756Upon activation of the "mx" map, netrw will query the user for some (external)
1757command to be applied to all marked files. All "%"s in the command will be
1758substituted with the name of each marked file in turn. If no "%"s are in the
1759command, then the command will be followed by a space and a marked filename.
1760
1761
1762MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2
1763 (See |netrw-mf| and |netrw-mr| for how to mark files)
1764 (uses the local marked file list)
1765
1766If any marked files are compressed, then "mz" will decompress them.
1767If any marked files are decompressed, then "mz" will compress them
1768using the command specified by |g:netrw_compress|; by default,
1769that's "gzip".
1770
1771For decompression, netrw provides a |Dictionary| of suffices and their
1772associated decompressing utilities; see |g:netrw_decompress|.
1773
1774Associated setting variables: |g:netrw_compress| |g:netrw_decompress|
1775
1776MARKED FILES: COPYING *netrw-mc* {{{2
1777 (See |netrw-mf| and |netrw-mr| for how to mark files)
1778 (Uses the global marked file list)
1779
1780Select a target directory with mt (|netrw-mt|). Then change directory,
1781select file(s) (see |netrw-mf|), and press "mc".
1782
1783Associated setting variable: |g:netrw_localcopycmd| |g:netrw_ssh_cmd|
1784
1785MARKED FILES: DIFF *netrw-md* {{{2
1786 (See |netrw-mf| and |netrw-mr| for how to mark files)
1787 (uses the global marked file list)
1788
1789Use |vimdiff| to visualize difference between selected files (two or
1790three may be selected for this). Uses the global marked file list.
1791
1792MARKED FILES: EDITING *netrw-me* {{{2
1793 (See |netrw-mf| and |netrw-mr| for how to mark files)
1794 (uses the global marked file list)
1795
1796This command will place the marked files on the |arglist| and commence
1797editing them. One may return the to explorer window with |:Rexplore|.
1798
1799MARKED FILES: GREP *netrw-mg* {{{2
1800 (See |netrw-mf| and |netrw-mr| for how to mark files)
1801 (uses the global marked file list)
1802
1803This command will apply |:vimgrep| to the marked files. The command will ask
1804for the requested pattern; one may enter: >
1805 /pattern/[g][j]
1806 ! /pattern/[g][j]
1807 pattern
1808<
1809MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2
1810 (See |netrw-mf| and |netrw-mr| for how to mark files)
1811 (uses the local marked file list)
1812
1813This command extracts the suffices of the marked files and toggles their
1814presence on the hiding list. Please note that marking the same suffix
1815this way multiple times will result in the suffix's presence being toggled
1816for each file (so an even quantity of marked files having the same suffix
1817is the same as not having bothered to select them at all).
1818
1819Related topics: |netrw-a| |g:netrw_list_hide|
1820
1821MARKED FILES: MOVING *netrw-mm* {{{2
1822 (See |netrw-mf| and |netrw-mr| for how to mark files)
1823 (uses the global marked file list)
1824
Bram Moolenaare37d50a2008-08-06 17:06:04 +00001825 WARNING: moving files is more dangerous than copying them.
1826 A file being moved is first copied and then deleted; if the
1827 copy operation fails and the delete succeeds, you will lose
1828 the file. Either try things out with unimportant files
1829 first or do the copy and then delete yourself using mc and D.
1830 Use at your own risk!
1831
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001832Select a target directory with mt (|netrw-mt|). Then change directory,
Bram Moolenaar446cb832008-06-24 21:56:24 +00001833select file(s) (see |netrw-mf|), and press "mm".
1834
1835Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|
1836
1837MARKED FILES: PRINTING *netrw-mp* {{{2
1838 (See |netrw-mf| and |netrw-mr| for how to mark files)
1839 (uses the local marked file list)
1840
1841Netrw will apply the |:hardcopy| command to marked files. What it does
1842is open each file in a one-line window, execute hardcopy, then close the
1843one-line window.
1844
1845
1846MARKED FILES: SOURCING *netrw-ms* {{{2
1847 (See |netrw-mf| and |netrw-mr| for how to mark files)
1848 (uses the local marked file list)
1849
1850Netrw will source the marked files (using vim's |:source| command)
1851
1852
1853MARKED FILES: TAGGING *netrw-mT* {{{2
1854 (See |netrw-mf| and |netrw-mr| for how to mark files)
1855 (uses the global marked file list)
1856
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001857The "mT" mapping will apply the command in |g:netrw_ctags| (by default, it is
Bram Moolenaar446cb832008-06-24 21:56:24 +00001858"ctags") to marked files. For remote browsing, in order to create a tags file
1859netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for
1860this to work on remote systems. For your local system, see |ctags| on how to
1861get a version. I myself use hdrtags, currently available at
1862http://mysite.verizon.net/astronaut/src/index.html , and have >
1863
1864 let g:netrw_ctags= "hdrtag"
1865<
1866in my <.vimrc>.
1867
1868When a remote set of files are tagged, the resulting tags file is "obtained";
1869ie. a copy is transferred to the local system's directory. The local tags
1870file is then modified so that one may use it through the network. The
1871modification is concerns the names of the files in the tags; each filename is
1872preceded by the netrw-compatible url used to obtain it. When one subsequently
1873uses one of the go to tag actions (|tags|), the url will be used by netrw to
1874edit the desired file and go to the tag.
1875
Bram Moolenaarc236c162008-07-13 17:41:49 +00001876Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001877
1878
1879MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2
1880 (See |netrw-mf| and |netrw-mr| for how to mark files)
1881
1882Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
1883
1884 * if the cursor is atop a file name, then the netrw window's currently
1885 displayed directory is used for the copy/move-to target.
1886
1887 * also, if the cursor is in the banner, then the netrw window's currently
1888 displayed directory is used for the copy/move-to target.
1889
1890 * however, if the cursor is atop a directory name, then that directory is
1891 used for the copy/move-to target
1892
1893There is only one copy/move-to target per vim session; ie. the target is a
1894script variable (see |s:var|) and is shared between all netrw windows (in an
1895instance of vim).
1896
1897MARKED FILES: UNMARKING *netrw-mu* {{{2
1898 (See |netrw-mf| and |netrw-mr| for how to mark files)
1899
1900The "mu" mapping will unmark all currently marked files.
1901
1902
1903NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2
1904
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001905(if you're interested in the netrw file transfer settings, see |netrw-options|)
Bram Moolenaar446cb832008-06-24 21:56:24 +00001906
1907The <netrw.vim> browser provides settings in the form of variables which
1908you may modify; by placing these settings in your <.vimrc>, you may customize
1909your browsing preferences. (see also: |netrw-settings|)
1910>
1911 --- -----------
1912 Var Explanation
1913 --- -----------
1914< *g:netrw_alto* change from above splitting to below splitting
1915 by setting this variable (see |netrw-o|)
1916 default: =&sb (see |'sb'|)
1917
1918 *g:netrw_altv* change from left splitting to right splitting
1919 by setting this variable (see |netrw-v|)
1920 default: =&spr (see |'spr'|)
1921
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001922 *g:netrw_banner* enable/suppress the banner
1923 =0: suppress the banner
1924 =1: banner is enabled (default)
1925 NOTE: suppressing the banner is a new feature
1926 which may cause problems.
1927
Bram Moolenaar446cb832008-06-24 21:56:24 +00001928 *g:netrw_browse_split* when browsing, <cr> will open the file by:
1929 =0: re-using the same window
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001930 =1: horizontally splitting the window first
1931 =2: vertically splitting the window first
Bram Moolenaar446cb832008-06-24 21:56:24 +00001932 =3: open file in new tab
1933 =4: act like "P" (ie. open previous window)
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001934 Note that |g:netrw_preview| may be used
1935 to get vertical splitting instead of
1936 horizontal splitting.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001937
1938 *g:netrw_browsex_viewer* specify user's preference for a viewer: >
1939 "kfmclient exec"
1940 "gnome-open"
1941< If >
1942 "-"
1943< is used, then netrwFileHandler() will look for
1944 a script/function to handle the given
1945 extension. (see |netrw_filehandler|).
1946
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001947 *g:netrw_chgperm* Unix/Linux: "chmod PERM FILENAME"
1948 Windows: "cacls FILENAME /e /p PERM"
1949 Used to change access permission for a file.
1950
Bram Moolenaar446cb832008-06-24 21:56:24 +00001951 *g:netrw_compress* ="gzip"
1952 Will compress marked files with this
1953 command
1954
Bram Moolenaarc236c162008-07-13 17:41:49 +00001955 *g:netrw_ctags* ="ctags"
1956 The default external program used to create tags
1957
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001958 *g:netrw_cursorline* = 1 (default)
1959 will use the |'cursorline'| local setting when
1960 |g:netrw_liststyle| ==0 (thin listing) or
1961 |g:netrw_liststyle| ==1 (long listing) or
1962 |g:netrw_liststyle| ==3 (tree listing)
1963 (ie. doesn't affect the wide listing)
1964 =0: off
1965 =2: like ==1, but the wide listing gets both
1966 cursorline and |'cursorcolumn'|locally set
1967
Bram Moolenaar446cb832008-06-24 21:56:24 +00001968 *g:netrw_decompress* = { ".gz" : "gunzip" ,
1969 ".bz2" : "bunzip2" ,
1970 ".zip" : "unzip" ,
1971 ".tar" : "tar -xf"}
1972 A dictionary mapping suffices to
1973 decompression programs.
1974
1975 *g:netrw_fastbrowse* =0: slow speed directory browsing;
1976 never re-uses directory listings,
1977 always obtains directory listings.
1978 =1: medium speed directory browsing;
1979 re-use directory listings only
1980 when remote directory browsing.
1981 (default value)
1982 =2: fast directory browsing;
1983 only obtains directory listings when the
1984 directory hasn't been seen before
1985 (or |netrw-ctrl-l| is used).
1986
1987 Fast browsing retains old directory listing
1988 buffers so that they don't need to be
1989 re-acquired. This feature is especially
1990 important for remote browsing. However, if
1991 a file is introduced or deleted into or from
1992 such directories, the old directory buffer
1993 becomes out-of-date. One may always refresh
1994 such a directory listing with |netrw-ctrl-l|.
1995 This option gives the user the choice of
1996 trading off accuracy (ie. up-to-date listing)
1997 versus speed.
1998
1999 *g:netrw_fname_escape* =' ?&;%'
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002000 Used on filenames before remote reading/writing
Bram Moolenaar446cb832008-06-24 21:56:24 +00002001
2002 *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
2003 that can show up as "directories" and "files"
2004 in the listing. This pattern is used to
2005 remove such embedded messages. By default its
2006 value is:
2007 '^total\s\+\d\+$\|
2008 ^Trying\s\+\d\+.*$\|
2009 ^KERBEROS_V\d rejected\|
2010 ^Security extensions not\|
2011 No such file\|
2012 : connect to address [0-9a-fA-F:]*
2013 : No route to host$'
2014
2015 *g:netrw_ftp_list_cmd* options for passing along to ftp for directory
2016 listing. Defaults:
2017 unix or g:netrw_cygwin set: : "ls -lF"
2018 otherwise "dir"
2019
2020
2021 *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory
2022 listing, sorted by size of file.
2023 Defaults:
2024 unix or g:netrw_cygwin set: : "ls -slF"
2025 otherwise "dir"
2026
2027 *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory
2028 listing, sorted by time of last modification.
2029 Defaults:
2030 unix or g:netrw_cygwin set: : "ls -tlF"
2031 otherwise "dir"
2032
Bram Moolenaar00a927d2010-05-14 23:24:24 +02002033 *g:netrw_glob_escape* ='[]*?`{~$' (unix)
2034 ='[]*?`{$' (windows
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002035 These characters in directory names are
Bram Moolenaar446cb832008-06-24 21:56:24 +00002036 escaped before applying glob()
2037
2038 *g:netrw_hide* if true, the hiding list is used
2039 default: =0
2040
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002041 *g:netrw_home* The home directory for where bookmarks and
2042 history are saved (as .netrwbook and
2043 .netrwhist).
2044 default: the first directory on the
2045 |'runtimepath'|
2046
Bram Moolenaar446cb832008-06-24 21:56:24 +00002047 *g:netrw_keepdir* =1 (default) keep current directory immune from
2048 the browsing directory.
2049 =0 keep the current directory the same as the
2050 browsing directory.
2051 The current browsing directory is contained in
2052 b:netrw_curdir (also see |netrw-c|)
2053
2054 *g:netrw_list_cmd* command for listing remote directories
2055 default: (if ssh is executable)
2056 "ssh HOSTNAME ls -FLa"
2057
2058 *g:netrw_liststyle* Set the default listing style:
2059 = 0: thin listing (one file per line)
2060 = 1: long listing (one file per line with time
2061 stamp information and file size)
2062 = 2: wide listing (multiple files in columns)
2063 = 3: tree style listing
2064 *g:netrw_list_hide* comma separated pattern list for hiding files
2065 Patterns are regular expressions (see |regexp|)
2066 Example: let g:netrw_list_hide= '.*\.swp$'
2067 default: ""
2068
2069 *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002070 ="copy" Windows
Bram Moolenaar446cb832008-06-24 21:56:24 +00002071 Copies marked files (|netrw-mf|) to target
2072 directory (|netrw-mt|, |netrw-mc|)
2073
2074 *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002075 ="move" Windows
Bram Moolenaar446cb832008-06-24 21:56:24 +00002076 Moves marked files (|netrw-mf|) to target
2077 directory (|netrw-mt|, |netrw-mm|)
2078
2079 *g:netrw_local_mkdir* command for making a local directory
2080 default: "mkdir"
2081
2082 *g:netrw_local_rmdir* remove directory command (rmdir)
2083 default: "rmdir"
2084
2085 *g:netrw_maxfilenamelen* =32 by default, selected so as to make long
2086 listings fit on 80 column displays.
2087 If your screen is wider, and you have file
2088 or directory names longer than 32 bytes,
2089 you may set this option to keep listings
2090 columnar.
2091
2092 *g:netrw_mkdir_cmd* command for making a remote directory
2093 default: "ssh USEPORT HOSTNAME mkdir"
2094
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002095 *g:netrw_mousemaps* =1 (default) enables the mouse buttons
2096 while browsing:
2097 leftmouse : open file/directory
2098 shift-leftmouse : mark file
2099 middlemouse : same as P
2100 rightmouse : remove file/directory
2101 =0: disables mouse maps
2102
2103 *g:netrw_retmap* if it exists and is set to one, then:
2104 * if in a netrw-selected file, AND
2105 * no normal-mode <2-leftmouse> mapping exists,
2106 then the <2-leftmouse> will be mapped for easy
Bram Moolenaar446cb832008-06-24 21:56:24 +00002107 return to the netrw browser window.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002108 example: click once to select and open a file,
2109 double-click to return.
2110
2111 Note that one may instead choose to:
2112 * let g:netrw_retmap= 1, AND
2113 * nmap <silent> YourChoice <Plug>NetrwReturn
2114 and have another mapping instead of
2115 <2-leftmouse> to invoke the return.
2116
2117 You may also use the |:Rexplore| command to do
2118 the same thing.
2119
Bram Moolenaar446cb832008-06-24 21:56:24 +00002120 default: =0
2121
2122 *g:netrw_rm_cmd* command for removing files
2123 default: "ssh USEPORT HOSTNAME rm"
2124
2125 *g:netrw_rmdir_cmd* command for removing directories
2126 default: "ssh USEPORT HOSTNAME rmdir"
2127
2128 *g:netrw_rmf_cmd* command for removing softlinks
2129 default: "ssh USEPORT HOSTNAME rm -f"
2130
2131 *g:netrw_sort_by* sort by "name", "time", or "size"
2132 default: "name"
2133
2134 *g:netrw_sort_direction* sorting direction: "normal" or "reverse"
2135 default: "normal"
2136
Bram Moolenaarc236c162008-07-13 17:41:49 +00002137 *g:netrw_sort_options* sorting is done using |:sort|; this
2138 variable's value is appended to the
2139 sort command. Thus one may ignore case,
2140 for example, with the following in your
2141 .vimrc: >
2142 let g:netrw_sort_options="i"
2143< default: ""
2144
Bram Moolenaar446cb832008-06-24 21:56:24 +00002145 *g:netrw_sort_sequence* when sorting by name, first sort by the
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002146 comma-separated pattern sequence. Note that
2147 the filigree added to indicate filetypes
2148 should be accounted for in your pattern.
Bram Moolenaar446cb832008-06-24 21:56:24 +00002149 default: '[\/]$,*,\.bak$,\.o$,\.h$,
2150 \.info$,\.swp$,\.obj$'
2151
2152 *g:netrw_special_syntax* If true, then certain files will be shown
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002153 in special syntax in the browser:
Bram Moolenaar446cb832008-06-24 21:56:24 +00002154
2155 netrwBak : *.bak
2156 netrwCompress: *.gz *.bz2 *.Z *.zip
2157 netrwData : *.dat
2158 netrwHdr : *.h
2159 netrwLib : *.a *.so *.lib *.dll
2160 netrwMakefile: [mM]akefile *.mak
2161 netrwObj : *.o *.obj
2162 netrwTags : tags ANmenu ANtags
2163 netrwTilde : *~
2164 netrwTmp : tmp* *tmp
2165
2166 These syntax highlighting groups are linked
2167 to Folded or DiffChange by default
2168 (see |hl-Folded| and |hl-DiffChange|), but
2169 one may put lines like >
2170 hi link netrwCompress Visual
2171< into one's <.vimrc> to use one's own
2172 preferences.
2173
2174 *g:netrw_ssh_cmd* One may specify an executable command
2175 to use instead of ssh for remote actions
2176 such as listing, file removal, etc.
2177 default: ssh
2178
2179 *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines,
2180 messages, banners, and whatnot that one doesn't
2181 want masquerading as "directories" and "files".
2182 Use this pattern to remove such embedded
2183 messages. By default its value is:
2184 '^total\s\+\d\+$'
2185
2186
2187 *g:netrw_tmpfile_escape* =' &;'
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002188 escape() is applied to all temporary files
Bram Moolenaar446cb832008-06-24 21:56:24 +00002189 to escape these characters.
2190
2191 *g:netrw_timefmt* specify format string to vim's strftime().
2192 The default, "%c", is "the preferred date
2193 and time representation for the current
2194 locale" according to my manpage entry for
2195 strftime(); however, not all are satisfied
2196 with it. Some alternatives:
2197 "%a %d %b %Y %T",
2198 " %a %Y-%m-%d %I-%M-%S %p"
2199 default: "%c"
2200
2201 *g:netrw_use_noswf* netrw normally avoids writing swapfiles
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002202 for browser buffers. However, under some
Bram Moolenaar446cb832008-06-24 21:56:24 +00002203 systems this apparently is causing nasty
2204 ml_get errors to appear; if you're getting
2205 ml_get errors, try putting
2206 let g:netrw_use_noswf= 0
2207 in your .vimrc.
2208
2209 *g:netrw_winsize* specify initial size of new windows made with
2210 "o" (see |netrw-o|), "v" (see |netrw-v|),
2211 |:Hexplore| or |:Vexplore|.
2212 default: ""
2213
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002214 *g:netrw_xstrlen* Controls how netrw computes string lengths,
2215 including multi-byte characters' string
Bram Moolenaar446cb832008-06-24 21:56:24 +00002216 length. (thanks to N Weibull, T Mechelynck)
2217 =0: uses Vim's built-in strlen()
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002218 =1: number of codepoints (Latin a + combining
Bram Moolenaar446cb832008-06-24 21:56:24 +00002219 circumflex is two codepoints) (DEFAULT)
2220 =2: number of spacing codepoints (Latin a +
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002221 combining circumflex is one spacing
Bram Moolenaar446cb832008-06-24 21:56:24 +00002222 codepoint; a hard tab is one; wide and
2223 narrow CJK are one each; etc.)
2224 =3: virtual length (counting tabs as anything
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002225 between 1 and |'tabstop'|, wide CJK as 2
Bram Moolenaar446cb832008-06-24 21:56:24 +00002226 rather than 1, Arabic alif as zero when
2227 immediately preceded by lam, one
2228 otherwise, etc)
2229
2230 *g:NetrwTopLvlMenu* This variable specifies the top level
2231 menu name; by default, it's "Netrw.". If
2232 you wish to change this, do so in your
2233 .vimrc.
2234
2235NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* {{{2
2236
2237Netrw has been designed to handle user options by saving them, setting the
2238options to something that's compatible with netrw's needs, and then restoring
2239them. However, the autochdir option: >
2240 :set acd
2241is problematical. Autochdir sets the current directory to that containing the
2242file you edit; this apparently also applies to directories. In other words,
2243autochdir sets the current directory to that containing the "file" (even if
2244that "file" is itself a directory).
2245
2246NETRW SETTINGS *netrw-settings* {{{2
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00002247
2248With the NetrwSettings.vim plugin, >
2249 :NetrwSettings
2250will bring up a window with the many variables that netrw uses for its
Bram Moolenaar1afcace2005-11-25 19:54:28 +00002251settings. You may change any of their values; when you save the file, the
2252settings therein will be used. One may also press "?" on any of the lines for
2253help on what each of the variables do.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00002254
Bram Moolenaar446cb832008-06-24 21:56:24 +00002255(also see: |netrw-browser-var| |netrw-protocol| |netrw-var| |netrw-variables|)
Bram Moolenaar9964e462007-05-05 17:54:07 +00002256
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00002257
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00002258==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00002259OBTAINING A FILE *netrw-O* {{{2
2260
2261If there are no marked files:
2262
2263 When browsing a remote directory, one may obtain a file under the cursor
2264 (ie. get a copy on your local machine, but not edit it) by pressing the O
2265 key.
2266
2267If there are marked files:
2268
2269 The marked files will be obtained (ie. a copy will be transferred to your
2270 local machine, but not set up for editing).
2271
2272Only ftp and scp are supported for this operation (but since these two are
2273available for browsing, that shouldn't be a problem). The status bar will
2274then show, on its right hand side, a message like "Obtaining filename". The
2275statusline will be restored after the transfer is complete.
2276
2277Netrw can also "obtain" a file using the local browser. Netrw's display
2278of a directory is not necessarily the same as Vim's "current directory",
2279unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select
2280a file using the local browser (by putting the cursor on it) and pressing
2281"O" will then "obtain" the file; ie. copy it to Vim's current directory.
2282
2283Related topics:
2284 * To see what the current directory is, use |:pwd|
2285 * To make the currently browsed directory the current directory, see |netrw-c|
2286 * To automatically make the currently browsed directory the current
2287 directory, see |g:netrw_keepdir|.
2288
2289
Bram Moolenaarc236c162008-07-13 17:41:49 +00002290OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%*
2291
2292To open a file in netrw's current directory, press "%". This map will
2293query the user for a new filename; an empty file by that name will be
2294placed in the netrw's current directory (ie. b:netrw_curdir).
2295
2296
Bram Moolenaar446cb832008-06-24 21:56:24 +00002297PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2
2298
2299One may use a preview window by using the "p" key when the cursor is atop the
2300desired filename to be previewed. The display will then split to show both
2301the browser (where the cursor will remain) and the file (see |:pedit|).
2302By default, the split will be taken horizontally; one may use vertical
2303splitting if one has set |g:netrw_preview| first.
2304
Bram Moolenaar00a927d2010-05-14 23:24:24 +02002305An interesting set of netrw settings is: >
2306
2307 let g:netrw_preview = 1
2308 let g:netrw_liststyle = 3
2309 let g:netrw_winsize = 30
2310
2311These will:
2312 1. Make vertical splitting the default for previewing files
2313 2. Make the default listing style "tree"
2314 3. When a vertical preview window is opened, the directory listing
2315 will use only 30 columns; the rest of the window is used for the
2316 preview window.
Bram Moolenaar446cb832008-06-24 21:56:24 +00002317
2318PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2
2319
2320To edit a file or directory in the previously used (last accessed) window (see
2321:he |CTRL-W_p|), press a "P". If there's only one window, then the one window
2322will be horizontally split (above/below splitting is controlled by
2323|g:netrw_alto|, and its initial size is controlled by |g:netrw_winsize|).
2324
2325If there's more than one window, the previous window will be re-used on
2326the selected file/directory. If the previous window's associated buffer
2327has been modified, and there's only one window with that buffer, then
2328the user will be asked if s/he wishes to save the buffer first (yes,
2329no, or cancel).
2330
2331
2332REFRESHING THE LISTING *netrw-ctrl-l* *netrw-ctrl_l* {{{2
2333
2334To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
2335hit the <cr> when atop the ./ directory entry in the listing. One may also
2336refresh a local directory by using ":e .".
2337
2338
2339RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2
2340
2341If there are no marked files: (see |netrw-mf|)
2342
2343 Renaming/moving files and directories involves moving the cursor to the
2344 file/directory to be moved (renamed) and pressing "R". You will then be
2345 queried for where you want the file/directory to be moved. You may select
2346 a range of lines with the "V" command (visual selection), and then
2347 pressing "R".
2348
2349If there are marked files: (see |netrw-mf|)
2350
2351 Marked files will be renamed (moved). You will be queried as above in
2352 order to specify where you want the file/directory to be moved.
2353
2354 WARNING:~
2355
2356 Note that moving files is a dangerous operation; copies are safer. That's
2357 because a "move" for remote files is actually a copy + delete -- and if
2358 the copy fails and the delete does not, you may lose the file.
2359
2360The g:netrw_rename_cmd variable is used to implement renaming. By default its
2361value is:
2362
2363 ssh HOSTNAME mv
2364
2365One may rename a block of files and directories by selecting them with
2366the V (|linewise-visual|).
2367
2368
2369REVERSING SORTING ORDER *netrw-r* *netrw-reverse* {{{2
2370
2371One may toggle between normal and reverse sorting order by pressing the
2372"r" key.
2373
2374Related topics: |netrw-s|
2375Associated setting variable: |g:netrw_sort_direction|
2376
2377
2378SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2
2379
2380One may select the sorting style by name, time, or (file) size. The "s" map
2381allows one to circulate amongst the three choices; the directory listing will
2382automatically be refreshed to reflect the selected style.
2383
2384Related topics: |netrw-r| |netrw-S|
2385Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
2386
2387
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002388SETTING EDITING WINDOW *netrw-C* {{{2
2389
2390One may select a netrw window for editing with the "C" mapping, or by setting
2391g:netrw_chgwin to the selected window number. Subsequent selection of a file
2392to edit (|netrw-cr|) will use that window.
2393
2394Related topics: |netrw-cr|
2395Associated setting variables: |g:netrw_chgwin|
2396
2397
Bram Moolenaar446cb832008-06-24 21:56:24 +0000239810. Problems and Fixes *netrw-problems* {{{1
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002399
2400 (This section is likely to grow as I get feedback)
2401 (also see |netrw-debug|)
Bram Moolenaar488c6512005-08-11 20:09:58 +00002402 *netrw-p1*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002403 P1. I use windows 95, and my ftp dumps four blank lines at the
2404 end of every read.
2405
2406 See |netrw-fixup|, and put the following into your
2407 <.vimrc> file:
2408
2409 let g:netrw_win95ftp= 1
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00002410
Bram Moolenaar488c6512005-08-11 20:09:58 +00002411 *netrw-p2*
Bram Moolenaar9964e462007-05-05 17:54:07 +00002412 P2. I use Windows, and my network browsing with ftp doesn't sort by
2413 time or size! -or- The remote system is a Windows server; why
2414 don't I get sorts by time or size?
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002415
2416 Windows' ftp has a minimal support for ls (ie. it doesn't
2417 accept sorting options). It doesn't support the -F which
2418 gives an explanatory character (ABC/ for "ABC is a directory").
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002419 Netrw then uses "dir" to get both its thin and long listings.
Bram Moolenaar9964e462007-05-05 17:54:07 +00002420 If you think your ftp does support a full-up ls, put the
2421 following into your <.vimrc>: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002422
Bram Moolenaar9964e462007-05-05 17:54:07 +00002423 let g:netrw_ftp_list_cmd = "ls -lF"
2424 let g:netrw_ftp_timelist_cmd= "ls -tlF"
2425 let g:netrw_ftp_sizelist_cmd= "ls -slF"
2426<
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002427 Alternatively, if you have cygwin on your Windows box, put
Bram Moolenaar9964e462007-05-05 17:54:07 +00002428 into your <.vimrc>: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002429
2430 let g:netrw_cygwin= 1
Bram Moolenaar9964e462007-05-05 17:54:07 +00002431<
2432 This problem also occurs when the remote system is Windows.
2433 In this situation, the various g:netrw_ftp_[time|size]list_cmds
2434 are as shown above, but the remote system will not correctly
2435 modify its listing behavior.
2436
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002437
Bram Moolenaar488c6512005-08-11 20:09:58 +00002438 *netrw-p3*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002439 P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw
2440 used ssh! That wasn't what I asked for...
2441
2442 Netrw has two methods for browsing remote directories: ssh
2443 and ftp. Unless you specify ftp specifically, ssh is used.
2444 When it comes time to do download a file (not just a directory
2445 listing), netrw will use the given protocol to do so.
2446
Bram Moolenaar488c6512005-08-11 20:09:58 +00002447 *netrw-p4*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002448 P4. I would like long listings to be the default.
2449
Bram Moolenaar446cb832008-06-24 21:56:24 +00002450 Put the following statement into your |.vimrc|: >
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002451
Bram Moolenaar446cb832008-06-24 21:56:24 +00002452 let g:netrw_liststyle= 1
2453<
2454 Check out |netrw-browser-var| for more customizations that
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002455 you can set.
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002456
Bram Moolenaar488c6512005-08-11 20:09:58 +00002457 *netrw-p5*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002458 P5. My times come up oddly in local browsing
2459
2460 Does your system's strftime() accept the "%c" to yield dates
2461 such as "Sun Apr 27 11:49:23 1997"? If not, do a "man strftime"
2462 and find out what option should be used. Then put it into
Bram Moolenaar446cb832008-06-24 21:56:24 +00002463 your |.vimrc|: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002464
Bram Moolenaar446cb832008-06-24 21:56:24 +00002465 let g:netrw_timefmt= "%X" (where X is the option)
2466<
Bram Moolenaar488c6512005-08-11 20:09:58 +00002467 *netrw-p6*
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002468 P6. I want my current directory to track my browsing.
2469 How do I do that?
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002470
Bram Moolenaar446cb832008-06-24 21:56:24 +00002471 Put the following line in your |.vimrc|:
2472>
Bram Moolenaar433f7c82006-03-21 21:29:36 +00002473 let g:netrw_keepdir= 0
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002474<
Bram Moolenaar9964e462007-05-05 17:54:07 +00002475 *netrw-p7*
2476 P7. I use Chinese (or other non-ascii) characters in my filenames, and
2477 netrw (Explore, Sexplore, Hexplore, etc) doesn't display them!
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00002478
Bram Moolenaar9964e462007-05-05 17:54:07 +00002479 (taken from an answer provided by Wu Yongwei on the vim
2480 mailing list)
2481 I now see the problem. You code page is not 936, right? Vim
2482 seems only able to open files with names that are valid in the
2483 current code page, as are many other applications that do not
2484 use the Unicode version of Windows APIs. This is an OS-related
2485 issue. You should not have such problems when the system
2486 locale uses UTF-8, such as modern Linux distros.
2487
2488 (...it is one more reason to recommend that people use utf-8!)
2489
2490 *netrw-p8*
2491 P8. I'm getting "ssh is not executable on your system" -- what do I
2492 do?
2493
2494 (Dudley Fox) Most people I know use putty for windows ssh. It
2495 is a free ssh/telnet application. You can read more about it
2496 here:
2497
2498 http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also:
2499
2500 (Marlin Unruh) This program also works for me. It's a single
2501 executable, so he/she can copy it into the Windows\System32
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002502 folder and create a shortcut to it.
Bram Moolenaar9964e462007-05-05 17:54:07 +00002503
2504 (Dudley Fox) You might also wish to consider plink, as it
2505 sounds most similar to what you are looking for. plink is an
2506 application in the putty suite.
2507
2508 http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink
2509
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002510 (Vissale Neang) Maybe you can try OpenSSH for windows, which
Bram Moolenaar9964e462007-05-05 17:54:07 +00002511 can be obtained from:
2512
2513 http://sshwindows.sourceforge.net/
2514
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002515 It doesn't need the full Cygwin package.
Bram Moolenaar9964e462007-05-05 17:54:07 +00002516
2517 (Antoine Mechelynck) For individual Unix-like programs needed
2518 for work in a native-Windows environment, I recommend getting
2519 them from the GnuWin32 project on sourceforge if it has them:
2520
2521 http://gnuwin32.sourceforge.net/
2522
2523 Unlike Cygwin, which sets up a Unix-like virtual machine on
2524 top of Windows, GnuWin32 is a rewrite of Unix utilities with
2525 Windows system calls, and its programs works quite well in the
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002526 cmd.exe "Dos box".
Bram Moolenaar9964e462007-05-05 17:54:07 +00002527
2528 (dave) Download WinSCP and use that to connect to the server.
2529 In Preferences > Editors, set gvim as your editor:
2530
2531 - Click "Add..."
2532 - Set External Editor (adjust path as needed, include
2533 the quotes and !.! at the end):
2534 "c:\Program Files\Vim\vim70\gvim.exe" !.!
2535 - Check that the filetype in the box below is
2536 {asterisk}.{asterisk} (all files), or whatever types
2537 you want (cec: change {asterisk} to * ; I had to
2538 write it that way because otherwise the helptags
Bram Moolenaar446cb832008-06-24 21:56:24 +00002539 system thinks it's a tag)
2540 - Make sure it's at the top of the listbox (click it,
2541 then click "Up" if it's not)
Bram Moolenaar9964e462007-05-05 17:54:07 +00002542 If using the Norton Commander style, you just have to hit <F4>
2543 to edit a file in a local copy of gvim.
2544
2545 (Vit Gottwald) How to generate public/private key and save
2546 public key it on server: >
2547 http://www.tartarus.org/~simon/puttydoc/Chapter8.html#pubkey-gettingready
2548 8.3 Getting ready for public key authentication
2549<
Bram Moolenaar446cb832008-06-24 21:56:24 +00002550 How to use a private key with 'pscp': >
2551
Bram Moolenaar9964e462007-05-05 17:54:07 +00002552 http://www.tartarus.org/~simon/puttydoc/Chapter5.html
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002553 5.2.4 Using public key authentication with PSCP
Bram Moolenaar9964e462007-05-05 17:54:07 +00002554<
Bram Moolenaar446cb832008-06-24 21:56:24 +00002555 (Ben Schmidt) I find the ssh included with cwRsync is
2556 brilliant, and install cwRsync or cwRsyncServer on most
2557 Windows systems I come across these days. I guess COPSSH,
2558 packed by the same person, is probably even better for use as
2559 just ssh on Windows, and probably includes sftp, etc. which I
2560 suspect the cwRsync doesn't, though it might
2561
Bram Moolenaar9964e462007-05-05 17:54:07 +00002562 (cec) To make proper use of these suggestions above, you will
2563 need to modify the following user-settable variables in your
2564 .vimrc:
2565
Bram Moolenaar446cb832008-06-24 21:56:24 +00002566 |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd|
2567 |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd|
Bram Moolenaar9964e462007-05-05 17:54:07 +00002568
2569 The first one (|g:netrw_ssh_cmd|) is the most important; most
2570 of the others will use the string in g:netrw_ssh_cmd by
2571 default.
2572 *netrw-p9* *netrw-ml_get*
2573 P9. I'm browsing, changing directory, and bang! ml_get errors
2574 appear and I have to kill vim. Any way around this?
2575
2576 Normally netrw attempts to avoid writing swapfiles for
2577 its temporary directory buffers. However, on some systems
2578 this attempt appears to be causing ml_get errors to
2579 appear. Please try setting |g:netrw_use_noswf| to 0
2580 in your <.vimrc>: >
2581 let g:netrw_use_noswf= 0
2582<
Bram Moolenaar446cb832008-06-24 21:56:24 +00002583 *netrw-p10*
2584 P10. I'm being pestered with "[something] is a directory" and
2585 "Press ENTER or type command to continue" prompts...
2586
2587 The "[something] is a directory" prompt is issued by Vim,
2588 not by netrw, and there appears to be no way to work around
2589 it. Coupled with the default cmdheight of 1, this message
2590 causes the "Press ENTER..." prompt. So: read |hit-enter|;
2591 I also suggest that you set your |'cmdheight'| to 2 (or more) in
2592 your <.vimrc> file.
2593
2594 *netrw-p11*
2595 P11. I want to have two windows; a thin one on the left and my editing
2596 window on the right. How can I do this?
2597
2598 * Put the following line in your <.vimrc>:
2599 let g:netrw_altv = 1
2600 * Edit the current directory: :e .
2601 * Select some file, press v
2602 * Resize the windows as you wish (see |CTRL-W_<| and
2603 |CTRL-W_>|). If you're using gvim, you can drag
2604 the separating bar with your mouse.
2605 * When you want a new file, use ctrl-w h to go back to the
2606 netrw browser, select a file, then press P (see |CTRL-W_h|
2607 and |netrw-P|). If you're using gvim, you can press
2608 <leftmouse> in the browser window and then press the
2609 <middlemouse> to select the file.
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002610
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002611 *netrw-p12*
2612 P12. My directory isn't sorting correctly, or unwanted letters are
2613 appearing in the listed filenames, or things aren't lining
2614 up properly in the wide listing, ...
2615
2616 This may be due to an encoding problem. I myself usually use
2617 utf-8, but really only use ascii (ie. bytes from 32-126).
2618 Multibyte encodings use two (or more) bytes per character.
2619 You may need to change |g:netrw_sepchr| and/or |g:netrw_xstrlen|.
2620
Bram Moolenaar00a927d2010-05-14 23:24:24 +02002621 *netrw-p13*
2622 P13. I'm a Windows + putty + ssh user, and when I attempt to browse,
2623 the directories are missing trailing "/"s so netrw treats them
2624 as file transfers instead of as attempts to browse
2625 subdirectories. How may I fix this?
2626
2627 (mikeyao) If you want to use vim via ssh and putty under Windows,
2628 try combining the use of pscp/psftp with plink. pscp/psftp will
2629 be used to connect and plink will be used to execute commands on
2630 the server, for example: list files and directory using 'ls'.
2631
2632 These are the settings I use to do this:
2633>
2634 " list files, it's the key setting, if you haven't set,
2635 " you will get a blank buffer
2636 let g:netrw_list_cmd = "plink HOSTNAME ls -Fa"
2637 " if you haven't add putty directory in system path, you should
2638 " specify scp/sftp command. For examples:
2639 "let g:netrw_sftp_cmd = "d:\\dev\\putty\\PSFTP.exe"
2640 "let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe"
2641<
2642
2643
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002644==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +0000264511. Debugging Netrw Itself *netrw-debug* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00002646
2647The <netrw.vim> script is typically available as:
Bram Moolenaar488c6512005-08-11 20:09:58 +00002648>
Bram Moolenaar446cb832008-06-24 21:56:24 +00002649 /usr/local/share/vim/vim6x/plugin/netrwPlugin.vim
2650 /usr/local/share/vim/vim6x/autoload/netrw.vim
Bram Moolenaar488c6512005-08-11 20:09:58 +00002651< -or- >
Bram Moolenaar446cb832008-06-24 21:56:24 +00002652 /usr/local/share/vim/vim7x/plugin/netrwPlugin.vim
2653 /usr/local/share/vim/vim7x/autoload/netrw.vim
Bram Moolenaar488c6512005-08-11 20:09:58 +00002654<
Bram Moolenaar071d4272004-06-13 20:20:40 +00002655which is loaded automatically at startup (assuming :set nocp).
2656
2657 1. Get the <Decho.vim> script, available as:
2658
Bram Moolenaar446cb832008-06-24 21:56:24 +00002659 http://mysite.verizon.net/astronaut/vim/index.html#DECHO
Bram Moolenaar071d4272004-06-13 20:20:40 +00002660 or
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00002661 http://vim.sourceforge.net/scripts/script.php?script_id=120
Bram Moolenaar071d4272004-06-13 20:20:40 +00002662
Bram Moolenaar446cb832008-06-24 21:56:24 +00002663 It now comes as a "vimball"; if you're using vim 7.0 or earlier,
2664 you'll need to update vimball, too. See
2665 http://mysite.verizon.net/astronaut/vim/index.html#VIMBALL
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00002666
Bram Moolenaar446cb832008-06-24 21:56:24 +00002667 2. Edit the <netrw.vim> file by typing: >
Bram Moolenaard4755bb2004-09-02 19:12:26 +00002668
2669 vim netrw.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +00002670 :DechoOn
Bram Moolenaard4755bb2004-09-02 19:12:26 +00002671 :wq
Bram Moolenaar446cb832008-06-24 21:56:24 +00002672<
2673 To restore to normal non-debugging behavior, re-edit <netrw.vim>
2674 and type >
Bram Moolenaar071d4272004-06-13 20:20:40 +00002675
Bram Moolenaard4755bb2004-09-02 19:12:26 +00002676 vim netrw.vim
2677 :DechoOff
2678 :wq
Bram Moolenaar446cb832008-06-24 21:56:24 +00002679<
Bram Moolenaard4755bb2004-09-02 19:12:26 +00002680 This command, provided by <Decho.vim>, will comment out all
2681 Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()).
2682
Bram Moolenaar446cb832008-06-24 21:56:24 +00002683 3. Then bring up vim and attempt to evoke the problem by doing a
2684 transfer or doing some browsing. A set of messages should appear
2685 concerning the steps that <netrw.vim> took in attempting to
2686 read/write your file over the network in a separate tab.
Bram Moolenaar071d4272004-06-13 20:20:40 +00002687
Bram Moolenaar9964e462007-05-05 17:54:07 +00002688 To save the file, use >
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002689 :tabnext
Bram Moolenaar9964e462007-05-05 17:54:07 +00002690 :set bt=
2691 :w! DBG
2692< Please send that information to <netrw.vim>'s maintainer, >
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00002693 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
Bram Moolenaar9964e462007-05-05 17:54:07 +00002694<
Bram Moolenaar071d4272004-06-13 20:20:40 +00002695==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000269612. History *netrw-history* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00002697
Bram Moolenaar00a927d2010-05-14 23:24:24 +02002698 v138: May 01, 2010 * added the bomb setting to the Save-Set-Restore
2699 option handling (for Tony M)
2700 * (Bram Moolenaar) netrw optionally sets cursorline
2701 (and sometimes cursorcolumn) for its display.
2702 This option setting was leaking through with
2703 remote file handling.
2704 v137: Dec 28, 2009 * modified the preview window handling for
2705 vertically split windows. The preview
2706 window will take up all but g:netrw_winsize
2707 columns of the original window; those
2708 g:netrw_winsize columns will be used for
2709 the netrw listing.
2710 * (Simon Dambe) removed "~" from
2711 |g:netrw_glob_escape| under Windows
2712 * (Bram Moolenaar) modified test for status bar
2713 click with leftmouse. Moved code to
2714 s:NetrwLeftmouse().
2715 Feb 24, 2010 * (for Jean Johner) added insert-mode maps; one
2716 can get into insert mode with netrw via
2717 ctrl-o :e .
2718 Mar 15, 2010 * (Dominique Pellé) Directory with backslashes such
2719 as foo\bar were not being entered/left properly
2720 Mar 15, 2010 * Using :Explore .. and causing two FocusGained
2721 events caused the directory to change. Fixed.
2722 Mar 22, 2010 * Last fix caused problems for *//pat and */filepat
2723 searches.
2724 Mar 30, 2010 * With :set hidden and changing listing styles 8
2725 times, the tree listing buffer was being marked
2726 as modified upon exit. Fixed.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002727 v136: Jan 14, 2009 * extended |g:Netrw_funcref| to also handle lists
2728 of function references
2729 Jan 14, 2009 * (reported by Marvin Renich) with spell check
2730 enabled, some filenamess will still being
2731 displayed as spelling errors.
2732 Apr 13, 2009 * (Björn Winckler) writing a file using
2733 remote scp caused syntax highlighting problem.
2734 Solution: avoid syntax/syntax.vim's
2735 au Filetype * syntax setting autocommand by
2736 checking that the current buffer has the
2737 netrw filetype before attempting a doau
2738 in s:NetrwSafeOptions().
2739 Apr 14, 2009 * (asgeo1) suggested the "T" map (|netrw-T|)
2740 Apr 14, 2009 * marking wasn't working on executable and
2741 other special filenames
2742 Apr 20, 2009 * (Dennis Benzinger) files opened via http have
2743 their syntax filetype auto-detected
2744 Jun 19, 2009 * (Yukihiro Nakadaira) help document improvements
2745 Jul 22, 2009 * g:netrw_browse_split will honor the
2746 |'equalalways'| setting.
2747 Jul 29, 2009 * implemented "I" mapping to toggle banner
2748 (this is experimental and still being debugged)
2749 Sep 19, 2009 * (Mike McEwan) writes via ftp now send both
2750 g:netrw_ftpmode and g:netrw_ftpextracmd (if the
2751 latter exists)
2752 Dec 02, 2009 * netrw uses vimgrep several places; it now uses
2753 "noautocmd vimgrep" (should be speedier).
2754 Dec 03, 2009 * changed back to using -source instead of -dump
2755 for elinks-using commands. (requested by James
2756 Vega and Karsten Hopp)
2757 v135: Oct 29, 2008 * using |simplify()| on directory names
2758 (supporting handling ".."s in directory names)
2759 Oct 31, 2008 * added special file highlighting for core dumps
2760 under Unix/Linux. The default sorting sequence
2761 now also gives core dumps priority.
2762 Nov 10, 2008 * uses a call to netrw#Nread() instead of Nread
2763 to avoid having to use fnameescape()
2764 * fixed a tree redrawing problem (open directory,
2765 open subdir, close subdir, close dir)
2766 Nov 19, 2008 * sprinkled some histdel("/",-1)s through the code
2767 in an attempt to prevent netrw from changing
2768 the search history.
2769 Jan 02, 2009 * |g:Netrw_funcref| included
2770 Jan 05, 2009 * Explore */ **/ *// **// all clear explorer
2771 variables
2772 Jan 05, 2009 * (Panagiotis Louridas) extended s:WinPath()
2773 to remove cygdrive from non-cygwin Windows
2774 paths. Improved the determination as to
2775 whether or not to do so.
2776 Jan 13, 2009 * included contains=@NoSpell in every syntax
2777 group for syntax/netrw.vim .
2778 v134: Sep 30, 2008 * (Sander Marechal) provided a bugfix involving
2779 the use of the |netrw-t| command with a remote
2780 directory.
2781 Sep 30, 2008 * using "x" on a remote jpg was failing; fixed.
2782 Oct 03, 2008 * bookmarks now go on a list and are stored to
2783 the first directory on the |'runtimepath'| in
2784 the hopes of making their retention reliable.
2785 History now also goes to that directory.
2786 Oct 07, 2008 * Included check that vim 7.0 or later is in use.
2787 Oct 07, 2008 * Improved |g:netrw_retmap| handling.
2788 Oct 12, 2008 * Based upon Sébastien Migniot's suggestion, if
2789 cadaver isn't available then netrw will try to
2790 use curl for the dav://... protocol.
2791 Oct 13, 2008 * added @*/ to netrw buffers' |'iskeyword'|setting
2792 This lets mf (|netrw-mf|) mark directories, links
2793 and executables.
2794 Oct 13, 2008 * avoids a second NetrwBrowse() refresh when
2795 g:netrw_fastbrowse is <= 1 (slow, medium speed)
2796 Oct 22, 2008 * |g:netrw_http_xcmd| may now be overridden
2797 independently of |g:netrw_http_cmd|.
2798 Oct 23, 2008 * [N] added to the various Explore commands to
2799 let users specify the width/height of new
2800 explorer windows, overriding |g:netrw_winsize|.
2801 v133: Aug 10, 2008 * NetReadFixup() for win95 was missing some "a:"s
2802 Aug 12, 2008 * (Jan Minář) an error condition in NetrwMethod()
2803 wasn't being used, resulting in "b:netrw_fname
2804 undefined" errors
2805 Aug 12, 2008 * (François Ingeirest) asked that "hi link" be
2806 changed to hi default link in the netrw syntax
2807 files.
2808 Aug 12, 2008 * using s:NetrwUnmarkList() more often. Filenames
2809 were being left on the global list when removed
2810 from the buffer-local lists.
2811 Aug 14, 2008 * (Joshua Clayton) an errant extra ")" was left in
2812 the rcp-handling portion of NetRead().
2813 Sep 03, 2008 * added |'cursorline'| highlighting to thin, long,
2814 and tree displays.
Bram Moolenaared39e1d2008-08-09 17:55:22 +00002815 v132: Aug 06, 2008 * Fixed marked file-based obtain
2816 Aug 08, 2008 * sourcing a file via ftp from a netrw-generated
2817 buffer (or any buffer with |'nobl'|) left an
2818 empty no-name buffer in its wake. Fixed.
Bram Moolenaare37d50a2008-08-06 17:06:04 +00002819 v130: Jul 31, 2008 * trying out elinks/links for http://host/
2820 requests. One problem: in-page links
2821 (such as with ...#LABEL) are not supported
2822 * verified that Bram's modified netrwPlugin works
2823 Aug 01, 2008 * fixed a bug: when sourcing a file via ftp, the
2824 "filter window" was left behind.
2825 v129: Jul 31, 2008 * bug found in non-mouse enabled vim and some
2826 local maps
2827 v128: Jul 30, 2008 * much work done in using shellescape() and
2828 fnameescape()
Bram Moolenaarc236c162008-07-13 17:41:49 +00002829 v126: Jun 30, 2008 * after having gone to a remote directory,
2830 <f1> was no longer taking one to the correct
2831 entry in the help (|netrw-quickhelp|). Fixed.
2832 Jul 01, 2008 * extracting the last filename from a wide listing
2833 missed the last letter when |'virtualedit'| not
2834 enabled.
2835 Jul 01, 2008 * vim foo/bar was creating [Scratch] buffers,
2836 where bar was also a directory
2837 Jul 01, 2008 * numerous additional changes were made to netrw
2838 to use fnameescape() and shellescape() instead
2839 of escape(). Not all changes have been tested
2840 as yet...
2841 Jul 01, 2008 * (James Vega reported) some problems with
2842 :NetrwSettings (due to no longer used setting
2843 variables).
2844 Jul 07, 2008 * Additional numerous changes to support security;
2845 shellescape(arg,1), etc.
Bram Moolenaar446cb832008-06-24 21:56:24 +00002846 v125: Apr 07, 2008 * (Cristian Rigamonti) CR provides a patch; he
2847 noted that gx was failing since its call to
2848 netrw#NetBrowseX() wasn't updated to
2849 netrw#NetrwBrowseX().
2850 * (Stanis Trendelenburg) ST provides a patch to
2851 supports davs: (dav + ssl)
2852 * (Rick Choi) noted that directory names comprised
2853 of three digits were not being displayed by
2854 the internal browser. Fixed.
2855 * (Erik Falor) provided a patch to handle problems
2856 with changing directory and |'acd'| option.
2857 * (James Vega, Teemu Likonen) noted that netrw
2858 wasn't handling multi-byte filenames/directories
2859 correctly. Fixed.
2860 * (Rick) found problem with g:netrw_maxfilenamelen
2861 being overridden.
2862 * (James Vega) pointed out that netrw was
2863 misidentifying all files in a symbolically linked
2864 directory as being symbolically linked
2865 themselves. This particular problem was fixed;
2866 however, there are now situations where
2867 symbolically linked files will not be detected.
2868 Really need an internal vim function to do this
2869 identification.
2870 Apr 17, 2008 * When g:netrw_keepdir==0, current directory
2871 doesn't necessarily equal b:netrw_curdir
2872 initially. Problem is due to the patch directly
2873 above.
2874 * Fixed qf to handle case where b:netrw_curdir
2875 isn't the same as the current directory under
2876 linux/macosx.
2877 * New: |netrw-mg| (apply vimgrep to marked files)
2878 May 05, 2008 * (Rick) pointed out that a "setlocal ts=32" was
2879 interfering with g:netrw_maxfilenamelen
2880 May 05, 2008 * (James Vega) a file inside a linked directory
2881 was showing up as a symbolic link itself.
2882 May 22, 2008 * symbolic links, fifos, and sockets are now
2883 indicated by a trailing @, |, or =, respectively.
2884 Jun 06, 2008 * Removed numerous bugs from the marked file
2885 move and copy. Tested these changes under
2886 Unix only thus far.
2887 * :Rexplore returns to the screen position in the
2888 netrw listing from whence the file was edited
2889 v124: Apr 02, 2008 * (Adrian Rollett) change the line supporting the
2890 "x" action for mac to use g:netrw_shq
2891 v123: Feb 27, 2008 * Marked files now keeps a "global" marked file
2892 list. The global marked file list is used to
2893 support tag processing and vimdiff'ing
2894 (|netrw-md| |netrw-mt|)
2895 * Been insuring that mm and mc works with various
2896 combinations of local and remote directories
2897 * (Stefan Bittner) http://.../ should always have
2898 filetype "html" -- fixed.
2899 * (Stefan Bittner) a "?" in a http://.../ request
2900 wasn't being handled correctly. Fixed by
2901 removing ? from default |g:netrw_tmpfile_escape|.
2902 * (Nico Weber) % codes in http://.../ requests
2903 weren't being handled correctly. Fixed by
2904 including % in default |g:netrw_fname_escape|.
2905 * (Stefan Bittner) attempts to update Buffers.Refresh
2906 were failing because locale use changed the menu
2907 names. I implemented a workaround.
2908 v122: Feb 12, 2008 * bugfix - first sorting sequence match now has
2909 priority
2910 Feb 14, 2008 * bugfix - sorting sequence was effectively ignoring
2911 sequencing priority of anything following '*'
2912 * toggling a marked file was showing incorrect list
2913 (list was correct, but displayed matches weren't)
2914 * |g:netrw_special_syntax| implemented
2915 v121: Feb 11, 2008 * Bram M reported that :e file ... :e . would not
2916 retain the alternate file. Fixed -- I hope!
2917 * bugfix -- apparently v120 broke an explicit
2918 :Explore dirname
2919 v120: Jan 21, 2008 * |netrw-mt| changed to allow for target selection
2920 based on whether or not word under cursor is a
2921 directory or file, or if cursor is in banner
2922 area.
2923 * |netrw-mh| included (hiding by marked-file suffix)
2924 * functions moved about a bit (improved
2925 categorization)
2926 * executable files now displayed with trailing (*)
2927 * symbolically linked files now displayed with
2928 trailing (@)
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002929 * Somewhen, s:NetrwMarkFileMove() got damaged. It
2930 * is now restored (missing an endif, for example).
Bram Moolenaar446cb832008-06-24 21:56:24 +00002931 * |netrw-mu| implemented (unmarking marked files)
2932 * many bugs have been removed from the marked file
2933 system (tnx to Mark S. for feedback)
2934 * |netrw-ms| implemented (sourcing marked files)
2935 * fixed use of P with tree listing style
2936 * multiple tree listing now supported
2937 * ./ suppressed
2938 * changed q -> qb (query bookmarks)
2939 * implemented |netrw-qf|
2940 * Explore now has four special list-generation
2941 modes: */filepat **/filepat
2942 *//pattern **//pattern
2943 * gh (|netrw-gh|) is a shortcut for toggling the
2944 hiding of files and directories beginning with a
2945 dot
2946 v119: Jan 10, 2008 * When g:netrw_keepdir is false,
2947 NetrwOptionsRestore() had a problem
2948 (Bill McCarthy)
2949 Jan 11, 2008 * Netrw now shows symbolic links with a trailing
2950 "@" and special highlighting.
2951 Jan 15, 2008 * Changed g:netrw_noretmap -> |g:netrw_retmap|.
2952 Changed: disabled by default at Bram's
2953 preference.
2954 v118: Jan 02, 2008 * Fixed a problem with Windows;
2955 :Explore c:/path/ would not work,
2956 but :Explore c:/path would.
2957 * Fixed a bug in s:NetrwOptionRestore() - lcd's
2958 argument wasn't being properly escaped so it
2959 wouldn't handle spaces in directory names.
2960 (Gary Johnson)
2961 v117: Jan 02, 2008 * Fixed a problem with P; had to include
2962 a b:netrw_curdir bypass (Bram Moolenaar)
2963 v116: Nov 27, 2007 * netrw#LocalBrowseCheck() has &ft=="netrw"
2964 check to prevent doing a directory listing
2965 (was getting unexpected directory refreshes
2966 in the middle of some function calls)
2967 * NetrwOptionRestore moved after e! filename
2968 in order to retain user options for editing
2969 in s:NetrwBrowseChgDir()
2970 Dec 12, 2007 * Bug fix -- netrw does a better job of retaining
2971 user options when editing files under the aegis
2972 of the browser
2973 v115: Oct 04, 2007 * Erik Remmelzwaal pointed out that the use of
2974 shellslash in s:GetTempfile() was incorrect
2975 Oct 11, 2007 * Tracked down and eliminated a bug with editing
2976 remote *.tar.gz and *.tar.bz2 files
2977 Oct 11, 2007 * g:netrw_localmovecmd wasn't being initialized
2978 properly, and g:netrw_localcopycmd was being
2979 overwritten.
2980 Oct 12, 2007 * Placed all :Rexplore and <2-leftmouse> setup
2981 in a new support function (s:SetRexDir()).
2982 Oct 15, 2007 * new: g:netrw_browse_split == 4; means <cr>
2983 based selection will use previous window
2984 Oct 20, 2007 * also checks on |'shellxquote'| to set g:netrw_shq
2985 Oct 24, 2007 * Explore handles path/**/filename
2986 Oct 27, 2007 * sourcing remote files often didn't work with ftp,
2987 turns out that b:netrw_method was undefined, so
2988 s:SaveBufVars and s:RestoreBufVars() fixed it.
2989 v114: Sep 28, 2007 * mT, the map that invokes tags, has been improved
2990 to support use of remote tags files.
2991 Oct 02, 2007 * changed Netrw menu to use more submenus
2992 v113: Sep 07, 2007 * worked out why the cursor position wasn't being
2993 saved and restored as intended after doing such
2994 things as deleting and renaming files.
2995 Sep 11, 2007 * Fixed bug which effectively disabled <c-l> and
2996 <c-h> maps
2997 Sep 18, 2007 * there used to be one NetrwOptionRestore() call at
2998 the end of the s:NetrwBrowseChgDir() function;
2999 they're now at the end of every if..elseif..else
3000 block. The edit-a-file one is not quite at the end
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003001 of its block; instead, it's just before the edit.
Bram Moolenaar446cb832008-06-24 21:56:24 +00003002 Restores user options, then this new placement
3003 allows ftplugins, autocmds, etc to change settings
3004 (ex. ftplugin/cpp.vim sets cindent).
3005 Sep 19, 2007 * changed all strlen() calls to use s:Strlen(), a
3006 function which handles utf-8 wide characters
3007 correctly.
3008 Sep 20, 2007 * (Nico Weber) the "x" command has been extended
3009 to Mac's OS/X (macunix); it now uses open to
3010 handle |netrw-x| browsing with special files.
3011 Sep 22, 2007 * Added g:netrw_noretmap to netrw at Tony M's
3012 request.
3013 * Included path to NetrwRemoteRmFile()
3014 v112: Aug 18, 2007 * added mx (|netrw-mx|) for executing arbitrary
3015 commands on marked files
3016 Aug 22, 2007 * more option save/restore work for
3017 s:NetrwBrowseChgDir(); s:NetrwOptionSave()
3018 and s:NetrwOptionRestore() now take a parameter
3019 specifying the type of variables to be used for
3020 saving and restoring (either "w:" or "s:")
3021 Sep 04, 2007 * added the :NetrwClean[!] command
3022 v111: Jul 25, 2007 * using Windows but not using Cygwin, netrw does a
3023 "file bufname" where the bufname uses /s
3024 instead of \s; Vim "fixes" it by changing the
3025 bufname to use \s anyway. This meant that
3026 NetrwGetBuffer() didn't find the appropriately
3027 named buffer, and so would generate a new
3028 buffer listing; hence the cursor would appear
3029 to have been moved when doing a preview.
3030 * added <2-leftmouse> map to return to netrw's
3031 browser display
3032 Aug 16, 2007 * added the mark-file system, including
3033 maps for mf mp mt mz and mu. Modifications
3034 made to maps for a D O and R to support
3035 marked files.
3036 v110: May 10, 2007 * added [ and ] maps to NetrwTreeListing
3037 May 25, 2007 * |g:netrw_preview| included
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003038 May 29, 2007 * modified netrw#NetBrowseX to consistently use
Bram Moolenaarc236c162008-07-13 17:41:49 +00003039 g:netrw_shq instead of hardcoded quotes,
Bram Moolenaar446cb832008-06-24 21:56:24 +00003040 and modified the snippet that sets up redir
3041 so Windows machines use "nul" instead of
3042 "/dev/null".
3043 Jun 01, 2007 * fixed bug -- NetGetBuffer() wasn't always
3044 recognizing a buffer name match when it should,
3045 thus resulting in [Scratch] buffers.
3046 Jun 04, 2007 * Gary Johnson found a bugfix for the "c" mapping
3047 when the directory is to be made current but
3048 the name contains spaces.
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003049 v109: Mar 26, 2007 * if a directory name includes a "$" character,
3050 Explore() will use expand() in an attempt to
3051 decipher the name.
3052 May 07, 2007 * g:netrw_use_errorwindow now allows one to
Bram Moolenaar446cb832008-06-24 21:56:24 +00003053 have error messages go to a reliable window
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003054 or to use a less reliable but recallable
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003055 echoerr method
3056 May 07, 2007 * g:netrw_scpport and g:netrw_sshport support
Bram Moolenaar446cb832008-06-24 21:56:24 +00003057 use of -P and -p, respectively, to set port
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003058 for scp/ssh.
Bram Moolenaar9964e462007-05-05 17:54:07 +00003059 v108: Jan 03, 2007 * included preview map (|netrw-p|), supporting
3060 remote browsing
3061 * netrw can now source remote files
3062 Jan 26, 2007 * Colton Jamieson noted that remote directory
3063 browsing did not support alternate port
3064 selection. This feature has now been extended
3065 to apply to all remote browsing commands via ssh.
3066 (list, remove/delete, rename)
3067 Jan 31, 2007 * Luis Florit reported that @* was an invalid
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003068 register. The @* register is now only saved and
3069 restored if |'guioptions'| contains "a".
Bram Moolenaar9964e462007-05-05 17:54:07 +00003070 Feb 02, 2007 * Fixed a bug that cropped up when writing files
3071 via scp using cygwin
3072 Feb 08, 2007 * tree listing mode managed to stop working again;
3073 fixed again!
3074 Feb 15, 2007 * Guido Van Hoecke reported that netrw didn't
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003075 handle browsing well with M$ ftp servers. He even
Bram Moolenaar9964e462007-05-05 17:54:07 +00003076 set up a temporary account for me to test with
3077 (thanks!). Netrw now can browse M$ ftp servers.
3078 v107: Oct 12, 2006 * bypassed the autowrite option
3079 Oct 24, 2006 * handles automatic decompression of *.gz and *.bz2
3080 files
3081 Nov 03, 2006 * Explore will highlight matching files when
3082 **/pattern is used (and if the |'hls'| option
3083 is set)
3084 Nov 09, 2006 * a debugging line, when enabled, was inadvertently
3085 bringing up help instead of simply reporting on
3086 list contents
3087 Nov 21, 2006 * tree listing improved (cursor remains put)
3088 Nov 27, 2006 * fixed b:netrw_curdir bug when repeated "i"s were
3089 pressed.
3090 Dec 15, 2006 * considerable qty of changes, mostly to share more
3091 code between local and remote browsing. Includes
3092 support for tree-style listing for both remote
3093 and local browsing.
3094 Dec 15, 2006 * Included Peter Bengtsson's modifications to
3095 support the Amiga.
3096 v106: Sep 21, 2006 * removed old v:version<700 code as netrw now
3097 requires vim 7.0
3098 * worked around a bug where register * was
3099 overwritten during local browsing
3100 v104: Sep 05, 2006 * as suggested by Rodolfo Borges, :Explore and
3101 variants will position the cursor on the file
3102 just having been edited
3103 * changed default |g:netrw_sort_sequence| order
3104 * changed b, Nb to simply mb (see |netrw-mb|)
3105 * changed B, NB to simply gb (see |netrw-gb|)
3106 * tree listing style (see |g:netrw_liststyle|)
3107 * attempts to retain the alternate file
3108 v103: Jul 26, 2006 * used Yakov Lerner's tip#1289 to improve netrw
3109 error message display
3110 * wide listings didn't handle files with backslashes
3111 in their names properly. A symptom was an
3112 inability to open files.
3113 Aug 09, 2006 * included "t" mapping for opening tabbed windows,
3114 both for remote and local browsing
3115 * changed netrw_longlist to netrw_liststyle
3116 Aug 15, 2006 * fixed one of the NB maps
3117 Aug 22, 2006 * changed *Explore commands to use -nargs=* instead
3118 of -nargs=?. Allows both -complete=dir _and_ the
3119 starstar arguments to work (-nargs=? seems to
3120 require one or the other).
3121 Aug 23, 2006 * copied all w:.. variables across splits to
3122 new windows
3123 Aug 25, 2006 * when g:netrw_browsex_viewer was '-'
3124 (see |g:netrw_browsex_viewer|) it wasn't causing
3125 netrwFileHandlers#Invoke() to be called as it
3126 was expected to. (tnx Steve Dugaro)
3127 Aug 29, 2006 * changed NetBrowseX() to use "setlocal ... noswf"
3128 instead of "set ... noswf" (tnx Benji Fisher)
3129 Aug 31, 2006 * tabs and fastbrowse<=1 didn't work together.
3130 v102: Jun 15, 2006 * chgd netrwPlugin to call netrw#LocalBrowseCheck()
3131 * bugfix: g:netrw_keepdir==0 had stopped working
3132 Jul 06, 2006 * bugfix: NetOptionSave/Restore now saves/restores
3133 the unnamed register (|registers|)
3134 Jul 07, 2006 * |g:netrw_menu| support included
3135 Jul 13, 2006 * :Texplore command implemented
3136 Jul 17, 2006 * NetSplit and (Local|Net)BrowseChgDir() were both
3137 splitting windows. This affected o, v, and
3138 g:netrw_browse_split.
3139 Jul 20, 2006 * works around wildignore setting (was causing
3140 netrw's local browser not to list wildignore'd
3141 files)
3142 Jul 24, 2006 * <leftmouse> acts as a <cr> for selecting a file
3143 <rightmouse> acts as a <del> for deleting a file
3144 v100: May 14, 2006 * when using Windows and shell==cmd.exe, the
3145 default for g:netrw_ignorenetrc is now 1
3146 * bugfix: unwanted ^Ms now removed
3147 (affected shell==cmd.exe - Windows)
3148 * added Bookmarks and History to the menu
3149 * an error message about non-existing
3150 w:netrw_longlist was appearing during attempts to
3151 Explore (fixed)
3152 * g:netrw_shq now available to make netrw use
3153 specified style of quotes for commands
3154 May 29, 2006 * user NFH_*() functions were inadvertently being
3155 ignored
3156 * fixed a Windows non-cygwin ftp handling problem.
3157 * hiding pattern candidate separators included some
3158 characters it shouldn't have (tnx to Osei Poku)
3159 Jun 01, 2006 * for browsing, netrw was supposed to use "dir"
3160 instead of "ls -lF" when using
3161 ftp+non-cygwin+windows. Fixed.
3162 * an inadvertently left-in-place debugging statement
3163 was preventing use of the "x" key with browsing.
3164 Jun 05, 2006 * g:netrw_nogx available to prevent making the gx
3165 map (see |g:netrw_nogx|)
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003166 * bugfix, Explore wouldn't change directory
Bram Moolenaar9964e462007-05-05 17:54:07 +00003167 properly (vim ., :Explore subdirname)
3168 Jun 06, 2006 * moved history to 2nd line in Netrw menu
3169 * fixed delete for unix-based systems
3170 Jun 07, 2006 * x key now works for windows-noncygwin-ftp
3171 Jun 08, 2006 * Explore */pat and **//pat now wraps
3172 v99: May 09, 2006 * g:netrw_browse_split=3 for opening files in new
3173 tabs implemented.
3174 May 12, 2006 * deletes temporary file at end of NetRead()
3175 * visual mode based Obtain implemented
3176 * added -complete=dir to the various Explore
3177 commands
3178 v98: May 02, 2006 * the "p" key didn't work properly when the browsing
3179 directory name had spaces in it.
3180 v97: May 01, 2006 * exists("&acd") now used to determine if
3181 the 'acd' option exists
3182 * "obtain" now works again under Windows
Bram Moolenaar446cb832008-06-24 21:56:24 +00003183 v96: * bugfix - the |'acd'| option is not always defined
3184 but is now bypassed only when it is
3185 v95: * bugfix - Hiding mode worked correctly (don't show
3186 any file matching any of the g:netrw_hide
3187 patterns), but showing mode was showing only those
3188 files that didn't match any of the g:netrw_hide
3189 patterns. Instead, it now shows all files that
3190 match any of the g:netrw_hide patterns (the
3191 difference between a logical and and logical or).
3192 v94: * bugfix - a Decho() had a missing quote; only
3193 affects things when debugging was enabled.
3194 v93: * bugfix - removed FocusGained event from causing a
3195 slow-browser refresh for Windows
3196 v92: * :Explore **//pattern implemented
3197 (**/filepattern was already taken)
3198 v91: * :Explore */pattern implemented
3199 * |'acd'| option bypassed
3200 v90: * mark ', as suggested by Yegappan Lakshmanan, used
3201 to help guarantee entry into the jump list when
3202 appropriate.
3203 * <s-down> and <s-up> are no longer defined until a
3204 :Explore **/pattern is used (if the user already
3205 has a map for them). They will be defined for new
3206 browser windows from that point forward.
3207 v89: * A <s-down>, <s-up>, :Nexplore, or a :Pexplore
3208 without having first done an :Explore **/pattern
3209 (see |netrw-starstar|) caused
3210 a lot of unhelpful error messages to appear
3211 v88: * moved DrChip.Netrw menu to Netrw. Now has
3212 priority 80 by default.
3213 g:NetrwTopLvlMenu == "Netrw" and can be changed
3214 by the user to suit. The priority is given by
3215 g:NetrwMenuPriority.
3216 * Changed filetype for browser displays from
3217 netrwlist to netrw.
3218 v87: * bug fix -- menus were partially disappearing
3219 v85: * bug fix -- missing an endif
3220 * bug fix -- handles spaces in names and directories
3221 when using ftp-based browsing
3222 v83: * disabled stop-acd handling; the change in directory
3223 handling may allow acd to be used again.
3224 * D was refusing to delete remote files/directories
3225 in wide listing mode.
3226 v81: * FocusGained also used to refresh/wipe local browser
3227 directory buffers
3228 * (bugfix) netrw was leaving [Scratch] buffers behind
3229 when the user had the "hidden" option set. The
3230 'hidden' option is now bypassed.
3231 v80: * ShellCmdPost event used in conjunction with
3232 g:netrw_fastbrowse to refresh/wipe local browser
3233 directory buffers.
3234 v79: * directories are now displayed with nowrap
3235 * (bugfix) if the column width was smaller than the
3236 largest file's name, then netrw would hang when
3237 using wide-listing mode - fixed
3238 * g:netrw_fastbrowse introduced
3239 v78: * progress has been made on allowing spaces inside
3240 directory names for remote work (reading, writing,
3241 browsing). (scp)
3242 v77: * Mikolaj Machowski fixed a bug in a substitute cmd
3243 * g:netrw_browsex_viewer implemented
3244 * Mikolaj Machowski pointed out that gnome-open is
3245 often executable under KDE systems, although it is
3246 effectively not functional. NetBrowseX now looks
3247 for "kicker" as a running process to determine if
3248 KDE is actually running.
3249 * Explorer's O functionality was inadvertently left
3250 out. Netrw now does the same thing, but with the
3251 "P" key.
3252 * added g:netrw_browse_split option
3253 * fixed a bug where the directory contained a "." but
3254 the file didn't (was treating the dirname from "."
3255 onwards as a suffix)
3256 v76: * "directory is missing" error message now restores
3257 echo highlighting
3258 v75: * file://... now conforms to RFC2396 (thanks to
3259 S. Zacchiroli)
3260 * if the binary option is set, then NetWrite() will
3261 only write the whole file (line numbers don't make
3262 sense with this). Supports writing of tar and zip
3263 files.
3264 v74: * bugfix (vim, then :Explore) now works
3265 * ctrl-L keeps cursor at same screen location (both
3266 local and remote browsing)
3267 * netrw now can read remote zip and tar files
3268 * Obtain now uses WinXP ftp+.netrc successfully
3269 v73: * bugfix -- scp://host/path/file was getting named
3270 incorrectly
3271 * netrw detects use of earlier-than-7.0 version of
3272 vim and issues a pertinent error message.
3273 * netrwSettings.vim is now uses autoloading. Only
3274 <netrwPlugin.vim> is needed as a pure plugin
3275 (ie. always loaded).
3276 v72: * bugfix -- formerly, one could prevent the loading
3277 of netrw by "let g:loaded_netrw=1"; when
3278 autoloading became supported, this feature was
3279 lost. It is now restored.
3280 v71: * bugfix -- made some "set nomodifiable"s into
3281 setlocal variants (allows :e somenewfile to be
3282 modifiable as usual)
3283 * NetrwSettings calls a netrw function, thereby
3284 assuring that netrw has loaded. However, if netrw
3285 does not load for whatever reason, then
3286 NetrwSettings will now issue a warning message.
3287 * For what reason I don't recall, when wget and fetch
3288 are both not present, and an attempt to read a
3289 http://... url is made, netrw exited. It now only
3290 returns.
3291 * When ch=1, on the second and subsequent uses of
3292 browsing Netrw would issue a blank line to clear
3293 the echo'd messages. This caused an annoying
3294 "Hit-Enter" prompt; now a blank line message
3295 is echo'd only if &ch>1.
3296 v70: * when using |netrw-O|, the "Obtaining filename"
3297 message is now shown using |hl-User9|. If User9
3298 has not been defined, netrw itself will define it.
3299 v69: * Bugfix: win95/98 machines were experiencing a
3300 "E121: Undefined variable: g:netrw_win95ftp"
3301 message
3302 v68: * double-click-leftmouse selects word under mouse
3303 v67: * Passwords which contain blanks will now be
3304 surrounded by double-quotes automatically (Yongwei)
3305 v66: * Netrw now seems to work with a few more Windows
3306 situations
3307 * O now obtains a file: remote browsing
3308 file -> local copy, locally browsing
3309 file -> current directory (see :pwd)
3310 * i now cycles between thin, long, and wide listing
3311 styles
3312 * NB and Nb are maps that are always available;
3313 corresponding B and b maps are only available when
3314 not using wide listing in order to allow them to
3315 be used for motions
3316 v65: * Browser functions now use NetOptionSave/Restore; in
3317 particular, netrw now works around the report
3318 setting
3319 v64: * Bugfix - browsing a "/" directory (Unix) yielded
3320 buffers named "[Scratch]" instead of "/"
3321 * Bugfix - remote browsing with ftp was omitting
3322 the ./ and ../
3323 v63: * netrw now takes advantage of autoload (needs 7.0)
3324 * Bugfix - using r (to reverse sort) working again
3325 v62: * Bugfix - spaces allowed again in directory names
3326 with g:netrw_keepdir=0. In fact, I've tested netrw
3327 with most ANSI punctuation marks for directory
3328 names.
3329 * Bugfix - NetrwSettings gave errors when
3330 g:netrw_silent had not be set.
3331 v61: * Document upgrade -- netrw variable-based settings
3332 all should have tags. Supports NetrwSettings cmd.
3333 * Several important variables are window-oriented.
3334 Netrw has to transfer these across a window split.
3335 See s:BufWinVars() and s:UseBufWinVars().
3336 v60: * When using the i map to switch between long and
3337 short listings, netrw will now keep cursor on same
3338 line
3339 * "Match # of #" now uses status line
3340 * :Explore **/*.c will now work from a
3341 non-netrw-browser window
3342 * :Explore **/patterns can now be run in separate
3343 browser windows
3344 * active banner (hit <cr> will cause various things
3345 to happen)
3346 v59: * bugfix -- another keepalt work-around installed
3347 (for vim6.3)
3348 * "Match # of #" for Explore **/pattern matches
3349 v58: * Explore and relatives can now handle
3350 **/somefilepattern (v7)
3351 * Nexplore and Pexplore introduced (v7). shift-down
3352 and shift-up cursor keys will invoke Nexplore and
3353 Pexplore, respectively.
3354 * bug fixed with o and v
3355 * autochdir only worked around for vim when it has
3356 been compiled with either
3357 |+netbeans_intg| or |+sun_workshop|
3358 * Under Windows, all directories and files were
3359 being preceded with a "/" when local browsing.
3360 Fixed.
3361 * When: syntax highlighting is off, laststatus=2, and
3362 remote browsing is used, sometimes the laststatus
3363 highlighting bleeds into the entire display. Work
3364 around - do an extra redraw in that case.
3365 * Bugfix: when g:netrw_keepdir=0, due to re-use of
3366 buffers, netrw didn't change the directory when it
3367 should've
3368 * Bugfix: D and R commands work again
3369 v57: * Explore and relatives can now handle RO files
3370 * reverse sort restored with vim7's sort command
3371 * g:netrw_keepdir now being used to keep the current
3372 directory unchanged as intended (sense change)
3373 * vim 6.3 still supported
3374 v56: * LocalBrowse now saves autochdir setting, unsets it,
3375 and restores it before returning.
3376 * using vim's rename() instead of system +
3377 local_rename variable
3378 * avoids changing directory when g:netrw_keepdir is
3379 false
3380 v55: * -bar used with :Explore :Sexplore etc to allow
3381 multiple commands to be separated by |s
3382 * browser listings now use the "nowrap" option
3383 * browser: some unuseful error messages now
3384 suppressed
3385 v54: * For backwards compatibility, Explore and Sexplore
3386 have been implemented. In addition, Hexplore and
3387 Vexplore commands are available, too.
3388 * <amatch> used instead of <afile> in the
3389 transparency support (BufReadCmd, FileReadCmd,
3390 FileWriteCmd)
3391 * ***netrw*** prepended to various error messages
3392 netrw may emit
3393 * g:netrw_port used instead of b:netrw_port for scp
3394 * any leading [:#] is removed from port numbers
3395 v53: * backslashes as well as slashes placed in various
3396 patterns (ex. g:netrw_sort_sequence) to better
3397 support Windows
3398 v52: * nonumber'ing now set for browsing buffers
3399 * when the hiding list hid all files, error messages
3400 ensued. Fixed
3401 * when browsing, swf is set, but directory is not
3402 set, when netrw was attempting to restore options,
3403 vim wanted to save a swapfile to a local directory
3404 using an url-style path. Fixed
3405 v51: * cygwin detection now automated
3406 (using windows and &shell is bash)
3407 * customizable browser "file" rejection patterns
3408 * directory history
3409 * :[range]w url now supported (ie. netrw uses a
3410 FileWriteCmd event)
3411 * error messages have a "Press <cr> to continue" to
3412 allow them to be seen
3413 * directory browser displays no longer bother the
3414 swapfile
3415 * u/U commands to go up and down the history stack
3416 * history stack may be saved with viminfo with it's
3417 "!" option
3418 * bugfixes associated with unwanted [No Files]
3419 entries
3420 v50: * directories now displayed using buftype=nofile;
3421 should keep the directory names as-is
3422 * attempts to remove empty "[No File]" buffers
3423 leftover from :file ..name.. commands
3424 * bugfix: a "caps-lock" editing difficulty left in
3425 v49 was fixed
3426 * syntax highlighting for "Showing:" the hiding list
3427 included
3428 * bookmarks can now be retained if "!" is in the
3429 viminfo option
3430 v49: * will use ftp for http://.../ browsing
3431 v48: * One may use ftp to do remote host file browsing
3432 * (windows and !cygwin) remote browsing with ftp can
3433 now use the "dir" command internally to provide
3434 listings
3435 * g:netrw_keepdir now allows one to keep the initial
3436 current directory as the current directory
3437 (normally the local file browser makes the
3438 currently viewed directory the current directory)
3439 * g:netrw_alto and g:netrw_altv now support
3440 alternate placement of windows started with o or v
3441 * Nread ? and Nwrite ? now uses echomsg (instead of
3442 echo) so :messages can repeat showing the help
3443 * bugfix: avoids problems with partial matches of
3444 directory names to prior buffers with longer names
3445 * one can suppress error messages with g:netrw_quiet
3446 ctrl-h used
3447 * instead of <Leader>h for editing hiding list one
3448 may edit the sorting sequence with the S map, which
3449 now allows confirmation of deletion with
3450 [y(es) n(o) a(ll) q(uit)]
3451 * the "x" map now handles special file viewing with:
3452 (windows) rundll32 url.dll (gnome) gnome-open (kde)
3453 kfmclient If none of these are on the executable
3454 path, then netrwFileHandlers.vim is used.
3455 * directory bookmarking during both local and remote
3456 browsing implemented
3457 * one may view all, use the hiding list to suppress,
3458 or use the hiding list to show-only remote and
3459 local file/directory listings
3460 * improved unusual file and directory name handling
3461 preview window support
3462 v47: * now handles local browsing.
3463 v46: * now handles remote browsing
3464 * g:netrw_silent (if 1) will cause all transfers to
3465 be silent
3466 v45: * made the [user@]hostname:path form a bit more
3467 restrictive to better handle errors in using
3468 protocols (e.g. scp:usr@host:file was being
3469 recognized as an rcp request)
3470 v44: * changed from "rsync -a" to just "rsync"
3471 * somehow an editing error messed up the test to
3472 recognize use of the fetch method for NetRead.
3473 * more debugging statements included
3474 v43: * moved "Explanation" comments to <pi_netrw.txt> help
3475 file as "Network Reference" (|netrw-ref|)
3476 * <netrw.vim> now uses Dfunc() Decho() and Dret() for
3477 debugging
3478 * removed superfluous NetRestorePosn() calls
3479 v42: * now does BufReadPre and BufReadPost events on
3480 file:///* and file://localhost/*
3481 v41: * installed file:///* and file://localhost/* handling
3482 v40: * prevents redraw when a protocol error occurs so
3483 that the user may see it
3484 v39: * sftp support
3485 v38: * Now uses NetRestorePosn() calls with Nread/Nwrite
3486 commands
3487 * Temporary files now removed via bwipe! instead of
3488 bwipe (thanks to Dave Roberts)
3489 v37: * Claar's modifications which test if ftp is
3490 successful, otherwise give an error message
3491 * After a read, the alternate file was pointing to
3492 the temp file. The temp file buffer is now wiped
3493 out.
3494 * removed silent from transfer methods so user can
3495 see what's happening
Bram Moolenaar071d4272004-06-13 20:20:40 +00003496
3497
3498==============================================================================
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100349913. Todo *netrw-todo* {{{1
3500
350107/29/09 : banner :|g:netrw_banner| can be used to suppress the
3502 suppression banner. This feature is new and experimental,
3503 so its in the process of being debugged.
350409/04/09 : "gp" : See if it can be made to work for remote systems.
3505 : See if it can be made to work with marked files.
3506
3507==============================================================================
350814. Credits *netrw-credits* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00003509
3510 Vim editor by Bram Moolenaar (Thanks, Bram!)
3511 dav support by C Campbell
3512 fetch support by Bram Moolenaar and C Campbell
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00003513 ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM>
Bram Moolenaar071d4272004-06-13 20:20:40 +00003514 http support by Bram Moolenaar <bram@moolenaar.net>
3515 rcp
3516 rsync support by C Campbell (suggested by Erik Warendorph)
3517 scp support by raf <raf@comdyn.com.au>
3518 sftp support by C Campbell
3519
3520 inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell
3521
3522 Jérôme Augé -- also using new buffer method with ftp+.netrc
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00003523 Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use,
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003524 fetch,...
Bram Moolenaar071d4272004-06-13 20:20:40 +00003525 Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution
3526 Erik Warendorph -- for several suggestions (g:netrw_..._cmd
3527 variables, rsync etc)
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00003528 Doug Claar -- modifications to test for success with ftp
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003529 operation
Bram Moolenaar071d4272004-06-13 20:20:40 +00003530
3531==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00003532Modelines: {{{1
Bram Moolenaar83bab712005-08-01 21:58:57 +00003533 vim:tw=78:ts=8:ft=help:norl:fdm=marker