blob: ae4a870507b318b1ce077aa9c207a876d05e3b5a [file] [log] [blame]
Bram Moolenaaradc21822011-04-01 18:03:16 +02001*pi_netrw.txt* For Vim version 7.3. Last change: 2011 Apr 01
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 Moolenaaradc21822011-04-01 18:03:16 +02009Copyright: Copyright (C) 1999-2011 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 Moolenaaradc21822011-04-01 18:03:16 +0200446. Transparent Remote 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|
Bram Moolenaaradc21822011-04-01 18:03:16 +020068 Forcing treatment as a file or directory...........|netrw-gd| |netrw-gf|
Bram Moolenaar446cb832008-06-24 21:56:24 +000069 Going Up...........................................|netrw--|
70 Hiding Files Or Directories........................|netrw-a|
71 Improving Browsing.................................|netrw-ssh-hack|
72 Listing Bookmarks And History......................|netrw-qb|
73 Making A New Directory.............................|netrw-d|
Bram Moolenaar83bab712005-08-01 21:58:57 +000074 Making The Browsing Directory The Current Directory|netrw-c|
Bram Moolenaar446cb832008-06-24 21:56:24 +000075 Marking Files......................................|netrw-mf|
76 Marking Files By Regular Expression................|netrw-mr|
77 Marked Files: Arbitrary Command....................|netrw-mx|
78 Marked Files: Compression And Decompression........|netrw-mz|
79 Marked Files: Copying..............................|netrw-mc|
80 Marked Files: Diff.................................|netrw-md|
81 Marked Files: Editing..............................|netrw-me|
82 Marked Files: Grep.................................|netrw-mg|
83 Marked Files: Hiding and Unhiding by Suffix........|netrw-mh|
84 Marked Files: Moving...............................|netrw-mm|
85 Marked Files: Printing.............................|netrw-mp|
86 Marked Files: Sourcing.............................|netrw-ms|
87 Marked Files: Tagging..............................|netrw-mT|
88 Marked Files: Setting the Target Directory.........|netrw-mt|
89 Marked Files: Unmarking............................|netrw-mu|
90 Netrw Browser Variables............................|netrw-browser-var|
91 Netrw Browsing And Option Incompatibilities........|netrw-incompatible|
92 Netrw Settings.....................................|netrw-settings|
93 Obtaining A File...................................|netrw-O|
94 Preview Window.....................................|netrw-p|
95 Previous Window....................................|netrw-P|
96 Refreshing The Listing.............................|netrw-ctrl-l|
97 Renaming Files Or Directories......................|netrw-move|
98 Reversing Sorting Order............................|netrw-r|
99 Selecting Sorting Style............................|netrw-s|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100100 Setting Editing Window.............................|netrw-C|
Bram Moolenaar9964e462007-05-05 17:54:07 +000010110. Problems and Fixes...................................|netrw-problems|
Bram Moolenaar446cb832008-06-24 21:56:24 +000010211. Debugging Netrw Itself...............................|netrw-debug|
Bram Moolenaar9964e462007-05-05 17:54:07 +000010312. History..............................................|netrw-history|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010010413. Todo.................................................|netrw-todo|
10514. Credits..............................................|netrw-credits|
Bram Moolenaar071d4272004-06-13 20:20:40 +0000106
Bram Moolenaar071d4272004-06-13 20:20:40 +0000107{Vi does not have any of this}
108
109==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00001102. Starting With Netrw *netrw-start* {{{1
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000111
Bram Moolenaar446cb832008-06-24 21:56:24 +0000112Netrw makes reading files, writing files, browsing over a network, and
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100113local browsing easy! First, make sure that you have plugins enabled, so
Bram Moolenaar446cb832008-06-24 21:56:24 +0000114you'll need to have at least the following in your <.vimrc>:
115(or see |netrw-activate|) >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000116
Bram Moolenaar9964e462007-05-05 17:54:07 +0000117 set nocp " 'compatible' is not set
118 filetype plugin on " plugins are enabled
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000119<
120(see |'cp'| and |:filetype-plugin-on|)
121
122Netrw supports "transparent" editing of files on other machines using urls
123(see |netrw-transparent|). As an example of this, let's assume you have an
Bram Moolenaar446cb832008-06-24 21:56:24 +0000124account on some other machine; if you can use scp, try: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000125
126 vim scp://hostname/path/to/file
127<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000128Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|!
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000129
Bram Moolenaar446cb832008-06-24 21:56:24 +0000130So, what if you have ftp, not ssh/scp? That's easy, too; try >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000131
132 vim ftp://hostname/path/to/file
133<
134Want to make ftp simpler to use? See if your ftp supports a file called
135<.netrc> -- typically it goes in your home directory, has read/write
136permissions for only the user to read (ie. not group, world, other, etc),
137and has lines resembling >
138
139 machine HOSTNAME login USERID password "PASSWORD"
140 machine HOSTNAME login USERID password "PASSWORD"
141 ...
Bram Moolenaar9964e462007-05-05 17:54:07 +0000142 default login USERID password "PASSWORD"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000143<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000144Now about browsing -- when you just want to look around before editing a
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000145file. For browsing on your current host, just "edit" a directory: >
146
147 vim .
148 vim /home/userid/path
149<
150For browsing on a remote host, "edit" a directory (but make sure that
151the directory name is followed by a "/"): >
152
153 vim scp://hostname/
154 vim ftp://hostname/path/to/dir/
155<
156See |netrw-browse| for more!
157
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100158There are more protocols supported by netrw than just scp and ftp, too: see the
159next section, |netrw-externapp|, on how to use these external applications with
160netrw and vim.
161
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200162PREVENTING LOADING *netrw-noload*
Bram Moolenaar446cb832008-06-24 21:56:24 +0000163
164If you want to use plugins, but for some reason don't wish to use netrw, then
165you need to avoid loading both the plugin and the autoload portions of netrw.
166You may do so by placing the following two lines in your <.vimrc>: >
167
168 :let g:loaded_netrw = 1
169 :let g:loaded_netrwPlugin = 1
170<
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000171
172==============================================================================
Bram Moolenaar00a927d2010-05-14 23:24:24 +02001733. Netrw Reference *netrw-ref* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000174
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100175 Netrw supports several protocols in addition to scp and ftp as mentioned
Bram Moolenaar446cb832008-06-24 21:56:24 +0000176 in |netrw-start|. These include dav, fetch, http,... well, just look
177 at the list in |netrw-externapp|. Each protocol is associated with a
178 variable which holds the default command supporting that protocol.
179
180EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000181
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000182 Protocol Variable Default Value
183 -------- ---------------- -------------
Bram Moolenaaradc21822011-04-01 18:03:16 +0200184 dav: *g:netrw_dav_cmd* = "cadaver" if cadaver is executable
185 dav: g:netrw_dav_cmd = "curl -o" elseif curl is available
186 fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available
187 ftp: *g:netrw_ftp_cmd* = "ftp"
188 http: *g:netrw_http_cmd* = "elinks" if elinks is available
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100189 http: g:netrw_http_cmd = "links" elseif links is available
190 http: g:netrw_http_cmd = "curl" elseif curl is available
191 http: g:netrw_http_cmd = "wget" elseif wget is available
192 http: g:netrw_http_cmd = "fetch" elseif fetch is available
Bram Moolenaaradc21822011-04-01 18:03:16 +0200193 rcp: *g:netrw_rcp_cmd* = "rcp"
194 rsync: *g:netrw_rsync_cmd* = "rsync -a"
195 scp: *g:netrw_scp_cmd* = "scp -q"
196 sftp: *g:netrw_sftp_cmd* = "sftp"
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100197
198 *g:netrw_http_xcmd* : the option string for http://... protocols are
199 specified via this variable and may be independently overridden. By
200 default, the option arguments for the http-handling commands are: >
201
202 elinks : "-source >"
203 links : "-source >"
204 curl : "-o"
205 wget : "-q -O"
206 fetch : "-o"
207<
208 For example, if your system has elinks, and you'd rather see the
209 page using an attempt at rendering the text, you may wish to have >
210 let g:netrw_http_xcmd= "-dump >"
211< in your .vimrc.
212
Bram Moolenaar071d4272004-06-13 20:20:40 +0000213
Bram Moolenaar446cb832008-06-24 21:56:24 +0000214READING *netrw-read* *netrw-nread* {{{2
215
216 Generally, one may just use the url notation with a normal editing
217 command, such as >
218
219 :e ftp://[user@]machine/path
220<
221 Netrw also provides the Nread command:
222
Bram Moolenaar071d4272004-06-13 20:20:40 +0000223 :Nread ? give help
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000224 :Nread "machine:path" uses rcp
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000225 :Nread "machine path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000226 :Nread "machine id password path" uses ftp
227 :Nread "dav://machine[:port]/path" uses cadaver
228 :Nread "fetch://[user@]machine/path" uses fetch
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000229 :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000230 :Nread "http://[user@]machine/path" uses http uses wget
231 :Nread "rcp://[user@]machine/path" uses rcp
232 :Nread "rsync://[user@]machine[:port]/path" uses rsync
233 :Nread "scp://[user@]machine[[:#]port]/path" uses scp
234 :Nread "sftp://[user@]machine/path" uses sftp
Bram Moolenaar071d4272004-06-13 20:20:40 +0000235
Bram Moolenaar446cb832008-06-24 21:56:24 +0000236WRITING *netrw-write* *netrw-nwrite* {{{2
237
238 One may just use the url notation with a normal file writing
239 command, such as >
240
241 :w ftp://[user@]machine/path
242<
243 Netrw also provides the Nwrite command:
244
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000245 :Nwrite ? give help
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000246 :Nwrite "machine:path" uses rcp
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000247 :Nwrite "machine path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000248 :Nwrite "machine id password path" uses ftp
249 :Nwrite "dav://machine[:port]/path" uses cadaver
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000250 :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000251 :Nwrite "rcp://[user@]machine/path" uses rcp
252 :Nwrite "rsync://[user@]machine[:port]/path" uses rsync
253 :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp
254 :Nwrite "sftp://[user@]machine/path" uses sftp
Bram Moolenaar071d4272004-06-13 20:20:40 +0000255 http: not supported!
256
Bram Moolenaar446cb832008-06-24 21:56:24 +0000257SOURCING *netrw-source* {{{2
258
259 One may just use the url notation with the normal file sourcing
260 command, such as >
261
262 :so ftp://[user@]machine/path
263<
264 Netrw also provides the Nsource command:
265
Bram Moolenaar9964e462007-05-05 17:54:07 +0000266 :Nsource ? give help
267 :Nsource "dav://machine[:port]/path" uses cadaver
268 :Nsource "fetch://[user@]machine/path" uses fetch
269 :Nsource "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
270 :Nsource "http://[user@]machine/path" uses http uses wget
271 :Nsource "rcp://[user@]machine/path" uses rcp
272 :Nsource "rsync://[user@]machine[:port]/path" uses rsync
273 :Nsource "scp://[user@]machine[[:#]port]/path" uses scp
274 :Nsource "sftp://[user@]machine/path" uses sftp
275
Bram Moolenaar446cb832008-06-24 21:56:24 +0000276DIRECTORY LISTING *netrw-dirlist* {{{2
277
278 One may browse a directory to get a listing by simply attempting to
279 edit the directory: >
280
281 :e scp://[user]@hostname/path/
282 :e ftp://[user]@hostname/path/
283<
284 For remote directories (ie. those using scp or ftp), that trailing
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100285 "/" is necessary (the slash tells netrw to treat the argument as a
286 directory to browse instead of a file to download).
Bram Moolenaar446cb832008-06-24 21:56:24 +0000287
288 However, the Nread command can also be used to accomplish this:
289
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000290 :Nread [protocol]://[user]@hostname/path/
291
Bram Moolenaar446cb832008-06-24 21:56:24 +0000292 *netrw-login* *netrw-password*
293CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000294
Bram Moolenaar071d4272004-06-13 20:20:40 +0000295 Attempts to use ftp will prompt you for a user-id and a password.
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000296 These will be saved in global variables g:netrw_uid and
Bram Moolenaar446cb832008-06-24 21:56:24 +0000297 s:netrw_passwd; subsequent uses of ftp will re-use those two items to
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000298 simplify the further use of ftp. However, if you need to use a
299 different user id and/or password, you'll want to call NetUserPass()
300 first. To work around the need to enter passwords, check if your ftp
301 supports a <.netrc> file in your home directory. Also see
302 |netrw-passwd| (and if you're using ssh/scp hoping to figure out how
Bram Moolenaar446cb832008-06-24 21:56:24 +0000303 to not need to use passwords, look at |netrw-ssh-hack|).
Bram Moolenaar071d4272004-06-13 20:20:40 +0000304
305 :NetUserPass [uid [password]] -- prompts as needed
306 :call NetUserPass() -- prompts for uid and password
307 :call NetUserPass("uid") -- prompts for password
308 :call NetUserPass("uid","password") -- sets global uid and password
309
Bram Moolenaar446cb832008-06-24 21:56:24 +0000310NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2
311(also see: |netrw-browser-var| |netrw-protocol| |netrw-settings| |netrw-var|)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000312
Bram Moolenaar446cb832008-06-24 21:56:24 +0000313Netrw provides a lot of variables which allow you to customize netrw to your
314preferences. One way to look at them is via the command :NetrwSettings (see
315|netrw-settings|) which will display your current netrw settings. Most such
316settings are described below, in |netrw-browser-options|, and in
317|netrw-externapp|:
Bram Moolenaar9964e462007-05-05 17:54:07 +0000318
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100319 *b:netrw_lastfile* last file Network-read/written retained on a
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200320 per-buffer basis (supports plain :Nw )
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100321
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +0200322 *g:netrw_bufsettings* the settings that netrw buffers have
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200323 (default) noma nomod nonu nowrap ro nobl
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +0200324
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100325 *g:netrw_chgwin* specifies a window number where file edits will take
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200326 place. (also see |netrw-C|)
327 (default) not defined
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100328
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +0200329 *g:Netrw_funcref* specifies a function (or functions) to be called when
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200330 netrw edits a file. The file is first edited, and
331 then the function reference (|Funcref|) is called.
332 This variable may also hold a |List| of Funcrefs.
333 (default) not defined
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +0200334>
335 Example: place in .vimrc; affects all file opening
336 fun! MyFuncRef()
337 endfun
338 let g:Netrw_funcref= function("MyFuncRef")
339<
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000340 *g:netrw_ftp* if it doesn't exist, use default ftp
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200341 =0 use default ftp (uid password)
342 =1 use alternate ftp method (user uid password)
343 If you're having trouble with ftp, try changing the
344 value of this variable to see if the alternate ftp
345 method works for your setup.
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000346
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100347 *g:netrw_ftpextracmd* default: doesn't exist
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200348 If this variable exists, then any string it contains
349 will be placed into the commands set to your ftp
350 client. As an example:
351 ="passive"
Bram Moolenaar9964e462007-05-05 17:54:07 +0000352
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000353 *g:netrw_ftpmode* ="binary" (default)
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200354 ="ascii"
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000355
Bram Moolenaar9964e462007-05-05 17:54:07 +0000356 *g:netrw_ignorenetrc* =0 (default for linux, cygwin)
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200357 =1 If you have a <.netrc> file but it doesn't work and
358 you want it ignored, then set this variable as
359 shown. (default for Windows + cmd.exe)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000360
361 *g:netrw_menu* =0 disable netrw's menu
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200362 =1 (default) netrw's menu enabled
Bram Moolenaar9964e462007-05-05 17:54:07 +0000363
364 *g:netrw_nogx* if this variable exists, then the "gx" map will not
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200365 be available (see |netrw-gx|)
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000366
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100367 *g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis
368 *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis
Bram Moolenaar446cb832008-06-24 21:56:24 +0000369
370 *g:netrw_preview* =0 (default) preview window shown in a horizontally
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200371 split window
372 =1 preview window shown in a vertically split window.
373 Also affects the "previous window" (see |netrw-P|) in
374 the same way.
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000375
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000376 *g:netrw_scpport* = "-P" : option to use to set port for scp
377 *g:netrw_sshport* = "-p" : option to use to set port for ssh
378
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100379 *g:netrw_sepchr* =\0xff
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200380 =\0x01 for enc == euc-jp (and perhaps it should be for
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100381 others, too, please let me
382 know)
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200383 Separates priority codes from filenames internally.
384 See |netrw-p12|.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100385
Bram Moolenaar446cb832008-06-24 21:56:24 +0000386 *g:netrw_silent* =0 : transfers done normally
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200387 =1 : transfers done silently
Bram Moolenaar446cb832008-06-24 21:56:24 +0000388
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000389 *g:netrw_use_errorwindow* =1 : messages from netrw will use a separate one
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200390 line window. This window provides reliable
391 delivery of messages. (default)
392 =0 : messages from netrw will use echoerr ;
393 messages don't always seem to show up this
394 way, but one doesn't have to quit the window.
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000395
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000396 *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200397 lines that o/s's ftp "provides" on transfers
398 =0 force normal ftp behavior (no trailing line removal)
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000399
400 *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200401 permits network browsing to use ls with time and
402 size sorting (default if windows)
403 =0 assume Windows' scp accepts windows-style paths
404 Network browsing uses dir instead of ls
405 This option is ignored if you're using unix
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000406
407 *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200408 =1 use WinNT's rcp in binary mode (default)
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000409
Bram Moolenaar446cb832008-06-24 21:56:24 +0000410PATHS *netrw-path* {{{2
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000411
412Paths to files are generally user-directory relative for most protocols.
413It is possible that some protocol will make paths relative to some
414associated directory, however.
415>
416 example: vim scp://user@host/somefile
417 example: vim scp://user@host/subdir1/subdir2/somefile
418<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000419where "somefile" is in the "user"'s home directory. If you wish to get a
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000420file using root-relative paths, use the full path:
421>
422 example: vim scp://user@host//somefile
423 example: vim scp://user@host//subdir1/subdir2/somefile
424<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000425
426==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00004274. Network-Oriented File Transfer *netrw-xfer* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000428
429Network-oriented file transfer under Vim is implemented by a VimL-based script
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000430(<netrw.vim>) using plugin techniques. It currently supports both reading and
431writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch,
Bram Moolenaar071d4272004-06-13 20:20:40 +0000432dav/cadaver, rsync, or sftp.
433
434http is currently supported read-only via use of wget or fetch.
435
436<netrw.vim> is a standard plugin which acts as glue between Vim and the
437various file transfer programs. It uses autocommand events (BufReadCmd,
438FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. >
439
440 ex. vim ftp://hostname/path/to/file
441<
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000442The characters preceding the colon specify the protocol to use; in the
Bram Moolenaar446cb832008-06-24 21:56:24 +0000443example, it's ftp. The <netrw.vim> script then formulates a command or a
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000444series of commands (typically ftp) which it issues to an external program
445(ftp, scp, etc) which does the actual file transfer/protocol. Files are read
446from/written to a temporary file (under Unix/Linux, /tmp/...) which the
447<netrw.vim> script will clean up.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000448
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100449Now, a word about Jan Minář's "FTP User Name and Password Disclosure"; first,
450ftp is not a secure protocol. User names and passwords are transmitted "in
451the clear" over the internet; any snooper tool can pick these up; this is not
452a netrw thing, this is a ftp thing. If you're concerned about this, please
453try to use scp or sftp instead.
454
455Netrw re-uses the user id and password during the same vim session and so long
456as the remote hostname remains the same.
457
458Jan seems to be a bit confused about how netrw handles ftp; normally multiple
459commands are performed in a "ftp session", and he seems to feel that the
460uid/password should only be retained over one ftp session. However, netrw
461does every ftp operation in a separate "ftp session"; so remembering the
462uid/password for just one "ftp session" would be the same as not remembering
463the uid/password at all. IMHO this would rapidly grow tiresome as one
464browsed remote directories, for example.
465
466On the other hand, thanks go to Jan M. for pointing out the many
467vulnerabilities that netrw (and vim itself) had had in handling "crafted"
468filenames. The |shellescape()| and |fnameescape()| functions were written in
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +0200469response by Bram Moolenaar to handle these sort of problems, and netrw has
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100470been modified to use them. Still, my advice is, if the "filename" looks like
471a vim command that you aren't comfortable with having executed, don't open it.
472
Bram Moolenaar9964e462007-05-05 17:54:07 +0000473 *netrw-putty* *netrw-pscp* *netrw-psftp*
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000474One may modify any protocol's implementing external application by setting a
475variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000476"scp -q"). As an example, consider using PuTTY: >
Bram Moolenaar9964e462007-05-05 17:54:07 +0000477
478 let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch'
479 let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"'
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000480<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000481See |netrw-p8| for more about putty, pscp, psftp, etc.
482
Bram Moolenaar071d4272004-06-13 20:20:40 +0000483Ftp, an old protocol, seems to be blessed by numerous implementations.
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000484Unfortunately, some implementations are noisy (ie., add junk to the end of the
485file). Thus, concerned users may decide to write a NetReadFixup() function
486that will clean up after reading with their ftp. Some Unix systems (ie.,
487FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is
488not noisy and more convenient, actually, for <netrw.vim> to use.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100489Consequently, if "fetch" is available (ie. executable), it may be preferable
490to use it for ftp://... based transfers.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000491
492For rcp, scp, sftp, and http, one may use network-oriented file transfers
Bram Moolenaar83bab712005-08-01 21:58:57 +0000493transparently; ie.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000494>
495 vim rcp://[user@]machine/path
496 vim scp://[user@]machine/path
497<
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100498If your ftp supports <.netrc>, then it too can be transparently used
Bram Moolenaar071d4272004-06-13 20:20:40 +0000499if the needed triad of machine name, user id, and password are present in
500that file. Your ftp must be able to use the <.netrc> file on its own, however.
501>
502 vim ftp://[user@]machine[[:#]portnumber]/path
503<
Bram Moolenaaradc21822011-04-01 18:03:16 +0200504Windows provides an ftp (typically c:\Windows\System32\ftp.exe) which uses
505an option, -s:filename (filename can and probably should be a full path)
506which contains ftp commands which will be automatically run whenever ftp
507starts. You may use this feature to enter a user and password for one site: >
508 userid
509 password
510If |g:netrw_ftp_cmd| contains -s:[path/]MACHINE, then (on Windows machines only)
511netrw will substitute the current machine name requested for ftp connection
512for MACHINE. Hence one can have multiple machine.ftp files containing login
513and password for ftp. Example: >
514
515 g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE'
516 vim ftp://myhost.somewhere.net/
517will use a file >
518 C:\Users\Myself\myhost.ftp
519<
520Often, ftp will need to query the user for the userid and password.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000521The latter will be done "silently"; ie. asterisks will show up instead of
Bram Moolenaar071d4272004-06-13 20:20:40 +0000522the actually-typed-in password. Netrw will retain the userid and password
523for subsequent read/writes from the most recent transfer so subsequent
524transfers (read/write) to or from that machine will take place without
525additional prompting.
526
527 *netrw-urls*
528 +=================================+============================+============+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000529 | Reading | Writing | Uses |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000530 +=================================+============================+============+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000531 | DAV: | | |
532 | dav://host/path | | cadaver |
533 | :Nread dav://host/path | :Nwrite dav://host/path | cadaver |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000534 +---------------------------------+----------------------------+------------+
Bram Moolenaar446cb832008-06-24 21:56:24 +0000535 | DAV + SSL: | | |
536 | davs://host/path | | cadaver |
537 | :Nread davs://host/path | :Nwrite davs://host/path | cadaver |
538 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000539 | FETCH: | | |
540 | fetch://[user@]host/path | | |
541 | fetch://[user@]host:http/path | Not Available | fetch |
542 | :Nread fetch://[user@]host/path| | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000543 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000544 | FILE: | | |
545 | file:///* | file:///* | |
546 | file://localhost/* | file://localhost/* | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000547 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000548 | FTP: (*3) | (*3) | |
549 | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) |
550 | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc |
551 | :Nread host path | :Nwrite host path | ftp+.netrc |
552 | :Nread host uid pass path | :Nwrite host uid pass path | ftp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000553 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000554 | HTTP: wget is executable: (*4) | | |
555 | http://[user@]host/path | Not Available | wget |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000556 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000557 | HTTP: fetch is executable (*4) | | |
558 | http://[user@]host/path | Not Available | fetch |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000559 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000560 | RCP: | | |
561 | rcp://[user@]host/path | rcp://[user@]host/path | rcp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000562 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000563 | RSYNC: | | |
564 | rsync://[user@]host/path | rsync://[user@]host/path | rsync |
565 | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync |
566 | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000567 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000568 | SCP: | | |
569 | scp://[user@]host/path | scp://[user@]host/path | scp |
570 | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000571 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000572 | SFTP: | | |
573 | sftp://[user@]host/path | sftp://[user@]host/path | sftp |
574 | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000575 +=================================+============================+============+
576
577 (*1) For an absolute path use scp://machine//path.
578
579 (*2) if <.netrc> is present, it is assumed that it will
580 work with your ftp client. Otherwise the script will
Bram Moolenaar9964e462007-05-05 17:54:07 +0000581 prompt for user-id and password.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000582
Bram Moolenaar9964e462007-05-05 17:54:07 +0000583 (*3) for ftp, "machine" may be machine#port or machine:port
Bram Moolenaar071d4272004-06-13 20:20:40 +0000584 if a different port is needed than the standard ftp port
585
586 (*4) for http:..., if wget is available it will be used. Otherwise,
587 if fetch is available it will be used.
588
589Both the :Nread and the :Nwrite ex-commands can accept multiple filenames.
590
591
592NETRC *netrw-netrc*
593
Bram Moolenaar446cb832008-06-24 21:56:24 +0000594The <.netrc> file, typically located in your home directory, contains lines
595therein which map a hostname (machine name) to the user id and password you
596prefer to use with it.
597
Bram Moolenaar071d4272004-06-13 20:20:40 +0000598The typical syntax for lines in a <.netrc> file is given as shown below.
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000599Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000600>
601 machine {full machine name} login {user-id} password "{password}"
602 default login {user-id} password "{password}"
603
604Your ftp client must handle the use of <.netrc> on its own, but if the
605<.netrc> file exists, an ftp transfer will not ask for the user-id or
606password.
607
608 Note:
609 Since this file contains passwords, make very sure nobody else can
610 read this file! Most programs will refuse to use a .netrc that is
611 readable for others. Don't forget that the system administrator can
Bram Moolenaar446cb832008-06-24 21:56:24 +0000612 still read the file! Ie. for Linux/Unix: chmod 600 .netrc
Bram Moolenaar071d4272004-06-13 20:20:40 +0000613
614
615PASSWORD *netrw-passwd*
616
617The script attempts to get passwords for ftp invisibly using |inputsecret()|,
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200618a built-in Vim function. See |netrw-userpass| for how to change the password
Bram Moolenaar071d4272004-06-13 20:20:40 +0000619after one has set it.
620
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000621Unfortunately there doesn't appear to be a way for netrw to feed a password to
622scp. Thus every transfer via scp will require re-entry of the password.
Bram Moolenaar446cb832008-06-24 21:56:24 +0000623However, |netrw-ssh-hack| can help with this problem.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000624
625
626==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00006275. Activation *netrw-activate* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000628
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000629Network-oriented file transfers are available by default whenever Vim's
Bram Moolenaar446cb832008-06-24 21:56:24 +0000630|'nocompatible'| mode is enabled. Netrw's script files reside in your
631system's plugin, autoload, and syntax directories; just the
632plugin/netrwPlugin.vim script is sourced automatically whenever you bring up
633vim. The main script in autoload/netrw.vim is only loaded when you actually
634use netrw. I suggest that, at a minimum, you have at least the following in
635your <.vimrc> customization file: >
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000636
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000637 set nocp
638 if version >= 600
639 filetype plugin indent on
640 endif
641<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000642
643==============================================================================
Bram Moolenaaradc21822011-04-01 18:03:16 +02006446. Transparent Remote File Editing *netrw-transparent* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000645
646Transparent file transfers occur whenever a regular file read or write
Bram Moolenaar446cb832008-06-24 21:56:24 +0000647(invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd|
648events) is made. Thus one may read, write, or source files across networks
649just as easily as if they were local files! >
Bram Moolenaar071d4272004-06-13 20:20:40 +0000650
651 vim ftp://[user@]machine/path
652 ...
653 :wq
654
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000655See |netrw-activate| for more on how to encourage your vim to use plugins
656such as netrw.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000657
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000658
Bram Moolenaar071d4272004-06-13 20:20:40 +0000659==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00006607. Ex Commands *netrw-ex* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000661
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000662The usual read/write commands are supported. There are also a few
Bram Moolenaar446cb832008-06-24 21:56:24 +0000663additional commands available. Often you won't need to use Nwrite or
Bram Moolenaar9964e462007-05-05 17:54:07 +0000664Nread as shown in |netrw-transparent| (ie. simply use >
665 :e url
666 :r url
667 :w url
668instead, as appropriate) -- see |netrw-urls|. In the explanations
669below, a {netfile} is an url to a remote file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000670
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200671 *:Nwrite* *:Nw*
Bram Moolenaar446cb832008-06-24 21:56:24 +0000672:[range]Nw[rite] Write the specified lines to the current
Bram Moolenaar071d4272004-06-13 20:20:40 +0000673 file as specified in b:netrw_lastfile.
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200674 (related: |netrw-nwrite|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000675
Bram Moolenaar446cb832008-06-24 21:56:24 +0000676:[range]Nw[rite] {netfile} [{netfile}]...
Bram Moolenaar071d4272004-06-13 20:20:40 +0000677 Write the specified lines to the {netfile}.
678
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200679 *:Nread* *:Nr*
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100680:Nr[ead] Read the lines from the file specified in b:netrw_lastfile
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200681 into the current buffer. (related: |netrw-nread|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000682
Bram Moolenaar446cb832008-06-24 21:56:24 +0000683:Nr[ead] {netfile} {netfile}...
Bram Moolenaar071d4272004-06-13 20:20:40 +0000684 Read the {netfile} after the current line.
685
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200686 *:Nsource* *:Ns*
Bram Moolenaar446cb832008-06-24 21:56:24 +0000687:Ns[ource] {netfile}
Bram Moolenaar9964e462007-05-05 17:54:07 +0000688 Source the {netfile}.
689 To start up vim using a remote .vimrc, one may use
690 the following (all on one line) (tnx to Antoine Mechelynck) >
691 vim -u NORC -N
692 --cmd "runtime plugin/netrwPlugin.vim"
693 --cmd "source scp://HOSTNAME/.vimrc"
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200694< (related: |netrw-source|)
695
696:call NetUserPass() *NetUserPass()*
Bram Moolenaar446cb832008-06-24 21:56:24 +0000697 If g:netrw_uid and s:netrw_passwd don't exist,
698 this function will query the user for them.
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200699 (related: |netrw-userpass|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000700
701:call NetUserPass("userid")
Bram Moolenaar446cb832008-06-24 21:56:24 +0000702 This call will set the g:netrw_uid and, if
Bram Moolenaar071d4272004-06-13 20:20:40 +0000703 the password doesn't exist, will query the user for it.
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200704 (related: |netrw-userpass|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000705
706:call NetUserPass("userid","passwd")
Bram Moolenaar446cb832008-06-24 21:56:24 +0000707 This call will set both the g:netrw_uid and s:netrw_passwd.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000708 The user-id and password are used by ftp transfers. One may
Bram Moolenaar446cb832008-06-24 21:56:24 +0000709 effectively remove the user-id and password by using empty
710 strings (ie. "").
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200711 (related: |netrw-userpass|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000712
Bram Moolenaar9964e462007-05-05 17:54:07 +0000713:NetrwSettings This command is described in |netrw-settings| -- used to
714 display netrw settings and change netrw behavior.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000715
Bram Moolenaar071d4272004-06-13 20:20:40 +0000716
717==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00007188. Variables and Options *netrw-options* *netrw-var* {{{1
719
720(if you're interested in the netrw browser settings, see: |netrw-browser-var|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000721
Bram Moolenaar9964e462007-05-05 17:54:07 +0000722The <netrw.vim> script provides several variables which act as options to
Bram Moolenaar446cb832008-06-24 21:56:24 +0000723affect <netrw.vim>'s file transfer behavior. These variables typically may be
724set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|)
Bram Moolenaar446cb832008-06-24 21:56:24 +0000725>
Bram Moolenaar9964e462007-05-05 17:54:07 +0000726 -------------
727 Netrw Options
728 -------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000729 Option Meaning
730 -------------- -----------------------------------------------
731<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000732 b:netrw_col Holds current cursor position (during NetWrite)
733 g:netrw_cygwin =1 assume scp under windows is from cygwin
734 (default/windows)
735 =0 assume scp under windows accepts windows
736 style paths (default/else)
737 g:netrw_ftp =0 use default ftp (uid password)
738 g:netrw_ftpmode ="binary" (default)
739 ="ascii" (your choice)
740 g:netrw_ignorenetrc =1 (default)
741 if you have a <.netrc> file but you don't
Bram Moolenaar071d4272004-06-13 20:20:40 +0000742 want it used, then set this variable. Its
743 mere existence is enough to cause <.netrc>
744 to be ignored.
Bram Moolenaar9964e462007-05-05 17:54:07 +0000745 b:netrw_lastfile Holds latest method/machine/path.
746 b:netrw_line Holds current line number (during NetWrite)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000747 g:netrw_silent =0 transfers done normally
748 =1 transfers done silently
749 g:netrw_uid Holds current user-id for ftp.
Bram Moolenaar9964e462007-05-05 17:54:07 +0000750 g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
751 =1 use WinNT/2K/XP's rcp, binary mode
752 g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc
753 =1 use default method to do ftp >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000754 -----------------------------------------------------------------------
755<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000756The script will also make use of the following variables internally, albeit
757temporarily.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000758>
759 -------------------
760 Temporary Variables
761 -------------------
762 Variable Meaning
763 -------- ------------------------------------
764<
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100765 b:netrw_method Index indicating rcp/ftp+.netrc/ftp
766 w:netrw_method (same as b:netrw_method)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000767 g:netrw_machine Holds machine name parsed from input
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100768 b:netrw_fname Holds filename being accessed >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000769 ------------------------------------------------------------
770<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000771 *netrw-protocol*
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000772
773Netrw supports a number of protocols. These protocols are invoked using the
774variables listed below, and may be modified by the user.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000775>
776 ------------------------
Bram Moolenaar9964e462007-05-05 17:54:07 +0000777 Protocol Control Options
Bram Moolenaar071d4272004-06-13 20:20:40 +0000778 ------------------------
Bram Moolenaar9964e462007-05-05 17:54:07 +0000779 Option Type Setting Meaning
780 --------- -------- -------------- ---------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000781<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000782 netrw_ftp variable =doesn't exist userid set by "user userid"
783 =0 userid set by "user userid"
784 =1 userid set by "userid"
785 NetReadFixup function =doesn't exist no change
786 =exists Allows user to have files
787 read via ftp automatically
788 transformed however they wish
789 by NetReadFixup()
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100790 g:netrw_dav_cmd variable ="cadaver" if cadaver is executable
791 g:netrw_dav_cmd variable ="curl -o" elseif curl is executable
Bram Moolenaar9964e462007-05-05 17:54:07 +0000792 g:netrw_fetch_cmd variable ="fetch -o" if fetch is available
Bram Moolenaar071d4272004-06-13 20:20:40 +0000793 g:netrw_ftp_cmd variable ="ftp"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000794 g:netrw_http_cmd variable ="fetch -o" if fetch is available
795 g:netrw_http_cmd variable ="wget -O" else if wget is available
Bram Moolenaar9964e462007-05-05 17:54:07 +0000796 g:netrw_list_cmd variable ="ssh USEPORT HOSTNAME ls -Fa"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000797 g:netrw_rcp_cmd variable ="rcp"
798 g:netrw_rsync_cmd variable ="rsync -a"
799 g:netrw_scp_cmd variable ="scp -q"
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000800 g:netrw_sftp_cmd variable ="sftp" >
801 -------------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000802<
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000803 *netrw-ftp*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000804
Bram Moolenaar9964e462007-05-05 17:54:07 +0000805The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|)
806specify the external program to use handle the ftp protocol. They may
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +0200807include command line options (such as -p for passive mode). Example: >
Bram Moolenaar071d4272004-06-13 20:20:40 +0000808
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +0200809 let g:netrw_ftp_cmd= "ftp -p"
810<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000811Browsing is supported by using the |g:netrw_list_cmd|; the substring
812"HOSTNAME" will be changed via substitution with whatever the current request
813is for a hostname.
814
815Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's
816that give trouble . In order to best understand how to use these options if
817ftp is giving you troubles, a bit of discussion is provided on how netrw does
818ftp reads.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000819
820For ftp, netrw typically builds up lines of one of the following formats in a
Bram Moolenaar071d4272004-06-13 20:20:40 +0000821temporary file:
822>
823 IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1
824 ---------------------------------- ------------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000825<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000826 open machine [port] open machine [port]
827 user userid password userid password
828 [g:netrw_ftpmode] password
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200829 [g:netrw_ftpextracmd] [g:netrw_ftpmode]
Bram Moolenaar9964e462007-05-05 17:54:07 +0000830 get filename tempfile [g:netrw_extracmd]
831 get filename tempfile >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000832 ---------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000833<
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200834The |g:netrw_ftpmode| and |g:netrw_ftpextracmd| are optional.
Bram Moolenaar9964e462007-05-05 17:54:07 +0000835
Bram Moolenaar071d4272004-06-13 20:20:40 +0000836Netrw then executes the lines above by use of a filter:
837>
838 :%! {g:netrw_ftp_cmd} -i [-n]
839<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000840where
841 g:netrw_ftp_cmd is usually "ftp",
842 -i tells ftp not to be interactive
843 -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>)
844
845If <.netrc> exists it will be used to avoid having to query the user for
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000846userid and password. The transferred file is put into a temporary file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000847The temporary file is then read into the main editing session window that
848requested it and the temporary file deleted.
849
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000850If your ftp doesn't accept the "user" command and immediately just demands a
851userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000852
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000853 *netrw-cadaver*
854To handle the SSL certificate dialog for untrusted servers, one may pull
855down the certificate and place it into /usr/ssl/cert.pem. This operation
856renders the server treatment as "trusted".
857
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000858 *netrw-fixup* *netreadfixup*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000859If your ftp for whatever reason generates unwanted lines (such as AUTH
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100860messages) you may write a NetReadFixup() function:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000861>
862 function! NetReadFixup(method,line1,line2)
863 " a:line1: first new line in current file
864 " a:line2: last new line in current file
865 if a:method == 1 "rcp
866 elseif a:method == 2 "ftp + <.netrc>
867 elseif a:method == 3 "ftp + machine,uid,password,filename
868 elseif a:method == 4 "scp
869 elseif a:method == 5 "http/wget
870 elseif a:method == 6 "dav/cadaver
871 elseif a:method == 7 "rsync
872 elseif a:method == 8 "fetch
873 elseif a:method == 9 "sftp
Bram Moolenaar9964e462007-05-05 17:54:07 +0000874 else " complain
Bram Moolenaar071d4272004-06-13 20:20:40 +0000875 endif
876 endfunction
877>
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000878The NetReadFixup() function will be called if it exists and thus allows you to
879customize your reading process. As a further example, <netrw.vim> contains
880just such a function to handle Windows 95 ftp. For whatever reason, Windows
88195's ftp dumps four blank lines at the end of a transfer, and so it is
882desirable to automate their removal. Here's some code taken from <netrw.vim>
883itself:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000884>
885 if has("win95") && g:netrw_win95ftp
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000886 fun! NetReadFixup(method, line1, line2)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000887 if method == 3 " ftp (no <.netrc>)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000888 let fourblanklines= line2 - 3
889 silent fourblanklines.",".line2."g/^\s*/d"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000890 endif
891 endfunction
892 endif
893>
894
895==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00008969. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100897 *netrw-browser* *netrw-dir* *netrw-list*
Bram Moolenaar83bab712005-08-01 21:58:57 +0000898
Bram Moolenaar446cb832008-06-24 21:56:24 +0000899INTRODUCTION TO BROWSING *netrw-intro-browse* {{{2
900 (Quick References: |netrw-quickmaps| |netrw-quickcoms|)
Bram Moolenaar83bab712005-08-01 21:58:57 +0000901
Bram Moolenaar446cb832008-06-24 21:56:24 +0000902Netrw supports the browsing of directories on your local system and on remote
903hosts; browsing includes listing files and directories, entering directories,
904editing files therein, deleting files/directories, making new directories,
905moving (renaming) files and directories, copying files and directories, etc.
906One may mark files and execute any system command on them! The Netrw browser
907generally implements the previous explorer's maps and commands for remote
908directories, although details (such as pertinent global variable names)
909necessarily differ. To browse a directory, simply "edit" it! >
Bram Moolenaar269ec652004-07-29 08:43:53 +0000910
Bram Moolenaar446cb832008-06-24 21:56:24 +0000911 vim /your/directory/
912 vim .
913 vim c:\your\directory\
914<
915(Related topics: |netrw-cr| |netrw-o| |netrw-p| |netrw-P| |netrw-t|
916 |netrw-mf| |netrw-mx| |netrw-D| |netrw-R| |netrw-v| )
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000917
918The Netrw remote file and directory browser handles two protocols: ssh and
Bram Moolenaar446cb832008-06-24 21:56:24 +0000919ftp. The protocol in the url, if it is ftp, will cause netrw also to use ftp
920in its remote browsing. Specifying any other protocol will cause it to be
921used for file transfers; but the ssh protocol will be used to do remote
922browsing.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000923
Bram Moolenaar446cb832008-06-24 21:56:24 +0000924To use Netrw's remote directory browser, simply attempt to read a "file" with
925a trailing slash and it will be interpreted as a request to list a directory:
926>
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000927 vim [protocol]://[user@]hostname/path/
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000928<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000929where [protocol] is typically scp or ftp. As an example, try: >
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +0000930
Bram Moolenaar446cb832008-06-24 21:56:24 +0000931 vim ftp://ftp.home.vim.org/pub/vim/
932<
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100933For local directories, the trailing slash is not required. Again, because it's
Bram Moolenaar446cb832008-06-24 21:56:24 +0000934easy to miss: to browse remote directories, the url must terminate with a
935slash!
Bram Moolenaar83bab712005-08-01 21:58:57 +0000936
Bram Moolenaar446cb832008-06-24 21:56:24 +0000937If you'd like to avoid entering the password repeatedly for remote directory
938listings with ssh or scp, see |netrw-ssh-hack|. To avoid password entry with
939ftp, see |netrw-netrc| (if your ftp supports it).
Bram Moolenaar83bab712005-08-01 21:58:57 +0000940
Bram Moolenaar446cb832008-06-24 21:56:24 +0000941There are several things you can do to affect the browser's display of files:
Bram Moolenaar83bab712005-08-01 21:58:57 +0000942
Bram Moolenaar446cb832008-06-24 21:56:24 +0000943 * To change the listing style, press the "i" key (|netrw-i|).
944 Currently there are four styles: thin, long, wide, and tree.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100945 To make that change "permanent", see |g:netrw_liststyle|.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000946
Bram Moolenaar446cb832008-06-24 21:56:24 +0000947 * To hide files (don't want to see those xyz~ files anymore?) see
948 |netrw-ctrl-h|.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000949
Bram Moolenaar446cb832008-06-24 21:56:24 +0000950 * Press s to sort files by name, time, or size.
951
952See |netrw-browse-cmds| for all the things you can do with netrw!
953
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100954 *netrw-getftype* *netrw-filigree* *netrw-ftype*
955The |getftype()| function is used to append a bit of filigree to indicate
956filetype to locally listed files:
957
958 directory : /
959 executable : *
960 fifo : |
961 links : @
962 sockets : =
963
964The filigree also affects the |g:netrw_sort_sequence|.
965
Bram Moolenaar446cb832008-06-24 21:56:24 +0000966
967QUICK HELP *netrw-quickhelp* {{{2
968 (Use ctrl-] to select a topic)~
969 Intro to Browsing...............................|netrw-intro-browse|
970 Quick Reference: Maps.........................|netrw-quickmap|
971 Quick Reference: Commands.....................|netrw-browse-cmds|
972 Hiding
973 Edit hiding list..............................|netrw-ctrl-h|
974 Hiding Files or Directories...................|netrw-a|
975 Hiding/Unhiding by suffix.....................|netrw-mh|
976 Hiding dot-files.............................|netrw-gh|
977 Listing Style
978 Select listing style (thin/long/wide/tree)....|netrw-i|
979 Associated setting variable...................|g:netrw_liststyle|
980 Shell command used to perform listing.........|g:netrw_list_cmd|
981 Quick file info...............................|netrw-qf|
982 Sorted by
983 Select sorting style (name/time/size).........|netrw-s|
984 Editing the sorting sequence..................|netrw-S|
Bram Moolenaarc236c162008-07-13 17:41:49 +0000985 Sorting options...............................|g:netrw_sort_options|
Bram Moolenaar446cb832008-06-24 21:56:24 +0000986 Associated setting variable...................|g:netrw_sort_sequence|
987 Reverse sorting order.........................|netrw-r|
988
989
990 *netrw-quickmap* *netrw-quickmaps*
991QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000992>
Bram Moolenaar446cb832008-06-24 21:56:24 +0000993 --- ----------------- ----
994 Map Quick Explanation Link
995 --- ----------------- ----
996< <F1> Causes Netrw to issue help
997 <cr> Netrw will enter the directory or read the file |netrw-cr|
998 <del> Netrw will attempt to remove the file/directory |netrw-del|
999 - Makes Netrw go up one directory |netrw--|
1000 a Toggles between normal display, |netrw-a|
1001 hiding (suppress display of files matching g:netrw_list_hide)
1002 showing (display only files which match g:netrw_list_hide)
1003 c Make browsing directory the current directory |netrw-c|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001004 C Setting the editing window |netrw-C|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001005 d Make a directory |netrw-d|
1006 D Attempt to remove the file(s)/directory(ies) |netrw-D|
1007 gb Go to previous bookmarked directory |netrw-gb|
1008 gh Quick hide/unhide of dot-files |netrw-gh|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001009 <c-h> Edit file hiding list |netrw-ctrl-h|
1010 i Cycle between thin, long, wide, and tree listings |netrw-i|
1011 <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
1012 mb Bookmark current directory |netrw-mb|
1013 mc Copy marked files to marked-file target directory |netrw-mc|
1014 md Apply diff to marked files (up to 3) |netrw-md|
1015 me Place marked files on arg list and edit them |netrw-me|
1016 mf Mark a file |netrw-mf|
1017 mh Toggle marked file suffices' presence on hiding list |netrw-mh|
1018 mm Move marked files to marked-file target directory |netrw-mm|
1019 mp Print marked files |netrw-mp|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001020 mr Mark files satisfying a shell-style |regexp| |netrw-mr|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001021 mt Current browsing directory becomes markfile target |netrw-mt|
1022 mT Apply ctags to marked files |netrw-mT|
1023 mu Unmark all marked files |netrw-mu|
1024 mx Apply arbitrary shell command to marked files |netrw-mx|
1025 mz Compress/decompress marked files |netrw-mz|
1026 o Enter the file/directory under the cursor in a new |netrw-o|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001027 browser window. A horizontal split is used.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001028 O Obtain a file specified by cursor |netrw-O|
1029 p Preview the file |netrw-p|
1030 P Browse in the previously used window |netrw-P|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001031 qb List bookmarked directories and history |netrw-qb|
1032 qf Display information on file |netrw-qf|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001033 r Reverse sorting order |netrw-r|
1034 R Rename the designed file(s)/directory(ies) |netrw-R|
1035 s Select sorting style: by name, time, or file size |netrw-s|
1036 S Specify suffix priority for name-sorting |netrw-S|
1037 t Enter the file/directory under the cursor in a new tab|netrw-t|
1038 u Change to recently-visited directory |netrw-u|
1039 U Change to subsequently-visited directory |netrw-U|
1040 v Enter the file/directory under the cursor in a new |netrw-v|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001041 browser window. A vertical split is used.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001042 x View file with an associated program |netrw-x|
1043
Bram Moolenaarc236c162008-07-13 17:41:49 +00001044 % Open a new file in netrw's current directory |netrw-%|
1045
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001046 *netrw-mouse* *netrw-leftmouse* *netrw-middlemouse* *netrw-rightmouse*
Bram Moolenaar446cb832008-06-24 21:56:24 +00001047 <leftmouse> (gvim only) selects word under mouse as if a <cr>
1048 had been pressed (ie. edit file, change directory)
1049 <middlemouse> (gvim only) same as P selecting word under mouse;
1050 see |netrw-P|
1051 <rightmouse> (gvim only) delete file/directory using word under
1052 mouse
1053 <2-leftmouse> (gvim only) when:
1054 * in a netrw-selected file, AND
1055 * |g:netrw_retmap| == 1 AND
1056 * the user doesn't already have a <2-leftmouse> mapping
1057 defined before netrw is autoloaded,
1058 then a double clicked leftmouse button will return
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001059 to the netrw browser window. See |g:netrw_retmap|.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001060 <s-leftmouse> (gvim only) like mf, will mark files
1061
Bram Moolenaar00a927d2010-05-14 23:24:24 +02001062 (to disable mouse buttons while browsing: |g:netrw_mousemaps|)
1063
Bram Moolenaar446cb832008-06-24 21:56:24 +00001064 *netrw-quickcom* *netrw-quickcoms*
1065QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2
1066 :NetrwClean[!] ...........................................|netrw-clean|
1067 :NetrwSettings ...........................................|netrw-settings|
1068 :Explore[!] [dir] Explore directory of current file......|netrw-explore|
1069 :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore|
1070 :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
1071 :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
1072 :Rexplore Return to Explorer.....................|netrw-explore|
1073 :Sexplore[!] [dir] Split & Explore directory .............|netrw-explore|
1074 :Texplore[!] [dir] Tab & Explore..........................|netrw-explore|
1075 :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
1076
1077BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001078
Bram Moolenaar446cb832008-06-24 21:56:24 +00001079One may easily "bookmark" a directory by using >
1080
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001081 mb
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001082<
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001083Bookmarks are retained in between sessions in a $HOME/.netrwbook file, and are
1084kept in sorted order.
1085
1086Related Topics:
1087 |netrw-gb| how to return (go) to a bookmark
1088 |netrw-mB| how to delete bookmarks
1089 |netrw-qb| how to list bookmarks
Bram Moolenaar4a85b412006-04-23 22:40:29 +00001090
1091
Bram Moolenaar446cb832008-06-24 21:56:24 +00001092BROWSING *netrw-cr* {{{2
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001093
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001094Browsing is simple: move the cursor onto a file or directory of interest.
Bram Moolenaar843ee412004-06-30 16:16:41 +00001095Hitting the <cr> (the return key) will select the file or directory.
1096Directories will themselves be listed, and files will be opened using the
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001097protocol given in the original read request.
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001098
Bram Moolenaar446cb832008-06-24 21:56:24 +00001099 CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that
1100 two or more spaces delimit filenames and directory names for the long and
1101 wide listing formats. Thus, if your filename or directory name has two or
1102 more sequential spaces embedded in it, or any trailing spaces, then you'll
1103 need to use the "thin" format to select it.
Bram Moolenaar843ee412004-06-30 16:16:41 +00001104
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001105The |g:netrw_browse_split| option, which is zero by default, may be used to
Bram Moolenaar446cb832008-06-24 21:56:24 +00001106cause the opening of files to be done in a new window or tab instead of the
1107default. When the option is one or two, the splitting will be taken
1108horizontally or vertically, respectively. When the option is set to three, a
1109<cr> will cause the file to appear in a new tab.
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001110
Bram Moolenaar83bab712005-08-01 21:58:57 +00001111
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001112When using the gui (gvim), one may select a file by pressing the <leftmouse>
1113button. In addition, if
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001114
Bram Moolenaar446cb832008-06-24 21:56:24 +00001115 *|g:netrw_retmap| == 1 AND (its default value is 0)
1116 * in a netrw-selected file, AND
1117 * the user doesn't already have a <2-leftmouse> mapping defined before
1118 netrw is loaded
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001119
Bram Moolenaar446cb832008-06-24 21:56:24 +00001120then a doubly-clicked leftmouse button will return to the netrw browser
1121window.
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001122
Bram Moolenaar446cb832008-06-24 21:56:24 +00001123Netrw attempts to speed up browsing, especially for remote browsing where one
1124may have to enter passwords, by keeping and re-using previously obtained
1125directory listing buffers. The |g:netrw_fastbrowse| variable is used to
1126control this behavior; one may have slow browsing (no buffer re-use), medium
1127speed browsing (re-use directory buffer listings only for remote directories),
1128and fast browsing (re-use directory buffer listings as often as possible).
1129The price for such re-use is that when changes are made (such as new files
1130are introduced into a directory), the listing may become out-of-date. One may
1131always refresh directory listing buffers by pressing ctrl-L (see
1132|netrw-ctrl-l|).
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001133
1134
Bram Moolenaar446cb832008-06-24 21:56:24 +00001135Related topics: |netrw-o| |netrw-p| |netrw-P| |netrw-t| |netrw-v|
1136Associated setting variables: |g:netrw_browse_split| |g:netrw_fastbrowse|
1137 |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
1138 |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_cmd|
1139 |g:netrw_ssh_browse_reject| |g:netrw_use_noswf|
1140
1141
1142BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2
1143
1144Normally one enters a file or directory using the <cr>. However, the "o" map
1145allows one to open a new window to hold the new directory listing or file. A
1146horizontal split is used. (for vertical splitting, see |netrw-v|)
1147
1148Normally, the o key splits the window horizontally with the new window and
1149cursor at the top. To change to splitting the window horizontally with the
1150new window and cursor at the bottom, have
1151
1152 let g:netrw_alto = 1
1153
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001154in your <.vimrc>. (also see |netrw-t| |netrw-T| |netrw-v|)
Bram Moolenaar446cb832008-06-24 21:56:24 +00001155
1156Associated setting variables: |g:netrw_alto| |g:netrw_winsize|
1157
1158
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001159BROWSING WITH A NEW TAB *netrw-t* *netrw-T* {{{2
Bram Moolenaar446cb832008-06-24 21:56:24 +00001160
1161Normally one enters a file or directory using the <cr>. The "t" map
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001162allows one to open a new window holding the new directory listing or file in
1163a new tab. The "T" version puts the file or directory into a background tab
1164(see |gT|)
1165
1166Related actions: |netrw-o| |netrw-v|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001167
1168
1169BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2
1170
1171Normally one enters a file or directory using the <cr>. However, the "v" map
1172allows one to open a new window to hold the new directory listing or file. A
1173vertical split is used. (for horizontal splitting, see |netrw-o|)
1174
1175Normally, the v key splits the window vertically with the new window and
1176cursor at the left. To change to splitting the window vertically with the new
1177window and cursor at the right, have
1178
1179 let g:netrw_altv = 1
1180
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001181in your <.vimrc>. (also see: |netrw-o| |netrw-t| |netrw-T|)
Bram Moolenaar446cb832008-06-24 21:56:24 +00001182
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001183There is only one tree listing buffer; using "v" on a displayed subdirectory
Bram Moolenaar446cb832008-06-24 21:56:24 +00001184will split the screen, but the same buffer will be shown twice.
1185
1186Associated setting variable: |g:netrw_altv| |g:netrw_winsize|
1187
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001188
1189CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001190
Bram Moolenaar9964e462007-05-05 17:54:07 +00001191The "i" map cycles between the thin, long, wide, and tree listing formats.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001192
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001193The thin listing format gives just the files' and directories' names.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001194
Bram Moolenaar8299df92004-07-10 09:47:34 +00001195The long listing is either based on the "ls" command via ssh for remote
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001196directories or displays the filename, file size (in bytes), and the time and
1197date of last modification for local directories. With the long listing
1198format, netrw is not able to recognize filenames which have trailing spaces.
1199Use the thin listing format for such files.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001200
Bram Moolenaar9964e462007-05-05 17:54:07 +00001201The wide listing format uses two or more contiguous spaces to delineate
1202filenames; when using that format, netrw won't be able to recognize or use
1203filenames which have two or more contiguous spaces embedded in the name or any
1204trailing spaces. The thin listing format will, however, work with such files.
1205This listing format is the most compact.
1206
1207The tree listing format has a top directory followed by files and directories
1208preceded by a "|". One may open and close directories by pressing the <cr>
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001209key while atop the directory name.
1210
1211One may make a preferred listing style your default; see |g:netrw_liststyle|.
1212As an example, by putting the following line in your .vimrc, >
1213 let g:netrw_liststyle= 4
1214the tree style will become your default listing style.
Bram Moolenaar8299df92004-07-10 09:47:34 +00001215
Bram Moolenaar446cb832008-06-24 21:56:24 +00001216Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen|
1217 |g:netrw_timefmt| |g:netrw_list_cmd|
Bram Moolenaar8299df92004-07-10 09:47:34 +00001218
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001219CHANGE FILE PERMISSION *netrw-gp* {{{2
1220
1221"gp" will ask you for a new permission for the file named under the cursor.
1222Currently, this only works for local files.
1223
1224Associated setting variables: |g:netrw_chgperm|
1225
Bram Moolenaar83bab712005-08-01 21:58:57 +00001226
Bram Moolenaar446cb832008-06-24 21:56:24 +00001227CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2
Bram Moolenaar843ee412004-06-30 16:16:41 +00001228
Bram Moolenaar446cb832008-06-24 21:56:24 +00001229To change directory back to a bookmarked directory, use
Bram Moolenaar843ee412004-06-30 16:16:41 +00001230
Bram Moolenaar446cb832008-06-24 21:56:24 +00001231 {cnt}gb
Bram Moolenaar843ee412004-06-30 16:16:41 +00001232
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001233Any count may be used to reference any of the bookmarks.
1234
1235Related Topics:
1236 |netrw-mB| how to delete bookmarks
1237 |netrw-mb| how to make a bookmark
1238 |netrw-qb| how to list bookmarks
Bram Moolenaar843ee412004-06-30 16:16:41 +00001239
Bram Moolenaar843ee412004-06-30 16:16:41 +00001240
Bram Moolenaar00a927d2010-05-14 23:24:24 +02001241CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001242
1243Every time you change to a new directory (new for the current session),
1244netrw will save the directory in a recently-visited directory history
Bram Moolenaaradc21822011-04-01 18:03:16 +02001245list (unless |g:netrw_dirhistmax| is zero; by default, it's ten). With the
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001246"u" map, one can change to an earlier directory (predecessor). To do
1247the opposite, see |netrw-U|.
1248
1249
Bram Moolenaar446cb832008-06-24 21:56:24 +00001250CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001251
1252With the "U" map, one can change to a later directory (successor).
1253This map is the opposite of the "u" map. (see |netrw-u|) Use the
Bram Moolenaar446cb832008-06-24 21:56:24 +00001254q map to list both the bookmarks and history. (see |netrw-qb|)
1255
1256
1257NETRW CLEAN *netrw-clean* *:NetrwClean*
1258
1259With :NetrwClean one may easily remove netrw from one's home directory;
1260more precisely, from the first directory on your |'runtimepath'|.
1261
1262With :NetrwClean!, netrw will remove netrw from all directories on your
1263|'runtimepath'|.
1264
1265With either form of the command, netrw will first ask for confirmation
1266that the removal is in fact what you want to do. If netrw doesn't have
1267permission to remove a file, it will issue an error message.
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001268
Bram Moolenaar9964e462007-05-05 17:54:07 +00001269 *netrw-gx*
Bram Moolenaar446cb832008-06-24 21:56:24 +00001270CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler* {{{2
Bram Moolenaar9964e462007-05-05 17:54:07 +00001271 (also see |netrw_filehandler|)
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001272
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001273Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
1274best seen with a special handler (ie. a tool provided with your computer).
1275Netrw allows one to invoke such special handlers by: >
1276
1277 * when Exploring, hit the "x" key
1278 * when editing, hit gx with the cursor atop the special filename
Bram Moolenaar9964e462007-05-05 17:54:07 +00001279< (not available if the |g:netrw_nogx| variable exists)
1280
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001281Netrw determines which special handler by the following method:
1282
1283 * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
1284 view files. Examples of useful settings (place into your <.vimrc>): >
1285
1286 :let g:netrw_browsex_viewer= "kfmclient exec"
1287< or >
1288 :let g:netrw_browsex_viewer= "gnome-open"
1289<
1290 If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
1291 invoked first (see |netrw_filehandler|).
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001292
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001293 * for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001294 * for Gnome (with gnome-open): gnome-open is used.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001295 * for KDE (with kfmclient) : kfmclient is used.
1296 * for Mac OS X : open is used.
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001297 * otherwise the netrwFileHandler plugin is used.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001298
1299The file's suffix is used by these various approaches to determine an
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001300appropriate application to use to "handle" these files. Such things as
1301OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
1302*.eps) can be handled.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001303
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001304 *netrw_filehandler*
Bram Moolenaar9964e462007-05-05 17:54:07 +00001305
1306The "x" map applies a function to a file, based on its extension. Of course,
1307the handler function must exist for it to be called!
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001308>
1309 Ex. mypgm.html x ->
Bram Moolenaar9964e462007-05-05 17:54:07 +00001310 NFH_html("scp://user@host/some/path/mypgm.html")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001311<
Bram Moolenaar9964e462007-05-05 17:54:07 +00001312Users may write their own netrw File Handler functions to support more
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001313suffixes with special handling. See <autoload/netrwFileHandlers.vim> for
Bram Moolenaar9964e462007-05-05 17:54:07 +00001314examples on how to make file handler functions. As an example: >
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001315
Bram Moolenaar9964e462007-05-05 17:54:07 +00001316 " NFH_suffix(filename)
1317 fun! NFH_suffix(filename)
1318 ..do something special with filename..
1319 endfun
1320<
1321These functions need to be defined in some file in your .vim/plugin
1322(vimfiles\plugin) directory. Vim's function names may not have punctuation
1323characters (except for the underscore) in them. To support suffices that
1324contain such characters, netrw will first convert the suffix using the
1325following table: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001326
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001327 @ -> AT ! -> EXCLAMATION % -> PERCENT
1328 : -> COLON = -> EQUAL ? -> QUESTION
Bram Moolenaar9964e462007-05-05 17:54:07 +00001329 , -> COMMA - -> MINUS ; -> SEMICOLON
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001330 $ -> DOLLAR + -> PLUS ~ -> TILDE
1331<
Bram Moolenaar9964e462007-05-05 17:54:07 +00001332So, for example: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001333
Bram Moolenaar9964e462007-05-05 17:54:07 +00001334 file.rcs,v -> NFH_rcsCOMMAv()
1335<
1336If more such translations are necessary, please send me email: >
1337 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
1338with a request.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001339
Bram Moolenaar446cb832008-06-24 21:56:24 +00001340Associated setting variable: |g:netrw_browsex_viewer|
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001341
Bram Moolenaar446cb832008-06-24 21:56:24 +00001342 *netrw-curdir*
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001343DELETING BOOKMARKS *netrw-mB* {{{2
1344
1345To delete a bookmark, use >
1346
1347 {cnt}mB
1348<
1349Related Topics:
1350 |netrw-gb| how to return (go) to a bookmark
1351 |netrw-mb| how to make a bookmark
1352 |netrw-qb| how to list bookmarks
1353
1354
Bram Moolenaar446cb832008-06-24 21:56:24 +00001355DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001356
Bram Moolenaar446cb832008-06-24 21:56:24 +00001357If files have not been marked with |netrw-mf|: (local marked file list)
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001358
Bram Moolenaar446cb832008-06-24 21:56:24 +00001359 Deleting/removing files and directories involves moving the cursor to the
1360 file/directory to be deleted and pressing "D". Directories must be empty
1361 first before they can be successfully removed. If the directory is a
1362 softlink to a directory, then netrw will make two requests to remove the
1363 directory before succeeding. Netrw will ask for confirmation before doing
1364 the removal(s). You may select a range of lines with the "V" command
1365 (visual selection), and then pressing "D".
Bram Moolenaar9964e462007-05-05 17:54:07 +00001366
Bram Moolenaar446cb832008-06-24 21:56:24 +00001367If files have been marked with |netrw-mf|: (local marked file list)
1368
1369 Marked files (and empty directories) will be deleted; again, you'll be
1370 asked to confirm the deletion before it actually takes place.
1371
1372The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are
1373used to control the attempts to remove files and directories. The
1374g:netrw_rm_cmd is used with files, and its default value is:
1375
1376 g:netrw_rm_cmd: ssh HOSTNAME rm
1377
1378The g:netrw_rmdir_cmd variable is used to support the removal of directories.
1379Its default value is:
1380
1381 g:netrw_rmdir_cmd: ssh HOSTNAME rmdir
1382
1383If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
1384to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
1385
1386 g:netrw_rmf_cmd: ssh HOSTNAME rm -f
1387
1388Associated setting variable: |g:netrw_local_rmdir| |g:netrw_rm_cmd|
1389 |g:netrw_rmdir_cmd| |g:netrw_ssh_cmd|
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001390
1391
Bram Moolenaar446cb832008-06-24 21:56:24 +00001392*netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore*
1393*netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore*
1394DIRECTORY EXPLORATION COMMANDS {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001395
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001396 :[N]Explore[!] [dir]... Explore directory of current file *:Explore*
1397 :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
1398 :Rexplore ... Return to Explorer *:Rexplore*
1399 :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore*
1400 :Texplore [dir]... Tab & Explore *:Texplore*
1401 :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
Bram Moolenaar446cb832008-06-24 21:56:24 +00001402
1403 Used with :Explore **/pattern : (also see |netrw-starstar|)
1404 :Nexplore............. go to next matching file *:Nexplore*
1405 :Pexplore............. go to previous matching file *:Pexplore*
1406
1407:Explore will open the local-directory browser on the current file's
1408 directory (or on directory [dir] if specified). The window will be
1409 split only if the file has been modified, otherwise the browsing
1410 window will take over that window. Normally the splitting is taken
1411 horizontally.
1412:Explore! is like :Explore, but will use vertical splitting.
1413:Sexplore will always split the window before invoking the local-directory
1414 browser. As with Explore, the splitting is normally done
1415 horizontally.
1416:Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically.
1417:Hexplore [dir] does an :Explore with |:belowright| horizontal splitting.
1418:Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting.
1419:Vexplore [dir] does an :Explore with |:leftabove| vertical splitting.
1420:Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting.
1421:Texplore [dir] does a tabnew before generating the browser window
1422
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001423By default, these commands use the current file's directory. However, one may
1424explicitly provide a directory (path) to use.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001425
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001426The [N] will override |g:netrw_winsize| to specify the quantity of rows and/or
1427columns the new explorer window should have.
1428
1429Otherwise, the |g:netrw_winsize| variable, if it has been specified by the
1430user, is used to control the quantity of rows and/or columns new explorer
1431windows should have.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001432
1433:Rexplore This command is a little different from the others. When one
1434 edits a file, for example by pressing <cr> when atop a file in
1435 a netrw browser window, :Rexplore will return the display to
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001436 that of the last netrw browser window. It is a command version
1437 of the <2-leftmouse> map (which is only available under gvim and
Bram Moolenaar446cb832008-06-24 21:56:24 +00001438 cooperative terms).
1439
1440
1441*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat*
1442EXPLORING WITH STARS AND PATTERNS
1443
1444When Explore, Sexplore, Hexplore, or Vexplore are used with one of the
1445following four styles, Explore generates a list of files which satisfy
1446the request. >
1447
1448 */filepat files in current directory which satisfy filepat
1449 **/filepat files in current directory or below which satisfy the
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001450 file pattern
Bram Moolenaar446cb832008-06-24 21:56:24 +00001451 *//pattern files in the current directory which contain the
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001452 pattern (vimgrep is used)
Bram Moolenaar446cb832008-06-24 21:56:24 +00001453 **//pattern files in the current directory or below which contain
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001454 the pattern (vimgrep is used)
Bram Moolenaar572cb562005-08-05 21:35:02 +00001455<
Bram Moolenaar446cb832008-06-24 21:56:24 +00001456The cursor will be placed on the first file in the list. One may then
1457continue to go to subsequent files on that list via |:Nexplore| or to
1458preceding files on that list with |:Pexplore|. Explore will update the
1459directory and place the cursor appropriately.
1460
1461A plain >
1462 :Explore
1463will clear the explore list.
1464
1465If your console or gui produces recognizable shift-up or shift-down sequences,
1466then you'll likely find using shift-downarrow and shift-uparrow convenient.
1467They're mapped by netrw:
1468
1469 <s-down> == Nexplore, and
1470 <s-up> == Pexplore.
1471
1472As an example, consider
1473>
1474 :Explore */*.c
1475 :Nexplore
1476 :Nexplore
1477 :Pexplore
1478<
1479The status line will show, on the right hand side of the status line, a
1480message like "Match 3 of 20".
1481
1482Associated setting variables: |g:netrw_keepdir| |g:netrw_browse_split|
1483 |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject|
1484 |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
1485 |g:netrw_ftp_timelist_cmd| |g:netrw_list_cmd|
1486 |g:netrw_liststyle|
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001487
1488
Bram Moolenaar446cb832008-06-24 21:56:24 +00001489DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001490
Bram Moolenaar446cb832008-06-24 21:56:24 +00001491With the cursor atop a filename, pressing "qf" will reveal the file's size
1492and last modification timestamp. Currently this capability is only available
1493for local files.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001494
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001495
Bram Moolenaar446cb832008-06-24 21:56:24 +00001496EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001497
Bram Moolenaar446cb832008-06-24 21:56:24 +00001498The "<ctrl-h>" map brings up a requestor allowing the user to change the
1499file/directory hiding list contained in |g:netrw_list_hide|. The hiding list
1500consists of one or more patterns delimited by commas. Files and/or
1501directories satisfying these patterns will either be hidden (ie. not shown) or
1502be the only ones displayed (see |netrw-a|).
1503
1504The "gh" mapping (see |netrw-gh|) quickly alternates between the usual
1505hiding list and the hiding of files or directories that begin with ".".
1506
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001507As an example, >
1508 let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+'
1509Effectively, this makes the effect of a |netrw-gh| command the initial setting.
1510What it means:
1511
1512 \(^\|\s\s\) : if the line begins with the following, -or-
1513 two consecutive spaces are encountered
1514 \zs : start the hiding match now
1515 \. : if it now begins with a dot
1516 \S\+ : and is followed by one or more non-whitespace
1517 characters
1518
Bram Moolenaar446cb832008-06-24 21:56:24 +00001519Associated setting variables: |g:netrw_hide| |g:netrw_list_hide|
1520Associated topics: |netrw-a| |netrw-gh| |netrw-mh|
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001521
1522
Bram Moolenaar446cb832008-06-24 21:56:24 +00001523EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2
1524
1525When "Sorted by" is name, one may specify priority via the sorting sequence
1526(g:netrw_sort_sequence). The sorting sequence typically prioritizes the
1527name-listing by suffix, although any pattern will do. Patterns are delimited
1528by commas. The default sorting sequence is (all one line):
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001529
1530For Unix: >
1531 '[\/]$,\<core\%(\.\d\+\)\=,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,
1532 \.info$,\.swp$,\.bak$,\~$'
1533<
1534Otherwise: >
Bram Moolenaar446cb832008-06-24 21:56:24 +00001535 '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,
1536 \.swp$,\.bak$,\~$'
1537<
1538The lone * is where all filenames not covered by one of the other patterns
1539will end up. One may change the sorting sequence by modifying the
1540g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by
1541using the "S" map.
1542
Bram Moolenaarc236c162008-07-13 17:41:49 +00001543Related topics: |netrw-s| |netrw-S|
1544Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001545
1546
Bram Moolenaaradc21822011-04-01 18:03:16 +02001547FORCING TREATMENT AS A FILE OR DIRECTORY *netrw-gd* *netrw-gf* {{{2
1548
1549Remote symbolic links (ie. those listed via ssh or ftp) are problematic
1550in that it is difficult to tell whether they link to a file or to a
1551directory.
1552
1553To force treatment as a file: use >
1554 gd
1555<
1556To force treatment as a directory: use >
1557 gf
1558<
1559
Bram Moolenaar446cb832008-06-24 21:56:24 +00001560GOING UP *netrw--* {{{2
1561
1562To go up a directory, press "-" or press the <cr> when atop the ../ directory
1563entry in the listing.
1564
1565Netrw will use the command in |g:netrw_list_cmd| to perform the directory
1566listing operation after changing HOSTNAME to the host specified by the
1567user-provided url. By default netrw provides the command as:
1568
1569 ssh HOSTNAME ls -FLa
1570
1571where the HOSTNAME becomes the [user@]hostname as requested by the attempt to
1572read. Naturally, the user may override this command with whatever is
1573preferred. The NetList function which implements remote browsing
1574expects that directories will be flagged by a trailing slash.
1575
1576
1577HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2
1578
1579Netrw's browsing facility allows one to use the hiding list in one of three
1580ways: ignore it, hide files which match, and show only those files which
1581match.
1582
1583If no files have been marked via |netrw-mf|:
1584
1585The "a" map allows the user to cycle through the three hiding modes.
1586
1587The |g:netrw_list_hide| variable holds a comma delimited list of patterns
1588based on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list.
1589(also see |netrw-ctrl-h|) To set the hiding list, use the <c-h> map. As an
1590example, to hide files which begin with a ".", one may use the <c-h> map to
1591set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*'
1592in one's <.vimrc>). One may then use the "a" key to show all files, hide
1593matching files, or to show only the matching files.
1594
1595 Example: \.[ch]$
1596 This hiding list command will hide/show all *.c and *.h files.
1597
1598 Example: \.c$,\.h$
1599 This hiding list command will also hide/show all *.c and *.h
1600 files.
1601
1602Don't forget to use the "a" map to select the mode (normal/hiding/show) you
1603want!
1604
1605If files have been marked using |netrw-mf|, then this command will:
1606
1607 if showing all files or non-hidden files:
1608 modify the g:netrw_list_hide list by appending the marked files to it
1609 and showing only non-hidden files.
1610
1611 else if showing hidden files only:
1612 modify the g:netrw_list_hide list by removing the marked files from it
1613 and showing only non-hidden files.
1614 endif
1615
1616 *netrw-gh* *netrw-hide*
1617As a quick shortcut, one may press >
1618 gh
1619to toggle between hiding files which begin with a period (dot) and not hiding
1620them.
1621
1622Associated setting variable: |g:netrw_list_hide|
1623Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh|
1624
1625IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001626
1627Especially with the remote directory browser, constantly entering the password
1628is tedious.
1629
Bram Moolenaar9964e462007-05-05 17:54:07 +00001630For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00001631tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip
1632for setting up no-password ssh and scp and discusses associated security
Bram Moolenaar9964e462007-05-05 17:54:07 +00001633issues. It used to be available at http://hacks.oreilly.com/pub/h/66 ,
1634but apparently that address is now being redirected to some "hackzine".
Bram Moolenaare37d50a2008-08-06 17:06:04 +00001635I'll attempt a summary based on that article and on a communication from
1636Ben Schmidt:
Bram Moolenaar843ee412004-06-30 16:16:41 +00001637
Bram Moolenaare37d50a2008-08-06 17:06:04 +00001638 1. Generate a public/private key pair on the local machine
1639 (ssh client): >
1640 ssh-keygen -t rsa
1641 (saving the file in ~/.ssh/id_rsa as prompted)
1642<
1643 2. Just hit the <CR> when asked for passphrase (twice) for no
1644 passphrase. If you do use a passphrase, you will also need to use
1645 ssh-agent so you only have to type the passphrase once per session.
1646 If you don't use a passphrase, simply logging onto your local
1647 computer or getting access to the keyfile in any way will suffice
1648 to access any ssh servers which have that key authorized for login.
1649
1650 3. This creates two files: >
1651 ~/.ssh/id_rsa
1652 ~/.ssh/id_rsa.pub
1653<
1654 4. On the target machine (ssh server): >
1655 cd
1656 mkdir -p .ssh
1657 chmod 0700 .ssh
1658<
1659 5. On your local machine (ssh client): (one line) >
1660 ssh {serverhostname}
1661 cat '>>' '~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub
1662<
1663 or, for OpenSSH, (one line) >
1664 ssh {serverhostname}
1665 cat '>>' '~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub
1666<
1667You can test it out with >
1668 ssh {serverhostname}
1669and you should be log onto the server machine without further need to type
1670anything.
1671
1672If you decided to use a passphrase, do: >
1673 ssh-agent $SHELL
1674 ssh-add
1675 ssh {serverhostname}
1676You will be prompted for your key passphrase when you use ssh-add, but not
1677subsequently when you use ssh. For use with vim, you can use >
1678 ssh-agent vim
1679and, when next within vim, use >
1680 :!ssh-add
1681Alternatively, you can apply ssh-agent to the terminal you're planning on
1682running vim in: >
1683 ssh-agent xterm &
1684and do ssh-add whenever you need.
Bram Moolenaar843ee412004-06-30 16:16:41 +00001685
Bram Moolenaar9964e462007-05-05 17:54:07 +00001686For Windows, folks on the vim mailing list have mentioned that Pageant helps
1687with avoiding the constant need to enter the password.
Bram Moolenaar433f7c82006-03-21 21:29:36 +00001688
Bram Moolenaar446cb832008-06-24 21:56:24 +00001689Kingston Fung wrote about another way to avoid constantly needing to enter
1690passwords:
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001691
Bram Moolenaar446cb832008-06-24 21:56:24 +00001692 In order to avoid the need to type in the password for scp each time, you
1693 provide a hack in the docs to set up a non password ssh account. I found a
1694 better way to do that: I can use a regular ssh account which uses a
1695 password to access the material without the need to key-in the password
1696 each time. It's good for security and convenience. I tried ssh public key
1697 authorization + ssh-agent, implementing this, and it works! Here are two
1698 links with instructions:
1699
1700 http://www.ibm.com/developerworks/library/l-keyc2/
1701 http://sial.org/howto/openssh/publickey-auth/
1702
1703
1704LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2
1705
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001706Pressing "qb" (query bookmarks) will list both the bookmarked directories and
1707directory traversal history.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001708
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001709Related Topics:
1710 |netrw-gb| how to return (go) to a bookmark
1711 |netrw-mb| how to make a bookmark
1712 |netrw-mB| how to delete bookmarks
1713 |netrw-u| change to a predecessor directory via the history stack
1714 |netrw-U| change to a successor directory via the history stack
Bram Moolenaar446cb832008-06-24 21:56:24 +00001715
1716MAKING A NEW DIRECTORY *netrw-d* {{{2
1717
1718With the "d" map one may make a new directory either remotely (which depends
1719on the global variable g:netrw_mkdir_cmd) or locally (which depends on the
1720global variable g:netrw_local_mkdir). Netrw will issue a request for the new
1721directory's name. A bare <CR> at that point will abort the making of the
1722directory. Attempts to make a local directory that already exists (as either
1723a file or a directory) will be detected, reported on, and ignored.
1724
1725Currently, making a directory via ftp is not supported.
1726
1727Associated setting variable: |g:netrw_local_mkdir| |g:netrw_mkdir_cmd|
1728
1729
1730MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* {{{2
1731
1732By default, |g:netrw_keepdir| is 1. This setting means that the current
1733directory will not track the browsing directory.
1734
1735Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory to
1736track netrw's browsing directory.
1737
1738However, given the default setting for g:netrw_keepdir of 1 where netrw
1739maintains its own separate notion of the current directory, in order to make
1740the two directories the same, use the "c" map (just type c). That map will
1741set Vim's notion of the current directory to netrw's current browsing
1742directory.
1743
1744Associated setting variable: |g:netrw_keepdir|
1745
1746MARKING FILES *netrw-mf* {{{2
1747 (also see |netrw-mr|)
1748
1749One may mark files with the cursor atop a filename and then pressing "mf".
1750With gvim, one may also mark files with <s-leftmouse>. The following netrw
1751maps make use of marked files:
1752
1753 |netrw-a| Hide marked files/directories
1754 |netrw-D| Delete marked files/directories
1755 |netrw-mc| Copy marked files to target
1756 |netrw-md| Apply vimdiff to marked files
1757 |netrw-me| Edit marked files
1758 |netrw-mg| Apply vimgrep to marked files
1759 |netrw-mm| Move marked files
1760 |netrw-mp| Print marked files
1761 |netrw-mt| Set target for |netrw-mm| and |netrw-mc|
1762 |netrw-mT| Generate tags using marked files
1763 |netrw-mx| Apply shell command to marked files
1764 |netrw-mz| Compress/Decompress marked files
1765 |netrw-O| Obtain marked files
1766 |netrw-R| Rename marked files
1767
1768One may unmark files one at a time the same way one marks them; ie. place
1769the cursor atop a marked file and press "mf". This process also works
1770with <s-leftmouse> using gvim. One may unmark all files by pressing
1771"mu" (see |netrw-mu|).
1772
Bram Moolenaaradc21822011-04-01 18:03:16 +02001773Marked files are highlighted using the "netrwMarkFile" highlighting group,
1774which by default is linked to "Identifier" (see Identifier under
1775|group-name|). You may change the highlighting group by putting something
1776like >
1777
1778 highlight clear netrwMarkFile
1779 hi link netrwMarkFile ..whatever..
1780<
1781into $HOME/.vim/after/syntax/netrw.vim .
1782
Bram Moolenaar446cb832008-06-24 21:56:24 +00001783*markfilelist* *global_markfilelist* *local_markfilelist*
1784All marked files are entered onto the global marked file list; there is only
1785one such list. In addition, every netrw buffer also has its own local marked
1786file list; since netrw buffers are associated with specific directories, this
1787means that each directory has its own local marked file list. The various
1788commands which operate on marked files use one or the other of the marked file
1789lists.
1790
1791
1792MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
1793 (also see |netrw-mf|)
1794
1795One may also mark files by pressing "mr"; netrw will then issue a prompt,
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001796"Enter regexp: ". You may then enter a shell-style regular expression such
1797as *.c$ (see |glob()|). For remote systems, glob() doesn't work -- so netrw
1798converts "*" into ".*" (see |regexp|) and marks files based on that. In the
1799future I may make it possible to use |regexp|s instead of glob()-style
1800expressions (yet-another-option).
Bram Moolenaar446cb832008-06-24 21:56:24 +00001801
1802
1803MARKED FILES: ARBITRARY COMMAND *netrw-mx* {{{2
1804 (See |netrw-mf| and |netrw-mr| for how to mark files)
1805 (uses the local marked-file list)
1806
1807Upon activation of the "mx" map, netrw will query the user for some (external)
1808command to be applied to all marked files. All "%"s in the command will be
1809substituted with the name of each marked file in turn. If no "%"s are in the
1810command, then the command will be followed by a space and a marked filename.
1811
1812
1813MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2
1814 (See |netrw-mf| and |netrw-mr| for how to mark files)
1815 (uses the local marked file list)
1816
1817If any marked files are compressed, then "mz" will decompress them.
1818If any marked files are decompressed, then "mz" will compress them
1819using the command specified by |g:netrw_compress|; by default,
1820that's "gzip".
1821
1822For decompression, netrw provides a |Dictionary| of suffices and their
1823associated decompressing utilities; see |g:netrw_decompress|.
1824
1825Associated setting variables: |g:netrw_compress| |g:netrw_decompress|
1826
1827MARKED FILES: COPYING *netrw-mc* {{{2
1828 (See |netrw-mf| and |netrw-mr| for how to mark files)
1829 (Uses the global marked file list)
1830
1831Select a target directory with mt (|netrw-mt|). Then change directory,
Bram Moolenaaradc21822011-04-01 18:03:16 +02001832select file(s) (see |netrw-mf|), and press "mc". The copy is done
1833from the current window (where one does the mf) to the target.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001834
1835Associated setting variable: |g:netrw_localcopycmd| |g:netrw_ssh_cmd|
1836
1837MARKED FILES: DIFF *netrw-md* {{{2
1838 (See |netrw-mf| and |netrw-mr| for how to mark files)
1839 (uses the global marked file list)
1840
1841Use |vimdiff| to visualize difference between selected files (two or
1842three may be selected for this). Uses the global marked file list.
1843
1844MARKED FILES: EDITING *netrw-me* {{{2
1845 (See |netrw-mf| and |netrw-mr| for how to mark files)
1846 (uses the global marked file list)
1847
1848This command will place the marked files on the |arglist| and commence
1849editing them. One may return the to explorer window with |:Rexplore|.
1850
1851MARKED FILES: GREP *netrw-mg* {{{2
1852 (See |netrw-mf| and |netrw-mr| for how to mark files)
1853 (uses the global marked file list)
1854
1855This command will apply |:vimgrep| to the marked files. The command will ask
1856for the requested pattern; one may enter: >
1857 /pattern/[g][j]
1858 ! /pattern/[g][j]
1859 pattern
1860<
1861MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2
1862 (See |netrw-mf| and |netrw-mr| for how to mark files)
1863 (uses the local marked file list)
1864
1865This command extracts the suffices of the marked files and toggles their
1866presence on the hiding list. Please note that marking the same suffix
1867this way multiple times will result in the suffix's presence being toggled
1868for each file (so an even quantity of marked files having the same suffix
1869is the same as not having bothered to select them at all).
1870
1871Related topics: |netrw-a| |g:netrw_list_hide|
1872
1873MARKED FILES: MOVING *netrw-mm* {{{2
1874 (See |netrw-mf| and |netrw-mr| for how to mark files)
1875 (uses the global marked file list)
1876
Bram Moolenaare37d50a2008-08-06 17:06:04 +00001877 WARNING: moving files is more dangerous than copying them.
1878 A file being moved is first copied and then deleted; if the
1879 copy operation fails and the delete succeeds, you will lose
1880 the file. Either try things out with unimportant files
1881 first or do the copy and then delete yourself using mc and D.
1882 Use at your own risk!
1883
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001884Select a target directory with mt (|netrw-mt|). Then change directory,
Bram Moolenaaradc21822011-04-01 18:03:16 +02001885select file(s) (see |netrw-mf|), and press "mm". The move is done
1886from the current window (where one does the mf) to the target.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001887
1888Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|
1889
1890MARKED FILES: PRINTING *netrw-mp* {{{2
1891 (See |netrw-mf| and |netrw-mr| for how to mark files)
1892 (uses the local marked file list)
1893
1894Netrw will apply the |:hardcopy| command to marked files. What it does
1895is open each file in a one-line window, execute hardcopy, then close the
1896one-line window.
1897
1898
1899MARKED FILES: SOURCING *netrw-ms* {{{2
1900 (See |netrw-mf| and |netrw-mr| for how to mark files)
1901 (uses the local marked file list)
1902
1903Netrw will source the marked files (using vim's |:source| command)
1904
1905
1906MARKED FILES: TAGGING *netrw-mT* {{{2
1907 (See |netrw-mf| and |netrw-mr| for how to mark files)
1908 (uses the global marked file list)
1909
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001910The "mT" mapping will apply the command in |g:netrw_ctags| (by default, it is
Bram Moolenaar446cb832008-06-24 21:56:24 +00001911"ctags") to marked files. For remote browsing, in order to create a tags file
1912netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for
1913this to work on remote systems. For your local system, see |ctags| on how to
1914get a version. I myself use hdrtags, currently available at
1915http://mysite.verizon.net/astronaut/src/index.html , and have >
1916
1917 let g:netrw_ctags= "hdrtag"
1918<
1919in my <.vimrc>.
1920
1921When a remote set of files are tagged, the resulting tags file is "obtained";
1922ie. a copy is transferred to the local system's directory. The local tags
1923file is then modified so that one may use it through the network. The
1924modification is concerns the names of the files in the tags; each filename is
1925preceded by the netrw-compatible url used to obtain it. When one subsequently
1926uses one of the go to tag actions (|tags|), the url will be used by netrw to
1927edit the desired file and go to the tag.
1928
Bram Moolenaarc236c162008-07-13 17:41:49 +00001929Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001930
1931
1932MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2
1933 (See |netrw-mf| and |netrw-mr| for how to mark files)
1934
1935Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
1936
1937 * if the cursor is atop a file name, then the netrw window's currently
1938 displayed directory is used for the copy/move-to target.
1939
1940 * also, if the cursor is in the banner, then the netrw window's currently
1941 displayed directory is used for the copy/move-to target.
1942
1943 * however, if the cursor is atop a directory name, then that directory is
1944 used for the copy/move-to target
1945
1946There is only one copy/move-to target per vim session; ie. the target is a
1947script variable (see |s:var|) and is shared between all netrw windows (in an
1948instance of vim).
1949
1950MARKED FILES: UNMARKING *netrw-mu* {{{2
1951 (See |netrw-mf| and |netrw-mr| for how to mark files)
1952
1953The "mu" mapping will unmark all currently marked files.
1954
1955
1956NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2
1957
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001958(if you're interested in the netrw file transfer settings, see |netrw-options|)
Bram Moolenaar446cb832008-06-24 21:56:24 +00001959
1960The <netrw.vim> browser provides settings in the form of variables which
1961you may modify; by placing these settings in your <.vimrc>, you may customize
1962your browsing preferences. (see also: |netrw-settings|)
1963>
1964 --- -----------
1965 Var Explanation
1966 --- -----------
Bram Moolenaaradc21822011-04-01 18:03:16 +02001967< *g:netrw_alto* change from above splitting to below splitting
Bram Moolenaar446cb832008-06-24 21:56:24 +00001968 by setting this variable (see |netrw-o|)
1969 default: =&sb (see |'sb'|)
1970
Bram Moolenaaradc21822011-04-01 18:03:16 +02001971 *g:netrw_altv* change from left splitting to right splitting
Bram Moolenaar446cb832008-06-24 21:56:24 +00001972 by setting this variable (see |netrw-v|)
1973 default: =&spr (see |'spr'|)
1974
Bram Moolenaaradc21822011-04-01 18:03:16 +02001975 *g:netrw_banner* enable/suppress the banner
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001976 =0: suppress the banner
1977 =1: banner is enabled (default)
1978 NOTE: suppressing the banner is a new feature
1979 which may cause problems.
1980
Bram Moolenaaradc21822011-04-01 18:03:16 +02001981 *g:netrw_browse_split* when browsing, <cr> will open the file by:
Bram Moolenaar446cb832008-06-24 21:56:24 +00001982 =0: re-using the same window
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001983 =1: horizontally splitting the window first
1984 =2: vertically splitting the window first
Bram Moolenaar446cb832008-06-24 21:56:24 +00001985 =3: open file in new tab
1986 =4: act like "P" (ie. open previous window)
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001987 Note that |g:netrw_preview| may be used
1988 to get vertical splitting instead of
1989 horizontal splitting.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001990
Bram Moolenaaradc21822011-04-01 18:03:16 +02001991 *g:netrw_browsex_viewer* specify user's preference for a viewer: >
Bram Moolenaar446cb832008-06-24 21:56:24 +00001992 "kfmclient exec"
1993 "gnome-open"
1994< If >
1995 "-"
1996< is used, then netrwFileHandler() will look for
1997 a script/function to handle the given
1998 extension. (see |netrw_filehandler|).
1999
Bram Moolenaaradc21822011-04-01 18:03:16 +02002000 *g:netrw_chgperm* Unix/Linux: "chmod PERM FILENAME"
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002001 Windows: "cacls FILENAME /e /p PERM"
2002 Used to change access permission for a file.
2003
Bram Moolenaaradc21822011-04-01 18:03:16 +02002004 *g:netrw_compress* ="gzip"
Bram Moolenaar446cb832008-06-24 21:56:24 +00002005 Will compress marked files with this
2006 command
2007
Bram Moolenaaradc21822011-04-01 18:03:16 +02002008 *g:netrw_ctags* ="ctags"
Bram Moolenaarc236c162008-07-13 17:41:49 +00002009 The default external program used to create tags
2010
Bram Moolenaaradc21822011-04-01 18:03:16 +02002011 *g:netrw_cursor* = 2 (default)
2012 This option controls the use of the
2013 |'cursorline'| (cul) and |'cursorcolumn'|
2014 (cuc) settings by netrw:
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002015
Bram Moolenaaradc21822011-04-01 18:03:16 +02002016 Value Thin-Long-Tree Wide
2017 =0 u-cul u-cuc u-cul u-cuc
2018 =1 u-cul u-cuc cul u-cuc
2019 =2 cul u-cuc cul u-cuc
2020 =3 cul u-cuc cul cuc
2021 =4 cul cuc cul cuc
2022
2023 Where
2024 u-cul : user's |'cursorline'| setting used
2025 u-cuc : user's |'cursorcolumn'| setting used
2026 cul : |'cursorline'| locally set
2027 cuc : |'cursorcolumn'| locally set
2028
2029 *g:netrw_decompress* = { ".gz" : "gunzip" ,
Bram Moolenaar446cb832008-06-24 21:56:24 +00002030 ".bz2" : "bunzip2" ,
2031 ".zip" : "unzip" ,
2032 ".tar" : "tar -xf"}
2033 A dictionary mapping suffices to
2034 decompression programs.
2035
Bram Moolenaaradc21822011-04-01 18:03:16 +02002036 *g:netrw_dirhistmax* =10: controls maximum quantity of past
2037 history. May be zero to supppress
2038 history.
2039 (related: |netrw-qb| |netrw-u| |netrw-U|)
2040
2041 *g:netrw_fastbrowse* =0: slow speed directory browsing;
Bram Moolenaar446cb832008-06-24 21:56:24 +00002042 never re-uses directory listings,
2043 always obtains directory listings.
2044 =1: medium speed directory browsing;
2045 re-use directory listings only
2046 when remote directory browsing.
2047 (default value)
2048 =2: fast directory browsing;
2049 only obtains directory listings when the
2050 directory hasn't been seen before
2051 (or |netrw-ctrl-l| is used).
2052
2053 Fast browsing retains old directory listing
2054 buffers so that they don't need to be
2055 re-acquired. This feature is especially
2056 important for remote browsing. However, if
2057 a file is introduced or deleted into or from
2058 such directories, the old directory buffer
2059 becomes out-of-date. One may always refresh
2060 such a directory listing with |netrw-ctrl-l|.
2061 This option gives the user the choice of
2062 trading off accuracy (ie. up-to-date listing)
2063 versus speed.
2064
Bram Moolenaaradc21822011-04-01 18:03:16 +02002065 *g:netrw_fname_escape* =' ?&;%'
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002066 Used on filenames before remote reading/writing
Bram Moolenaar446cb832008-06-24 21:56:24 +00002067
Bram Moolenaaradc21822011-04-01 18:03:16 +02002068 *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
Bram Moolenaar446cb832008-06-24 21:56:24 +00002069 that can show up as "directories" and "files"
2070 in the listing. This pattern is used to
2071 remove such embedded messages. By default its
2072 value is:
2073 '^total\s\+\d\+$\|
2074 ^Trying\s\+\d\+.*$\|
2075 ^KERBEROS_V\d rejected\|
2076 ^Security extensions not\|
2077 No such file\|
2078 : connect to address [0-9a-fA-F:]*
2079 : No route to host$'
2080
Bram Moolenaaradc21822011-04-01 18:03:16 +02002081 *g:netrw_ftp_list_cmd* options for passing along to ftp for directory
Bram Moolenaar446cb832008-06-24 21:56:24 +00002082 listing. Defaults:
2083 unix or g:netrw_cygwin set: : "ls -lF"
2084 otherwise "dir"
2085
2086
Bram Moolenaaradc21822011-04-01 18:03:16 +02002087 *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory
Bram Moolenaar446cb832008-06-24 21:56:24 +00002088 listing, sorted by size of file.
2089 Defaults:
2090 unix or g:netrw_cygwin set: : "ls -slF"
2091 otherwise "dir"
2092
Bram Moolenaaradc21822011-04-01 18:03:16 +02002093 *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory
Bram Moolenaar446cb832008-06-24 21:56:24 +00002094 listing, sorted by time of last modification.
2095 Defaults:
2096 unix or g:netrw_cygwin set: : "ls -tlF"
2097 otherwise "dir"
2098
Bram Moolenaaradc21822011-04-01 18:03:16 +02002099 *g:netrw_glob_escape* ='[]*?`{~$' (unix)
Bram Moolenaar00a927d2010-05-14 23:24:24 +02002100 ='[]*?`{$' (windows
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002101 These characters in directory names are
Bram Moolenaar446cb832008-06-24 21:56:24 +00002102 escaped before applying glob()
2103
Bram Moolenaaradc21822011-04-01 18:03:16 +02002104 *g:netrw_hide* if true, the hiding list is used
Bram Moolenaar446cb832008-06-24 21:56:24 +00002105 default: =0
2106
Bram Moolenaaradc21822011-04-01 18:03:16 +02002107 *g:netrw_home* The home directory for where bookmarks and
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002108 history are saved (as .netrwbook and
2109 .netrwhist).
2110 default: the first directory on the
2111 |'runtimepath'|
2112
Bram Moolenaaradc21822011-04-01 18:03:16 +02002113 *g:netrw_keepdir* =1 (default) keep current directory immune from
Bram Moolenaar446cb832008-06-24 21:56:24 +00002114 the browsing directory.
2115 =0 keep the current directory the same as the
2116 browsing directory.
2117 The current browsing directory is contained in
2118 b:netrw_curdir (also see |netrw-c|)
2119
Bram Moolenaaradc21822011-04-01 18:03:16 +02002120 *g:netrw_list_cmd* command for listing remote directories
Bram Moolenaar446cb832008-06-24 21:56:24 +00002121 default: (if ssh is executable)
2122 "ssh HOSTNAME ls -FLa"
2123
Bram Moolenaaradc21822011-04-01 18:03:16 +02002124 *g:netrw_liststyle* Set the default listing style:
Bram Moolenaar446cb832008-06-24 21:56:24 +00002125 = 0: thin listing (one file per line)
2126 = 1: long listing (one file per line with time
2127 stamp information and file size)
2128 = 2: wide listing (multiple files in columns)
2129 = 3: tree style listing
Bram Moolenaaradc21822011-04-01 18:03:16 +02002130 *g:netrw_list_hide* comma separated pattern list for hiding files
Bram Moolenaar446cb832008-06-24 21:56:24 +00002131 Patterns are regular expressions (see |regexp|)
2132 Example: let g:netrw_list_hide= '.*\.swp$'
2133 default: ""
2134
Bram Moolenaaradc21822011-04-01 18:03:16 +02002135 *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002136 ="copy" Windows
Bram Moolenaar446cb832008-06-24 21:56:24 +00002137 Copies marked files (|netrw-mf|) to target
2138 directory (|netrw-mt|, |netrw-mc|)
2139
Bram Moolenaaradc21822011-04-01 18:03:16 +02002140 *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002141 ="move" Windows
Bram Moolenaar446cb832008-06-24 21:56:24 +00002142 Moves marked files (|netrw-mf|) to target
2143 directory (|netrw-mt|, |netrw-mm|)
2144
Bram Moolenaaradc21822011-04-01 18:03:16 +02002145 *g:netrw_local_mkdir* command for making a local directory
Bram Moolenaar446cb832008-06-24 21:56:24 +00002146 default: "mkdir"
2147
Bram Moolenaaradc21822011-04-01 18:03:16 +02002148 *g:netrw_local_rmdir* remove directory command (rmdir)
Bram Moolenaar446cb832008-06-24 21:56:24 +00002149 default: "rmdir"
2150
Bram Moolenaaradc21822011-04-01 18:03:16 +02002151 *g:netrw_maxfilenamelen* =32 by default, selected so as to make long
Bram Moolenaar446cb832008-06-24 21:56:24 +00002152 listings fit on 80 column displays.
2153 If your screen is wider, and you have file
2154 or directory names longer than 32 bytes,
2155 you may set this option to keep listings
2156 columnar.
2157
Bram Moolenaaradc21822011-04-01 18:03:16 +02002158 *g:netrw_mkdir_cmd* command for making a remote directory
Bram Moolenaar446cb832008-06-24 21:56:24 +00002159 default: "ssh USEPORT HOSTNAME mkdir"
2160
Bram Moolenaaradc21822011-04-01 18:03:16 +02002161 *g:netrw_mousemaps* =1 (default) enables the mouse buttons
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002162 while browsing:
2163 leftmouse : open file/directory
2164 shift-leftmouse : mark file
2165 middlemouse : same as P
2166 rightmouse : remove file/directory
2167 =0: disables mouse maps
2168
Bram Moolenaaradc21822011-04-01 18:03:16 +02002169 *g:netrw_retmap* if it exists and is set to one, then:
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002170 * if in a netrw-selected file, AND
2171 * no normal-mode <2-leftmouse> mapping exists,
2172 then the <2-leftmouse> will be mapped for easy
Bram Moolenaar446cb832008-06-24 21:56:24 +00002173 return to the netrw browser window.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002174 example: click once to select and open a file,
2175 double-click to return.
2176
2177 Note that one may instead choose to:
2178 * let g:netrw_retmap= 1, AND
2179 * nmap <silent> YourChoice <Plug>NetrwReturn
2180 and have another mapping instead of
2181 <2-leftmouse> to invoke the return.
2182
2183 You may also use the |:Rexplore| command to do
2184 the same thing.
2185
Bram Moolenaar446cb832008-06-24 21:56:24 +00002186 default: =0
2187
Bram Moolenaaradc21822011-04-01 18:03:16 +02002188 *g:netrw_rm_cmd* command for removing files
Bram Moolenaar446cb832008-06-24 21:56:24 +00002189 default: "ssh USEPORT HOSTNAME rm"
2190
Bram Moolenaaradc21822011-04-01 18:03:16 +02002191 *g:netrw_rmdir_cmd* command for removing directories
Bram Moolenaar446cb832008-06-24 21:56:24 +00002192 default: "ssh USEPORT HOSTNAME rmdir"
2193
Bram Moolenaaradc21822011-04-01 18:03:16 +02002194 *g:netrw_rmf_cmd* command for removing softlinks
Bram Moolenaar446cb832008-06-24 21:56:24 +00002195 default: "ssh USEPORT HOSTNAME rm -f"
2196
Bram Moolenaaradc21822011-04-01 18:03:16 +02002197 *g:netrw_sort_by* sort by "name", "time", or "size"
Bram Moolenaar446cb832008-06-24 21:56:24 +00002198 default: "name"
2199
Bram Moolenaaradc21822011-04-01 18:03:16 +02002200 *g:netrw_sort_direction* sorting direction: "normal" or "reverse"
Bram Moolenaar446cb832008-06-24 21:56:24 +00002201 default: "normal"
2202
Bram Moolenaaradc21822011-04-01 18:03:16 +02002203 *g:netrw_sort_options* sorting is done using |:sort|; this
Bram Moolenaarc236c162008-07-13 17:41:49 +00002204 variable's value is appended to the
2205 sort command. Thus one may ignore case,
2206 for example, with the following in your
2207 .vimrc: >
2208 let g:netrw_sort_options="i"
2209< default: ""
2210
Bram Moolenaaradc21822011-04-01 18:03:16 +02002211 *g:netrw_sort_sequence* when sorting by name, first sort by the
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002212 comma-separated pattern sequence. Note that
2213 the filigree added to indicate filetypes
2214 should be accounted for in your pattern.
Bram Moolenaar446cb832008-06-24 21:56:24 +00002215 default: '[\/]$,*,\.bak$,\.o$,\.h$,
2216 \.info$,\.swp$,\.obj$'
2217
Bram Moolenaaradc21822011-04-01 18:03:16 +02002218 *g:netrw_special_syntax* If true, then certain files will be shown
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002219 in special syntax in the browser:
Bram Moolenaar446cb832008-06-24 21:56:24 +00002220
2221 netrwBak : *.bak
2222 netrwCompress: *.gz *.bz2 *.Z *.zip
2223 netrwData : *.dat
2224 netrwHdr : *.h
2225 netrwLib : *.a *.so *.lib *.dll
2226 netrwMakefile: [mM]akefile *.mak
2227 netrwObj : *.o *.obj
2228 netrwTags : tags ANmenu ANtags
Bram Moolenaaradc21822011-04-01 18:03:16 +02002229 netrwTilde : *~
Bram Moolenaar446cb832008-06-24 21:56:24 +00002230 netrwTmp : tmp* *tmp
2231
2232 These syntax highlighting groups are linked
2233 to Folded or DiffChange by default
2234 (see |hl-Folded| and |hl-DiffChange|), but
2235 one may put lines like >
2236 hi link netrwCompress Visual
2237< into one's <.vimrc> to use one's own
2238 preferences.
2239
Bram Moolenaaradc21822011-04-01 18:03:16 +02002240 *g:netrw_ssh_cmd* One may specify an executable command
Bram Moolenaar446cb832008-06-24 21:56:24 +00002241 to use instead of ssh for remote actions
2242 such as listing, file removal, etc.
2243 default: ssh
2244
Bram Moolenaaradc21822011-04-01 18:03:16 +02002245 *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines,
Bram Moolenaar446cb832008-06-24 21:56:24 +00002246 messages, banners, and whatnot that one doesn't
2247 want masquerading as "directories" and "files".
2248 Use this pattern to remove such embedded
2249 messages. By default its value is:
2250 '^total\s\+\d\+$'
2251
2252
Bram Moolenaaradc21822011-04-01 18:03:16 +02002253 *g:netrw_tmpfile_escape* =' &;'
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002254 escape() is applied to all temporary files
Bram Moolenaar446cb832008-06-24 21:56:24 +00002255 to escape these characters.
2256
Bram Moolenaaradc21822011-04-01 18:03:16 +02002257 *g:netrw_timefmt* specify format string to vim's strftime().
Bram Moolenaar446cb832008-06-24 21:56:24 +00002258 The default, "%c", is "the preferred date
2259 and time representation for the current
2260 locale" according to my manpage entry for
2261 strftime(); however, not all are satisfied
2262 with it. Some alternatives:
2263 "%a %d %b %Y %T",
2264 " %a %Y-%m-%d %I-%M-%S %p"
2265 default: "%c"
2266
Bram Moolenaaradc21822011-04-01 18:03:16 +02002267 *g:netrw_use_noswf* netrw normally avoids writing swapfiles
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002268 for browser buffers. However, under some
Bram Moolenaar446cb832008-06-24 21:56:24 +00002269 systems this apparently is causing nasty
2270 ml_get errors to appear; if you're getting
2271 ml_get errors, try putting
2272 let g:netrw_use_noswf= 0
2273 in your .vimrc.
2274
Bram Moolenaaradc21822011-04-01 18:03:16 +02002275 *g:netrw_winsize* specify initial size of new windows made with
Bram Moolenaar446cb832008-06-24 21:56:24 +00002276 "o" (see |netrw-o|), "v" (see |netrw-v|),
2277 |:Hexplore| or |:Vexplore|.
2278 default: ""
2279
Bram Moolenaaradc21822011-04-01 18:03:16 +02002280 *g:netrw_xstrlen* Controls how netrw computes string lengths,
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002281 including multi-byte characters' string
Bram Moolenaar446cb832008-06-24 21:56:24 +00002282 length. (thanks to N Weibull, T Mechelynck)
2283 =0: uses Vim's built-in strlen()
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002284 =1: number of codepoints (Latin a + combining
Bram Moolenaar446cb832008-06-24 21:56:24 +00002285 circumflex is two codepoints) (DEFAULT)
2286 =2: number of spacing codepoints (Latin a +
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002287 combining circumflex is one spacing
Bram Moolenaar446cb832008-06-24 21:56:24 +00002288 codepoint; a hard tab is one; wide and
2289 narrow CJK are one each; etc.)
2290 =3: virtual length (counting tabs as anything
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002291 between 1 and |'tabstop'|, wide CJK as 2
Bram Moolenaar446cb832008-06-24 21:56:24 +00002292 rather than 1, Arabic alif as zero when
2293 immediately preceded by lam, one
2294 otherwise, etc)
2295
Bram Moolenaaradc21822011-04-01 18:03:16 +02002296 *g:NetrwTopLvlMenu* This variable specifies the top level
Bram Moolenaar446cb832008-06-24 21:56:24 +00002297 menu name; by default, it's "Netrw.". If
2298 you wish to change this, do so in your
2299 .vimrc.
2300
2301NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* {{{2
2302
2303Netrw has been designed to handle user options by saving them, setting the
2304options to something that's compatible with netrw's needs, and then restoring
2305them. However, the autochdir option: >
2306 :set acd
2307is problematical. Autochdir sets the current directory to that containing the
2308file you edit; this apparently also applies to directories. In other words,
2309autochdir sets the current directory to that containing the "file" (even if
2310that "file" is itself a directory).
2311
Bram Moolenaaradc21822011-04-01 18:03:16 +02002312NETRW BROWSER SETTINGS *netrw-settings* {{{2
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00002313
2314With the NetrwSettings.vim plugin, >
2315 :NetrwSettings
2316will bring up a window with the many variables that netrw uses for its
Bram Moolenaar1afcace2005-11-25 19:54:28 +00002317settings. You may change any of their values; when you save the file, the
2318settings therein will be used. One may also press "?" on any of the lines for
2319help on what each of the variables do.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00002320
Bram Moolenaar446cb832008-06-24 21:56:24 +00002321(also see: |netrw-browser-var| |netrw-protocol| |netrw-var| |netrw-variables|)
Bram Moolenaar9964e462007-05-05 17:54:07 +00002322
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00002323
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00002324==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00002325OBTAINING A FILE *netrw-O* {{{2
2326
2327If there are no marked files:
2328
2329 When browsing a remote directory, one may obtain a file under the cursor
2330 (ie. get a copy on your local machine, but not edit it) by pressing the O
2331 key.
2332
2333If there are marked files:
2334
2335 The marked files will be obtained (ie. a copy will be transferred to your
2336 local machine, but not set up for editing).
2337
2338Only ftp and scp are supported for this operation (but since these two are
2339available for browsing, that shouldn't be a problem). The status bar will
2340then show, on its right hand side, a message like "Obtaining filename". The
2341statusline will be restored after the transfer is complete.
2342
2343Netrw can also "obtain" a file using the local browser. Netrw's display
2344of a directory is not necessarily the same as Vim's "current directory",
2345unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select
2346a file using the local browser (by putting the cursor on it) and pressing
2347"O" will then "obtain" the file; ie. copy it to Vim's current directory.
2348
2349Related topics:
2350 * To see what the current directory is, use |:pwd|
2351 * To make the currently browsed directory the current directory, see |netrw-c|
2352 * To automatically make the currently browsed directory the current
2353 directory, see |g:netrw_keepdir|.
2354
2355
Bram Moolenaaradc21822011-04-01 18:03:16 +02002356 *netrw-createfile*
Bram Moolenaarc236c162008-07-13 17:41:49 +00002357OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%*
2358
2359To open a file in netrw's current directory, press "%". This map will
2360query the user for a new filename; an empty file by that name will be
2361placed in the netrw's current directory (ie. b:netrw_curdir).
2362
2363
Bram Moolenaar446cb832008-06-24 21:56:24 +00002364PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2
2365
2366One may use a preview window by using the "p" key when the cursor is atop the
2367desired filename to be previewed. The display will then split to show both
2368the browser (where the cursor will remain) and the file (see |:pedit|).
2369By default, the split will be taken horizontally; one may use vertical
2370splitting if one has set |g:netrw_preview| first.
2371
Bram Moolenaar00a927d2010-05-14 23:24:24 +02002372An interesting set of netrw settings is: >
2373
2374 let g:netrw_preview = 1
2375 let g:netrw_liststyle = 3
2376 let g:netrw_winsize = 30
2377
2378These will:
2379 1. Make vertical splitting the default for previewing files
2380 2. Make the default listing style "tree"
2381 3. When a vertical preview window is opened, the directory listing
2382 will use only 30 columns; the rest of the window is used for the
2383 preview window.
Bram Moolenaar446cb832008-06-24 21:56:24 +00002384
2385PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2
2386
2387To edit a file or directory in the previously used (last accessed) window (see
2388:he |CTRL-W_p|), press a "P". If there's only one window, then the one window
2389will be horizontally split (above/below splitting is controlled by
2390|g:netrw_alto|, and its initial size is controlled by |g:netrw_winsize|).
2391
2392If there's more than one window, the previous window will be re-used on
2393the selected file/directory. If the previous window's associated buffer
2394has been modified, and there's only one window with that buffer, then
2395the user will be asked if s/he wishes to save the buffer first (yes,
2396no, or cancel).
2397
2398
2399REFRESHING THE LISTING *netrw-ctrl-l* *netrw-ctrl_l* {{{2
2400
2401To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
2402hit the <cr> when atop the ./ directory entry in the listing. One may also
2403refresh a local directory by using ":e .".
2404
2405
2406RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2
2407
2408If there are no marked files: (see |netrw-mf|)
2409
2410 Renaming/moving files and directories involves moving the cursor to the
2411 file/directory to be moved (renamed) and pressing "R". You will then be
2412 queried for where you want the file/directory to be moved. You may select
2413 a range of lines with the "V" command (visual selection), and then
2414 pressing "R".
2415
2416If there are marked files: (see |netrw-mf|)
2417
2418 Marked files will be renamed (moved). You will be queried as above in
2419 order to specify where you want the file/directory to be moved.
2420
2421 WARNING:~
2422
2423 Note that moving files is a dangerous operation; copies are safer. That's
2424 because a "move" for remote files is actually a copy + delete -- and if
2425 the copy fails and the delete does not, you may lose the file.
2426
2427The g:netrw_rename_cmd variable is used to implement renaming. By default its
2428value is:
2429
2430 ssh HOSTNAME mv
2431
2432One may rename a block of files and directories by selecting them with
2433the V (|linewise-visual|).
2434
2435
2436REVERSING SORTING ORDER *netrw-r* *netrw-reverse* {{{2
2437
2438One may toggle between normal and reverse sorting order by pressing the
2439"r" key.
2440
2441Related topics: |netrw-s|
2442Associated setting variable: |g:netrw_sort_direction|
2443
2444
2445SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2
2446
2447One may select the sorting style by name, time, or (file) size. The "s" map
2448allows one to circulate amongst the three choices; the directory listing will
2449automatically be refreshed to reflect the selected style.
2450
2451Related topics: |netrw-r| |netrw-S|
2452Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
2453
2454
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002455SETTING EDITING WINDOW *netrw-C* {{{2
2456
2457One may select a netrw window for editing with the "C" mapping, or by setting
2458g:netrw_chgwin to the selected window number. Subsequent selection of a file
2459to edit (|netrw-cr|) will use that window.
2460
2461Related topics: |netrw-cr|
2462Associated setting variables: |g:netrw_chgwin|
2463
2464
Bram Moolenaar446cb832008-06-24 21:56:24 +0000246510. Problems and Fixes *netrw-problems* {{{1
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002466
2467 (This section is likely to grow as I get feedback)
2468 (also see |netrw-debug|)
Bram Moolenaar488c6512005-08-11 20:09:58 +00002469 *netrw-p1*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002470 P1. I use windows 95, and my ftp dumps four blank lines at the
2471 end of every read.
2472
2473 See |netrw-fixup|, and put the following into your
2474 <.vimrc> file:
2475
2476 let g:netrw_win95ftp= 1
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00002477
Bram Moolenaar488c6512005-08-11 20:09:58 +00002478 *netrw-p2*
Bram Moolenaar9964e462007-05-05 17:54:07 +00002479 P2. I use Windows, and my network browsing with ftp doesn't sort by
2480 time or size! -or- The remote system is a Windows server; why
2481 don't I get sorts by time or size?
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002482
2483 Windows' ftp has a minimal support for ls (ie. it doesn't
2484 accept sorting options). It doesn't support the -F which
2485 gives an explanatory character (ABC/ for "ABC is a directory").
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002486 Netrw then uses "dir" to get both its thin and long listings.
Bram Moolenaar9964e462007-05-05 17:54:07 +00002487 If you think your ftp does support a full-up ls, put the
2488 following into your <.vimrc>: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002489
Bram Moolenaar9964e462007-05-05 17:54:07 +00002490 let g:netrw_ftp_list_cmd = "ls -lF"
2491 let g:netrw_ftp_timelist_cmd= "ls -tlF"
2492 let g:netrw_ftp_sizelist_cmd= "ls -slF"
2493<
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002494 Alternatively, if you have cygwin on your Windows box, put
Bram Moolenaar9964e462007-05-05 17:54:07 +00002495 into your <.vimrc>: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002496
2497 let g:netrw_cygwin= 1
Bram Moolenaar9964e462007-05-05 17:54:07 +00002498<
2499 This problem also occurs when the remote system is Windows.
2500 In this situation, the various g:netrw_ftp_[time|size]list_cmds
2501 are as shown above, but the remote system will not correctly
2502 modify its listing behavior.
2503
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002504
Bram Moolenaar488c6512005-08-11 20:09:58 +00002505 *netrw-p3*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002506 P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw
2507 used ssh! That wasn't what I asked for...
2508
2509 Netrw has two methods for browsing remote directories: ssh
2510 and ftp. Unless you specify ftp specifically, ssh is used.
2511 When it comes time to do download a file (not just a directory
2512 listing), netrw will use the given protocol to do so.
2513
Bram Moolenaar488c6512005-08-11 20:09:58 +00002514 *netrw-p4*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002515 P4. I would like long listings to be the default.
2516
Bram Moolenaar446cb832008-06-24 21:56:24 +00002517 Put the following statement into your |.vimrc|: >
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002518
Bram Moolenaar446cb832008-06-24 21:56:24 +00002519 let g:netrw_liststyle= 1
2520<
2521 Check out |netrw-browser-var| for more customizations that
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002522 you can set.
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002523
Bram Moolenaar488c6512005-08-11 20:09:58 +00002524 *netrw-p5*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002525 P5. My times come up oddly in local browsing
2526
2527 Does your system's strftime() accept the "%c" to yield dates
2528 such as "Sun Apr 27 11:49:23 1997"? If not, do a "man strftime"
2529 and find out what option should be used. Then put it into
Bram Moolenaar446cb832008-06-24 21:56:24 +00002530 your |.vimrc|: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002531
Bram Moolenaar446cb832008-06-24 21:56:24 +00002532 let g:netrw_timefmt= "%X" (where X is the option)
2533<
Bram Moolenaar488c6512005-08-11 20:09:58 +00002534 *netrw-p6*
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00002535 P6. I want my current directory to track my browsing.
2536 How do I do that?
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002537
Bram Moolenaar446cb832008-06-24 21:56:24 +00002538 Put the following line in your |.vimrc|:
2539>
Bram Moolenaar433f7c82006-03-21 21:29:36 +00002540 let g:netrw_keepdir= 0
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002541<
Bram Moolenaar9964e462007-05-05 17:54:07 +00002542 *netrw-p7*
2543 P7. I use Chinese (or other non-ascii) characters in my filenames, and
2544 netrw (Explore, Sexplore, Hexplore, etc) doesn't display them!
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00002545
Bram Moolenaar9964e462007-05-05 17:54:07 +00002546 (taken from an answer provided by Wu Yongwei on the vim
2547 mailing list)
2548 I now see the problem. You code page is not 936, right? Vim
2549 seems only able to open files with names that are valid in the
2550 current code page, as are many other applications that do not
2551 use the Unicode version of Windows APIs. This is an OS-related
2552 issue. You should not have such problems when the system
2553 locale uses UTF-8, such as modern Linux distros.
2554
2555 (...it is one more reason to recommend that people use utf-8!)
2556
2557 *netrw-p8*
2558 P8. I'm getting "ssh is not executable on your system" -- what do I
2559 do?
2560
2561 (Dudley Fox) Most people I know use putty for windows ssh. It
2562 is a free ssh/telnet application. You can read more about it
2563 here:
2564
2565 http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also:
2566
2567 (Marlin Unruh) This program also works for me. It's a single
2568 executable, so he/she can copy it into the Windows\System32
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002569 folder and create a shortcut to it.
Bram Moolenaar9964e462007-05-05 17:54:07 +00002570
2571 (Dudley Fox) You might also wish to consider plink, as it
2572 sounds most similar to what you are looking for. plink is an
2573 application in the putty suite.
2574
2575 http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink
2576
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002577 (Vissale Neang) Maybe you can try OpenSSH for windows, which
Bram Moolenaar9964e462007-05-05 17:54:07 +00002578 can be obtained from:
2579
2580 http://sshwindows.sourceforge.net/
2581
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002582 It doesn't need the full Cygwin package.
Bram Moolenaar9964e462007-05-05 17:54:07 +00002583
2584 (Antoine Mechelynck) For individual Unix-like programs needed
2585 for work in a native-Windows environment, I recommend getting
2586 them from the GnuWin32 project on sourceforge if it has them:
2587
2588 http://gnuwin32.sourceforge.net/
2589
2590 Unlike Cygwin, which sets up a Unix-like virtual machine on
2591 top of Windows, GnuWin32 is a rewrite of Unix utilities with
2592 Windows system calls, and its programs works quite well in the
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002593 cmd.exe "Dos box".
Bram Moolenaar9964e462007-05-05 17:54:07 +00002594
2595 (dave) Download WinSCP and use that to connect to the server.
2596 In Preferences > Editors, set gvim as your editor:
2597
2598 - Click "Add..."
2599 - Set External Editor (adjust path as needed, include
2600 the quotes and !.! at the end):
2601 "c:\Program Files\Vim\vim70\gvim.exe" !.!
2602 - Check that the filetype in the box below is
2603 {asterisk}.{asterisk} (all files), or whatever types
2604 you want (cec: change {asterisk} to * ; I had to
2605 write it that way because otherwise the helptags
Bram Moolenaar446cb832008-06-24 21:56:24 +00002606 system thinks it's a tag)
2607 - Make sure it's at the top of the listbox (click it,
2608 then click "Up" if it's not)
Bram Moolenaar9964e462007-05-05 17:54:07 +00002609 If using the Norton Commander style, you just have to hit <F4>
2610 to edit a file in a local copy of gvim.
2611
2612 (Vit Gottwald) How to generate public/private key and save
2613 public key it on server: >
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +02002614 http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey-gettingready
2615 (8.3 Getting ready for public key authentication)
Bram Moolenaar9964e462007-05-05 17:54:07 +00002616<
Bram Moolenaar446cb832008-06-24 21:56:24 +00002617 How to use a private key with 'pscp': >
2618
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +02002619 http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter5.html
2620 (5.2.4 Using public key authentication with PSCP)
Bram Moolenaar9964e462007-05-05 17:54:07 +00002621<
Bram Moolenaar446cb832008-06-24 21:56:24 +00002622 (Ben Schmidt) I find the ssh included with cwRsync is
2623 brilliant, and install cwRsync or cwRsyncServer on most
2624 Windows systems I come across these days. I guess COPSSH,
2625 packed by the same person, is probably even better for use as
2626 just ssh on Windows, and probably includes sftp, etc. which I
2627 suspect the cwRsync doesn't, though it might
2628
Bram Moolenaar9964e462007-05-05 17:54:07 +00002629 (cec) To make proper use of these suggestions above, you will
2630 need to modify the following user-settable variables in your
2631 .vimrc:
2632
Bram Moolenaar446cb832008-06-24 21:56:24 +00002633 |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd|
2634 |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd|
Bram Moolenaar9964e462007-05-05 17:54:07 +00002635
2636 The first one (|g:netrw_ssh_cmd|) is the most important; most
2637 of the others will use the string in g:netrw_ssh_cmd by
2638 default.
2639 *netrw-p9* *netrw-ml_get*
2640 P9. I'm browsing, changing directory, and bang! ml_get errors
2641 appear and I have to kill vim. Any way around this?
2642
2643 Normally netrw attempts to avoid writing swapfiles for
2644 its temporary directory buffers. However, on some systems
2645 this attempt appears to be causing ml_get errors to
2646 appear. Please try setting |g:netrw_use_noswf| to 0
2647 in your <.vimrc>: >
2648 let g:netrw_use_noswf= 0
2649<
Bram Moolenaar446cb832008-06-24 21:56:24 +00002650 *netrw-p10*
2651 P10. I'm being pestered with "[something] is a directory" and
2652 "Press ENTER or type command to continue" prompts...
2653
2654 The "[something] is a directory" prompt is issued by Vim,
2655 not by netrw, and there appears to be no way to work around
2656 it. Coupled with the default cmdheight of 1, this message
2657 causes the "Press ENTER..." prompt. So: read |hit-enter|;
2658 I also suggest that you set your |'cmdheight'| to 2 (or more) in
2659 your <.vimrc> file.
2660
2661 *netrw-p11*
2662 P11. I want to have two windows; a thin one on the left and my editing
2663 window on the right. How can I do this?
2664
2665 * Put the following line in your <.vimrc>:
2666 let g:netrw_altv = 1
2667 * Edit the current directory: :e .
2668 * Select some file, press v
2669 * Resize the windows as you wish (see |CTRL-W_<| and
2670 |CTRL-W_>|). If you're using gvim, you can drag
2671 the separating bar with your mouse.
2672 * When you want a new file, use ctrl-w h to go back to the
2673 netrw browser, select a file, then press P (see |CTRL-W_h|
2674 and |netrw-P|). If you're using gvim, you can press
2675 <leftmouse> in the browser window and then press the
2676 <middlemouse> to select the file.
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002677
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002678 *netrw-p12*
2679 P12. My directory isn't sorting correctly, or unwanted letters are
2680 appearing in the listed filenames, or things aren't lining
2681 up properly in the wide listing, ...
2682
2683 This may be due to an encoding problem. I myself usually use
2684 utf-8, but really only use ascii (ie. bytes from 32-126).
2685 Multibyte encodings use two (or more) bytes per character.
2686 You may need to change |g:netrw_sepchr| and/or |g:netrw_xstrlen|.
2687
Bram Moolenaar00a927d2010-05-14 23:24:24 +02002688 *netrw-p13*
2689 P13. I'm a Windows + putty + ssh user, and when I attempt to browse,
2690 the directories are missing trailing "/"s so netrw treats them
2691 as file transfers instead of as attempts to browse
2692 subdirectories. How may I fix this?
2693
2694 (mikeyao) If you want to use vim via ssh and putty under Windows,
2695 try combining the use of pscp/psftp with plink. pscp/psftp will
2696 be used to connect and plink will be used to execute commands on
2697 the server, for example: list files and directory using 'ls'.
2698
2699 These are the settings I use to do this:
2700>
2701 " list files, it's the key setting, if you haven't set,
2702 " you will get a blank buffer
2703 let g:netrw_list_cmd = "plink HOSTNAME ls -Fa"
2704 " if you haven't add putty directory in system path, you should
2705 " specify scp/sftp command. For examples:
2706 "let g:netrw_sftp_cmd = "d:\\dev\\putty\\PSFTP.exe"
2707 "let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe"
2708<
2709
2710
Bram Moolenaarc0197e22004-09-13 20:26:32 +00002711==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +0000271211. Debugging Netrw Itself *netrw-debug* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00002713
Bram Moolenaaradc21822011-04-01 18:03:16 +02002714The <netrw.vim> script is typically available as something like:
Bram Moolenaar488c6512005-08-11 20:09:58 +00002715>
Bram Moolenaar446cb832008-06-24 21:56:24 +00002716 /usr/local/share/vim/vim7x/plugin/netrwPlugin.vim
2717 /usr/local/share/vim/vim7x/autoload/netrw.vim
Bram Moolenaaradc21822011-04-01 18:03:16 +02002718< -or- >
2719 /usr/local/share/vim/vim6x/plugin/netrwPlugin.vim
2720 /usr/local/share/vim/vim6x/autoload/netrw.vim
Bram Moolenaar488c6512005-08-11 20:09:58 +00002721<
Bram Moolenaar071d4272004-06-13 20:20:40 +00002722which is loaded automatically at startup (assuming :set nocp).
2723
2724 1. Get the <Decho.vim> script, available as:
2725
Bram Moolenaar446cb832008-06-24 21:56:24 +00002726 http://mysite.verizon.net/astronaut/vim/index.html#DECHO
Bram Moolenaar071d4272004-06-13 20:20:40 +00002727 or
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00002728 http://vim.sourceforge.net/scripts/script.php?script_id=120
Bram Moolenaar071d4272004-06-13 20:20:40 +00002729
Bram Moolenaar446cb832008-06-24 21:56:24 +00002730 It now comes as a "vimball"; if you're using vim 7.0 or earlier,
2731 you'll need to update vimball, too. See
2732 http://mysite.verizon.net/astronaut/vim/index.html#VIMBALL
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00002733
Bram Moolenaar446cb832008-06-24 21:56:24 +00002734 2. Edit the <netrw.vim> file by typing: >
Bram Moolenaard4755bb2004-09-02 19:12:26 +00002735
2736 vim netrw.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +00002737 :DechoOn
Bram Moolenaard4755bb2004-09-02 19:12:26 +00002738 :wq
Bram Moolenaar446cb832008-06-24 21:56:24 +00002739<
2740 To restore to normal non-debugging behavior, re-edit <netrw.vim>
2741 and type >
Bram Moolenaar071d4272004-06-13 20:20:40 +00002742
Bram Moolenaard4755bb2004-09-02 19:12:26 +00002743 vim netrw.vim
2744 :DechoOff
2745 :wq
Bram Moolenaar446cb832008-06-24 21:56:24 +00002746<
Bram Moolenaard4755bb2004-09-02 19:12:26 +00002747 This command, provided by <Decho.vim>, will comment out all
2748 Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()).
2749
Bram Moolenaar446cb832008-06-24 21:56:24 +00002750 3. Then bring up vim and attempt to evoke the problem by doing a
2751 transfer or doing some browsing. A set of messages should appear
2752 concerning the steps that <netrw.vim> took in attempting to
2753 read/write your file over the network in a separate tab.
Bram Moolenaar071d4272004-06-13 20:20:40 +00002754
Bram Moolenaar9964e462007-05-05 17:54:07 +00002755 To save the file, use >
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002756 :tabnext
Bram Moolenaar9964e462007-05-05 17:54:07 +00002757 :set bt=
2758 :w! DBG
2759< Please send that information to <netrw.vim>'s maintainer, >
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00002760 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
Bram Moolenaar9964e462007-05-05 17:54:07 +00002761<
Bram Moolenaar071d4272004-06-13 20:20:40 +00002762==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000276312. History *netrw-history* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00002764
Bram Moolenaaradc21822011-04-01 18:03:16 +02002765 v141: Aug 28, 2010 * added -s:... support for Windows ftp
2766 * restored 2-leftmouse for :Rex-like return
2767 * added balloon help for banner
2768 Oct 26, 2010 * :Texplore changed to start from netrw's idea
2769 of the current directory, not pwd's
2770 Feb 10, 2011 * netrwPlugin modified to use BufReadCmd
2771 when the "filename" ends with a "/" or a "\"
2772 Avoids "... is a directory" message, works
2773 inside a try-catch-endtry clause.
2774 Feb 22, 2011 * for menus, &go =~# used to insure correct case
Bram Moolenaar477db062010-07-28 18:17:41 +02002775 v140: Jul 27, 2010 * (Lech Lorens) unexpected change of window
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +02002776 v139: May 14, 2010 * when viewing remote directory listings and
2777 changing listing style, going to tree listing
2778 mode was issuing two rather useless messages
2779 about the buffer name. They have now been
2780 silenced.
2781 * (Jean Johner) with "behave mswin", clicking
2782 on a filename in wide mode opened a new file
2783 with a missing first letter
2784 * (Britton Kerin) wanted netrw listings to be
2785 buflisted; the |g:netrw_bufsettings| option
2786 permits that.
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +02002787 Jun 18, 2010 * (Jan Steffens) added support for xz compression
2788 Jun 23, 2010 * vimdiff dir1 dir2 now works
Bram Moolenaar477db062010-07-28 18:17:41 +02002789 Jul 27, 2010 * (John Orr) pointed out that the intended maparg
2790 test for gx was actually testing for g rather
2791 than gx. Fixed.
Bram Moolenaar00a927d2010-05-14 23:24:24 +02002792 v138: May 01, 2010 * added the bomb setting to the Save-Set-Restore
2793 option handling (for Tony M)
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +02002794 May 14, 2010 * (Bram Moolenaar) netrw optionally sets cursorline
Bram Moolenaar00a927d2010-05-14 23:24:24 +02002795 (and sometimes cursorcolumn) for its display.
2796 This option setting was leaking through with
2797 remote file handling.
2798 v137: Dec 28, 2009 * modified the preview window handling for
2799 vertically split windows. The preview
2800 window will take up all but g:netrw_winsize
Bram Moolenaaradc21822011-04-01 18:03:16 +02002801 columns of the original window; those
Bram Moolenaar00a927d2010-05-14 23:24:24 +02002802 g:netrw_winsize columns will be used for
2803 the netrw listing.
2804 * (Simon Dambe) removed "~" from
2805 |g:netrw_glob_escape| under Windows
2806 * (Bram Moolenaar) modified test for status bar
2807 click with leftmouse. Moved code to
2808 s:NetrwLeftmouse().
2809 Feb 24, 2010 * (for Jean Johner) added insert-mode maps; one
2810 can get into insert mode with netrw via
2811 ctrl-o :e .
2812 Mar 15, 2010 * (Dominique Pellé) Directory with backslashes such
2813 as foo\bar were not being entered/left properly
2814 Mar 15, 2010 * Using :Explore .. and causing two FocusGained
2815 events caused the directory to change. Fixed.
2816 Mar 22, 2010 * Last fix caused problems for *//pat and */filepat
2817 searches.
2818 Mar 30, 2010 * With :set hidden and changing listing styles 8
2819 times, the tree listing buffer was being marked
2820 as modified upon exit. Fixed.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002821 v136: Jan 14, 2009 * extended |g:Netrw_funcref| to also handle lists
2822 of function references
2823 Jan 14, 2009 * (reported by Marvin Renich) with spell check
2824 enabled, some filenamess will still being
2825 displayed as spelling errors.
2826 Apr 13, 2009 * (Björn Winckler) writing a file using
2827 remote scp caused syntax highlighting problem.
2828 Solution: avoid syntax/syntax.vim's
2829 au Filetype * syntax setting autocommand by
2830 checking that the current buffer has the
2831 netrw filetype before attempting a doau
2832 in s:NetrwSafeOptions().
2833 Apr 14, 2009 * (asgeo1) suggested the "T" map (|netrw-T|)
2834 Apr 14, 2009 * marking wasn't working on executable and
2835 other special filenames
2836 Apr 20, 2009 * (Dennis Benzinger) files opened via http have
2837 their syntax filetype auto-detected
2838 Jun 19, 2009 * (Yukihiro Nakadaira) help document improvements
2839 Jul 22, 2009 * g:netrw_browse_split will honor the
2840 |'equalalways'| setting.
2841 Jul 29, 2009 * implemented "I" mapping to toggle banner
2842 (this is experimental and still being debugged)
2843 Sep 19, 2009 * (Mike McEwan) writes via ftp now send both
2844 g:netrw_ftpmode and g:netrw_ftpextracmd (if the
2845 latter exists)
2846 Dec 02, 2009 * netrw uses vimgrep several places; it now uses
2847 "noautocmd vimgrep" (should be speedier).
2848 Dec 03, 2009 * changed back to using -source instead of -dump
2849 for elinks-using commands. (requested by James
2850 Vega and Karsten Hopp)
2851 v135: Oct 29, 2008 * using |simplify()| on directory names
2852 (supporting handling ".."s in directory names)
2853 Oct 31, 2008 * added special file highlighting for core dumps
2854 under Unix/Linux. The default sorting sequence
2855 now also gives core dumps priority.
2856 Nov 10, 2008 * uses a call to netrw#Nread() instead of Nread
2857 to avoid having to use fnameescape()
2858 * fixed a tree redrawing problem (open directory,
2859 open subdir, close subdir, close dir)
2860 Nov 19, 2008 * sprinkled some histdel("/",-1)s through the code
2861 in an attempt to prevent netrw from changing
2862 the search history.
2863 Jan 02, 2009 * |g:Netrw_funcref| included
2864 Jan 05, 2009 * Explore */ **/ *// **// all clear explorer
2865 variables
2866 Jan 05, 2009 * (Panagiotis Louridas) extended s:WinPath()
2867 to remove cygdrive from non-cygwin Windows
2868 paths. Improved the determination as to
2869 whether or not to do so.
2870 Jan 13, 2009 * included contains=@NoSpell in every syntax
2871 group for syntax/netrw.vim .
2872 v134: Sep 30, 2008 * (Sander Marechal) provided a bugfix involving
2873 the use of the |netrw-t| command with a remote
2874 directory.
2875 Sep 30, 2008 * using "x" on a remote jpg was failing; fixed.
2876 Oct 03, 2008 * bookmarks now go on a list and are stored to
2877 the first directory on the |'runtimepath'| in
2878 the hopes of making their retention reliable.
2879 History now also goes to that directory.
2880 Oct 07, 2008 * Included check that vim 7.0 or later is in use.
2881 Oct 07, 2008 * Improved |g:netrw_retmap| handling.
2882 Oct 12, 2008 * Based upon Sébastien Migniot's suggestion, if
2883 cadaver isn't available then netrw will try to
2884 use curl for the dav://... protocol.
2885 Oct 13, 2008 * added @*/ to netrw buffers' |'iskeyword'|setting
2886 This lets mf (|netrw-mf|) mark directories, links
2887 and executables.
2888 Oct 13, 2008 * avoids a second NetrwBrowse() refresh when
2889 g:netrw_fastbrowse is <= 1 (slow, medium speed)
2890 Oct 22, 2008 * |g:netrw_http_xcmd| may now be overridden
2891 independently of |g:netrw_http_cmd|.
2892 Oct 23, 2008 * [N] added to the various Explore commands to
2893 let users specify the width/height of new
2894 explorer windows, overriding |g:netrw_winsize|.
2895 v133: Aug 10, 2008 * NetReadFixup() for win95 was missing some "a:"s
2896 Aug 12, 2008 * (Jan Minář) an error condition in NetrwMethod()
2897 wasn't being used, resulting in "b:netrw_fname
2898 undefined" errors
2899 Aug 12, 2008 * (François Ingeirest) asked that "hi link" be
2900 changed to hi default link in the netrw syntax
2901 files.
2902 Aug 12, 2008 * using s:NetrwUnmarkList() more often. Filenames
2903 were being left on the global list when removed
2904 from the buffer-local lists.
2905 Aug 14, 2008 * (Joshua Clayton) an errant extra ")" was left in
2906 the rcp-handling portion of NetRead().
2907 Sep 03, 2008 * added |'cursorline'| highlighting to thin, long,
2908 and tree displays.
Bram Moolenaared39e1d2008-08-09 17:55:22 +00002909 v132: Aug 06, 2008 * Fixed marked file-based obtain
2910 Aug 08, 2008 * sourcing a file via ftp from a netrw-generated
2911 buffer (or any buffer with |'nobl'|) left an
2912 empty no-name buffer in its wake. Fixed.
Bram Moolenaare37d50a2008-08-06 17:06:04 +00002913 v130: Jul 31, 2008 * trying out elinks/links for http://host/
2914 requests. One problem: in-page links
2915 (such as with ...#LABEL) are not supported
2916 * verified that Bram's modified netrwPlugin works
2917 Aug 01, 2008 * fixed a bug: when sourcing a file via ftp, the
2918 "filter window" was left behind.
2919 v129: Jul 31, 2008 * bug found in non-mouse enabled vim and some
2920 local maps
2921 v128: Jul 30, 2008 * much work done in using shellescape() and
2922 fnameescape()
Bram Moolenaarc236c162008-07-13 17:41:49 +00002923 v126: Jun 30, 2008 * after having gone to a remote directory,
2924 <f1> was no longer taking one to the correct
2925 entry in the help (|netrw-quickhelp|). Fixed.
2926 Jul 01, 2008 * extracting the last filename from a wide listing
2927 missed the last letter when |'virtualedit'| not
2928 enabled.
2929 Jul 01, 2008 * vim foo/bar was creating [Scratch] buffers,
2930 where bar was also a directory
2931 Jul 01, 2008 * numerous additional changes were made to netrw
2932 to use fnameescape() and shellescape() instead
2933 of escape(). Not all changes have been tested
2934 as yet...
2935 Jul 01, 2008 * (James Vega reported) some problems with
2936 :NetrwSettings (due to no longer used setting
2937 variables).
2938 Jul 07, 2008 * Additional numerous changes to support security;
2939 shellescape(arg,1), etc.
Bram Moolenaar446cb832008-06-24 21:56:24 +00002940 v125: Apr 07, 2008 * (Cristian Rigamonti) CR provides a patch; he
2941 noted that gx was failing since its call to
2942 netrw#NetBrowseX() wasn't updated to
2943 netrw#NetrwBrowseX().
2944 * (Stanis Trendelenburg) ST provides a patch to
2945 supports davs: (dav + ssl)
2946 * (Rick Choi) noted that directory names comprised
2947 of three digits were not being displayed by
2948 the internal browser. Fixed.
2949 * (Erik Falor) provided a patch to handle problems
2950 with changing directory and |'acd'| option.
2951 * (James Vega, Teemu Likonen) noted that netrw
2952 wasn't handling multi-byte filenames/directories
2953 correctly. Fixed.
2954 * (Rick) found problem with g:netrw_maxfilenamelen
2955 being overridden.
2956 * (James Vega) pointed out that netrw was
2957 misidentifying all files in a symbolically linked
2958 directory as being symbolically linked
2959 themselves. This particular problem was fixed;
2960 however, there are now situations where
2961 symbolically linked files will not be detected.
2962 Really need an internal vim function to do this
2963 identification.
2964 Apr 17, 2008 * When g:netrw_keepdir==0, current directory
2965 doesn't necessarily equal b:netrw_curdir
2966 initially. Problem is due to the patch directly
2967 above.
2968 * Fixed qf to handle case where b:netrw_curdir
2969 isn't the same as the current directory under
2970 linux/macosx.
2971 * New: |netrw-mg| (apply vimgrep to marked files)
2972 May 05, 2008 * (Rick) pointed out that a "setlocal ts=32" was
2973 interfering with g:netrw_maxfilenamelen
2974 May 05, 2008 * (James Vega) a file inside a linked directory
2975 was showing up as a symbolic link itself.
2976 May 22, 2008 * symbolic links, fifos, and sockets are now
2977 indicated by a trailing @, |, or =, respectively.
2978 Jun 06, 2008 * Removed numerous bugs from the marked file
2979 move and copy. Tested these changes under
2980 Unix only thus far.
2981 * :Rexplore returns to the screen position in the
2982 netrw listing from whence the file was edited
2983 v124: Apr 02, 2008 * (Adrian Rollett) change the line supporting the
2984 "x" action for mac to use g:netrw_shq
2985 v123: Feb 27, 2008 * Marked files now keeps a "global" marked file
2986 list. The global marked file list is used to
2987 support tag processing and vimdiff'ing
2988 (|netrw-md| |netrw-mt|)
2989 * Been insuring that mm and mc works with various
2990 combinations of local and remote directories
2991 * (Stefan Bittner) http://.../ should always have
2992 filetype "html" -- fixed.
2993 * (Stefan Bittner) a "?" in a http://.../ request
2994 wasn't being handled correctly. Fixed by
2995 removing ? from default |g:netrw_tmpfile_escape|.
2996 * (Nico Weber) % codes in http://.../ requests
2997 weren't being handled correctly. Fixed by
2998 including % in default |g:netrw_fname_escape|.
2999 * (Stefan Bittner) attempts to update Buffers.Refresh
3000 were failing because locale use changed the menu
3001 names. I implemented a workaround.
3002 v122: Feb 12, 2008 * bugfix - first sorting sequence match now has
3003 priority
3004 Feb 14, 2008 * bugfix - sorting sequence was effectively ignoring
3005 sequencing priority of anything following '*'
3006 * toggling a marked file was showing incorrect list
3007 (list was correct, but displayed matches weren't)
3008 * |g:netrw_special_syntax| implemented
3009 v121: Feb 11, 2008 * Bram M reported that :e file ... :e . would not
3010 retain the alternate file. Fixed -- I hope!
3011 * bugfix -- apparently v120 broke an explicit
3012 :Explore dirname
3013 v120: Jan 21, 2008 * |netrw-mt| changed to allow for target selection
3014 based on whether or not word under cursor is a
3015 directory or file, or if cursor is in banner
3016 area.
3017 * |netrw-mh| included (hiding by marked-file suffix)
3018 * functions moved about a bit (improved
3019 categorization)
3020 * executable files now displayed with trailing (*)
3021 * symbolically linked files now displayed with
3022 trailing (@)
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003023 * Somewhen, s:NetrwMarkFileMove() got damaged. It
3024 * is now restored (missing an endif, for example).
Bram Moolenaar446cb832008-06-24 21:56:24 +00003025 * |netrw-mu| implemented (unmarking marked files)
3026 * many bugs have been removed from the marked file
3027 system (tnx to Mark S. for feedback)
3028 * |netrw-ms| implemented (sourcing marked files)
3029 * fixed use of P with tree listing style
3030 * multiple tree listing now supported
3031 * ./ suppressed
3032 * changed q -> qb (query bookmarks)
3033 * implemented |netrw-qf|
3034 * Explore now has four special list-generation
3035 modes: */filepat **/filepat
3036 *//pattern **//pattern
3037 * gh (|netrw-gh|) is a shortcut for toggling the
3038 hiding of files and directories beginning with a
3039 dot
3040 v119: Jan 10, 2008 * When g:netrw_keepdir is false,
3041 NetrwOptionsRestore() had a problem
3042 (Bill McCarthy)
3043 Jan 11, 2008 * Netrw now shows symbolic links with a trailing
3044 "@" and special highlighting.
3045 Jan 15, 2008 * Changed g:netrw_noretmap -> |g:netrw_retmap|.
3046 Changed: disabled by default at Bram's
3047 preference.
3048 v118: Jan 02, 2008 * Fixed a problem with Windows;
3049 :Explore c:/path/ would not work,
3050 but :Explore c:/path would.
3051 * Fixed a bug in s:NetrwOptionRestore() - lcd's
3052 argument wasn't being properly escaped so it
3053 wouldn't handle spaces in directory names.
3054 (Gary Johnson)
3055 v117: Jan 02, 2008 * Fixed a problem with P; had to include
3056 a b:netrw_curdir bypass (Bram Moolenaar)
3057 v116: Nov 27, 2007 * netrw#LocalBrowseCheck() has &ft=="netrw"
3058 check to prevent doing a directory listing
3059 (was getting unexpected directory refreshes
3060 in the middle of some function calls)
3061 * NetrwOptionRestore moved after e! filename
3062 in order to retain user options for editing
3063 in s:NetrwBrowseChgDir()
3064 Dec 12, 2007 * Bug fix -- netrw does a better job of retaining
3065 user options when editing files under the aegis
3066 of the browser
3067 v115: Oct 04, 2007 * Erik Remmelzwaal pointed out that the use of
3068 shellslash in s:GetTempfile() was incorrect
3069 Oct 11, 2007 * Tracked down and eliminated a bug with editing
3070 remote *.tar.gz and *.tar.bz2 files
3071 Oct 11, 2007 * g:netrw_localmovecmd wasn't being initialized
3072 properly, and g:netrw_localcopycmd was being
3073 overwritten.
3074 Oct 12, 2007 * Placed all :Rexplore and <2-leftmouse> setup
3075 in a new support function (s:SetRexDir()).
3076 Oct 15, 2007 * new: g:netrw_browse_split == 4; means <cr>
3077 based selection will use previous window
3078 Oct 20, 2007 * also checks on |'shellxquote'| to set g:netrw_shq
3079 Oct 24, 2007 * Explore handles path/**/filename
3080 Oct 27, 2007 * sourcing remote files often didn't work with ftp,
3081 turns out that b:netrw_method was undefined, so
3082 s:SaveBufVars and s:RestoreBufVars() fixed it.
3083 v114: Sep 28, 2007 * mT, the map that invokes tags, has been improved
3084 to support use of remote tags files.
3085 Oct 02, 2007 * changed Netrw menu to use more submenus
3086 v113: Sep 07, 2007 * worked out why the cursor position wasn't being
3087 saved and restored as intended after doing such
3088 things as deleting and renaming files.
3089 Sep 11, 2007 * Fixed bug which effectively disabled <c-l> and
3090 <c-h> maps
3091 Sep 18, 2007 * there used to be one NetrwOptionRestore() call at
3092 the end of the s:NetrwBrowseChgDir() function;
3093 they're now at the end of every if..elseif..else
3094 block. The edit-a-file one is not quite at the end
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003095 of its block; instead, it's just before the edit.
Bram Moolenaar446cb832008-06-24 21:56:24 +00003096 Restores user options, then this new placement
3097 allows ftplugins, autocmds, etc to change settings
3098 (ex. ftplugin/cpp.vim sets cindent).
3099 Sep 19, 2007 * changed all strlen() calls to use s:Strlen(), a
3100 function which handles utf-8 wide characters
3101 correctly.
3102 Sep 20, 2007 * (Nico Weber) the "x" command has been extended
3103 to Mac's OS/X (macunix); it now uses open to
3104 handle |netrw-x| browsing with special files.
3105 Sep 22, 2007 * Added g:netrw_noretmap to netrw at Tony M's
3106 request.
3107 * Included path to NetrwRemoteRmFile()
3108 v112: Aug 18, 2007 * added mx (|netrw-mx|) for executing arbitrary
3109 commands on marked files
3110 Aug 22, 2007 * more option save/restore work for
3111 s:NetrwBrowseChgDir(); s:NetrwOptionSave()
3112 and s:NetrwOptionRestore() now take a parameter
3113 specifying the type of variables to be used for
3114 saving and restoring (either "w:" or "s:")
3115 Sep 04, 2007 * added the :NetrwClean[!] command
3116 v111: Jul 25, 2007 * using Windows but not using Cygwin, netrw does a
3117 "file bufname" where the bufname uses /s
3118 instead of \s; Vim "fixes" it by changing the
3119 bufname to use \s anyway. This meant that
3120 NetrwGetBuffer() didn't find the appropriately
3121 named buffer, and so would generate a new
3122 buffer listing; hence the cursor would appear
3123 to have been moved when doing a preview.
3124 * added <2-leftmouse> map to return to netrw's
3125 browser display
3126 Aug 16, 2007 * added the mark-file system, including
3127 maps for mf mp mt mz and mu. Modifications
3128 made to maps for a D O and R to support
3129 marked files.
3130 v110: May 10, 2007 * added [ and ] maps to NetrwTreeListing
3131 May 25, 2007 * |g:netrw_preview| included
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003132 May 29, 2007 * modified netrw#NetBrowseX to consistently use
Bram Moolenaarc236c162008-07-13 17:41:49 +00003133 g:netrw_shq instead of hardcoded quotes,
Bram Moolenaar446cb832008-06-24 21:56:24 +00003134 and modified the snippet that sets up redir
3135 so Windows machines use "nul" instead of
3136 "/dev/null".
3137 Jun 01, 2007 * fixed bug -- NetGetBuffer() wasn't always
3138 recognizing a buffer name match when it should,
3139 thus resulting in [Scratch] buffers.
3140 Jun 04, 2007 * Gary Johnson found a bugfix for the "c" mapping
3141 when the directory is to be made current but
3142 the name contains spaces.
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003143 v109: Mar 26, 2007 * if a directory name includes a "$" character,
3144 Explore() will use expand() in an attempt to
3145 decipher the name.
3146 May 07, 2007 * g:netrw_use_errorwindow now allows one to
Bram Moolenaar446cb832008-06-24 21:56:24 +00003147 have error messages go to a reliable window
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003148 or to use a less reliable but recallable
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003149 echoerr method
3150 May 07, 2007 * g:netrw_scpport and g:netrw_sshport support
Bram Moolenaar446cb832008-06-24 21:56:24 +00003151 use of -P and -p, respectively, to set port
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003152 for scp/ssh.
Bram Moolenaar9964e462007-05-05 17:54:07 +00003153 v108: Jan 03, 2007 * included preview map (|netrw-p|), supporting
3154 remote browsing
3155 * netrw can now source remote files
3156 Jan 26, 2007 * Colton Jamieson noted that remote directory
3157 browsing did not support alternate port
3158 selection. This feature has now been extended
3159 to apply to all remote browsing commands via ssh.
3160 (list, remove/delete, rename)
3161 Jan 31, 2007 * Luis Florit reported that @* was an invalid
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003162 register. The @* register is now only saved and
3163 restored if |'guioptions'| contains "a".
Bram Moolenaar9964e462007-05-05 17:54:07 +00003164 Feb 02, 2007 * Fixed a bug that cropped up when writing files
3165 via scp using cygwin
3166 Feb 08, 2007 * tree listing mode managed to stop working again;
3167 fixed again!
3168 Feb 15, 2007 * Guido Van Hoecke reported that netrw didn't
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003169 handle browsing well with M$ ftp servers. He even
Bram Moolenaar9964e462007-05-05 17:54:07 +00003170 set up a temporary account for me to test with
3171 (thanks!). Netrw now can browse M$ ftp servers.
3172 v107: Oct 12, 2006 * bypassed the autowrite option
3173 Oct 24, 2006 * handles automatic decompression of *.gz and *.bz2
3174 files
3175 Nov 03, 2006 * Explore will highlight matching files when
3176 **/pattern is used (and if the |'hls'| option
3177 is set)
3178 Nov 09, 2006 * a debugging line, when enabled, was inadvertently
3179 bringing up help instead of simply reporting on
3180 list contents
3181 Nov 21, 2006 * tree listing improved (cursor remains put)
3182 Nov 27, 2006 * fixed b:netrw_curdir bug when repeated "i"s were
3183 pressed.
3184 Dec 15, 2006 * considerable qty of changes, mostly to share more
3185 code between local and remote browsing. Includes
3186 support for tree-style listing for both remote
3187 and local browsing.
3188 Dec 15, 2006 * Included Peter Bengtsson's modifications to
3189 support the Amiga.
3190 v106: Sep 21, 2006 * removed old v:version<700 code as netrw now
3191 requires vim 7.0
3192 * worked around a bug where register * was
3193 overwritten during local browsing
3194 v104: Sep 05, 2006 * as suggested by Rodolfo Borges, :Explore and
3195 variants will position the cursor on the file
3196 just having been edited
3197 * changed default |g:netrw_sort_sequence| order
3198 * changed b, Nb to simply mb (see |netrw-mb|)
3199 * changed B, NB to simply gb (see |netrw-gb|)
3200 * tree listing style (see |g:netrw_liststyle|)
3201 * attempts to retain the alternate file
3202 v103: Jul 26, 2006 * used Yakov Lerner's tip#1289 to improve netrw
3203 error message display
3204 * wide listings didn't handle files with backslashes
3205 in their names properly. A symptom was an
3206 inability to open files.
3207 Aug 09, 2006 * included "t" mapping for opening tabbed windows,
3208 both for remote and local browsing
3209 * changed netrw_longlist to netrw_liststyle
3210 Aug 15, 2006 * fixed one of the NB maps
3211 Aug 22, 2006 * changed *Explore commands to use -nargs=* instead
3212 of -nargs=?. Allows both -complete=dir _and_ the
3213 starstar arguments to work (-nargs=? seems to
3214 require one or the other).
3215 Aug 23, 2006 * copied all w:.. variables across splits to
3216 new windows
3217 Aug 25, 2006 * when g:netrw_browsex_viewer was '-'
3218 (see |g:netrw_browsex_viewer|) it wasn't causing
3219 netrwFileHandlers#Invoke() to be called as it
3220 was expected to. (tnx Steve Dugaro)
3221 Aug 29, 2006 * changed NetBrowseX() to use "setlocal ... noswf"
3222 instead of "set ... noswf" (tnx Benji Fisher)
3223 Aug 31, 2006 * tabs and fastbrowse<=1 didn't work together.
3224 v102: Jun 15, 2006 * chgd netrwPlugin to call netrw#LocalBrowseCheck()
3225 * bugfix: g:netrw_keepdir==0 had stopped working
3226 Jul 06, 2006 * bugfix: NetOptionSave/Restore now saves/restores
3227 the unnamed register (|registers|)
3228 Jul 07, 2006 * |g:netrw_menu| support included
3229 Jul 13, 2006 * :Texplore command implemented
3230 Jul 17, 2006 * NetSplit and (Local|Net)BrowseChgDir() were both
3231 splitting windows. This affected o, v, and
3232 g:netrw_browse_split.
3233 Jul 20, 2006 * works around wildignore setting (was causing
3234 netrw's local browser not to list wildignore'd
3235 files)
3236 Jul 24, 2006 * <leftmouse> acts as a <cr> for selecting a file
3237 <rightmouse> acts as a <del> for deleting a file
3238 v100: May 14, 2006 * when using Windows and shell==cmd.exe, the
3239 default for g:netrw_ignorenetrc is now 1
3240 * bugfix: unwanted ^Ms now removed
3241 (affected shell==cmd.exe - Windows)
3242 * added Bookmarks and History to the menu
3243 * an error message about non-existing
3244 w:netrw_longlist was appearing during attempts to
3245 Explore (fixed)
3246 * g:netrw_shq now available to make netrw use
3247 specified style of quotes for commands
3248 May 29, 2006 * user NFH_*() functions were inadvertently being
3249 ignored
3250 * fixed a Windows non-cygwin ftp handling problem.
3251 * hiding pattern candidate separators included some
3252 characters it shouldn't have (tnx to Osei Poku)
3253 Jun 01, 2006 * for browsing, netrw was supposed to use "dir"
3254 instead of "ls -lF" when using
3255 ftp+non-cygwin+windows. Fixed.
3256 * an inadvertently left-in-place debugging statement
3257 was preventing use of the "x" key with browsing.
3258 Jun 05, 2006 * g:netrw_nogx available to prevent making the gx
3259 map (see |g:netrw_nogx|)
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003260 * bugfix, Explore wouldn't change directory
Bram Moolenaar9964e462007-05-05 17:54:07 +00003261 properly (vim ., :Explore subdirname)
3262 Jun 06, 2006 * moved history to 2nd line in Netrw menu
3263 * fixed delete for unix-based systems
3264 Jun 07, 2006 * x key now works for windows-noncygwin-ftp
3265 Jun 08, 2006 * Explore */pat and **//pat now wraps
3266 v99: May 09, 2006 * g:netrw_browse_split=3 for opening files in new
3267 tabs implemented.
3268 May 12, 2006 * deletes temporary file at end of NetRead()
3269 * visual mode based Obtain implemented
3270 * added -complete=dir to the various Explore
3271 commands
3272 v98: May 02, 2006 * the "p" key didn't work properly when the browsing
3273 directory name had spaces in it.
3274 v97: May 01, 2006 * exists("&acd") now used to determine if
3275 the 'acd' option exists
3276 * "obtain" now works again under Windows
Bram Moolenaar446cb832008-06-24 21:56:24 +00003277 v96: * bugfix - the |'acd'| option is not always defined
3278 but is now bypassed only when it is
3279 v95: * bugfix - Hiding mode worked correctly (don't show
3280 any file matching any of the g:netrw_hide
3281 patterns), but showing mode was showing only those
3282 files that didn't match any of the g:netrw_hide
3283 patterns. Instead, it now shows all files that
3284 match any of the g:netrw_hide patterns (the
3285 difference between a logical and and logical or).
3286 v94: * bugfix - a Decho() had a missing quote; only
3287 affects things when debugging was enabled.
3288 v93: * bugfix - removed FocusGained event from causing a
3289 slow-browser refresh for Windows
3290 v92: * :Explore **//pattern implemented
3291 (**/filepattern was already taken)
3292 v91: * :Explore */pattern implemented
3293 * |'acd'| option bypassed
3294 v90: * mark ', as suggested by Yegappan Lakshmanan, used
3295 to help guarantee entry into the jump list when
3296 appropriate.
3297 * <s-down> and <s-up> are no longer defined until a
3298 :Explore **/pattern is used (if the user already
3299 has a map for them). They will be defined for new
3300 browser windows from that point forward.
3301 v89: * A <s-down>, <s-up>, :Nexplore, or a :Pexplore
3302 without having first done an :Explore **/pattern
3303 (see |netrw-starstar|) caused
3304 a lot of unhelpful error messages to appear
3305 v88: * moved DrChip.Netrw menu to Netrw. Now has
3306 priority 80 by default.
3307 g:NetrwTopLvlMenu == "Netrw" and can be changed
3308 by the user to suit. The priority is given by
3309 g:NetrwMenuPriority.
3310 * Changed filetype for browser displays from
3311 netrwlist to netrw.
3312 v87: * bug fix -- menus were partially disappearing
3313 v85: * bug fix -- missing an endif
3314 * bug fix -- handles spaces in names and directories
3315 when using ftp-based browsing
3316 v83: * disabled stop-acd handling; the change in directory
3317 handling may allow acd to be used again.
3318 * D was refusing to delete remote files/directories
3319 in wide listing mode.
3320 v81: * FocusGained also used to refresh/wipe local browser
3321 directory buffers
3322 * (bugfix) netrw was leaving [Scratch] buffers behind
3323 when the user had the "hidden" option set. The
3324 'hidden' option is now bypassed.
3325 v80: * ShellCmdPost event used in conjunction with
3326 g:netrw_fastbrowse to refresh/wipe local browser
3327 directory buffers.
3328 v79: * directories are now displayed with nowrap
3329 * (bugfix) if the column width was smaller than the
3330 largest file's name, then netrw would hang when
3331 using wide-listing mode - fixed
3332 * g:netrw_fastbrowse introduced
3333 v78: * progress has been made on allowing spaces inside
3334 directory names for remote work (reading, writing,
3335 browsing). (scp)
3336 v77: * Mikolaj Machowski fixed a bug in a substitute cmd
3337 * g:netrw_browsex_viewer implemented
3338 * Mikolaj Machowski pointed out that gnome-open is
3339 often executable under KDE systems, although it is
3340 effectively not functional. NetBrowseX now looks
3341 for "kicker" as a running process to determine if
3342 KDE is actually running.
3343 * Explorer's O functionality was inadvertently left
3344 out. Netrw now does the same thing, but with the
3345 "P" key.
3346 * added g:netrw_browse_split option
3347 * fixed a bug where the directory contained a "." but
3348 the file didn't (was treating the dirname from "."
3349 onwards as a suffix)
3350 v76: * "directory is missing" error message now restores
3351 echo highlighting
3352 v75: * file://... now conforms to RFC2396 (thanks to
3353 S. Zacchiroli)
3354 * if the binary option is set, then NetWrite() will
3355 only write the whole file (line numbers don't make
3356 sense with this). Supports writing of tar and zip
3357 files.
3358 v74: * bugfix (vim, then :Explore) now works
3359 * ctrl-L keeps cursor at same screen location (both
3360 local and remote browsing)
3361 * netrw now can read remote zip and tar files
3362 * Obtain now uses WinXP ftp+.netrc successfully
3363 v73: * bugfix -- scp://host/path/file was getting named
3364 incorrectly
3365 * netrw detects use of earlier-than-7.0 version of
3366 vim and issues a pertinent error message.
3367 * netrwSettings.vim is now uses autoloading. Only
3368 <netrwPlugin.vim> is needed as a pure plugin
3369 (ie. always loaded).
3370 v72: * bugfix -- formerly, one could prevent the loading
3371 of netrw by "let g:loaded_netrw=1"; when
3372 autoloading became supported, this feature was
3373 lost. It is now restored.
3374 v71: * bugfix -- made some "set nomodifiable"s into
3375 setlocal variants (allows :e somenewfile to be
3376 modifiable as usual)
3377 * NetrwSettings calls a netrw function, thereby
3378 assuring that netrw has loaded. However, if netrw
3379 does not load for whatever reason, then
3380 NetrwSettings will now issue a warning message.
3381 * For what reason I don't recall, when wget and fetch
3382 are both not present, and an attempt to read a
3383 http://... url is made, netrw exited. It now only
3384 returns.
3385 * When ch=1, on the second and subsequent uses of
3386 browsing Netrw would issue a blank line to clear
3387 the echo'd messages. This caused an annoying
3388 "Hit-Enter" prompt; now a blank line message
3389 is echo'd only if &ch>1.
3390 v70: * when using |netrw-O|, the "Obtaining filename"
3391 message is now shown using |hl-User9|. If User9
3392 has not been defined, netrw itself will define it.
3393 v69: * Bugfix: win95/98 machines were experiencing a
3394 "E121: Undefined variable: g:netrw_win95ftp"
3395 message
3396 v68: * double-click-leftmouse selects word under mouse
3397 v67: * Passwords which contain blanks will now be
3398 surrounded by double-quotes automatically (Yongwei)
3399 v66: * Netrw now seems to work with a few more Windows
3400 situations
3401 * O now obtains a file: remote browsing
3402 file -> local copy, locally browsing
3403 file -> current directory (see :pwd)
3404 * i now cycles between thin, long, and wide listing
3405 styles
3406 * NB and Nb are maps that are always available;
3407 corresponding B and b maps are only available when
3408 not using wide listing in order to allow them to
3409 be used for motions
3410 v65: * Browser functions now use NetOptionSave/Restore; in
3411 particular, netrw now works around the report
3412 setting
3413 v64: * Bugfix - browsing a "/" directory (Unix) yielded
3414 buffers named "[Scratch]" instead of "/"
3415 * Bugfix - remote browsing with ftp was omitting
3416 the ./ and ../
3417 v63: * netrw now takes advantage of autoload (needs 7.0)
3418 * Bugfix - using r (to reverse sort) working again
3419 v62: * Bugfix - spaces allowed again in directory names
3420 with g:netrw_keepdir=0. In fact, I've tested netrw
3421 with most ANSI punctuation marks for directory
3422 names.
3423 * Bugfix - NetrwSettings gave errors when
3424 g:netrw_silent had not be set.
3425 v61: * Document upgrade -- netrw variable-based settings
3426 all should have tags. Supports NetrwSettings cmd.
3427 * Several important variables are window-oriented.
3428 Netrw has to transfer these across a window split.
3429 See s:BufWinVars() and s:UseBufWinVars().
3430 v60: * When using the i map to switch between long and
3431 short listings, netrw will now keep cursor on same
3432 line
3433 * "Match # of #" now uses status line
3434 * :Explore **/*.c will now work from a
3435 non-netrw-browser window
3436 * :Explore **/patterns can now be run in separate
3437 browser windows
3438 * active banner (hit <cr> will cause various things
3439 to happen)
3440 v59: * bugfix -- another keepalt work-around installed
3441 (for vim6.3)
3442 * "Match # of #" for Explore **/pattern matches
3443 v58: * Explore and relatives can now handle
3444 **/somefilepattern (v7)
3445 * Nexplore and Pexplore introduced (v7). shift-down
3446 and shift-up cursor keys will invoke Nexplore and
3447 Pexplore, respectively.
3448 * bug fixed with o and v
3449 * autochdir only worked around for vim when it has
3450 been compiled with either
3451 |+netbeans_intg| or |+sun_workshop|
3452 * Under Windows, all directories and files were
3453 being preceded with a "/" when local browsing.
3454 Fixed.
3455 * When: syntax highlighting is off, laststatus=2, and
3456 remote browsing is used, sometimes the laststatus
3457 highlighting bleeds into the entire display. Work
3458 around - do an extra redraw in that case.
3459 * Bugfix: when g:netrw_keepdir=0, due to re-use of
3460 buffers, netrw didn't change the directory when it
3461 should've
3462 * Bugfix: D and R commands work again
3463 v57: * Explore and relatives can now handle RO files
3464 * reverse sort restored with vim7's sort command
3465 * g:netrw_keepdir now being used to keep the current
3466 directory unchanged as intended (sense change)
3467 * vim 6.3 still supported
3468 v56: * LocalBrowse now saves autochdir setting, unsets it,
3469 and restores it before returning.
3470 * using vim's rename() instead of system +
3471 local_rename variable
3472 * avoids changing directory when g:netrw_keepdir is
3473 false
3474 v55: * -bar used with :Explore :Sexplore etc to allow
3475 multiple commands to be separated by |s
3476 * browser listings now use the "nowrap" option
3477 * browser: some unuseful error messages now
3478 suppressed
3479 v54: * For backwards compatibility, Explore and Sexplore
3480 have been implemented. In addition, Hexplore and
3481 Vexplore commands are available, too.
3482 * <amatch> used instead of <afile> in the
3483 transparency support (BufReadCmd, FileReadCmd,
3484 FileWriteCmd)
3485 * ***netrw*** prepended to various error messages
3486 netrw may emit
3487 * g:netrw_port used instead of b:netrw_port for scp
3488 * any leading [:#] is removed from port numbers
3489 v53: * backslashes as well as slashes placed in various
3490 patterns (ex. g:netrw_sort_sequence) to better
3491 support Windows
3492 v52: * nonumber'ing now set for browsing buffers
3493 * when the hiding list hid all files, error messages
3494 ensued. Fixed
3495 * when browsing, swf is set, but directory is not
3496 set, when netrw was attempting to restore options,
3497 vim wanted to save a swapfile to a local directory
3498 using an url-style path. Fixed
3499 v51: * cygwin detection now automated
3500 (using windows and &shell is bash)
3501 * customizable browser "file" rejection patterns
3502 * directory history
3503 * :[range]w url now supported (ie. netrw uses a
3504 FileWriteCmd event)
3505 * error messages have a "Press <cr> to continue" to
3506 allow them to be seen
3507 * directory browser displays no longer bother the
3508 swapfile
3509 * u/U commands to go up and down the history stack
3510 * history stack may be saved with viminfo with it's
3511 "!" option
3512 * bugfixes associated with unwanted [No Files]
3513 entries
3514 v50: * directories now displayed using buftype=nofile;
3515 should keep the directory names as-is
3516 * attempts to remove empty "[No File]" buffers
3517 leftover from :file ..name.. commands
3518 * bugfix: a "caps-lock" editing difficulty left in
3519 v49 was fixed
3520 * syntax highlighting for "Showing:" the hiding list
3521 included
3522 * bookmarks can now be retained if "!" is in the
3523 viminfo option
3524 v49: * will use ftp for http://.../ browsing
3525 v48: * One may use ftp to do remote host file browsing
3526 * (windows and !cygwin) remote browsing with ftp can
3527 now use the "dir" command internally to provide
3528 listings
3529 * g:netrw_keepdir now allows one to keep the initial
3530 current directory as the current directory
3531 (normally the local file browser makes the
3532 currently viewed directory the current directory)
3533 * g:netrw_alto and g:netrw_altv now support
3534 alternate placement of windows started with o or v
3535 * Nread ? and Nwrite ? now uses echomsg (instead of
3536 echo) so :messages can repeat showing the help
3537 * bugfix: avoids problems with partial matches of
3538 directory names to prior buffers with longer names
3539 * one can suppress error messages with g:netrw_quiet
3540 ctrl-h used
3541 * instead of <Leader>h for editing hiding list one
3542 may edit the sorting sequence with the S map, which
3543 now allows confirmation of deletion with
3544 [y(es) n(o) a(ll) q(uit)]
3545 * the "x" map now handles special file viewing with:
3546 (windows) rundll32 url.dll (gnome) gnome-open (kde)
3547 kfmclient If none of these are on the executable
3548 path, then netrwFileHandlers.vim is used.
3549 * directory bookmarking during both local and remote
3550 browsing implemented
3551 * one may view all, use the hiding list to suppress,
3552 or use the hiding list to show-only remote and
3553 local file/directory listings
3554 * improved unusual file and directory name handling
3555 preview window support
3556 v47: * now handles local browsing.
3557 v46: * now handles remote browsing
3558 * g:netrw_silent (if 1) will cause all transfers to
3559 be silent
3560 v45: * made the [user@]hostname:path form a bit more
3561 restrictive to better handle errors in using
3562 protocols (e.g. scp:usr@host:file was being
3563 recognized as an rcp request)
3564 v44: * changed from "rsync -a" to just "rsync"
3565 * somehow an editing error messed up the test to
3566 recognize use of the fetch method for NetRead.
3567 * more debugging statements included
3568 v43: * moved "Explanation" comments to <pi_netrw.txt> help
3569 file as "Network Reference" (|netrw-ref|)
3570 * <netrw.vim> now uses Dfunc() Decho() and Dret() for
3571 debugging
3572 * removed superfluous NetRestorePosn() calls
3573 v42: * now does BufReadPre and BufReadPost events on
3574 file:///* and file://localhost/*
3575 v41: * installed file:///* and file://localhost/* handling
3576 v40: * prevents redraw when a protocol error occurs so
3577 that the user may see it
3578 v39: * sftp support
3579 v38: * Now uses NetRestorePosn() calls with Nread/Nwrite
3580 commands
3581 * Temporary files now removed via bwipe! instead of
3582 bwipe (thanks to Dave Roberts)
3583 v37: * Claar's modifications which test if ftp is
3584 successful, otherwise give an error message
3585 * After a read, the alternate file was pointing to
3586 the temp file. The temp file buffer is now wiped
3587 out.
3588 * removed silent from transfer methods so user can
3589 see what's happening
Bram Moolenaar071d4272004-06-13 20:20:40 +00003590
3591
3592==============================================================================
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100359313. Todo *netrw-todo* {{{1
3594
359507/29/09 : banner :|g:netrw_banner| can be used to suppress the
3596 suppression banner. This feature is new and experimental,
3597 so its in the process of being debugged.
359809/04/09 : "gp" : See if it can be made to work for remote systems.
3599 : See if it can be made to work with marked files.
3600
3601==============================================================================
360214. Credits *netrw-credits* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00003603
3604 Vim editor by Bram Moolenaar (Thanks, Bram!)
3605 dav support by C Campbell
3606 fetch support by Bram Moolenaar and C Campbell
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00003607 ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM>
Bram Moolenaar071d4272004-06-13 20:20:40 +00003608 http support by Bram Moolenaar <bram@moolenaar.net>
3609 rcp
3610 rsync support by C Campbell (suggested by Erik Warendorph)
3611 scp support by raf <raf@comdyn.com.au>
3612 sftp support by C Campbell
3613
3614 inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell
3615
3616 Jérôme Augé -- also using new buffer method with ftp+.netrc
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00003617 Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use,
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003618 fetch,...
Bram Moolenaar071d4272004-06-13 20:20:40 +00003619 Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution
3620 Erik Warendorph -- for several suggestions (g:netrw_..._cmd
3621 variables, rsync etc)
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00003622 Doug Claar -- modifications to test for success with ftp
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003623 operation
Bram Moolenaar071d4272004-06-13 20:20:40 +00003624
3625==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00003626Modelines: {{{1
Bram Moolenaar83bab712005-08-01 21:58:57 +00003627 vim:tw=78:ts=8:ft=help:norl:fdm=marker