blob: 8d867837faceedac97b08196f72f7de7968ab4a5 [file] [log] [blame]
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001*pi_netrw.txt* For Vim version 7.4. Last change: 2015 Oct 30
Bram Moolenaar071d4272004-06-13 20:20:40 +00002
Bram Moolenaarff034192013-04-24 18:51:19 +02003 ------------------------------------------------
4 NETRW REFERENCE MANUAL by Charles E. Campbell
5 ------------------------------------------------
6Author: Charles E. Campbell <NdrOchip@ScampbellPfamily.AbizM>
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01007 (remove NOSPAM from Campbell's email first)
8
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01009Copyright: Copyright (C) 1999-2015 Charles E Campbell *netrw-copyright*
Bram Moolenaar5b435d62012-04-05 17:33:26 +020010 The VIM LICENSE applies to the files in this package, including
11 netrw.vim, pi_netrw.txt, netrwFileHandlers.vim, netrwSettings.vim, and
12 syntax/netrw.vim. Like anything else that's free, netrw.vim and its
13 associated files are provided *as is* and comes with no warranty of
14 any kind, either expressed or implied. No guarantees of
15 merchantability. No guarantees of suitability for any purpose. By
16 using this plugin, you agree that in no event will the copyright
17 holder be liable for any damages resulting from the use of this
18 software. Use at your own risk!
Bram Moolenaar071d4272004-06-13 20:20:40 +000019
Bram Moolenaar1afcace2005-11-25 19:54:28 +000020
Bram Moolenaar8feef4f2015-01-07 16:57:10 +010021 *netrw*
Bram Moolenaar00a927d2010-05-14 23:24:24 +020022 *dav* *ftp* *netrw-file* *rcp* *scp*
23 *davs* *http* *netrw.vim* *rsync* *sftp*
Bram Moolenaar8feef4f2015-01-07 16:57:10 +010024 *fetch* *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 Moolenaarff034192013-04-24 18:51:19 +0200291. Contents..............................................|netrw-contents|
302. Starting With Netrw...................................|netrw-start|
313. Netrw Reference.......................................|netrw-ref|
32 EXTERNAL APPLICATIONS AND PROTOCOLS.................|netrw-externapp|
33 READING.............................................|netrw-read|
34 WRITING.............................................|netrw-write|
35 SOURCING............................................|netrw-source|
36 DIRECTORY LISTING...................................|netrw-dirlist|
37 CHANGING THE USERID AND PASSWORD....................|netrw-chgup|
38 VARIABLES AND SETTINGS..............................|netrw-variables|
39 PATHS...............................................|netrw-path|
404. Network-Oriented File Transfer........................|netrw-xfer|
41 NETRC...............................................|netrw-netrc|
42 PASSWORD............................................|netrw-passwd|
435. Activation............................................|netrw-activate|
446. Transparent Remote File Editing.......................|netrw-transparent|
457. Ex Commands...........................................|netrw-ex|
468. Variables and Options.................................|netrw-variables|
479. 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|
52 Browsing............................................|netrw-cr|
Bram Moolenaara6878372014-03-22 21:02:50 +010053 Squeezing the Current Tree-Listing Directory......|:netrw-s-cr|
Bram Moolenaarff034192013-04-24 18:51:19 +020054 Browsing With A Horizontally Split Window...........|netrw-o|
55 Browsing With A New Tab.............................|netrw-t|
56 Browsing With A Vertically Split Window.............|netrw-v|
57 Change Listing Style.(thin wide long tree)..........|netrw-i|
58 Changing To A Bookmarked Directory..................|netrw-gb|
59 Changing To A Predecessor Directory.................|netrw-u|
60 Changing To A Successor Directory...................|netrw-U|
Bram Moolenaar8feef4f2015-01-07 16:57:10 +010061 Customizing Browsing With A Special Handler.........|netrw-x|
Bram Moolenaarff034192013-04-24 18:51:19 +020062 Deleting Bookmarks..................................|netrw-mB|
63 Deleting Files Or Directories.......................|netrw-D|
64 Directory Exploring Commands........................|netrw-explore|
65 Exploring With Stars and Patterns...................|netrw-star|
66 Displaying Information About File...................|netrw-qf|
67 Edit File Or Directory Hiding List..................|netrw-ctrl-h|
68 Editing The Sorting Sequence........................|netrw-S|
69 Forcing treatment as a file or directory............|netrw-gd| |netrw-gf|
70 Going Up............................................|netrw--|
71 Hiding Files Or Directories.........................|netrw-a|
72 Improving Browsing..................................|netrw-ssh-hack|
73 Listing Bookmarks And History.......................|netrw-qb|
74 Making A New Directory..............................|netrw-d|
75 Making The Browsing Directory The Current Directory.|netrw-c|
76 Marking Files.......................................|netrw-mf|
77 Unmarking Files.....................................|netrw-mF|
78 Marking Files By QuickFix List......................|netrw-qF|
79 Marking Files By Regular Expression.................|netrw-mr|
Bram Moolenaar8feef4f2015-01-07 16:57:10 +010080 Marked Files: Arbitrary Shell Command...............|netrw-mx|
81 Marked Files: Arbitrary Shell Command, En Bloc......|netrw-mX|
82 Marked Files: Arbitrary Vim Command.................|netrw-mv|
Bram Moolenaarff034192013-04-24 18:51:19 +020083 Marked Files: Compression And Decompression.........|netrw-mz|
84 Marked Files: Copying...............................|netrw-mc|
85 Marked Files: Diff..................................|netrw-md|
86 Marked Files: Editing...............................|netrw-me|
87 Marked Files: Grep..................................|netrw-mg|
88 Marked Files: Hiding and Unhiding by Suffix.........|netrw-mh|
89 Marked Files: Moving................................|netrw-mm|
90 Marked Files: Printing..............................|netrw-mp|
91 Marked Files: Sourcing..............................|netrw-ms|
92 Marked Files: Setting the Target Directory..........|netrw-mt|
93 Marked Files: Tagging...............................|netrw-mT|
94 Marked Files: Target Directory Using Bookmarks......|netrw-Tb|
95 Marked Files: Target Directory Using History........|netrw-Th|
96 Marked Files: Unmarking.............................|netrw-mu|
97 Netrw Browser Variables.............................|netrw-browser-var|
98 Netrw Browsing And Option Incompatibilities.........|netrw-incompatible|
99 Netrw Settings Window...............................|netrw-settings-window|
100 Obtaining A File....................................|netrw-O|
101 Preview Window......................................|netrw-p|
102 Previous Window.....................................|netrw-P|
103 Refreshing The Listing..............................|netrw-ctrl-l|
104 Reversing Sorting Order.............................|netrw-r|
105 Renaming Files Or Directories.......................|netrw-R|
106 Selecting Sorting Style.............................|netrw-s|
107 Setting Editing Window..............................|netrw-C|
10810. Problems and Fixes....................................|netrw-problems|
10911. Debugging Netrw Itself................................|netrw-debug|
11012. History...............................................|netrw-history|
11113. Todo..................................................|netrw-todo|
11214. Credits...............................................|netrw-credits|
Bram Moolenaar071d4272004-06-13 20:20:40 +0000113
Bram Moolenaar071d4272004-06-13 20:20:40 +0000114{Vi does not have any of this}
115
116==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00001172. Starting With Netrw *netrw-start* {{{1
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000118
Bram Moolenaar446cb832008-06-24 21:56:24 +0000119Netrw makes reading files, writing files, browsing over a network, and
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100120local browsing easy! First, make sure that you have plugins enabled, so
Bram Moolenaar446cb832008-06-24 21:56:24 +0000121you'll need to have at least the following in your <.vimrc>:
122(or see |netrw-activate|) >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000123
Bram Moolenaar9964e462007-05-05 17:54:07 +0000124 set nocp " 'compatible' is not set
125 filetype plugin on " plugins are enabled
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000126<
127(see |'cp'| and |:filetype-plugin-on|)
128
129Netrw supports "transparent" editing of files on other machines using urls
130(see |netrw-transparent|). As an example of this, let's assume you have an
Bram Moolenaar446cb832008-06-24 21:56:24 +0000131account on some other machine; if you can use scp, try: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000132
133 vim scp://hostname/path/to/file
134<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000135Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|!
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000136
Bram Moolenaar446cb832008-06-24 21:56:24 +0000137So, what if you have ftp, not ssh/scp? That's easy, too; try >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000138
139 vim ftp://hostname/path/to/file
140<
141Want to make ftp simpler to use? See if your ftp supports a file called
142<.netrc> -- typically it goes in your home directory, has read/write
143permissions for only the user to read (ie. not group, world, other, etc),
144and has lines resembling >
145
146 machine HOSTNAME login USERID password "PASSWORD"
147 machine HOSTNAME login USERID password "PASSWORD"
148 ...
Bram Moolenaar9964e462007-05-05 17:54:07 +0000149 default login USERID password "PASSWORD"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000150<
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200151Windows' ftp doesn't support .netrc; however, one may have in one's .vimrc: >
152
Bram Moolenaare6ae6222013-05-21 21:01:10 +0200153 let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\MyUserName\MACHINE'
Bram Moolenaar97d62492012-11-15 21:28:22 +0100154<
Bram Moolenaare6ae6222013-05-21 21:01:10 +0200155Netrw will substitute the host's machine name for "MACHINE" from the url it is
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200156attempting to open, and so one may specify >
157 userid
158 password
Bram Moolenaare6ae6222013-05-21 21:01:10 +0200159for each site in a separate file: c:\Users\MyUserName\MachineName.
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200160
Bram Moolenaar446cb832008-06-24 21:56:24 +0000161Now about browsing -- when you just want to look around before editing a
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000162file. For browsing on your current host, just "edit" a directory: >
163
164 vim .
165 vim /home/userid/path
166<
167For browsing on a remote host, "edit" a directory (but make sure that
168the directory name is followed by a "/"): >
169
170 vim scp://hostname/
171 vim ftp://hostname/path/to/dir/
172<
173See |netrw-browse| for more!
174
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100175There are more protocols supported by netrw than just scp and ftp, too: see the
176next section, |netrw-externapp|, on how to use these external applications with
177netrw and vim.
178
Bram Moolenaar13600302014-05-22 18:26:40 +0200179PREVENTING LOADING *netrw-noload*
Bram Moolenaar446cb832008-06-24 21:56:24 +0000180
181If you want to use plugins, but for some reason don't wish to use netrw, then
182you need to avoid loading both the plugin and the autoload portions of netrw.
183You may do so by placing the following two lines in your <.vimrc>: >
184
185 :let g:loaded_netrw = 1
186 :let g:loaded_netrwPlugin = 1
187<
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +0000188
189==============================================================================
Bram Moolenaar13600302014-05-22 18:26:40 +02001903. Netrw Reference *netrw-ref* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000191
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100192 Netrw supports several protocols in addition to scp and ftp as mentioned
Bram Moolenaar446cb832008-06-24 21:56:24 +0000193 in |netrw-start|. These include dav, fetch, http,... well, just look
194 at the list in |netrw-externapp|. Each protocol is associated with a
195 variable which holds the default command supporting that protocol.
196
197EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000198
Bram Moolenaar8d043172014-01-23 14:24:41 +0100199 Protocol Variable Default Value
200 -------- ---------------- -------------
201 dav: *g:netrw_dav_cmd* = "cadaver" if cadaver is executable
202 dav: g:netrw_dav_cmd = "curl -o" elseif curl is available
203 fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available
204 ftp: *g:netrw_ftp_cmd* = "ftp"
205 http: *g:netrw_http_cmd* = "elinks" if elinks is available
206 http: g:netrw_http_cmd = "links" elseif links is available
207 http: g:netrw_http_cmd = "curl" elseif curl is available
208 http: g:netrw_http_cmd = "wget" elseif wget is available
209 http: g:netrw_http_cmd = "fetch" elseif fetch is available
210 http: *g:netrw_http_put_cmd* = "curl -T"
211 rcp: *g:netrw_rcp_cmd* = "rcp"
212 rsync: *g:netrw_rsync_cmd* = "rsync -a"
213 scp: *g:netrw_scp_cmd* = "scp -q"
214 sftp: *g:netrw_sftp_cmd* = "sftp"
Bram Moolenaar8feef4f2015-01-07 16:57:10 +0100215 file: *g:netrw_file_cmd* = "elinks" or "links"
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100216
217 *g:netrw_http_xcmd* : the option string for http://... protocols are
218 specified via this variable and may be independently overridden. By
219 default, the option arguments for the http-handling commands are: >
220
221 elinks : "-source >"
Bram Moolenaar97d62492012-11-15 21:28:22 +0100222 links : "-dump >"
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100223 curl : "-o"
224 wget : "-q -O"
225 fetch : "-o"
226<
227 For example, if your system has elinks, and you'd rather see the
228 page using an attempt at rendering the text, you may wish to have >
229 let g:netrw_http_xcmd= "-dump >"
230< in your .vimrc.
231
Bram Moolenaar8d043172014-01-23 14:24:41 +0100232 g:netrw_http_put_cmd: this option specifies both the executable and
233 any needed options. This command does a PUT operation to the url.
234
Bram Moolenaar071d4272004-06-13 20:20:40 +0000235
Bram Moolenaar446cb832008-06-24 21:56:24 +0000236READING *netrw-read* *netrw-nread* {{{2
237
238 Generally, one may just use the url notation with a normal editing
239 command, such as >
240
241 :e ftp://[user@]machine/path
242<
243 Netrw also provides the Nread command:
244
Bram Moolenaar071d4272004-06-13 20:20:40 +0000245 :Nread ? give help
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000246 :Nread "machine:path" uses rcp
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000247 :Nread "machine path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000248 :Nread "machine id password path" uses ftp
249 :Nread "dav://machine[:port]/path" uses cadaver
250 :Nread "fetch://[user@]machine/path" uses fetch
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000251 :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000252 :Nread "http://[user@]machine/path" uses http uses wget
253 :Nread "rcp://[user@]machine/path" uses rcp
254 :Nread "rsync://[user@]machine[:port]/path" uses rsync
255 :Nread "scp://[user@]machine[[:#]port]/path" uses scp
256 :Nread "sftp://[user@]machine/path" uses sftp
Bram Moolenaar071d4272004-06-13 20:20:40 +0000257
Bram Moolenaar446cb832008-06-24 21:56:24 +0000258WRITING *netrw-write* *netrw-nwrite* {{{2
259
260 One may just use the url notation with a normal file writing
261 command, such as >
262
263 :w ftp://[user@]machine/path
264<
265 Netrw also provides the Nwrite command:
266
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000267 :Nwrite ? give help
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000268 :Nwrite "machine:path" uses rcp
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000269 :Nwrite "machine path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000270 :Nwrite "machine id password path" uses ftp
271 :Nwrite "dav://machine[:port]/path" uses cadaver
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000272 :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000273 :Nwrite "rcp://[user@]machine/path" uses rcp
274 :Nwrite "rsync://[user@]machine[:port]/path" uses rsync
275 :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp
276 :Nwrite "sftp://[user@]machine/path" uses sftp
Bram Moolenaar071d4272004-06-13 20:20:40 +0000277 http: not supported!
278
Bram Moolenaar446cb832008-06-24 21:56:24 +0000279SOURCING *netrw-source* {{{2
280
281 One may just use the url notation with the normal file sourcing
282 command, such as >
283
284 :so ftp://[user@]machine/path
285<
286 Netrw also provides the Nsource command:
287
Bram Moolenaar9964e462007-05-05 17:54:07 +0000288 :Nsource ? give help
289 :Nsource "dav://machine[:port]/path" uses cadaver
290 :Nsource "fetch://[user@]machine/path" uses fetch
291 :Nsource "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc>
292 :Nsource "http://[user@]machine/path" uses http uses wget
293 :Nsource "rcp://[user@]machine/path" uses rcp
294 :Nsource "rsync://[user@]machine[:port]/path" uses rsync
295 :Nsource "scp://[user@]machine[[:#]port]/path" uses scp
296 :Nsource "sftp://[user@]machine/path" uses sftp
297
Bram Moolenaar13600302014-05-22 18:26:40 +0200298DIRECTORY LISTING *netrw-trailingslash* *netrw-dirlist* {{{2
Bram Moolenaar446cb832008-06-24 21:56:24 +0000299
300 One may browse a directory to get a listing by simply attempting to
301 edit the directory: >
302
303 :e scp://[user]@hostname/path/
304 :e ftp://[user]@hostname/path/
305<
Bram Moolenaar251e1912011-06-19 05:09:16 +0200306 For remote directory listings (ie. those using scp or ftp), that
307 trailing "/" is necessary (the slash tells netrw to treat the argument
308 as a directory to browse instead of as a file to download).
Bram Moolenaar446cb832008-06-24 21:56:24 +0000309
Bram Moolenaar251e1912011-06-19 05:09:16 +0200310 The Nread command may also be used to accomplish this (again, that
311 trailing slash is necessary): >
Bram Moolenaar446cb832008-06-24 21:56:24 +0000312
Bram Moolenaar251e1912011-06-19 05:09:16 +0200313 :Nread [protocol]://[user]@hostname/path/
314<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000315 *netrw-login* *netrw-password*
316CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000317
Bram Moolenaar071d4272004-06-13 20:20:40 +0000318 Attempts to use ftp will prompt you for a user-id and a password.
Bram Moolenaar15146672011-10-20 22:22:38 +0200319 These will be saved in global variables |g:netrw_uid| and
320 |s:netrw_passwd|; subsequent use of ftp will re-use those two strings,
321 thereby simplifying use of ftp. However, if you need to use a
322 different user id and/or password, you'll want to call |NetUserPass()|
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000323 first. To work around the need to enter passwords, check if your ftp
324 supports a <.netrc> file in your home directory. Also see
325 |netrw-passwd| (and if you're using ssh/scp hoping to figure out how
Bram Moolenaar15146672011-10-20 22:22:38 +0200326 to not need to use passwords for scp, look at |netrw-ssh-hack|).
Bram Moolenaar071d4272004-06-13 20:20:40 +0000327
328 :NetUserPass [uid [password]] -- prompts as needed
329 :call NetUserPass() -- prompts for uid and password
330 :call NetUserPass("uid") -- prompts for password
331 :call NetUserPass("uid","password") -- sets global uid and password
332
Bram Moolenaare6ae6222013-05-21 21:01:10 +0200333(Related topics: |ftp| |netrw-userpass| |netrw-start|)
334
Bram Moolenaar446cb832008-06-24 21:56:24 +0000335NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200336 (Also see:
337 |netrw-browser-var| : netrw browser option variables
338 |netrw-protocol| : file transfer protocol option variables
339 |netrw-settings| : additional file transfer options
340 |netrw-browser-options| : these options affect browsing directories
341 )
Bram Moolenaar9964e462007-05-05 17:54:07 +0000342
Bram Moolenaar446cb832008-06-24 21:56:24 +0000343Netrw provides a lot of variables which allow you to customize netrw to your
344preferences. One way to look at them is via the command :NetrwSettings (see
345|netrw-settings|) which will display your current netrw settings. Most such
346settings are described below, in |netrw-browser-options|, and in
347|netrw-externapp|:
Bram Moolenaar9964e462007-05-05 17:54:07 +0000348
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100349 *b:netrw_lastfile* last file Network-read/written retained on a
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200350 per-buffer basis (supports plain :Nw )
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100351
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +0200352 *g:netrw_bufsettings* the settings that netrw buffers have
Bram Moolenaar8feef4f2015-01-07 16:57:10 +0100353 (default) noma nomod nonu nowrap ro nobl
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +0200354
Bram Moolenaar13600302014-05-22 18:26:40 +0200355 *g:netrw_chgwin* specifies a window number where subsequent file edits
356 will take place. (also see |netrw-C|)
357 (default) -1
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100358
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +0200359 *g:Netrw_funcref* specifies a function (or functions) to be called when
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200360 netrw edits a file. The file is first edited, and
361 then the function reference (|Funcref|) is called.
362 This variable may also hold a |List| of Funcrefs.
363 (default) not defined. (the capital in g:Netrw...
364 is required by its holding a function reference)
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +0200365>
366 Example: place in .vimrc; affects all file opening
367 fun! MyFuncRef()
368 endfun
369 let g:Netrw_funcref= function("MyFuncRef")
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100370
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +0200371<
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100372 *g:Netrw_UserMaps* specifies a function or |List| of functions which can
373 be used to set up user-specified maps and functionality.
374 See |netrw-usermaps|
375
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200376 *g:netrw_ftp* if it doesn't exist, use default ftp
377 =0 use default ftp (uid password)
378 =1 use alternate ftp method (user uid password)
379 If you're having trouble with ftp, try changing the
380 value of this variable to see if the alternate ftp
381 method works for your setup.
382
Bram Moolenaar13600302014-05-22 18:26:40 +0200383 *g:netrw_ftp_options* Chosen by default, these options are supposed to
384 turn interactive prompting off and to restrain ftp
385 from attempting auto-login upon initial connection.
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200386 However, it appears that not all ftp implementations
387 support this (ex. ncftp).
388 ="-i -n"
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000389
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100390 *g:netrw_ftpextracmd* default: doesn't exist
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200391 If this variable exists, then any string it contains
392 will be placed into the commands set to your ftp
393 client. As an example:
394 ="passive"
Bram Moolenaar9964e462007-05-05 17:54:07 +0000395
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000396 *g:netrw_ftpmode* ="binary" (default)
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200397 ="ascii"
Bram Moolenaarf6cf9872005-08-08 22:00:59 +0000398
Bram Moolenaar9964e462007-05-05 17:54:07 +0000399 *g:netrw_ignorenetrc* =0 (default for linux, cygwin)
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200400 =1 If you have a <.netrc> file but it doesn't work and
401 you want it ignored, then set this variable as
402 shown. (default for Windows + cmd.exe)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000403
404 *g:netrw_menu* =0 disable netrw's menu
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200405 =1 (default) netrw's menu enabled
Bram Moolenaar9964e462007-05-05 17:54:07 +0000406
407 *g:netrw_nogx* if this variable exists, then the "gx" map will not
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200408 be available (see |netrw-gx|)
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000409
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100410 *g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis
Bram Moolenaar8feef4f2015-01-07 16:57:10 +0100411 *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis
Bram Moolenaar446cb832008-06-24 21:56:24 +0000412
413 *g:netrw_preview* =0 (default) preview window shown in a horizontally
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200414 split window
415 =1 preview window shown in a vertically split window.
Bram Moolenaar13600302014-05-22 18:26:40 +0200416 Also affects the "previous window" (see |netrw-P|)
417 in the same way.
Bram Moolenaar8feef4f2015-01-07 16:57:10 +0100418 The |g:netrw_alto| variable may be used to provide
419 additional splitting control:
420 g:netrw_preview g:netrw_alto result
421 0 0 |:aboveleft|
422 0 1 |:belowright|
423 1 0 |:topleft|
424 1 1 |:botright|
425 To control sizing, see |g:netrw_winsize|
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000426
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200427 *g:netrw_scpport* = "-P" : option to use to set port for scp
428 *g:netrw_sshport* = "-p" : option to use to set port for ssh
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000429
Bram Moolenaar8feef4f2015-01-07 16:57:10 +0100430 *g:netrw_sepchr* =\0xff
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200431 =\0x01 for enc == euc-jp (and perhaps it should be for
432 others, too, please let me know)
433 Separates priority codes from filenames internally.
434 See |netrw-p12|.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100435
Bram Moolenaar446cb832008-06-24 21:56:24 +0000436 *g:netrw_silent* =0 : transfers done normally
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200437 =1 : transfers done silently
Bram Moolenaar446cb832008-06-24 21:56:24 +0000438
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000439 *g:netrw_use_errorwindow* =1 : messages from netrw will use a separate one
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200440 line window. This window provides reliable
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200441 delivery of messages. (default)
442 =0 : messages from netrw will use echoerr ;
443 messages don't always seem to show up this
444 way, but one doesn't have to quit the window.
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +0000445
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000446 *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200447 lines that o/s's ftp "provides" on transfers
448 =0 force normal ftp behavior (no trailing line removal)
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000449
Bram Moolenaar8feef4f2015-01-07 16:57:10 +0100450 *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200451 permits network browsing to use ls with time and
452 size sorting (default if windows)
453 =0 assume Windows' scp accepts windows-style paths
454 Network browsing uses dir instead of ls
455 This option is ignored if you're using unix
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000456
457 *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200458 =1 use WinNT's rcp in binary mode (default)
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000459
Bram Moolenaar446cb832008-06-24 21:56:24 +0000460PATHS *netrw-path* {{{2
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000461
462Paths to files are generally user-directory relative for most protocols.
463It is possible that some protocol will make paths relative to some
464associated directory, however.
465>
466 example: vim scp://user@host/somefile
467 example: vim scp://user@host/subdir1/subdir2/somefile
468<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000469where "somefile" is in the "user"'s home directory. If you wish to get a
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000470file using root-relative paths, use the full path:
471>
472 example: vim scp://user@host//somefile
473 example: vim scp://user@host//subdir1/subdir2/somefile
474<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000475
476==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00004774. Network-Oriented File Transfer *netrw-xfer* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000478
479Network-oriented file transfer under Vim is implemented by a VimL-based script
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000480(<netrw.vim>) using plugin techniques. It currently supports both reading and
481writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch,
Bram Moolenaar071d4272004-06-13 20:20:40 +0000482dav/cadaver, rsync, or sftp.
483
484http is currently supported read-only via use of wget or fetch.
485
486<netrw.vim> is a standard plugin which acts as glue between Vim and the
487various file transfer programs. It uses autocommand events (BufReadCmd,
488FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. >
489
490 ex. vim ftp://hostname/path/to/file
491<
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000492The characters preceding the colon specify the protocol to use; in the
Bram Moolenaar446cb832008-06-24 21:56:24 +0000493example, it's ftp. The <netrw.vim> script then formulates a command or a
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000494series of commands (typically ftp) which it issues to an external program
495(ftp, scp, etc) which does the actual file transfer/protocol. Files are read
496from/written to a temporary file (under Unix/Linux, /tmp/...) which the
497<netrw.vim> script will clean up.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000498
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100499Now, a word about Jan Minář's "FTP User Name and Password Disclosure"; first,
500ftp is not a secure protocol. User names and passwords are transmitted "in
501the clear" over the internet; any snooper tool can pick these up; this is not
502a netrw thing, this is a ftp thing. If you're concerned about this, please
503try to use scp or sftp instead.
504
505Netrw re-uses the user id and password during the same vim session and so long
506as the remote hostname remains the same.
507
508Jan seems to be a bit confused about how netrw handles ftp; normally multiple
509commands are performed in a "ftp session", and he seems to feel that the
510uid/password should only be retained over one ftp session. However, netrw
511does every ftp operation in a separate "ftp session"; so remembering the
512uid/password for just one "ftp session" would be the same as not remembering
513the uid/password at all. IMHO this would rapidly grow tiresome as one
514browsed remote directories, for example.
515
516On the other hand, thanks go to Jan M. for pointing out the many
517vulnerabilities that netrw (and vim itself) had had in handling "crafted"
518filenames. The |shellescape()| and |fnameescape()| functions were written in
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +0200519response by Bram Moolenaar to handle these sort of problems, and netrw has
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100520been modified to use them. Still, my advice is, if the "filename" looks like
521a vim command that you aren't comfortable with having executed, don't open it.
522
Bram Moolenaar9964e462007-05-05 17:54:07 +0000523 *netrw-putty* *netrw-pscp* *netrw-psftp*
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000524One may modify any protocol's implementing external application by setting a
525variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000526"scp -q"). As an example, consider using PuTTY: >
Bram Moolenaar9964e462007-05-05 17:54:07 +0000527
528 let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch'
529 let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"'
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000530<
Bram Moolenaar15146672011-10-20 22:22:38 +0200531(note: it has been reported that windows 7 with putty v0.6's "-batch" option
532 doesn't work, so its best to leave it off for that system)
533
Bram Moolenaar9964e462007-05-05 17:54:07 +0000534See |netrw-p8| for more about putty, pscp, psftp, etc.
535
Bram Moolenaar071d4272004-06-13 20:20:40 +0000536Ftp, an old protocol, seems to be blessed by numerous implementations.
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000537Unfortunately, some implementations are noisy (ie., add junk to the end of the
538file). Thus, concerned users may decide to write a NetReadFixup() function
539that will clean up after reading with their ftp. Some Unix systems (ie.,
540FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is
541not noisy and more convenient, actually, for <netrw.vim> to use.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100542Consequently, if "fetch" is available (ie. executable), it may be preferable
543to use it for ftp://... based transfers.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000544
545For rcp, scp, sftp, and http, one may use network-oriented file transfers
Bram Moolenaar83bab712005-08-01 21:58:57 +0000546transparently; ie.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000547>
548 vim rcp://[user@]machine/path
549 vim scp://[user@]machine/path
550<
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100551If your ftp supports <.netrc>, then it too can be transparently used
Bram Moolenaar071d4272004-06-13 20:20:40 +0000552if the needed triad of machine name, user id, and password are present in
553that file. Your ftp must be able to use the <.netrc> file on its own, however.
554>
555 vim ftp://[user@]machine[[:#]portnumber]/path
556<
Bram Moolenaaradc21822011-04-01 18:03:16 +0200557Windows provides an ftp (typically c:\Windows\System32\ftp.exe) which uses
558an option, -s:filename (filename can and probably should be a full path)
559which contains ftp commands which will be automatically run whenever ftp
560starts. You may use this feature to enter a user and password for one site: >
561 userid
562 password
Bram Moolenaar13600302014-05-22 18:26:40 +0200563< *netrw-windows-netrc* *netrw-windows-s*
564If |g:netrw_ftp_cmd| contains -s:[path/]MACHINE, then (on Windows machines
565only) netrw will substitute the current machine name requested for ftp
566connections for MACHINE. Hence one can have multiple machine.ftp files
567containing login and password for ftp. Example: >
Bram Moolenaaradc21822011-04-01 18:03:16 +0200568
Bram Moolenaarff034192013-04-24 18:51:19 +0200569 let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE'
570 vim ftp://myhost.somewhere.net/
Bram Moolenaar13600302014-05-22 18:26:40 +0200571
Bram Moolenaaradc21822011-04-01 18:03:16 +0200572will use a file >
Bram Moolenaar13600302014-05-22 18:26:40 +0200573
Bram Moolenaaradc21822011-04-01 18:03:16 +0200574 C:\Users\Myself\myhost.ftp
575<
576Often, ftp will need to query the user for the userid and password.
Bram Moolenaar83bab712005-08-01 21:58:57 +0000577The latter will be done "silently"; ie. asterisks will show up instead of
Bram Moolenaar071d4272004-06-13 20:20:40 +0000578the actually-typed-in password. Netrw will retain the userid and password
579for subsequent read/writes from the most recent transfer so subsequent
580transfers (read/write) to or from that machine will take place without
581additional prompting.
582
583 *netrw-urls*
584 +=================================+============================+============+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000585 | Reading | Writing | Uses |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000586 +=================================+============================+============+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000587 | DAV: | | |
588 | dav://host/path | | cadaver |
589 | :Nread dav://host/path | :Nwrite dav://host/path | cadaver |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000590 +---------------------------------+----------------------------+------------+
Bram Moolenaar446cb832008-06-24 21:56:24 +0000591 | DAV + SSL: | | |
592 | davs://host/path | | cadaver |
593 | :Nread davs://host/path | :Nwrite davs://host/path | cadaver |
594 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000595 | FETCH: | | |
596 | fetch://[user@]host/path | | |
597 | fetch://[user@]host:http/path | Not Available | fetch |
598 | :Nread fetch://[user@]host/path| | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000599 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000600 | FILE: | | |
601 | file:///* | file:///* | |
602 | file://localhost/* | file://localhost/* | |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000603 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000604 | FTP: (*3) | (*3) | |
605 | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) |
606 | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc |
607 | :Nread host path | :Nwrite host path | ftp+.netrc |
608 | :Nread host uid pass path | :Nwrite host uid pass path | ftp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000609 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000610 | HTTP: wget is executable: (*4) | | |
611 | http://[user@]host/path | Not Available | wget |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000612 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000613 | HTTP: fetch is executable (*4) | | |
614 | http://[user@]host/path | Not Available | fetch |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000615 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000616 | RCP: | | |
617 | rcp://[user@]host/path | rcp://[user@]host/path | rcp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000618 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000619 | RSYNC: | | |
620 | rsync://[user@]host/path | rsync://[user@]host/path | rsync |
621 | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync |
622 | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000623 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000624 | SCP: | | |
625 | scp://[user@]host/path | scp://[user@]host/path | scp |
626 | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000627 +---------------------------------+----------------------------+------------+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000628 | SFTP: | | |
629 | sftp://[user@]host/path | sftp://[user@]host/path | sftp |
630 | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) |
Bram Moolenaar071d4272004-06-13 20:20:40 +0000631 +=================================+============================+============+
632
633 (*1) For an absolute path use scp://machine//path.
634
635 (*2) if <.netrc> is present, it is assumed that it will
636 work with your ftp client. Otherwise the script will
Bram Moolenaar9964e462007-05-05 17:54:07 +0000637 prompt for user-id and password.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000638
Bram Moolenaar9964e462007-05-05 17:54:07 +0000639 (*3) for ftp, "machine" may be machine#port or machine:port
Bram Moolenaar071d4272004-06-13 20:20:40 +0000640 if a different port is needed than the standard ftp port
641
642 (*4) for http:..., if wget is available it will be used. Otherwise,
643 if fetch is available it will be used.
644
645Both the :Nread and the :Nwrite ex-commands can accept multiple filenames.
646
647
648NETRC *netrw-netrc*
649
Bram Moolenaar446cb832008-06-24 21:56:24 +0000650The <.netrc> file, typically located in your home directory, contains lines
651therein which map a hostname (machine name) to the user id and password you
652prefer to use with it.
653
Bram Moolenaar071d4272004-06-13 20:20:40 +0000654The typical syntax for lines in a <.netrc> file is given as shown below.
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000655Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000656>
657 machine {full machine name} login {user-id} password "{password}"
658 default login {user-id} password "{password}"
659
660Your ftp client must handle the use of <.netrc> on its own, but if the
661<.netrc> file exists, an ftp transfer will not ask for the user-id or
662password.
663
664 Note:
665 Since this file contains passwords, make very sure nobody else can
666 read this file! Most programs will refuse to use a .netrc that is
667 readable for others. Don't forget that the system administrator can
Bram Moolenaar446cb832008-06-24 21:56:24 +0000668 still read the file! Ie. for Linux/Unix: chmod 600 .netrc
Bram Moolenaar071d4272004-06-13 20:20:40 +0000669
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200670Even though Windows' ftp clients typically do not support .netrc, netrw has
671a work-around: see |netrw-windows-s|.
672
Bram Moolenaar071d4272004-06-13 20:20:40 +0000673
674PASSWORD *netrw-passwd*
675
676The script attempts to get passwords for ftp invisibly using |inputsecret()|,
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200677a built-in Vim function. See |netrw-userpass| for how to change the password
Bram Moolenaar071d4272004-06-13 20:20:40 +0000678after one has set it.
679
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000680Unfortunately there doesn't appear to be a way for netrw to feed a password to
681scp. Thus every transfer via scp will require re-entry of the password.
Bram Moolenaar446cb832008-06-24 21:56:24 +0000682However, |netrw-ssh-hack| can help with this problem.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000683
684
685==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00006865. Activation *netrw-activate* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000687
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000688Network-oriented file transfers are available by default whenever Vim's
Bram Moolenaar446cb832008-06-24 21:56:24 +0000689|'nocompatible'| mode is enabled. Netrw's script files reside in your
690system's plugin, autoload, and syntax directories; just the
691plugin/netrwPlugin.vim script is sourced automatically whenever you bring up
692vim. The main script in autoload/netrw.vim is only loaded when you actually
693use netrw. I suggest that, at a minimum, you have at least the following in
694your <.vimrc> customization file: >
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000695
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000696 set nocp
697 if version >= 600
698 filetype plugin indent on
699 endif
700<
Bram Moolenaar8feef4f2015-01-07 16:57:10 +0100701By also including the following lines in your .vimrc, one may have netrw
702immediately activate when using [g]vim without any filenames, showing the
703current directory: >
704
705 " Augroup VimStartup:
706 augroup VimStartup
707 au!
708 au VimEnter * if expand("%") == "" | e . | endif
709 augroup END
710<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000711
712==============================================================================
Bram Moolenaar13600302014-05-22 18:26:40 +02007136. Transparent Remote File Editing *netrw-transparent* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000714
715Transparent file transfers occur whenever a regular file read or write
Bram Moolenaar446cb832008-06-24 21:56:24 +0000716(invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd|
717events) is made. Thus one may read, write, or source files across networks
718just as easily as if they were local files! >
Bram Moolenaar071d4272004-06-13 20:20:40 +0000719
720 vim ftp://[user@]machine/path
721 ...
722 :wq
723
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000724See |netrw-activate| for more on how to encourage your vim to use plugins
725such as netrw.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000726
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000727
Bram Moolenaar071d4272004-06-13 20:20:40 +0000728==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00007297. Ex Commands *netrw-ex* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000730
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000731The usual read/write commands are supported. There are also a few
Bram Moolenaar446cb832008-06-24 21:56:24 +0000732additional commands available. Often you won't need to use Nwrite or
Bram Moolenaar9964e462007-05-05 17:54:07 +0000733Nread as shown in |netrw-transparent| (ie. simply use >
734 :e url
735 :r url
736 :w url
737instead, as appropriate) -- see |netrw-urls|. In the explanations
738below, a {netfile} is an url to a remote file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000739
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200740 *:Nwrite* *:Nw*
Bram Moolenaar446cb832008-06-24 21:56:24 +0000741:[range]Nw[rite] Write the specified lines to the current
Bram Moolenaar071d4272004-06-13 20:20:40 +0000742 file as specified in b:netrw_lastfile.
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200743 (related: |netrw-nwrite|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000744
Bram Moolenaar446cb832008-06-24 21:56:24 +0000745:[range]Nw[rite] {netfile} [{netfile}]...
Bram Moolenaar071d4272004-06-13 20:20:40 +0000746 Write the specified lines to the {netfile}.
747
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200748 *:Nread* *:Nr*
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100749:Nr[ead] Read the lines from the file specified in b:netrw_lastfile
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200750 into the current buffer. (related: |netrw-nread|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000751
Bram Moolenaar446cb832008-06-24 21:56:24 +0000752:Nr[ead] {netfile} {netfile}...
Bram Moolenaar071d4272004-06-13 20:20:40 +0000753 Read the {netfile} after the current line.
754
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200755 *:Nsource* *:Ns*
Bram Moolenaar446cb832008-06-24 21:56:24 +0000756:Ns[ource] {netfile}
Bram Moolenaar9964e462007-05-05 17:54:07 +0000757 Source the {netfile}.
758 To start up vim using a remote .vimrc, one may use
759 the following (all on one line) (tnx to Antoine Mechelynck) >
760 vim -u NORC -N
761 --cmd "runtime plugin/netrwPlugin.vim"
762 --cmd "source scp://HOSTNAME/.vimrc"
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200763< (related: |netrw-source|)
764
765:call NetUserPass() *NetUserPass()*
Bram Moolenaar446cb832008-06-24 21:56:24 +0000766 If g:netrw_uid and s:netrw_passwd don't exist,
767 this function will query the user for them.
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200768 (related: |netrw-userpass|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000769
770:call NetUserPass("userid")
Bram Moolenaar446cb832008-06-24 21:56:24 +0000771 This call will set the g:netrw_uid and, if
Bram Moolenaar071d4272004-06-13 20:20:40 +0000772 the password doesn't exist, will query the user for it.
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200773 (related: |netrw-userpass|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000774
775:call NetUserPass("userid","passwd")
Bram Moolenaar446cb832008-06-24 21:56:24 +0000776 This call will set both the g:netrw_uid and s:netrw_passwd.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000777 The user-id and password are used by ftp transfers. One may
Bram Moolenaar446cb832008-06-24 21:56:24 +0000778 effectively remove the user-id and password by using empty
779 strings (ie. "").
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200780 (related: |netrw-userpass|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000781
Bram Moolenaar9964e462007-05-05 17:54:07 +0000782:NetrwSettings This command is described in |netrw-settings| -- used to
783 display netrw settings and change netrw behavior.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +0000784
Bram Moolenaar071d4272004-06-13 20:20:40 +0000785
786==============================================================================
Bram Moolenaar13600302014-05-22 18:26:40 +02007878. Variables and Options *netrw-var* *netrw-settings* {{{1
Bram Moolenaar446cb832008-06-24 21:56:24 +0000788
Bram Moolenaar15146672011-10-20 22:22:38 +0200789(also see: |netrw-options| |netrw-variables| |netrw-protocol|
Bram Moolenaar5b435d62012-04-05 17:33:26 +0200790 |netrw-browser-settings| |netrw-browser-options| )
Bram Moolenaar071d4272004-06-13 20:20:40 +0000791
Bram Moolenaar9964e462007-05-05 17:54:07 +0000792The <netrw.vim> script provides several variables which act as options to
Bram Moolenaar446cb832008-06-24 21:56:24 +0000793affect <netrw.vim>'s file transfer behavior. These variables typically may be
794set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|)
Bram Moolenaar15146672011-10-20 22:22:38 +0200795 *netrw-options*
Bram Moolenaar446cb832008-06-24 21:56:24 +0000796>
Bram Moolenaar9964e462007-05-05 17:54:07 +0000797 -------------
798 Netrw Options
799 -------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000800 Option Meaning
801 -------------- -----------------------------------------------
802<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000803 b:netrw_col Holds current cursor position (during NetWrite)
804 g:netrw_cygwin =1 assume scp under windows is from cygwin
805 (default/windows)
806 =0 assume scp under windows accepts windows
807 style paths (default/else)
808 g:netrw_ftp =0 use default ftp (uid password)
809 g:netrw_ftpmode ="binary" (default)
810 ="ascii" (your choice)
811 g:netrw_ignorenetrc =1 (default)
812 if you have a <.netrc> file but you don't
Bram Moolenaar071d4272004-06-13 20:20:40 +0000813 want it used, then set this variable. Its
814 mere existence is enough to cause <.netrc>
815 to be ignored.
Bram Moolenaar9964e462007-05-05 17:54:07 +0000816 b:netrw_lastfile Holds latest method/machine/path.
817 b:netrw_line Holds current line number (during NetWrite)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000818 g:netrw_silent =0 transfers done normally
819 =1 transfers done silently
820 g:netrw_uid Holds current user-id for ftp.
Bram Moolenaar9964e462007-05-05 17:54:07 +0000821 g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
822 =1 use WinNT/2K/XP's rcp, binary mode
823 g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc
824 =1 use default method to do ftp >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000825 -----------------------------------------------------------------------
826<
Bram Moolenaar13600302014-05-22 18:26:40 +0200827 *netrw-internal-variables*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000828The script will also make use of the following variables internally, albeit
829temporarily.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000830>
831 -------------------
832 Temporary Variables
833 -------------------
834 Variable Meaning
835 -------- ------------------------------------
836<
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100837 b:netrw_method Index indicating rcp/ftp+.netrc/ftp
838 w:netrw_method (same as b:netrw_method)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000839 g:netrw_machine Holds machine name parsed from input
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100840 b:netrw_fname Holds filename being accessed >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000841 ------------------------------------------------------------
842<
Bram Moolenaar446cb832008-06-24 21:56:24 +0000843 *netrw-protocol*
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000844
845Netrw supports a number of protocols. These protocols are invoked using the
846variables listed below, and may be modified by the user.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000847>
848 ------------------------
Bram Moolenaar9964e462007-05-05 17:54:07 +0000849 Protocol Control Options
Bram Moolenaar071d4272004-06-13 20:20:40 +0000850 ------------------------
Bram Moolenaar9964e462007-05-05 17:54:07 +0000851 Option Type Setting Meaning
852 --------- -------- -------------- ---------------------------
Bram Moolenaar8d043172014-01-23 14:24:41 +0100853< netrw_ftp variable =doesn't exist userid set by "user userid"
Bram Moolenaar9964e462007-05-05 17:54:07 +0000854 =0 userid set by "user userid"
855 =1 userid set by "userid"
856 NetReadFixup function =doesn't exist no change
857 =exists Allows user to have files
858 read via ftp automatically
859 transformed however they wish
860 by NetReadFixup()
Bram Moolenaar8d043172014-01-23 14:24:41 +0100861 g:netrw_dav_cmd var ="cadaver" if cadaver is executable
862 g:netrw_dav_cmd var ="curl -o" elseif curl is executable
863 g:netrw_fetch_cmd var ="fetch -o" if fetch is available
864 g:netrw_ftp_cmd var ="ftp"
865 g:netrw_http_cmd var ="fetch -o" if fetch is available
866 g:netrw_http_cmd var ="wget -O" else if wget is available
867 g:netrw_http_put_cmd var ="curl -T"
Bram Moolenaar8feef4f2015-01-07 16:57:10 +0100868 |g:netrw_list_cmd| var ="ssh USEPORT HOSTNAME ls -Fa"
Bram Moolenaar8d043172014-01-23 14:24:41 +0100869 g:netrw_rcp_cmd var ="rcp"
870 g:netrw_rsync_cmd var ="rsync -a"
871 g:netrw_scp_cmd var ="scp -q"
872 g:netrw_sftp_cmd var ="sftp" >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000873 -------------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000874<
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000875 *netrw-ftp*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000876
Bram Moolenaar9964e462007-05-05 17:54:07 +0000877The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|)
878specify the external program to use handle the ftp protocol. They may
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +0200879include command line options (such as -p for passive mode). Example: >
Bram Moolenaar071d4272004-06-13 20:20:40 +0000880
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +0200881 let g:netrw_ftp_cmd= "ftp -p"
882<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000883Browsing is supported by using the |g:netrw_list_cmd|; the substring
884"HOSTNAME" will be changed via substitution with whatever the current request
885is for a hostname.
886
887Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's
888that give trouble . In order to best understand how to use these options if
889ftp is giving you troubles, a bit of discussion is provided on how netrw does
890ftp reads.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000891
892For ftp, netrw typically builds up lines of one of the following formats in a
Bram Moolenaar071d4272004-06-13 20:20:40 +0000893temporary file:
894>
895 IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1
896 ---------------------------------- ------------------------------
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000897<
Bram Moolenaar9964e462007-05-05 17:54:07 +0000898 open machine [port] open machine [port]
899 user userid password userid password
900 [g:netrw_ftpmode] password
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200901 [g:netrw_ftpextracmd] [g:netrw_ftpmode]
Bram Moolenaar9964e462007-05-05 17:54:07 +0000902 get filename tempfile [g:netrw_extracmd]
903 get filename tempfile >
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000904 ---------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +0000905<
Bram Moolenaar8ada2cc2010-07-29 20:43:36 +0200906The |g:netrw_ftpmode| and |g:netrw_ftpextracmd| are optional.
Bram Moolenaar9964e462007-05-05 17:54:07 +0000907
Bram Moolenaar071d4272004-06-13 20:20:40 +0000908Netrw then executes the lines above by use of a filter:
909>
910 :%! {g:netrw_ftp_cmd} -i [-n]
911<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000912where
913 g:netrw_ftp_cmd is usually "ftp",
914 -i tells ftp not to be interactive
915 -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>)
916
917If <.netrc> exists it will be used to avoid having to query the user for
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000918userid and password. The transferred file is put into a temporary file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000919The temporary file is then read into the main editing session window that
920requested it and the temporary file deleted.
921
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000922If your ftp doesn't accept the "user" command and immediately just demands a
923userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000924
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000925 *netrw-cadaver*
926To handle the SSL certificate dialog for untrusted servers, one may pull
927down the certificate and place it into /usr/ssl/cert.pem. This operation
928renders the server treatment as "trusted".
929
Bram Moolenaar433f7c82006-03-21 21:29:36 +0000930 *netrw-fixup* *netreadfixup*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000931If your ftp for whatever reason generates unwanted lines (such as AUTH
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100932messages) you may write a NetReadFixup() function:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000933>
934 function! NetReadFixup(method,line1,line2)
935 " a:line1: first new line in current file
936 " a:line2: last new line in current file
937 if a:method == 1 "rcp
938 elseif a:method == 2 "ftp + <.netrc>
939 elseif a:method == 3 "ftp + machine,uid,password,filename
940 elseif a:method == 4 "scp
941 elseif a:method == 5 "http/wget
942 elseif a:method == 6 "dav/cadaver
943 elseif a:method == 7 "rsync
944 elseif a:method == 8 "fetch
945 elseif a:method == 9 "sftp
Bram Moolenaar9964e462007-05-05 17:54:07 +0000946 else " complain
Bram Moolenaar071d4272004-06-13 20:20:40 +0000947 endif
948 endfunction
949>
Bram Moolenaar1afcace2005-11-25 19:54:28 +0000950The NetReadFixup() function will be called if it exists and thus allows you to
951customize your reading process. As a further example, <netrw.vim> contains
952just such a function to handle Windows 95 ftp. For whatever reason, Windows
95395's ftp dumps four blank lines at the end of a transfer, and so it is
954desirable to automate their removal. Here's some code taken from <netrw.vim>
955itself:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000956>
957 if has("win95") && g:netrw_win95ftp
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000958 fun! NetReadFixup(method, line1, line2)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000959 if method == 3 " ftp (no <.netrc>)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000960 let fourblanklines= line2 - 3
961 silent fourblanklines.",".line2."g/^\s*/d"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000962 endif
963 endfunction
964 endif
965>
Bram Moolenaare6ae6222013-05-21 21:01:10 +0200966(Related topics: |ftp| |netrw-userpass| |netrw-start|)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000967
968==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00009699. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100970 *netrw-browser* *netrw-dir* *netrw-list*
Bram Moolenaar83bab712005-08-01 21:58:57 +0000971
Bram Moolenaar446cb832008-06-24 21:56:24 +0000972INTRODUCTION TO BROWSING *netrw-intro-browse* {{{2
973 (Quick References: |netrw-quickmaps| |netrw-quickcoms|)
Bram Moolenaar83bab712005-08-01 21:58:57 +0000974
Bram Moolenaar446cb832008-06-24 21:56:24 +0000975Netrw supports the browsing of directories on your local system and on remote
976hosts; browsing includes listing files and directories, entering directories,
977editing files therein, deleting files/directories, making new directories,
978moving (renaming) files and directories, copying files and directories, etc.
979One may mark files and execute any system command on them! The Netrw browser
980generally implements the previous explorer's maps and commands for remote
981directories, although details (such as pertinent global variable names)
982necessarily differ. To browse a directory, simply "edit" it! >
Bram Moolenaar269ec652004-07-29 08:43:53 +0000983
Bram Moolenaar446cb832008-06-24 21:56:24 +0000984 vim /your/directory/
985 vim .
986 vim c:\your\directory\
987<
988(Related topics: |netrw-cr| |netrw-o| |netrw-p| |netrw-P| |netrw-t|
989 |netrw-mf| |netrw-mx| |netrw-D| |netrw-R| |netrw-v| )
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000990
991The Netrw remote file and directory browser handles two protocols: ssh and
Bram Moolenaar446cb832008-06-24 21:56:24 +0000992ftp. The protocol in the url, if it is ftp, will cause netrw also to use ftp
993in its remote browsing. Specifying any other protocol will cause it to be
994used for file transfers; but the ssh protocol will be used to do remote
995browsing.
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000996
Bram Moolenaar446cb832008-06-24 21:56:24 +0000997To use Netrw's remote directory browser, simply attempt to read a "file" with
998a trailing slash and it will be interpreted as a request to list a directory:
999>
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001000 vim [protocol]://[user@]hostname/path/
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +00001001<
Bram Moolenaar446cb832008-06-24 21:56:24 +00001002where [protocol] is typically scp or ftp. As an example, try: >
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +00001003
Bram Moolenaar446cb832008-06-24 21:56:24 +00001004 vim ftp://ftp.home.vim.org/pub/vim/
1005<
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001006For local directories, the trailing slash is not required. Again, because it's
Bram Moolenaar446cb832008-06-24 21:56:24 +00001007easy to miss: to browse remote directories, the url must terminate with a
1008slash!
Bram Moolenaar83bab712005-08-01 21:58:57 +00001009
Bram Moolenaar446cb832008-06-24 21:56:24 +00001010If you'd like to avoid entering the password repeatedly for remote directory
1011listings with ssh or scp, see |netrw-ssh-hack|. To avoid password entry with
1012ftp, see |netrw-netrc| (if your ftp supports it).
Bram Moolenaar83bab712005-08-01 21:58:57 +00001013
Bram Moolenaar446cb832008-06-24 21:56:24 +00001014There are several things you can do to affect the browser's display of files:
Bram Moolenaar83bab712005-08-01 21:58:57 +00001015
Bram Moolenaar446cb832008-06-24 21:56:24 +00001016 * To change the listing style, press the "i" key (|netrw-i|).
1017 Currently there are four styles: thin, long, wide, and tree.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001018 To make that change "permanent", see |g:netrw_liststyle|.
Bram Moolenaar83bab712005-08-01 21:58:57 +00001019
Bram Moolenaar446cb832008-06-24 21:56:24 +00001020 * To hide files (don't want to see those xyz~ files anymore?) see
1021 |netrw-ctrl-h|.
Bram Moolenaar83bab712005-08-01 21:58:57 +00001022
Bram Moolenaar446cb832008-06-24 21:56:24 +00001023 * Press s to sort files by name, time, or size.
1024
1025See |netrw-browse-cmds| for all the things you can do with netrw!
1026
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001027 *netrw-getftype* *netrw-filigree* *netrw-ftype*
1028The |getftype()| function is used to append a bit of filigree to indicate
1029filetype to locally listed files:
1030
1031 directory : /
1032 executable : *
1033 fifo : |
1034 links : @
1035 sockets : =
1036
1037The filigree also affects the |g:netrw_sort_sequence|.
1038
Bram Moolenaar446cb832008-06-24 21:56:24 +00001039
1040QUICK HELP *netrw-quickhelp* {{{2
1041 (Use ctrl-] to select a topic)~
1042 Intro to Browsing...............................|netrw-intro-browse|
1043 Quick Reference: Maps.........................|netrw-quickmap|
1044 Quick Reference: Commands.....................|netrw-browse-cmds|
1045 Hiding
1046 Edit hiding list..............................|netrw-ctrl-h|
1047 Hiding Files or Directories...................|netrw-a|
1048 Hiding/Unhiding by suffix.....................|netrw-mh|
1049 Hiding dot-files.............................|netrw-gh|
1050 Listing Style
1051 Select listing style (thin/long/wide/tree)....|netrw-i|
1052 Associated setting variable...................|g:netrw_liststyle|
1053 Shell command used to perform listing.........|g:netrw_list_cmd|
1054 Quick file info...............................|netrw-qf|
1055 Sorted by
1056 Select sorting style (name/time/size).........|netrw-s|
1057 Editing the sorting sequence..................|netrw-S|
Bram Moolenaarc236c162008-07-13 17:41:49 +00001058 Sorting options...............................|g:netrw_sort_options|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001059 Associated setting variable...................|g:netrw_sort_sequence|
1060 Reverse sorting order.........................|netrw-r|
1061
1062
1063 *netrw-quickmap* *netrw-quickmaps*
1064QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001065>
Bram Moolenaar446cb832008-06-24 21:56:24 +00001066 --- ----------------- ----
1067 Map Quick Explanation Link
1068 --- ----------------- ----
1069< <F1> Causes Netrw to issue help
1070 <cr> Netrw will enter the directory or read the file |netrw-cr|
1071 <del> Netrw will attempt to remove the file/directory |netrw-del|
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001072 <c-h> Edit file hiding list |netrw-ctrl-h|
1073 <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
1074 <c-r> Browse using a gvim server |netrw-ctrl-r|
1075 <c-tab> Shrink/expand a netrw/explore window |netrw-c-tab|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001076 - Makes Netrw go up one directory |netrw--|
1077 a Toggles between normal display, |netrw-a|
Bram Moolenaar13600302014-05-22 18:26:40 +02001078 hiding (suppress display of files matching g:netrw_list_hide)
1079 showing (display only files which match g:netrw_list_hide)
Bram Moolenaar446cb832008-06-24 21:56:24 +00001080 c Make browsing directory the current directory |netrw-c|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001081 C Setting the editing window |netrw-C|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001082 d Make a directory |netrw-d|
1083 D Attempt to remove the file(s)/directory(ies) |netrw-D|
1084 gb Go to previous bookmarked directory |netrw-gb|
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001085 gd Force treatment as directory |netrw-gd|
1086 gf Force treatment as file |netrw-gf|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001087 gh Quick hide/unhide of dot-files |netrw-gh|
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001088 gn Make top of tree the directory below the cursor |netrw-gn|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001089 i Cycle between thin, long, wide, and tree listings |netrw-i|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001090 mb Bookmark current directory |netrw-mb|
1091 mc Copy marked files to marked-file target directory |netrw-mc|
1092 md Apply diff to marked files (up to 3) |netrw-md|
1093 me Place marked files on arg list and edit them |netrw-me|
1094 mf Mark a file |netrw-mf|
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001095 mF Unmark files |netrw-mF|
1096 mg Apply vimgrep to marked files |netrw-mg|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001097 mh Toggle marked file suffices' presence on hiding list |netrw-mh|
1098 mm Move marked files to marked-file target directory |netrw-mm|
1099 mp Print marked files |netrw-mp|
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001100 mr Mark files using a shell-style |regexp| |netrw-mr|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001101 mt Current browsing directory becomes markfile target |netrw-mt|
1102 mT Apply ctags to marked files |netrw-mT|
1103 mu Unmark all marked files |netrw-mu|
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001104 mv Apply arbitrary vim command to marked files |netrw-mv|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001105 mx Apply arbitrary shell command to marked files |netrw-mx|
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001106 mX Apply arbitrary shell command to marked files en bloc|netrw-mX|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001107 mz Compress/decompress marked files |netrw-mz|
1108 o Enter the file/directory under the cursor in a new |netrw-o|
Bram Moolenaar13600302014-05-22 18:26:40 +02001109 browser window. A horizontal split is used.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001110 O Obtain a file specified by cursor |netrw-O|
1111 p Preview the file |netrw-p|
1112 P Browse in the previously used window |netrw-P|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001113 qb List bookmarked directories and history |netrw-qb|
1114 qf Display information on file |netrw-qf|
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001115 qF Mark files using a quickfix list |netrw-qF|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001116 r Reverse sorting order |netrw-r|
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001117 R Rename the designated file(s)/directory(ies) |netrw-R|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001118 s Select sorting style: by name, time, or file size |netrw-s|
1119 S Specify suffix priority for name-sorting |netrw-S|
1120 t Enter the file/directory under the cursor in a new tab|netrw-t|
1121 u Change to recently-visited directory |netrw-u|
1122 U Change to subsequently-visited directory |netrw-U|
1123 v Enter the file/directory under the cursor in a new |netrw-v|
Bram Moolenaar13600302014-05-22 18:26:40 +02001124 browser window. A vertical split is used.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001125 x View file with an associated program |netrw-x|
Bram Moolenaar97d62492012-11-15 21:28:22 +01001126 X Execute filename under cursor via |system()| |netrw-X|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001127
Bram Moolenaarc236c162008-07-13 17:41:49 +00001128 % Open a new file in netrw's current directory |netrw-%|
1129
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001130 *netrw-mouse* *netrw-leftmouse* *netrw-middlemouse* *netrw-rightmouse*
Bram Moolenaar446cb832008-06-24 21:56:24 +00001131 <leftmouse> (gvim only) selects word under mouse as if a <cr>
1132 had been pressed (ie. edit file, change directory)
1133 <middlemouse> (gvim only) same as P selecting word under mouse;
1134 see |netrw-P|
1135 <rightmouse> (gvim only) delete file/directory using word under
1136 mouse
1137 <2-leftmouse> (gvim only) when:
Bram Moolenaar13600302014-05-22 18:26:40 +02001138 * in a netrw-selected file, AND
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001139 * |g:netrw_retmap| == 1 AND
Bram Moolenaar13600302014-05-22 18:26:40 +02001140 * the user doesn't already have a <2-leftmouse>
Bram Moolenaarff034192013-04-24 18:51:19 +02001141 mapping defined before netrw is autoloaded,
Bram Moolenaar446cb832008-06-24 21:56:24 +00001142 then a double clicked leftmouse button will return
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001143 to the netrw browser window. See |g:netrw_retmap|.
Bram Moolenaar8d043172014-01-23 14:24:41 +01001144 <s-leftmouse> (gvim only) like mf, will mark files. Dragging
1145 the shifted leftmouse will mark multiple files.
1146 (see |netrw-mf|)
Bram Moolenaar446cb832008-06-24 21:56:24 +00001147
Bram Moolenaar00a927d2010-05-14 23:24:24 +02001148 (to disable mouse buttons while browsing: |g:netrw_mousemaps|)
1149
Bram Moolenaar446cb832008-06-24 21:56:24 +00001150 *netrw-quickcom* *netrw-quickcoms*
1151QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2
Bram Moolenaar8d043172014-01-23 14:24:41 +01001152 :NetrwClean[!]............................................|netrw-clean|
1153 :NetrwSettings............................................|netrw-settings|
1154 :Ntree....................................................|netrw-ntree|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001155 :Explore[!] [dir] Explore directory of current file......|netrw-explore|
1156 :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore|
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001157 :Lexplore[!] [dir] Left Explorer Toggle...................|netrw-explore|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001158 :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
1159 :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
1160 :Rexplore Return to Explorer.....................|netrw-explore|
1161 :Sexplore[!] [dir] Split & Explore directory .............|netrw-explore|
1162 :Texplore[!] [dir] Tab & Explore..........................|netrw-explore|
1163 :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
1164
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001165BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001166
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001167One may easily "bookmark" the currently browsed directory by using >
Bram Moolenaar446cb832008-06-24 21:56:24 +00001168
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001169 mb
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00001170<
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001171 *.netrwbook*
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001172Bookmarks are retained in between sessions in a $HOME/.netrwbook file, and are
1173kept in sorted order.
1174
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001175If there are marked files and/or directories, mb will add them to the bookmark
1176list.
1177
1178*netrw-:NetrwMB*
1179Addtionally, one may use :NetrwMB to bookmark files or directories. >
1180
1181 :NetrwMB[!] [files/directories]
1182
1183< No bang: enters files/directories into Netrw's bookmark system
1184
1185 No argument and in netrw buffer:
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001186 if there are marked files : bookmark marked files
1187 otherwise : bookmark file/directory under cursor
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001188 No argument and not in netrw buffer: bookmarks current open file
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001189 Has arguments : |glob()|s each arg and bookmarks them
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001190
1191 With bang: deletes files/directories from Netrw's bookmark system
1192
1193The :NetrwMB command is available outside of netrw buffers (once netrw has been
1194invoked in the session).
1195
1196The file ".netrwbook" holds bookmarks when netrw (and vim) is not active. By
1197default, its stored on the first directory on the user's |'runtimepath'|.
1198
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001199Related Topics:
1200 |netrw-gb| how to return (go) to a bookmark
1201 |netrw-mB| how to delete bookmarks
1202 |netrw-qb| how to list bookmarks
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001203 |g:netrw_home| controls where .netrwbook is kept
Bram Moolenaar4a85b412006-04-23 22:40:29 +00001204
1205
Bram Moolenaar446cb832008-06-24 21:56:24 +00001206BROWSING *netrw-cr* {{{2
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001207
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00001208Browsing is simple: move the cursor onto a file or directory of interest.
Bram Moolenaar843ee412004-06-30 16:16:41 +00001209Hitting the <cr> (the return key) will select the file or directory.
1210Directories will themselves be listed, and files will be opened using the
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001211protocol given in the original read request.
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001212
Bram Moolenaar446cb832008-06-24 21:56:24 +00001213 CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that
1214 two or more spaces delimit filenames and directory names for the long and
1215 wide listing formats. Thus, if your filename or directory name has two or
1216 more sequential spaces embedded in it, or any trailing spaces, then you'll
1217 need to use the "thin" format to select it.
Bram Moolenaar843ee412004-06-30 16:16:41 +00001218
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001219The |g:netrw_browse_split| option, which is zero by default, may be used to
Bram Moolenaar446cb832008-06-24 21:56:24 +00001220cause the opening of files to be done in a new window or tab instead of the
1221default. When the option is one or two, the splitting will be taken
1222horizontally or vertically, respectively. When the option is set to three, a
1223<cr> will cause the file to appear in a new tab.
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001224
Bram Moolenaar83bab712005-08-01 21:58:57 +00001225
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001226When using the gui (gvim), one may select a file by pressing the <leftmouse>
1227button. In addition, if
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001228
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001229 * |g:netrw_retmap| == 1 AND (its default value is 0)
Bram Moolenaar446cb832008-06-24 21:56:24 +00001230 * in a netrw-selected file, AND
1231 * the user doesn't already have a <2-leftmouse> mapping defined before
1232 netrw is loaded
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001233
Bram Moolenaar446cb832008-06-24 21:56:24 +00001234then a doubly-clicked leftmouse button will return to the netrw browser
1235window.
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001236
Bram Moolenaar446cb832008-06-24 21:56:24 +00001237Netrw attempts to speed up browsing, especially for remote browsing where one
1238may have to enter passwords, by keeping and re-using previously obtained
1239directory listing buffers. The |g:netrw_fastbrowse| variable is used to
1240control this behavior; one may have slow browsing (no buffer re-use), medium
1241speed browsing (re-use directory buffer listings only for remote directories),
1242and fast browsing (re-use directory buffer listings as often as possible).
1243The price for such re-use is that when changes are made (such as new files
1244are introduced into a directory), the listing may become out-of-date. One may
1245always refresh directory listing buffers by pressing ctrl-L (see
1246|netrw-ctrl-l|).
Bram Moolenaara6878372014-03-22 21:02:50 +01001247 *:netrw-s-cr*
1248 Squeezing the Current Tree-Listing Directory~
1249 When the tree listing style is enabled (see |netrw-i|) and one is using
1250 gvim, then the <s-cr> mapping may be used to squeeze (close) the
1251 directory currently containing the cursor.
1252
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001253Related topics:
1254 |netrw-ctrl-r| |netrw-o| |netrw-p|
1255 |netrw-P| |netrw-t| |netrw-v|
1256Associated setting variables:
1257 |g:netrw_browse_split| |g:netrw_fastbrowse|
1258 |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
1259 |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_browse_reject|
1260 |g:netrw_ssh_cmd| |g:netrw_use_noswf|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001261
1262
1263BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2
1264
1265Normally one enters a file or directory using the <cr>. However, the "o" map
1266allows one to open a new window to hold the new directory listing or file. A
1267horizontal split is used. (for vertical splitting, see |netrw-v|)
1268
1269Normally, the o key splits the window horizontally with the new window and
Bram Moolenaar15146672011-10-20 22:22:38 +02001270cursor at the top.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001271
1272Associated setting variables: |g:netrw_alto| |g:netrw_winsize|
1273
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001274Related topics:
1275 |netrw-ctrl-r| |netrw-o| |netrw-p|
1276 |netrw-P| |netrw-t| |netrw-v|
Bram Moolenaar15146672011-10-20 22:22:38 +02001277Associated setting variables:
1278 |g:netrw_alto| control above/below splitting
1279 |g:netrw_winsize| control initial sizing
Bram Moolenaar446cb832008-06-24 21:56:24 +00001280
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001281BROWSING WITH A NEW TAB *netrw-t* {{{2
Bram Moolenaar446cb832008-06-24 21:56:24 +00001282
1283Normally one enters a file or directory using the <cr>. The "t" map
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001284allows one to open a new window holding the new directory listing or file in
Bram Moolenaarff034192013-04-24 18:51:19 +02001285a new tab.
1286
1287If you'd like to have the new listing in a background tab, use |gT|.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001288
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001289Related topics:
1290 |netrw-ctrl-r| |netrw-o| |netrw-p|
1291 |netrw-P| |netrw-t| |netrw-v|
Bram Moolenaar15146672011-10-20 22:22:38 +02001292Associated setting variables:
1293 |g:netrw_winsize| control initial sizing
Bram Moolenaar446cb832008-06-24 21:56:24 +00001294
1295BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2
1296
1297Normally one enters a file or directory using the <cr>. However, the "v" map
1298allows one to open a new window to hold the new directory listing or file. A
1299vertical split is used. (for horizontal splitting, see |netrw-o|)
1300
1301Normally, the v key splits the window vertically with the new window and
Bram Moolenaar15146672011-10-20 22:22:38 +02001302cursor at the left.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001303
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001304There is only one tree listing buffer; using "v" on a displayed subdirectory
Bram Moolenaar446cb832008-06-24 21:56:24 +00001305will split the screen, but the same buffer will be shown twice.
1306
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001307Related topics:
1308 |netrw-ctrl-r| |netrw-o| |netrw-p|
1309 |netrw-P| |netrw-t| |netrw-v|
Bram Moolenaar15146672011-10-20 22:22:38 +02001310Associated setting variables:
1311 |g:netrw_altv| control right/left splitting
1312 |g:netrw_winsize| control initial sizing
1313
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001314
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001315BROWSING USING A GVIM SERVER *netrw-ctrl-r* {{{2
1316
1317One may keep a browsing gvim separate from the gvim being used to edit.
1318Use the <c-r> map on a file (not a directory) in the netrw browser, and it
1319will use a gvim server (see |g:netrw_servername|). Subsequent use of <cr>
1320(see |netrw-cr|) will re-use that server for editing files.
1321
1322Related topics:
1323 |netrw-ctrl-r| |netrw-o| |netrw-p|
1324 |netrw-P| |netrw-t| |netrw-v|
1325Associated setting variables:
1326 |g:netrw_servername| : sets name of server
1327 |g:netrw_browse_split| : controls how <cr> will open files
1328
1329
1330CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001331
Bram Moolenaar9964e462007-05-05 17:54:07 +00001332The "i" map cycles between the thin, long, wide, and tree listing formats.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001333
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001334The thin listing format gives just the files' and directories' names.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001335
Bram Moolenaar8299df92004-07-10 09:47:34 +00001336The long listing is either based on the "ls" command via ssh for remote
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001337directories or displays the filename, file size (in bytes), and the time and
1338date of last modification for local directories. With the long listing
1339format, netrw is not able to recognize filenames which have trailing spaces.
1340Use the thin listing format for such files.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001341
Bram Moolenaar9964e462007-05-05 17:54:07 +00001342The wide listing format uses two or more contiguous spaces to delineate
1343filenames; when using that format, netrw won't be able to recognize or use
1344filenames which have two or more contiguous spaces embedded in the name or any
1345trailing spaces. The thin listing format will, however, work with such files.
Bram Moolenaar13600302014-05-22 18:26:40 +02001346The wide listing format is the most compact.
Bram Moolenaar9964e462007-05-05 17:54:07 +00001347
1348The tree listing format has a top directory followed by files and directories
Bram Moolenaar13600302014-05-22 18:26:40 +02001349preceded by one or more "|"s, which indicate the directory depth. One may
1350open and close directories by pressing the <cr> key while atop the directory
1351name.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001352
1353One may make a preferred listing style your default; see |g:netrw_liststyle|.
1354As an example, by putting the following line in your .vimrc, >
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001355 let g:netrw_liststyle= 3
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001356the tree style will become your default listing style.
Bram Moolenaar8299df92004-07-10 09:47:34 +00001357
Bram Moolenaar5b435d62012-04-05 17:33:26 +02001358One typical way to use the netrw tree display is to: >
1359
1360 vim .
1361 (use i until a tree display shows)
1362 navigate to a file
1363 v (edit as desired in vertically split window)
1364 ctrl-w h (to return to the netrw listing)
1365 P (edit newly selected file in the previous window)
1366 ctrl-w h (to return to the netrw listing)
1367 P (edit newly selected file in the previous window)
1368 ...etc...
1369<
Bram Moolenaar446cb832008-06-24 21:56:24 +00001370Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen|
1371 |g:netrw_timefmt| |g:netrw_list_cmd|
Bram Moolenaar8299df92004-07-10 09:47:34 +00001372
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001373CHANGE FILE PERMISSION *netrw-gp* {{{2
1374
1375"gp" will ask you for a new permission for the file named under the cursor.
1376Currently, this only works for local files.
1377
1378Associated setting variables: |g:netrw_chgperm|
1379
Bram Moolenaar83bab712005-08-01 21:58:57 +00001380
Bram Moolenaar446cb832008-06-24 21:56:24 +00001381CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2
Bram Moolenaar843ee412004-06-30 16:16:41 +00001382
Bram Moolenaar446cb832008-06-24 21:56:24 +00001383To change directory back to a bookmarked directory, use
Bram Moolenaar843ee412004-06-30 16:16:41 +00001384
Bram Moolenaar446cb832008-06-24 21:56:24 +00001385 {cnt}gb
Bram Moolenaar843ee412004-06-30 16:16:41 +00001386
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001387Any count may be used to reference any of the bookmarks.
Bram Moolenaarff034192013-04-24 18:51:19 +02001388Note that |netrw-qb| shows both bookmarks and history; to go
1389to a location stored in the history see |netrw-u| and |netrw-U|.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001390
1391Related Topics:
1392 |netrw-mB| how to delete bookmarks
1393 |netrw-mb| how to make a bookmark
1394 |netrw-qb| how to list bookmarks
Bram Moolenaar843ee412004-06-30 16:16:41 +00001395
Bram Moolenaar843ee412004-06-30 16:16:41 +00001396
Bram Moolenaar00a927d2010-05-14 23:24:24 +02001397CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001398
1399Every time you change to a new directory (new for the current session),
1400netrw will save the directory in a recently-visited directory history
Bram Moolenaaradc21822011-04-01 18:03:16 +02001401list (unless |g:netrw_dirhistmax| is zero; by default, it's ten). With the
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001402"u" map, one can change to an earlier directory (predecessor). To do
1403the opposite, see |netrw-U|.
1404
Bram Moolenaarff034192013-04-24 18:51:19 +02001405The "u" map also accepts counts to go back in the history several slots.
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001406For your convenience, qb (see |netrw-qb|) lists the history number which may
1407be used in that count.
Bram Moolenaarff034192013-04-24 18:51:19 +02001408
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001409 *.netrwhist*
Bram Moolenaarff034192013-04-24 18:51:19 +02001410See |g:netrw_dirhistmax| for how to control the quantity of history stack
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001411slots. The file ".netrwhist" holds history when netrw (and vim) is not
1412active. By default, its stored on the first directory on the user's
1413|'runtimepath'|.
1414
1415Related Topics:
1416 |netrw-U| changing to a successor directory
1417 |g:netrw_home| controls where .netrwhist is kept
Bram Moolenaarff034192013-04-24 18:51:19 +02001418
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001419
Bram Moolenaar446cb832008-06-24 21:56:24 +00001420CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001421
1422With the "U" map, one can change to a later directory (successor).
1423This map is the opposite of the "u" map. (see |netrw-u|) Use the
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001424qb map to list both the bookmarks and history. (see |netrw-qb|)
Bram Moolenaar446cb832008-06-24 21:56:24 +00001425
Bram Moolenaarff034192013-04-24 18:51:19 +02001426The "U" map also accepts counts to go forward in the history several slots.
1427
1428See |g:netrw_dirhistmax| for how to control the quantity of history stack
1429slots.
1430
Bram Moolenaar446cb832008-06-24 21:56:24 +00001431
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001432CHANGING TREE TOP *netrw-ntree* *:Ntree* *netrw-gn* {{{2
Bram Moolenaar8d043172014-01-23 14:24:41 +01001433
1434One may specify a new tree top for tree listings using >
1435
1436 :Ntree [dirname]
1437
1438Without a "dirname", the current line is used (and any leading depth
1439information is elided).
1440With a "dirname", the specified directory name is used.
1441
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001442The "gn" map will take the word below the cursor and use that for
1443changing the top of the tree listing.
1444
Bram Moolenaar8d043172014-01-23 14:24:41 +01001445
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001446NETRW CLEAN *netrw-clean* *:NetrwClean* {{{2
Bram Moolenaar446cb832008-06-24 21:56:24 +00001447
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001448With NetrwClean one may easily remove netrw from one's home directory;
Bram Moolenaar446cb832008-06-24 21:56:24 +00001449more precisely, from the first directory on your |'runtimepath'|.
1450
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001451With NetrwClean!, netrw will attempt to remove netrw from all directories on
1452your |'runtimepath'|. Of course, you have to have write/delete permissions
1453correct to do this.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001454
1455With either form of the command, netrw will first ask for confirmation
1456that the removal is in fact what you want to do. If netrw doesn't have
1457permission to remove a file, it will issue an error message.
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001458
Bram Moolenaar9964e462007-05-05 17:54:07 +00001459 *netrw-gx*
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001460CUSTOMIZING BROWSING WITH A SPECIAL HANDLER *netrw-x* *netrw-handler* {{{2
Bram Moolenaar9964e462007-05-05 17:54:07 +00001461 (also see |netrw_filehandler|)
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001462
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001463Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001464best seen with a special handler (ie. a tool provided with your computer's
1465operating system). Netrw allows one to invoke such special handlers by: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001466
1467 * when Exploring, hit the "x" key
1468 * when editing, hit gx with the cursor atop the special filename
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001469< (latter not available if the |g:netrw_nogx| variable exists)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001470
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001471Netrw determines which special handler by the following method:
1472
1473 * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
1474 view files. Examples of useful settings (place into your <.vimrc>): >
1475
1476 :let g:netrw_browsex_viewer= "kfmclient exec"
1477< or >
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001478 :let g:netrw_browsex_viewer= "xdg-open"
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001479<
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001480 If g:netrw_browsex_viewer == '-', then netrwFileHandlers#Invoke() will be
1481 used instead (see |netrw_filehandler|).
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001482
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001483 * for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001484 * for Gnome (with gnome-open): gnome-open is used.
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001485 * for KDE (with kfmclient) : kfmclient is used
Bram Moolenaar446cb832008-06-24 21:56:24 +00001486 * for Mac OS X : open is used.
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001487 * otherwise the netrwFileHandler plugin is used.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001488
1489The file's suffix is used by these various approaches to determine an
Bram Moolenaar1afcace2005-11-25 19:54:28 +00001490appropriate application to use to "handle" these files. Such things as
1491OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
1492*.eps) can be handled.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001493
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001494The gx mapping extends to all buffers; apply "gx" while atop a word and netrw
1495will apply a special handler to it (like "x" works when in a netrw buffer).
1496One may also use visual mode (see |visual-start|) to select the text that the
1497special handler will use. Normally gx uses expand("<cfile>") to pick up the
1498text under the cursor; one may change what |expand()| uses via the
1499|g:netrw_gx| variable. Alternatively, one may select the text to be used by
1500gx via first making a visual selection (see |visual-block|).
1501
1502Associated setting variables:
1503 |g:netrw_gx| control how gx picks up the text under the cursor
1504 |g:netrw_nogx| prevent gx map while editing
1505
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001506 *netrw_filehandler*
Bram Moolenaar9964e462007-05-05 17:54:07 +00001507
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001508When |g:netrw_browsex_viewer| exists and is "-", then netrw will attempt to
1509handle the special file with a vim function. The "x" map applies a function
1510to a file, based on its extension. Of course, the handler function must exist
1511for it to be called!
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001512>
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001513 Ex. mypgm.html x -> NFH_html("scp://user@host/some/path/mypgm.html")
1514
1515< Users may write their own netrw File Handler functions to
1516 support more suffixes with special handling. See
1517 <autoload/netrwFileHandlers.vim> for examples on how to make
1518 file handler functions. As an example: >
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001519
Bram Moolenaar9964e462007-05-05 17:54:07 +00001520 " NFH_suffix(filename)
1521 fun! NFH_suffix(filename)
1522 ..do something special with filename..
1523 endfun
1524<
1525These functions need to be defined in some file in your .vim/plugin
1526(vimfiles\plugin) directory. Vim's function names may not have punctuation
1527characters (except for the underscore) in them. To support suffices that
1528contain such characters, netrw will first convert the suffix using the
1529following table: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001530
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001531 @ -> AT ! -> EXCLAMATION % -> PERCENT
1532 : -> COLON = -> EQUAL ? -> QUESTION
Bram Moolenaar9964e462007-05-05 17:54:07 +00001533 , -> COMMA - -> MINUS ; -> SEMICOLON
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001534 $ -> DOLLAR + -> PLUS ~ -> TILDE
1535<
Bram Moolenaar9964e462007-05-05 17:54:07 +00001536So, for example: >
Bram Moolenaarafeb4fa2006-02-01 21:51:12 +00001537
Bram Moolenaar9964e462007-05-05 17:54:07 +00001538 file.rcs,v -> NFH_rcsCOMMAv()
1539<
1540If more such translations are necessary, please send me email: >
1541 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
1542with a request.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00001543
Bram Moolenaar446cb832008-06-24 21:56:24 +00001544Associated setting variable: |g:netrw_browsex_viewer|
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001545
Bram Moolenaar446cb832008-06-24 21:56:24 +00001546 *netrw-curdir*
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001547DELETING BOOKMARKS *netrw-mB* {{{2
1548
1549To delete a bookmark, use >
1550
1551 {cnt}mB
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001552
1553If there are marked files, then mB will remove them from the
1554bookmark list.
1555
1556Alternatively, one may use :NetrwMB! (see |netrw-:NetrwMB|). >
1557
1558 :NetrwMB! [files/directories]
1559
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001560Related Topics:
1561 |netrw-gb| how to return (go) to a bookmark
1562 |netrw-mb| how to make a bookmark
1563 |netrw-qb| how to list bookmarks
1564
1565
Bram Moolenaar446cb832008-06-24 21:56:24 +00001566DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001567
Bram Moolenaar446cb832008-06-24 21:56:24 +00001568If files have not been marked with |netrw-mf|: (local marked file list)
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001569
Bram Moolenaar446cb832008-06-24 21:56:24 +00001570 Deleting/removing files and directories involves moving the cursor to the
1571 file/directory to be deleted and pressing "D". Directories must be empty
1572 first before they can be successfully removed. If the directory is a
1573 softlink to a directory, then netrw will make two requests to remove the
1574 directory before succeeding. Netrw will ask for confirmation before doing
1575 the removal(s). You may select a range of lines with the "V" command
1576 (visual selection), and then pressing "D".
Bram Moolenaar9964e462007-05-05 17:54:07 +00001577
Bram Moolenaar446cb832008-06-24 21:56:24 +00001578If files have been marked with |netrw-mf|: (local marked file list)
1579
1580 Marked files (and empty directories) will be deleted; again, you'll be
1581 asked to confirm the deletion before it actually takes place.
1582
Bram Moolenaar13600302014-05-22 18:26:40 +02001583A further approach is to delete files which match a pattern.
1584
1585 * use :MF pattern (see |netrw-:MF|); then press "D".
1586
1587 * use mr (see |netrw-mr|) which will prompt you for pattern.
1588 This will cause the matching files to be marked. Then,
1589 press "D".
1590
Bram Moolenaar446cb832008-06-24 21:56:24 +00001591The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are
Bram Moolenaar13600302014-05-22 18:26:40 +02001592used to control the attempts to remove remote files and directories. The
Bram Moolenaar446cb832008-06-24 21:56:24 +00001593g:netrw_rm_cmd is used with files, and its default value is:
1594
1595 g:netrw_rm_cmd: ssh HOSTNAME rm
1596
1597The g:netrw_rmdir_cmd variable is used to support the removal of directories.
1598Its default value is:
1599
Bram Moolenaar13600302014-05-22 18:26:40 +02001600 |g:netrw_rmdir_cmd|: ssh HOSTNAME rmdir
Bram Moolenaar446cb832008-06-24 21:56:24 +00001601
1602If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
1603to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
1604
Bram Moolenaar13600302014-05-22 18:26:40 +02001605 |g:netrw_rmf_cmd|: ssh HOSTNAME rm -f
Bram Moolenaar446cb832008-06-24 21:56:24 +00001606
Bram Moolenaar15146672011-10-20 22:22:38 +02001607Related topics: |netrw-d|
Bram Moolenaar5b435d62012-04-05 17:33:26 +02001608Associated setting variable: |g:netrw_localrmdir| |g:netrw_rm_cmd|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001609 |g:netrw_rmdir_cmd| |g:netrw_ssh_cmd|
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001610
1611
Bram Moolenaar446cb832008-06-24 21:56:24 +00001612*netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore*
Bram Moolenaar8d043172014-01-23 14:24:41 +01001613*netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore* *netrw-lexplore*
Bram Moolenaar446cb832008-06-24 21:56:24 +00001614DIRECTORY EXPLORATION COMMANDS {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001615
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001616 :[N]Explore[!] [dir]... Explore directory of current file *:Explore*
1617 :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001618 :[N]Lexplore[!] [dir]... Left Explorer Toggle *:Lexplore*
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001619 :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore*
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001620 :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001621 :Texplore [dir]... Tab & Explore *:Texplore*
1622 :Rexplore ... Return to/from Explorer *:Rexplore*
Bram Moolenaar446cb832008-06-24 21:56:24 +00001623
1624 Used with :Explore **/pattern : (also see |netrw-starstar|)
1625 :Nexplore............. go to next matching file *:Nexplore*
1626 :Pexplore............. go to previous matching file *:Pexplore*
1627
Bram Moolenaara6878372014-03-22 21:02:50 +01001628 *netrw-:Explore*
Bram Moolenaar446cb832008-06-24 21:56:24 +00001629:Explore will open the local-directory browser on the current file's
1630 directory (or on directory [dir] if specified). The window will be
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001631 split only if the file has been modified and |'hidden'| is not set,
1632 otherwise the browsing window will take over that window. Normally
1633 the splitting is taken horizontally.
Bram Moolenaara6878372014-03-22 21:02:50 +01001634 Also see: |netrw-:Rexplore|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001635:Explore! is like :Explore, but will use vertical splitting.
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001636
Bram Moolenaara6878372014-03-22 21:02:50 +01001637 *netrw-:Hexplore*
Bram Moolenaar446cb832008-06-24 21:56:24 +00001638:Hexplore [dir] does an :Explore with |:belowright| horizontal splitting.
1639:Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting.
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001640
1641 *netrw-:Lexplore*
1642:[N]Lexplore [dir] toggles a full height Explorer window on the left hand side
1643 of the current tab. It will open a netrw window on the current
1644 directory if [dir] is omitted; a :Lexplore [dir] will show the
1645 specified directory in the left-hand side browser display no matter
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001646 from which window the command is issued.
1647
1648 By default, :Lexplore will change an uninitialized |g:netrw_chgwin|
1649 to 2; edits will thus preferentially be made in window#2.
1650
1651 The [N] specifies a |g:netrw_winsize| just for the new :Lexplore
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001652 window.
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001653
1654 Those who like this method often also often like tree style displays;
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001655 see |g:netrw_liststyle|.
1656
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001657 Also see: |netrw-C| |g:netrw_browse_split| |g:netrw_wiw|
1658 |netrw-p| |netrw-P| |g:netrw_chgwin|
1659 |netrw-c-tab| |g:netrw_winsize|
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001660
1661:[N]Lexplore! is like :Lexplore, except that the full-height Explorer window
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001662 will open on the right hand side and an uninitialized |g:netrw_chgwin|
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001663 will be set to 1.
1664
1665 *netrw-:Sexplore*
1666:[N]Sexplore will always split the window before invoking the local-directory
1667 browser. As with Explore, the splitting is normally done
1668 horizontally.
1669:[N]Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically.
1670
Bram Moolenaara6878372014-03-22 21:02:50 +01001671 *netrw-:Texplore*
Bram Moolenaar8d043172014-01-23 14:24:41 +01001672:Texplore [dir] does a |:tabnew| before generating the browser window
Bram Moolenaar446cb832008-06-24 21:56:24 +00001673
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001674 *netrw-:Vexplore*
1675:[N]Vexplore [dir] does an :Explore with |:leftabove| vertical splitting.
1676:[N]Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001677
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001678The optional parameters are:
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001679
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001680 [N]: This parameter will override |g:netrw_winsize| to specify the quantity of
1681 rows and/or columns the new explorer window should have.
1682 Otherwise, the |g:netrw_winsize| variable, if it has been specified by the
1683 user, is used to control the quantity of rows and/or columns new
1684 explorer windows should have.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001685
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001686 [dir]: By default, these explorer commands use the current file's directory.
1687 However, one may explicitly provide a directory (path) to use instead;
1688 ie. >
1689
1690 :Explore /some/path
1691<
Bram Moolenaara6878372014-03-22 21:02:50 +01001692 *netrw-:Rexplore*
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001693:Rexplore This command is a little different from the other Explore commands
1694 as it doesn't necessarily open an Explorer window.
Bram Moolenaara6878372014-03-22 21:02:50 +01001695
1696 Return to Explorer~
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001697 When one edits a file using netrw which can occur, for example,
1698 when pressing <cr> while the cursor is atop a filename in a netrw
1699 browser window, a :Rexplore issued while editing that file will
1700 return the display to that of the last netrw browser display in
1701 that window.
Bram Moolenaara6878372014-03-22 21:02:50 +01001702
1703 Return from Explorer~
1704 Conversely, when one is editing a directory, issuing a :Rexplore
Bram Moolenaar13600302014-05-22 18:26:40 +02001705 will return to editing the file that was last edited in that
Bram Moolenaara6878372014-03-22 21:02:50 +01001706 window.
1707
1708 The <2-leftmouse> map (which is only available under gvim and
1709 cooperative terms) does the same as :Rexplore.
Bram Moolenaar446cb832008-06-24 21:56:24 +00001710
Bram Moolenaar8d043172014-01-23 14:24:41 +01001711Also see: |g:netrw_alto| |g:netrw_altv| |g:netrw_winsize|
1712
Bram Moolenaar446cb832008-06-24 21:56:24 +00001713
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001714*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat* *netrw-grep*
1715EXPLORING WITH STARS AND PATTERNS {{{2
Bram Moolenaar446cb832008-06-24 21:56:24 +00001716
1717When Explore, Sexplore, Hexplore, or Vexplore are used with one of the
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001718following four patterns Explore generates a list of files which satisfy
Bram Moolenaar446cb832008-06-24 21:56:24 +00001719the request. >
1720
1721 */filepat files in current directory which satisfy filepat
1722 **/filepat files in current directory or below which satisfy the
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001723 file pattern
Bram Moolenaar446cb832008-06-24 21:56:24 +00001724 *//pattern files in the current directory which contain the
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001725 pattern (vimgrep is used)
Bram Moolenaar446cb832008-06-24 21:56:24 +00001726 **//pattern files in the current directory or below which contain
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001727 the pattern (vimgrep is used)
Bram Moolenaar572cb562005-08-05 21:35:02 +00001728<
Bram Moolenaar446cb832008-06-24 21:56:24 +00001729The cursor will be placed on the first file in the list. One may then
1730continue to go to subsequent files on that list via |:Nexplore| or to
1731preceding files on that list with |:Pexplore|. Explore will update the
1732directory and place the cursor appropriately.
1733
1734A plain >
1735 :Explore
1736will clear the explore list.
1737
1738If your console or gui produces recognizable shift-up or shift-down sequences,
1739then you'll likely find using shift-downarrow and shift-uparrow convenient.
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001740They're mapped by netrw as follows:
Bram Moolenaar446cb832008-06-24 21:56:24 +00001741
1742 <s-down> == Nexplore, and
1743 <s-up> == Pexplore.
1744
1745As an example, consider
1746>
1747 :Explore */*.c
1748 :Nexplore
1749 :Nexplore
1750 :Pexplore
1751<
1752The status line will show, on the right hand side of the status line, a
1753message like "Match 3 of 20".
1754
Bram Moolenaara6878372014-03-22 21:02:50 +01001755Associated setting variables:
1756 |g:netrw_keepdir| |g:netrw_browse_split|
1757 |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject|
1758 |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
1759 |g:netrw_ftp_timelist_cmd| |g:netrw_list_cmd|
1760 |g:netrw_liststyle|
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001761
1762
Bram Moolenaar446cb832008-06-24 21:56:24 +00001763DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001764
Bram Moolenaar446cb832008-06-24 21:56:24 +00001765With the cursor atop a filename, pressing "qf" will reveal the file's size
1766and last modification timestamp. Currently this capability is only available
1767for local files.
Bram Moolenaar578b49e2005-09-10 19:22:57 +00001768
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001769
Bram Moolenaar446cb832008-06-24 21:56:24 +00001770EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001771
Bram Moolenaar446cb832008-06-24 21:56:24 +00001772The "<ctrl-h>" map brings up a requestor allowing the user to change the
1773file/directory hiding list contained in |g:netrw_list_hide|. The hiding list
1774consists of one or more patterns delimited by commas. Files and/or
1775directories satisfying these patterns will either be hidden (ie. not shown) or
1776be the only ones displayed (see |netrw-a|).
1777
1778The "gh" mapping (see |netrw-gh|) quickly alternates between the usual
1779hiding list and the hiding of files or directories that begin with ".".
1780
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001781As an example, >
1782 let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+'
1783Effectively, this makes the effect of a |netrw-gh| command the initial setting.
1784What it means:
1785
1786 \(^\|\s\s\) : if the line begins with the following, -or-
1787 two consecutive spaces are encountered
1788 \zs : start the hiding match now
1789 \. : if it now begins with a dot
1790 \S\+ : and is followed by one or more non-whitespace
1791 characters
1792
Bram Moolenaar446cb832008-06-24 21:56:24 +00001793Associated setting variables: |g:netrw_hide| |g:netrw_list_hide|
1794Associated topics: |netrw-a| |netrw-gh| |netrw-mh|
Bram Moolenaard4755bb2004-09-02 19:12:26 +00001795
Bram Moolenaar15146672011-10-20 22:22:38 +02001796 *netrw-sort-sequence*
Bram Moolenaar446cb832008-06-24 21:56:24 +00001797EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2
1798
1799When "Sorted by" is name, one may specify priority via the sorting sequence
1800(g:netrw_sort_sequence). The sorting sequence typically prioritizes the
1801name-listing by suffix, although any pattern will do. Patterns are delimited
1802by commas. The default sorting sequence is (all one line):
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01001803
1804For Unix: >
1805 '[\/]$,\<core\%(\.\d\+\)\=,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,
1806 \.info$,\.swp$,\.bak$,\~$'
1807<
1808Otherwise: >
Bram Moolenaar446cb832008-06-24 21:56:24 +00001809 '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,
1810 \.swp$,\.bak$,\~$'
1811<
1812The lone * is where all filenames not covered by one of the other patterns
1813will end up. One may change the sorting sequence by modifying the
1814g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by
1815using the "S" map.
1816
Bram Moolenaarc236c162008-07-13 17:41:49 +00001817Related topics: |netrw-s| |netrw-S|
1818Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001819
1820
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001821EXECUTING FILE UNDER CURSOR VIA SYSTEM() *netrw-X* {{{2
Bram Moolenaar97d62492012-11-15 21:28:22 +01001822
1823Pressing X while the cursor is atop an executable file will yield a prompt
1824using the filename asking for any arguments. Upon pressing a [return], netrw
1825will then call |system()| with that command and arguments. The result will
1826be displayed by |:echomsg|, and so |:messages| will repeat display of the
1827result. Ansi escape sequences will be stripped out.
1828
1829
Bram Moolenaaradc21822011-04-01 18:03:16 +02001830FORCING TREATMENT AS A FILE OR DIRECTORY *netrw-gd* *netrw-gf* {{{2
1831
1832Remote symbolic links (ie. those listed via ssh or ftp) are problematic
1833in that it is difficult to tell whether they link to a file or to a
1834directory.
1835
1836To force treatment as a file: use >
Bram Moolenaar97d62492012-11-15 21:28:22 +01001837 gf
Bram Moolenaaradc21822011-04-01 18:03:16 +02001838<
1839To force treatment as a directory: use >
Bram Moolenaar97d62492012-11-15 21:28:22 +01001840 gd
Bram Moolenaaradc21822011-04-01 18:03:16 +02001841<
1842
Bram Moolenaar446cb832008-06-24 21:56:24 +00001843GOING UP *netrw--* {{{2
1844
1845To go up a directory, press "-" or press the <cr> when atop the ../ directory
1846entry in the listing.
1847
1848Netrw will use the command in |g:netrw_list_cmd| to perform the directory
1849listing operation after changing HOSTNAME to the host specified by the
Bram Moolenaara6878372014-03-22 21:02:50 +01001850user-prpvided url. By default netrw provides the command as: >
Bram Moolenaar446cb832008-06-24 21:56:24 +00001851
1852 ssh HOSTNAME ls -FLa
Bram Moolenaara6878372014-03-22 21:02:50 +01001853<
Bram Moolenaar446cb832008-06-24 21:56:24 +00001854where the HOSTNAME becomes the [user@]hostname as requested by the attempt to
1855read. Naturally, the user may override this command with whatever is
1856preferred. The NetList function which implements remote browsing
1857expects that directories will be flagged by a trailing slash.
1858
1859
1860HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2
1861
1862Netrw's browsing facility allows one to use the hiding list in one of three
1863ways: ignore it, hide files which match, and show only those files which
1864match.
1865
1866If no files have been marked via |netrw-mf|:
1867
1868The "a" map allows the user to cycle through the three hiding modes.
1869
1870The |g:netrw_list_hide| variable holds a comma delimited list of patterns
1871based on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list.
1872(also see |netrw-ctrl-h|) To set the hiding list, use the <c-h> map. As an
1873example, to hide files which begin with a ".", one may use the <c-h> map to
1874set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*'
1875in one's <.vimrc>). One may then use the "a" key to show all files, hide
1876matching files, or to show only the matching files.
1877
1878 Example: \.[ch]$
1879 This hiding list command will hide/show all *.c and *.h files.
1880
1881 Example: \.c$,\.h$
1882 This hiding list command will also hide/show all *.c and *.h
1883 files.
1884
1885Don't forget to use the "a" map to select the mode (normal/hiding/show) you
1886want!
1887
1888If files have been marked using |netrw-mf|, then this command will:
1889
1890 if showing all files or non-hidden files:
1891 modify the g:netrw_list_hide list by appending the marked files to it
1892 and showing only non-hidden files.
1893
1894 else if showing hidden files only:
1895 modify the g:netrw_list_hide list by removing the marked files from it
1896 and showing only non-hidden files.
1897 endif
1898
1899 *netrw-gh* *netrw-hide*
1900As a quick shortcut, one may press >
1901 gh
1902to toggle between hiding files which begin with a period (dot) and not hiding
1903them.
1904
Bram Moolenaar8d043172014-01-23 14:24:41 +01001905Associated setting variables: |g:netrw_list_hide| |g:netrw_hide|
Bram Moolenaar446cb832008-06-24 21:56:24 +00001906Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh|
1907
Bram Moolenaar8d043172014-01-23 14:24:41 +01001908 *netrw-gitignore*
1909Netrw provides a helper function 'netrw_gitignore#Hide()' that, when used with
1910|g:netrw_list_hide| automatically hides all git-ignored files.
1911
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001912'netrw_gitignore#Hide' searches for patterns in the following files: >
1913
Bram Moolenaar8d043172014-01-23 14:24:41 +01001914 './.gitignore'
1915 './.git/info/exclude'
1916 global gitignore file: `git config --global core.excludesfile`
1917 system gitignore file: `git config --system core.excludesfile`
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001918<
Bram Moolenaar8d043172014-01-23 14:24:41 +01001919Files that do not exist, are ignored.
1920Git-ignore patterns are taken from existing files, and converted to patterns for
1921hiding files. For example, if you had '*.log' in your '.gitignore' file, it
1922would be converted to '.*\.log'.
1923
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001924To use this function, simply assign its output to |g:netrw_list_hide| option. >
Bram Moolenaar8d043172014-01-23 14:24:41 +01001925
1926 Example: let g:netrw_list_hide= netrw_gitignore#Hide()
1927 Git-ignored files are hidden in Netrw.
1928
1929 Example: let g:netrw_list_hide= netrw_gitignore#Hide('my_gitignore_file')
1930 Function can take additional files with git-ignore patterns.
1931
1932 Example: g:netrw_list_hide= netrw_gitignore#Hide() . '.*\.swp$'
1933 Combining 'netrw_gitignore#Hide' with custom patterns.
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01001934<
Bram Moolenaar8d043172014-01-23 14:24:41 +01001935
Bram Moolenaar446cb832008-06-24 21:56:24 +00001936IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001937
1938Especially with the remote directory browser, constantly entering the password
1939is tedious.
1940
Bram Moolenaar9964e462007-05-05 17:54:07 +00001941For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00001942tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip
1943for setting up no-password ssh and scp and discusses associated security
Bram Moolenaar9964e462007-05-05 17:54:07 +00001944issues. It used to be available at http://hacks.oreilly.com/pub/h/66 ,
1945but apparently that address is now being redirected to some "hackzine".
Bram Moolenaare37d50a2008-08-06 17:06:04 +00001946I'll attempt a summary based on that article and on a communication from
1947Ben Schmidt:
Bram Moolenaar843ee412004-06-30 16:16:41 +00001948
Bram Moolenaare37d50a2008-08-06 17:06:04 +00001949 1. Generate a public/private key pair on the local machine
1950 (ssh client): >
1951 ssh-keygen -t rsa
1952 (saving the file in ~/.ssh/id_rsa as prompted)
1953<
1954 2. Just hit the <CR> when asked for passphrase (twice) for no
1955 passphrase. If you do use a passphrase, you will also need to use
1956 ssh-agent so you only have to type the passphrase once per session.
1957 If you don't use a passphrase, simply logging onto your local
1958 computer or getting access to the keyfile in any way will suffice
1959 to access any ssh servers which have that key authorized for login.
1960
1961 3. This creates two files: >
1962 ~/.ssh/id_rsa
1963 ~/.ssh/id_rsa.pub
1964<
1965 4. On the target machine (ssh server): >
1966 cd
1967 mkdir -p .ssh
1968 chmod 0700 .ssh
1969<
1970 5. On your local machine (ssh client): (one line) >
1971 ssh {serverhostname}
1972 cat '>>' '~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub
1973<
1974 or, for OpenSSH, (one line) >
1975 ssh {serverhostname}
1976 cat '>>' '~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub
1977<
1978You can test it out with >
1979 ssh {serverhostname}
1980and you should be log onto the server machine without further need to type
1981anything.
1982
1983If you decided to use a passphrase, do: >
1984 ssh-agent $SHELL
1985 ssh-add
1986 ssh {serverhostname}
1987You will be prompted for your key passphrase when you use ssh-add, but not
1988subsequently when you use ssh. For use with vim, you can use >
1989 ssh-agent vim
1990and, when next within vim, use >
1991 :!ssh-add
1992Alternatively, you can apply ssh-agent to the terminal you're planning on
1993running vim in: >
1994 ssh-agent xterm &
1995and do ssh-add whenever you need.
Bram Moolenaar843ee412004-06-30 16:16:41 +00001996
Bram Moolenaar9964e462007-05-05 17:54:07 +00001997For Windows, folks on the vim mailing list have mentioned that Pageant helps
1998with avoiding the constant need to enter the password.
Bram Moolenaar433f7c82006-03-21 21:29:36 +00001999
Bram Moolenaar446cb832008-06-24 21:56:24 +00002000Kingston Fung wrote about another way to avoid constantly needing to enter
2001passwords:
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00002002
Bram Moolenaar446cb832008-06-24 21:56:24 +00002003 In order to avoid the need to type in the password for scp each time, you
2004 provide a hack in the docs to set up a non password ssh account. I found a
2005 better way to do that: I can use a regular ssh account which uses a
2006 password to access the material without the need to key-in the password
2007 each time. It's good for security and convenience. I tried ssh public key
2008 authorization + ssh-agent, implementing this, and it works! Here are two
2009 links with instructions:
2010
2011 http://www.ibm.com/developerworks/library/l-keyc2/
2012 http://sial.org/howto/openssh/publickey-auth/
2013
2014
Bram Moolenaar8d043172014-01-23 14:24:41 +01002015 Ssh hints:
2016
2017 Thomer Gil has provided a hint on how to speed up netrw+ssh:
2018 http://thomer.com/howtos/netrw_ssh.html
2019
2020 Alex Young has several hints on speeding ssh up:
2021 http://usevim.com/2012/03/16/editing-remote-files/
2022
2023
Bram Moolenaar446cb832008-06-24 21:56:24 +00002024LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2
2025
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002026Pressing "qb" (query bookmarks) will list both the bookmarked directories and
2027directory traversal history.
Bram Moolenaar446cb832008-06-24 21:56:24 +00002028
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002029Related Topics:
2030 |netrw-gb| how to return (go) to a bookmark
2031 |netrw-mb| how to make a bookmark
2032 |netrw-mB| how to delete bookmarks
2033 |netrw-u| change to a predecessor directory via the history stack
2034 |netrw-U| change to a successor directory via the history stack
Bram Moolenaar446cb832008-06-24 21:56:24 +00002035
2036MAKING A NEW DIRECTORY *netrw-d* {{{2
2037
2038With the "d" map one may make a new directory either remotely (which depends
2039on the global variable g:netrw_mkdir_cmd) or locally (which depends on the
Bram Moolenaar5b435d62012-04-05 17:33:26 +02002040global variable g:netrw_localmkdir). Netrw will issue a request for the new
Bram Moolenaar446cb832008-06-24 21:56:24 +00002041directory's name. A bare <CR> at that point will abort the making of the
2042directory. Attempts to make a local directory that already exists (as either
2043a file or a directory) will be detected, reported on, and ignored.
2044
Bram Moolenaar15146672011-10-20 22:22:38 +02002045Related topics: |netrw-D|
Bram Moolenaar8d043172014-01-23 14:24:41 +01002046Associated setting variables: |g:netrw_localmkdir| |g:netrw_mkdir_cmd|
2047 |g:netrw_remote_mkdir| |netrw-%|
Bram Moolenaar446cb832008-06-24 21:56:24 +00002048
2049
2050MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* {{{2
2051
2052By default, |g:netrw_keepdir| is 1. This setting means that the current
Bram Moolenaarff034192013-04-24 18:51:19 +02002053directory will not track the browsing directory. (done for backwards
2054compatibility with v6's file explorer).
Bram Moolenaar446cb832008-06-24 21:56:24 +00002055
Bram Moolenaarff034192013-04-24 18:51:19 +02002056Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory
Bram Moolenaar446cb832008-06-24 21:56:24 +00002057track netrw's browsing directory.
2058
2059However, given the default setting for g:netrw_keepdir of 1 where netrw
2060maintains its own separate notion of the current directory, in order to make
2061the two directories the same, use the "c" map (just type c). That map will
2062set Vim's notion of the current directory to netrw's current browsing
2063directory.
2064
2065Associated setting variable: |g:netrw_keepdir|
2066
Bram Moolenaara6878372014-03-22 21:02:50 +01002067MARKING FILES *netrw-:MF* *netrw-mf* {{{2
Bram Moolenaar446cb832008-06-24 21:56:24 +00002068 (also see |netrw-mr|)
2069
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002070Netrw provides several ways to mark files:
Bram Moolenaara6878372014-03-22 21:02:50 +01002071
2072 * One may mark files with the cursor atop a filename and
Bram Moolenaar13600302014-05-22 18:26:40 +02002073 then pressing "mf".
Bram Moolenaara6878372014-03-22 21:02:50 +01002074
2075 * With gvim, in addition one may mark files with
Bram Moolenaar13600302014-05-22 18:26:40 +02002076 <s-leftmouse>. (see |netrw-mouse|)
Bram Moolenaara6878372014-03-22 21:02:50 +01002077
2078 * One may use the :MF command, which takes a list of
Bram Moolenaar13600302014-05-22 18:26:40 +02002079 files (for local directories, the list may include
2080 wildcards -- see |glob()|) >
Bram Moolenaara6878372014-03-22 21:02:50 +01002081
2082 :MF *.c
2083<
2084 * Note that :MF uses |<f-args>| to break the line
Bram Moolenaar13600302014-05-22 18:26:40 +02002085 at spaces.
2086
2087 * Mark files based upon the quickfix list (|netrw-qF|)
Bram Moolenaara6878372014-03-22 21:02:50 +01002088
2089The following netrw maps make use of marked files:
Bram Moolenaar446cb832008-06-24 21:56:24 +00002090
2091 |netrw-a| Hide marked files/directories
2092 |netrw-D| Delete marked files/directories
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002093 |netrw-mb| Append marked files to bookmarks
2094 |netrw-mB| Delete marked files from bookmarks
Bram Moolenaar446cb832008-06-24 21:56:24 +00002095 |netrw-mc| Copy marked files to target
2096 |netrw-md| Apply vimdiff to marked files
2097 |netrw-me| Edit marked files
Bram Moolenaarff034192013-04-24 18:51:19 +02002098 |netrw-mF| Unmark marked files
Bram Moolenaar446cb832008-06-24 21:56:24 +00002099 |netrw-mg| Apply vimgrep to marked files
Bram Moolenaara6878372014-03-22 21:02:50 +01002100 |netrw-mm| Move marked files to target
Bram Moolenaar446cb832008-06-24 21:56:24 +00002101 |netrw-mp| Print marked files
2102 |netrw-mt| Set target for |netrw-mm| and |netrw-mc|
2103 |netrw-mT| Generate tags using marked files
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002104 |netrw-mv| Apply vim command to marked files
Bram Moolenaar446cb832008-06-24 21:56:24 +00002105 |netrw-mx| Apply shell command to marked files
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002106 |netrw-mX| Apply shell command to marked files, en bloc
Bram Moolenaar446cb832008-06-24 21:56:24 +00002107 |netrw-mz| Compress/Decompress marked files
2108 |netrw-O| Obtain marked files
2109 |netrw-R| Rename marked files
2110
2111One may unmark files one at a time the same way one marks them; ie. place
2112the cursor atop a marked file and press "mf". This process also works
2113with <s-leftmouse> using gvim. One may unmark all files by pressing
2114"mu" (see |netrw-mu|).
2115
Bram Moolenaaradc21822011-04-01 18:03:16 +02002116Marked files are highlighted using the "netrwMarkFile" highlighting group,
2117which by default is linked to "Identifier" (see Identifier under
2118|group-name|). You may change the highlighting group by putting something
2119like >
2120
2121 highlight clear netrwMarkFile
2122 hi link netrwMarkFile ..whatever..
2123<
2124into $HOME/.vim/after/syntax/netrw.vim .
2125
Bram Moolenaar8d043172014-01-23 14:24:41 +01002126If the mouse is enabled and works with your vim, you may use <s-leftmouse> to
2127mark one or more files. You may mark multiple files by dragging the shifted
2128leftmouse. (see |netrw-mouse|)
2129
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002130 *markfilelist* *global_markfilelist* *local_markfilelist*
Bram Moolenaar446cb832008-06-24 21:56:24 +00002131All marked files are entered onto the global marked file list; there is only
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002132one such list. In addition, every netrw buffer also has its own buffer-local
2133marked file list; since netrw buffers are associated with specific
2134directories, this means that each directory has its own local marked file
2135list. The various commands which operate on marked files use one or the other
2136of the marked file lists.
Bram Moolenaar446cb832008-06-24 21:56:24 +00002137
Bram Moolenaara6878372014-03-22 21:02:50 +01002138Known Problem: if one is using tree mode (|g:netrw_liststyle|) and several
2139directories have files with the same name, then marking such a file will
2140result in all such files being highlighted as if they were all marked. The
2141|markfilelist|, however, will only have the selected file in it. This problem
2142is unlikely to be fixed.
2143
Bram Moolenaar446cb832008-06-24 21:56:24 +00002144
Bram Moolenaarff034192013-04-24 18:51:19 +02002145UNMARKING FILES *netrw-mF* {{{2
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002146 (also see |netrw-mf|, |netrw-mu|)
Bram Moolenaarff034192013-04-24 18:51:19 +02002147
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002148The "mF" command will unmark all files in the current buffer. One may also use
2149mf (|netrw-mf|) on a specific, already marked, file to unmark just that file.
Bram Moolenaarff034192013-04-24 18:51:19 +02002150
2151
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002152MARKING FILES BY QUICKFIX LIST *netrw-qF* {{{2
Bram Moolenaarff034192013-04-24 18:51:19 +02002153 (also see |netrw-mf|)
2154
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002155One may convert |quickfix-error-lists| into a marked file list using "qF".
2156You may then proceed with commands such as me (|netrw-me|) to edit them.
2157Quickfix error lists are generated, for example, by calls to |:vimgrep|.
Bram Moolenaarff034192013-04-24 18:51:19 +02002158
2159
Bram Moolenaar446cb832008-06-24 21:56:24 +00002160MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
2161 (also see |netrw-mf|)
2162
2163One may also mark files by pressing "mr"; netrw will then issue a prompt,
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002164"Enter regexp: ". You may then enter a shell-style regular expression such
2165as *.c$ (see |glob()|). For remote systems, glob() doesn't work -- so netrw
2166converts "*" into ".*" (see |regexp|) and marks files based on that. In the
2167future I may make it possible to use |regexp|s instead of glob()-style
2168expressions (yet-another-option).
Bram Moolenaar446cb832008-06-24 21:56:24 +00002169
2170
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002171MARKED FILES, ARBITRARY VIM COMMAND *netrw-mv* {{{2
2172 (See |netrw-mf| and |netrw-mr| for how to mark files)
2173 (uses the local marked-file list)
2174
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002175The "mv" map causes netrw to execute an arbitrary vim command on each file on
2176the local marked file list, individually:
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002177
2178 * 1split
2179 * sil! keepalt e file
2180 * run vim command
2181 * sil! keepalt wq!
2182
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002183A prompt, "Enter vim command: ", will be issued to elicit the vim command
2184you wish used.
2185
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002186
2187MARKED FILES, ARBITRARY SHELL COMMAND *netrw-mx* {{{2
Bram Moolenaar446cb832008-06-24 21:56:24 +00002188 (See |netrw-mf| and |netrw-mr| for how to mark files)
2189 (uses the local marked-file list)
2190
2191Upon activation of the "mx" map, netrw will query the user for some (external)
2192command to be applied to all marked files. All "%"s in the command will be
2193substituted with the name of each marked file in turn. If no "%"s are in the
2194command, then the command will be followed by a space and a marked filename.
2195
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002196Example:
2197 (mark files)
2198 mx
2199 Enter command: cat
2200
2201 The result is a series of shell commands:
2202 cat 'file1'
2203 cat 'file2'
2204 ...
2205
2206
2207MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOC *netrw-mX* {{{2
2208 (See |netrw-mf| and |netrw-mr| for how to mark files)
2209 (uses the global marked-file list)
2210
2211Upon activation of the 'mX' map, netrw will query the user for some (external)
2212command to be applied to all marked files on the global marked file list. The
2213"en bloc" means that one command will be executed on all the files at once: >
2214
2215 command files
2216
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002217This approach is useful, for example, to select files and make a tarball: >
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002218
2219 (mark files)
2220 mX
2221 Enter command: tar cf mynewtarball.tar
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002222<
2223The command that will be run with this example:
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002224
2225 tar cf mynewtarball.tar 'file1' 'file2' ...
2226
Bram Moolenaar446cb832008-06-24 21:56:24 +00002227
2228MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2
2229 (See |netrw-mf| and |netrw-mr| for how to mark files)
2230 (uses the local marked file list)
2231
2232If any marked files are compressed, then "mz" will decompress them.
2233If any marked files are decompressed, then "mz" will compress them
2234using the command specified by |g:netrw_compress|; by default,
2235that's "gzip".
2236
2237For decompression, netrw provides a |Dictionary| of suffices and their
2238associated decompressing utilities; see |g:netrw_decompress|.
2239
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002240Remember that one can mark multiple files by regular expression
2241(see |netrw-mr|); this is particularly useful to facilitate compressing and
2242decompressing a large number of files.
2243
Bram Moolenaar446cb832008-06-24 21:56:24 +00002244Associated setting variables: |g:netrw_compress| |g:netrw_decompress|
2245
2246MARKED FILES: COPYING *netrw-mc* {{{2
2247 (See |netrw-mf| and |netrw-mr| for how to mark files)
2248 (Uses the global marked file list)
2249
2250Select a target directory with mt (|netrw-mt|). Then change directory,
Bram Moolenaaradc21822011-04-01 18:03:16 +02002251select file(s) (see |netrw-mf|), and press "mc". The copy is done
2252from the current window (where one does the mf) to the target.
Bram Moolenaar446cb832008-06-24 21:56:24 +00002253
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002254If one does not have a target directory set with |netrw-mt|, then netrw
2255will query you for a directory to copy to.
2256
2257One may also copy directories and their contents (local only) to a target
2258directory.
2259
2260Associated setting variables:
2261 |g:netrw_localcopycmd|
2262 |g:netrw_localcopydircmd|
2263 |g:netrw_ssh_cmd|
Bram Moolenaar446cb832008-06-24 21:56:24 +00002264
2265MARKED FILES: DIFF *netrw-md* {{{2
2266 (See |netrw-mf| and |netrw-mr| for how to mark files)
2267 (uses the global marked file list)
2268
2269Use |vimdiff| to visualize difference between selected files (two or
2270three may be selected for this). Uses the global marked file list.
2271
2272MARKED FILES: EDITING *netrw-me* {{{2
2273 (See |netrw-mf| and |netrw-mr| for how to mark files)
2274 (uses the global marked file list)
2275
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002276The "me" command will place the marked files on the |arglist| and commence
Bram Moolenaar446cb832008-06-24 21:56:24 +00002277editing them. One may return the to explorer window with |:Rexplore|.
Bram Moolenaarff034192013-04-24 18:51:19 +02002278(use |:n| and |:p| to edit next and previous files in the arglist)
Bram Moolenaar446cb832008-06-24 21:56:24 +00002279
2280MARKED FILES: GREP *netrw-mg* {{{2
2281 (See |netrw-mf| and |netrw-mr| for how to mark files)
2282 (uses the global marked file list)
2283
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002284The "mg" command will apply |:vimgrep| to the marked files.
Bram Moolenaarff034192013-04-24 18:51:19 +02002285The command will ask for the requested pattern; one may then enter: >
2286
Bram Moolenaar446cb832008-06-24 21:56:24 +00002287 /pattern/[g][j]
2288 ! /pattern/[g][j]
2289 pattern
2290<
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002291With /pattern/, editing will start with the first item on the |quickfix| list
2292that vimgrep sets up (see |:copen|, |:cnext|, |:cprevious|). The |:vimgrep|
2293command is in use, so without 'g' each line is added to quickfix list only
2294once; with 'g' every match is included.
2295
2296With /pattern/j, "mg" will winnow the current marked file list to just those
2297marked files also possessing the specified pattern. Thus, one may use >
2298
2299 mr ...file-pattern...
2300 mg /pattern/j
2301<
2302to have a marked file list satisfying the file-pattern but also restricted to
2303files containing some desired pattern.
2304
Bram Moolenaarff034192013-04-24 18:51:19 +02002305
Bram Moolenaar446cb832008-06-24 21:56:24 +00002306MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2
2307 (See |netrw-mf| and |netrw-mr| for how to mark files)
2308 (uses the local marked file list)
2309
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002310The "mh" command extracts the suffices of the marked files and toggles their
Bram Moolenaar446cb832008-06-24 21:56:24 +00002311presence on the hiding list. Please note that marking the same suffix
2312this way multiple times will result in the suffix's presence being toggled
2313for each file (so an even quantity of marked files having the same suffix
2314is the same as not having bothered to select them at all).
2315
2316Related topics: |netrw-a| |g:netrw_list_hide|
2317
2318MARKED FILES: MOVING *netrw-mm* {{{2
2319 (See |netrw-mf| and |netrw-mr| for how to mark files)
2320 (uses the global marked file list)
2321
Bram Moolenaare37d50a2008-08-06 17:06:04 +00002322 WARNING: moving files is more dangerous than copying them.
2323 A file being moved is first copied and then deleted; if the
2324 copy operation fails and the delete succeeds, you will lose
2325 the file. Either try things out with unimportant files
2326 first or do the copy and then delete yourself using mc and D.
2327 Use at your own risk!
2328
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002329Select a target directory with mt (|netrw-mt|). Then change directory,
Bram Moolenaaradc21822011-04-01 18:03:16 +02002330select file(s) (see |netrw-mf|), and press "mm". The move is done
2331from the current window (where one does the mf) to the target.
Bram Moolenaar446cb832008-06-24 21:56:24 +00002332
2333Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|
2334
2335MARKED FILES: PRINTING *netrw-mp* {{{2
2336 (See |netrw-mf| and |netrw-mr| for how to mark files)
2337 (uses the local marked file list)
2338
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002339When "mp" is used, netrw will apply the |:hardcopy| command to marked files.
2340What netrw does is open each file in a one-line window, execute hardcopy, then
2341close the one-line window.
Bram Moolenaar446cb832008-06-24 21:56:24 +00002342
2343
2344MARKED FILES: SOURCING *netrw-ms* {{{2
2345 (See |netrw-mf| and |netrw-mr| for how to mark files)
2346 (uses the local marked file list)
2347
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002348With "ms", netrw will source the marked files (using vim's |:source| command)
Bram Moolenaar446cb832008-06-24 21:56:24 +00002349
2350
Bram Moolenaarff034192013-04-24 18:51:19 +02002351MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2
2352 (See |netrw-mf| and |netrw-mr| for how to mark files)
2353
2354Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
2355
2356 * If the cursor is atop a file name, then the netrw window's currently
2357 displayed directory is used for the copy/move-to target.
2358
2359 * Also, if the cursor is in the banner, then the netrw window's currently
2360 displayed directory is used for the copy/move-to target.
2361 Unless the target already is the current directory. In which case,
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002362 typing "mf" clears the target.
Bram Moolenaarff034192013-04-24 18:51:19 +02002363
2364 * However, if the cursor is atop a directory name, then that directory is
2365 used for the copy/move-to target
2366
Bram Moolenaara6878372014-03-22 21:02:50 +01002367 * One may use the :MT [directory] command to set the target *netrw-:MT*
2368 This command uses |<q-args>|, so spaces in the directory name are
2369 permitted without escaping.
2370
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002371 * With mouse-enabled vim or with gvim, one may select a target by using
2372 <c-leftmouse>
2373
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002374There is only one copy/move-to target at a time in a vim session; ie. the
2375target is a script variable (see |s:var|) and is shared between all netrw
2376windows (in an instance of vim).
Bram Moolenaarff034192013-04-24 18:51:19 +02002377
2378When using menus and gvim, netrw provides a "Targets" entry which allows one
2379to pick a target from the list of bookmarks and history.
2380
2381Related topics:
2382 Marking Files......................................|netrw-mf|
2383 Marking Files by Regular Expression................|netrw-mr|
2384 Marked Files: Target Directory Using Bookmarks.....|netrw-Tb|
2385 Marked Files: Target Directory Using History.......|netrw-Th|
2386
2387
Bram Moolenaar446cb832008-06-24 21:56:24 +00002388MARKED FILES: TAGGING *netrw-mT* {{{2
2389 (See |netrw-mf| and |netrw-mr| for how to mark files)
2390 (uses the global marked file list)
2391
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002392The "mT" mapping will apply the command in |g:netrw_ctags| (by default, it is
Bram Moolenaar446cb832008-06-24 21:56:24 +00002393"ctags") to marked files. For remote browsing, in order to create a tags file
2394netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for
2395this to work on remote systems. For your local system, see |ctags| on how to
2396get a version. I myself use hdrtags, currently available at
Bram Moolenaar97d62492012-11-15 21:28:22 +01002397http://www.drchip.org/astronaut/src/index.html , and have >
Bram Moolenaar446cb832008-06-24 21:56:24 +00002398
2399 let g:netrw_ctags= "hdrtag"
2400<
2401in my <.vimrc>.
2402
2403When a remote set of files are tagged, the resulting tags file is "obtained";
Bram Moolenaara6878372014-03-22 21:02:50 +01002404ie. a copy is transferred to the local system's directory. The now local tags
Bram Moolenaar446cb832008-06-24 21:56:24 +00002405file is then modified so that one may use it through the network. The
Bram Moolenaara6878372014-03-22 21:02:50 +01002406modification made concerns the names of the files in the tags; each filename is
Bram Moolenaar446cb832008-06-24 21:56:24 +00002407preceded by the netrw-compatible url used to obtain it. When one subsequently
2408uses one of the go to tag actions (|tags|), the url will be used by netrw to
2409edit the desired file and go to the tag.
2410
Bram Moolenaarc236c162008-07-13 17:41:49 +00002411Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd|
Bram Moolenaar446cb832008-06-24 21:56:24 +00002412
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002413MARKED FILES: TARGET DIRECTORY USING BOOKMARKS *netrw-Tb* {{{2
Bram Moolenaar446cb832008-06-24 21:56:24 +00002414
Bram Moolenaara6878372014-03-22 21:02:50 +01002415Sets the marked file copy/move-to target.
Bram Moolenaar446cb832008-06-24 21:56:24 +00002416
Bram Moolenaarff034192013-04-24 18:51:19 +02002417The |netrw-qb| map will give you a list of bookmarks (and history).
2418One may choose one of the bookmarks to become your marked file
2419target by using [count]Tb (default count: 1).
Bram Moolenaar446cb832008-06-24 21:56:24 +00002420
Bram Moolenaarff034192013-04-24 18:51:19 +02002421Related topics:
Bram Moolenaara6878372014-03-22 21:02:50 +01002422 Copying files to target............................|netrw-mc|
Bram Moolenaarff034192013-04-24 18:51:19 +02002423 Listing Bookmarks and History......................|netrw-qb|
2424 Marked Files: Setting The Target Directory.........|netrw-mt|
2425 Marked Files: Target Directory Using History.......|netrw-Th|
2426 Marking Files......................................|netrw-mf|
2427 Marking Files by Regular Expression................|netrw-mr|
Bram Moolenaara6878372014-03-22 21:02:50 +01002428 Moving files to target.............................|netrw-mm|
Bram Moolenaar446cb832008-06-24 21:56:24 +00002429
Bram Moolenaar446cb832008-06-24 21:56:24 +00002430
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002431MARKED FILES: TARGET DIRECTORY USING HISTORY *netrw-Th* {{{2
Bram Moolenaar446cb832008-06-24 21:56:24 +00002432
Bram Moolenaara6878372014-03-22 21:02:50 +01002433Sets the marked file copy/move-to target.
Bram Moolenaarff034192013-04-24 18:51:19 +02002434
2435The |netrw-qb| map will give you a list of history (and bookmarks).
2436One may choose one of the history entries to become your marked file
2437target by using [count]Th (default count: 0; ie. the current directory).
2438
2439Related topics:
Bram Moolenaara6878372014-03-22 21:02:50 +01002440 Copying files to target............................|netrw-mc|
Bram Moolenaarff034192013-04-24 18:51:19 +02002441 Listing Bookmarks and History......................|netrw-qb|
2442 Marked Files: Setting The Target Directory.........|netrw-mt|
2443 Marked Files: Target Directory Using Bookmarks.....|netrw-Tb|
2444 Marking Files......................................|netrw-mf|
2445 Marking Files by Regular Expression................|netrw-mr|
Bram Moolenaara6878372014-03-22 21:02:50 +01002446 Moving files to target.............................|netrw-mm|
Bram Moolenaarff034192013-04-24 18:51:19 +02002447
Bram Moolenaar446cb832008-06-24 21:56:24 +00002448
2449MARKED FILES: UNMARKING *netrw-mu* {{{2
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002450 (See |netrw-mf|, |netrw-mF|)
Bram Moolenaar446cb832008-06-24 21:56:24 +00002451
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002452The "mu" mapping will unmark all currently marked files. This command differs
2453from "mF" as the latter only unmarks files in the current directory whereas
2454"mu" will unmark global and all buffer-local marked files.
2455(see |netrw-mF|)
2456
Bram Moolenaar446cb832008-06-24 21:56:24 +00002457
Bram Moolenaar15146672011-10-20 22:22:38 +02002458 *netrw-browser-settings*
Bram Moolenaar446cb832008-06-24 21:56:24 +00002459NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2
2460
Bram Moolenaar15146672011-10-20 22:22:38 +02002461(if you're interested in the netrw file transfer settings, see |netrw-options|
2462 and |netrw-protocol|)
Bram Moolenaar446cb832008-06-24 21:56:24 +00002463
2464The <netrw.vim> browser provides settings in the form of variables which
2465you may modify; by placing these settings in your <.vimrc>, you may customize
2466your browsing preferences. (see also: |netrw-settings|)
2467>
2468 --- -----------
2469 Var Explanation
2470 --- -----------
Bram Moolenaar8d043172014-01-23 14:24:41 +01002471< *g:netrw_altfile* some like |CTRL-^| to return to the last
2472 edited file. Choose that by setting this
2473 parameter to 1.
2474 Others like |CTRL-^| to return to the
2475 netrw browsing buffer. Choose that by setting
2476 this parameter to 0.
2477 default: =0
2478
2479 *g:netrw_alto* change from above splitting to below splitting
Bram Moolenaar446cb832008-06-24 21:56:24 +00002480 by setting this variable (see |netrw-o|)
2481 default: =&sb (see |'sb'|)
2482
Bram Moolenaarff034192013-04-24 18:51:19 +02002483 *g:netrw_altv* change from left splitting to right splitting
Bram Moolenaar446cb832008-06-24 21:56:24 +00002484 by setting this variable (see |netrw-v|)
2485 default: =&spr (see |'spr'|)
2486
Bram Moolenaarff034192013-04-24 18:51:19 +02002487 *g:netrw_banner* enable/suppress the banner
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002488 =0: suppress the banner
2489 =1: banner is enabled (default)
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002490
Bram Moolenaare6ae6222013-05-21 21:01:10 +02002491 *g:netrw_bannerbackslash* if this variable exists and is not zero, the
2492 banner will be displayed with backslashes
2493 rather than forward slashes.
2494
Bram Moolenaarff034192013-04-24 18:51:19 +02002495 *g:netrw_browse_split* when browsing, <cr> will open the file by:
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002496 =0: re-using the same window (default)
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002497 =1: horizontally splitting the window first
2498 =2: vertically splitting the window first
Bram Moolenaar446cb832008-06-24 21:56:24 +00002499 =3: open file in new tab
2500 =4: act like "P" (ie. open previous window)
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002501 Note that |g:netrw_preview| may be used
2502 to get vertical splitting instead of
2503 horizontal splitting.
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002504 =[servername,tab-number,window-number]
2505 Given a |List| such as this, a remote server
2506 named by the "servername" will be used for
2507 editing. It will also use the specified tab
2508 and window numbers to perform editing
2509 (see |clientserver|, |netrw-ctrl-r|)
2510 This option does not affect |:Lexplore|
2511 windows.
Bram Moolenaar446cb832008-06-24 21:56:24 +00002512
Bram Moolenaar8d043172014-01-23 14:24:41 +01002513 Related topics:
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002514 |g:netrw_alto| |g:netrw_altv|
2515 |netrw-C| |netrw-cr|
2516 |netrw-ctrl-r|
Bram Moolenaar8d043172014-01-23 14:24:41 +01002517
Bram Moolenaarff034192013-04-24 18:51:19 +02002518 *g:netrw_browsex_viewer* specify user's preference for a viewer: >
Bram Moolenaar446cb832008-06-24 21:56:24 +00002519 "kfmclient exec"
2520 "gnome-open"
2521< If >
2522 "-"
2523< is used, then netrwFileHandler() will look for
2524 a script/function to handle the given
2525 extension. (see |netrw_filehandler|).
2526
Bram Moolenaarff034192013-04-24 18:51:19 +02002527 *g:netrw_chgperm* Unix/Linux: "chmod PERM FILENAME"
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002528 Windows: "cacls FILENAME /e /p PERM"
2529 Used to change access permission for a file.
2530
Bram Moolenaarff034192013-04-24 18:51:19 +02002531 *g:netrw_compress* ="gzip"
Bram Moolenaar446cb832008-06-24 21:56:24 +00002532 Will compress marked files with this
2533 command
2534
Bram Moolenaarff034192013-04-24 18:51:19 +02002535 *g:Netrw_corehandler* Allows one to specify something additional
Bram Moolenaar15146672011-10-20 22:22:38 +02002536 to do when handling <core> files via netrw's
2537 browser's "x" command (see |netrw-x|). If
2538 present, g:Netrw_corehandler specifies
2539 either one or more function references
2540 (see |Funcref|). (the capital g:Netrw...
2541 is required its holding a function reference)
2542
2543
Bram Moolenaarff034192013-04-24 18:51:19 +02002544 *g:netrw_ctags* ="ctags"
2545 The default external program used to create
2546 tags
Bram Moolenaarc236c162008-07-13 17:41:49 +00002547
Bram Moolenaarff034192013-04-24 18:51:19 +02002548 *g:netrw_cursor* = 2 (default)
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002549 This option controls the use of the
Bram Moolenaaradc21822011-04-01 18:03:16 +02002550 |'cursorline'| (cul) and |'cursorcolumn'|
2551 (cuc) settings by netrw:
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002552
Bram Moolenaaradc21822011-04-01 18:03:16 +02002553 Value Thin-Long-Tree Wide
2554 =0 u-cul u-cuc u-cul u-cuc
2555 =1 u-cul u-cuc cul u-cuc
2556 =2 cul u-cuc cul u-cuc
2557 =3 cul u-cuc cul cuc
2558 =4 cul cuc cul cuc
2559
2560 Where
2561 u-cul : user's |'cursorline'| setting used
2562 u-cuc : user's |'cursorcolumn'| setting used
2563 cul : |'cursorline'| locally set
2564 cuc : |'cursorcolumn'| locally set
2565
Bram Moolenaarff034192013-04-24 18:51:19 +02002566 *g:netrw_decompress* = { ".gz" : "gunzip" ,
Bram Moolenaar446cb832008-06-24 21:56:24 +00002567 ".bz2" : "bunzip2" ,
2568 ".zip" : "unzip" ,
2569 ".tar" : "tar -xf"}
2570 A dictionary mapping suffices to
2571 decompression programs.
2572
Bram Moolenaaradc21822011-04-01 18:03:16 +02002573 *g:netrw_dirhistmax* =10: controls maximum quantity of past
2574 history. May be zero to supppress
2575 history.
2576 (related: |netrw-qb| |netrw-u| |netrw-U|)
2577
Bram Moolenaar97d62492012-11-15 21:28:22 +01002578 *g:netrw_dynamic_maxfilenamelen* =32: enables dynamic determination of
2579 |g:netrw_maxfilenamelen|, which affects
2580 local file long listing.
Bram Moolenaara6878372014-03-22 21:02:50 +01002581
Bram Moolenaar5b435d62012-04-05 17:33:26 +02002582 *g:netrw_errorlvl* =0: error levels greater than or equal to
2583 this are permitted to be displayed
2584 0: notes
2585 1: warnings
2586 2: errors
2587
Bram Moolenaarff034192013-04-24 18:51:19 +02002588 *g:netrw_fastbrowse* =0: slow speed directory browsing;
Bram Moolenaar13600302014-05-22 18:26:40 +02002589 never re-uses directory listings;
Bram Moolenaar446cb832008-06-24 21:56:24 +00002590 always obtains directory listings.
2591 =1: medium speed directory browsing;
2592 re-use directory listings only
2593 when remote directory browsing.
2594 (default value)
2595 =2: fast directory browsing;
2596 only obtains directory listings when the
2597 directory hasn't been seen before
2598 (or |netrw-ctrl-l| is used).
2599
2600 Fast browsing retains old directory listing
2601 buffers so that they don't need to be
2602 re-acquired. This feature is especially
2603 important for remote browsing. However, if
2604 a file is introduced or deleted into or from
2605 such directories, the old directory buffer
2606 becomes out-of-date. One may always refresh
2607 such a directory listing with |netrw-ctrl-l|.
2608 This option gives the user the choice of
2609 trading off accuracy (ie. up-to-date listing)
2610 versus speed.
2611
Bram Moolenaar13600302014-05-22 18:26:40 +02002612 *g:netrw_ffkeep* (default: doesn't exist)
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002613 If this variable exists and is zero, then
Bram Moolenaar13600302014-05-22 18:26:40 +02002614 netrw will not do a save and restore for
2615 |'fileformat'|.
2616
Bram Moolenaarff034192013-04-24 18:51:19 +02002617 *g:netrw_fname_escape* =' ?&;%'
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002618 Used on filenames before remote reading/writing
Bram Moolenaar446cb832008-06-24 21:56:24 +00002619
Bram Moolenaarff034192013-04-24 18:51:19 +02002620 *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
Bram Moolenaar446cb832008-06-24 21:56:24 +00002621 that can show up as "directories" and "files"
2622 in the listing. This pattern is used to
2623 remove such embedded messages. By default its
2624 value is:
2625 '^total\s\+\d\+$\|
2626 ^Trying\s\+\d\+.*$\|
2627 ^KERBEROS_V\d rejected\|
2628 ^Security extensions not\|
2629 No such file\|
2630 : connect to address [0-9a-fA-F:]*
2631 : No route to host$'
2632
Bram Moolenaarff034192013-04-24 18:51:19 +02002633 *g:netrw_ftp_list_cmd* options for passing along to ftp for directory
Bram Moolenaar446cb832008-06-24 21:56:24 +00002634 listing. Defaults:
2635 unix or g:netrw_cygwin set: : "ls -lF"
2636 otherwise "dir"
2637
2638
Bram Moolenaarff034192013-04-24 18:51:19 +02002639 *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory
Bram Moolenaar446cb832008-06-24 21:56:24 +00002640 listing, sorted by size of file.
2641 Defaults:
2642 unix or g:netrw_cygwin set: : "ls -slF"
2643 otherwise "dir"
2644
Bram Moolenaarff034192013-04-24 18:51:19 +02002645 *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory
Bram Moolenaar446cb832008-06-24 21:56:24 +00002646 listing, sorted by time of last modification.
2647 Defaults:
2648 unix or g:netrw_cygwin set: : "ls -tlF"
2649 otherwise "dir"
2650
Bram Moolenaar5b435d62012-04-05 17:33:26 +02002651 *g:netrw_glob_escape* ='[]*?`{~$' (unix)
Bram Moolenaar00a927d2010-05-14 23:24:24 +02002652 ='[]*?`{$' (windows
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002653 These characters in directory names are
Bram Moolenaar446cb832008-06-24 21:56:24 +00002654 escaped before applying glob()
2655
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002656 *g:netrw_gx* ="<cfile>"
2657 This option controls how gx (|netrw-gx|) picks
2658 up the text under the cursor. See |expand()|
2659 for possibilities.
2660
Bram Moolenaarff034192013-04-24 18:51:19 +02002661 *g:netrw_hide* Controlled by the "a" map (see |netrw-a|)
2662 =0 : show all
2663 =1 : show not-hidden files
2664 =2 : show hidden files only
Bram Moolenaar446cb832008-06-24 21:56:24 +00002665 default: =0
2666
Bram Moolenaarff034192013-04-24 18:51:19 +02002667 *g:netrw_home* The home directory for where bookmarks and
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002668 history are saved (as .netrwbook and
2669 .netrwhist).
2670 default: the first directory on the
2671 |'runtimepath'|
2672
Bram Moolenaarff034192013-04-24 18:51:19 +02002673 *g:netrw_keepdir* =1 (default) keep current directory immune from
Bram Moolenaar446cb832008-06-24 21:56:24 +00002674 the browsing directory.
2675 =0 keep the current directory the same as the
2676 browsing directory.
2677 The current browsing directory is contained in
2678 b:netrw_curdir (also see |netrw-c|)
2679
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002680 *g:netrw_keepj* ="keepj" (default) netrw attempts to keep the
2681 |:jumps| table unaffected.
2682 ="" netrw will not use |:keepjumps| with
2683 exceptions only for the
2684 saving/restoration of position.
2685
Bram Moolenaarff034192013-04-24 18:51:19 +02002686 *g:netrw_list_cmd* command for listing remote directories
Bram Moolenaar446cb832008-06-24 21:56:24 +00002687 default: (if ssh is executable)
2688 "ssh HOSTNAME ls -FLa"
2689
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002690 *g:netrw_list_cmd_options* If this variable exists, then its contents are
2691 appended to the g:netrw_list_cmd. For
2692 example, use "2>/dev/null" to get rid of banner
2693 messages on unix systems.
2694
2695
Bram Moolenaarff034192013-04-24 18:51:19 +02002696 *g:netrw_liststyle* Set the default listing style:
Bram Moolenaar446cb832008-06-24 21:56:24 +00002697 = 0: thin listing (one file per line)
2698 = 1: long listing (one file per line with time
2699 stamp information and file size)
2700 = 2: wide listing (multiple files in columns)
2701 = 3: tree style listing
Bram Moolenaar8d043172014-01-23 14:24:41 +01002702
Bram Moolenaarff034192013-04-24 18:51:19 +02002703 *g:netrw_list_hide* comma separated pattern list for hiding files
Bram Moolenaar446cb832008-06-24 21:56:24 +00002704 Patterns are regular expressions (see |regexp|)
Bram Moolenaar8d043172014-01-23 14:24:41 +01002705 There's some special support for git-ignore
2706 files: you may add the output from the helper
2707 function 'netrw_gitignore#Hide() automatically
2708 hiding all gitignored files.
2709 For more details see |netrw-gitignore|.
2710
2711 Examples:
2712 let g:netrw_list_hide= '.*\.swp$'
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002713 let g:netrw_list_hide= netrw_gitignore#Hide().'.*\.swp$'
Bram Moolenaar8d043172014-01-23 14:24:41 +01002714 default: ""
Bram Moolenaar446cb832008-06-24 21:56:24 +00002715
Bram Moolenaarff034192013-04-24 18:51:19 +02002716 *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002717 ="copy" Windows
Bram Moolenaar446cb832008-06-24 21:56:24 +00002718 Copies marked files (|netrw-mf|) to target
2719 directory (|netrw-mt|, |netrw-mc|)
2720
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002721 *g:netrw_localcopydircmd* ="cp -R" Linux/Unix/MacOS/Cygwin
2722 ="xcopy /e /c /h/ /i /k" Windows
2723 Copies directories to target directory.
2724 (|netrw-mc|, |netrw-mt|)
2725
Bram Moolenaare6ae6222013-05-21 21:01:10 +02002726 *g:netrw_localmkdir* command for making a local directory
2727 default: "mkdir"
2728
Bram Moolenaarff034192013-04-24 18:51:19 +02002729 *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002730 ="move" Windows
Bram Moolenaar446cb832008-06-24 21:56:24 +00002731 Moves marked files (|netrw-mf|) to target
2732 directory (|netrw-mt|, |netrw-mm|)
2733
Bram Moolenaarff034192013-04-24 18:51:19 +02002734 *g:netrw_localrmdir* remove directory command (rmdir)
Bram Moolenaar446cb832008-06-24 21:56:24 +00002735 default: "rmdir"
2736
Bram Moolenaarff034192013-04-24 18:51:19 +02002737 *g:netrw_maxfilenamelen* =32 by default, selected so as to make long
Bram Moolenaar446cb832008-06-24 21:56:24 +00002738 listings fit on 80 column displays.
2739 If your screen is wider, and you have file
2740 or directory names longer than 32 bytes,
2741 you may set this option to keep listings
2742 columnar.
2743
Bram Moolenaarff034192013-04-24 18:51:19 +02002744 *g:netrw_mkdir_cmd* command for making a remote directory
Bram Moolenaar15146672011-10-20 22:22:38 +02002745 via ssh (also see |g:netrw_remote_mkdir|)
Bram Moolenaar446cb832008-06-24 21:56:24 +00002746 default: "ssh USEPORT HOSTNAME mkdir"
2747
Bram Moolenaar251e1912011-06-19 05:09:16 +02002748 *g:netrw_mousemaps* =1 (default) enables mouse buttons while
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002749 browsing to:
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002750 leftmouse : open file/directory
2751 shift-leftmouse : mark file
2752 middlemouse : same as P
2753 rightmouse : remove file/directory
2754 =0: disables mouse maps
2755
Bram Moolenaar15146672011-10-20 22:22:38 +02002756 *g:netrw_nobeval* doesn't exist (default)
2757 If this variable exists, then balloon
2758 evaluation will be suppressed
2759 (see |'ballooneval'|)
2760
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002761 *g:netrw_usetab* if this variable exists and is non-zero, then
2762 the <tab> map supporting shrinking/expanding a
2763 Lexplore or netrw window will be enabled.
2764 (see |netrw-c-tab|)
2765
Bram Moolenaara6878372014-03-22 21:02:50 +01002766 *g:netrw_remote_mkdir* command for making a remote directory
Bram Moolenaar15146672011-10-20 22:22:38 +02002767 via ftp (also see |g:netrw_mkdir_cmd|)
2768 default: "mkdir"
2769
Bram Moolenaarff034192013-04-24 18:51:19 +02002770 *g:netrw_retmap* if it exists and is set to one, then:
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002771 * if in a netrw-selected file, AND
2772 * no normal-mode <2-leftmouse> mapping exists,
2773 then the <2-leftmouse> will be mapped for easy
Bram Moolenaar446cb832008-06-24 21:56:24 +00002774 return to the netrw browser window.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002775 example: click once to select and open a file,
2776 double-click to return.
2777
2778 Note that one may instead choose to:
2779 * let g:netrw_retmap= 1, AND
2780 * nmap <silent> YourChoice <Plug>NetrwReturn
2781 and have another mapping instead of
2782 <2-leftmouse> to invoke the return.
2783
2784 You may also use the |:Rexplore| command to do
2785 the same thing.
2786
Bram Moolenaar446cb832008-06-24 21:56:24 +00002787 default: =0
2788
Bram Moolenaar13600302014-05-22 18:26:40 +02002789 *g:netrw_rm_cmd* command for removing remote files
Bram Moolenaar446cb832008-06-24 21:56:24 +00002790 default: "ssh USEPORT HOSTNAME rm"
2791
Bram Moolenaar13600302014-05-22 18:26:40 +02002792 *g:netrw_rmdir_cmd* command for removing remote directories
Bram Moolenaar446cb832008-06-24 21:56:24 +00002793 default: "ssh USEPORT HOSTNAME rmdir"
2794
Bram Moolenaar13600302014-05-22 18:26:40 +02002795 *g:netrw_rmf_cmd* command for removing remote softlinks
Bram Moolenaar446cb832008-06-24 21:56:24 +00002796 default: "ssh USEPORT HOSTNAME rm -f"
2797
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002798 *g:netrw_servername* use this variable to provide a name for
2799 |netrw-ctrl-r| to use for its server.
2800 default: "NETRWSERVER"
2801
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002802 *g:netrw_sort_by* sort by "name", "time", "size", or
2803 "exten".
Bram Moolenaar446cb832008-06-24 21:56:24 +00002804 default: "name"
2805
Bram Moolenaarff034192013-04-24 18:51:19 +02002806 *g:netrw_sort_direction* sorting direction: "normal" or "reverse"
Bram Moolenaar446cb832008-06-24 21:56:24 +00002807 default: "normal"
2808
Bram Moolenaarff034192013-04-24 18:51:19 +02002809 *g:netrw_sort_options* sorting is done using |:sort|; this
Bram Moolenaarc236c162008-07-13 17:41:49 +00002810 variable's value is appended to the
2811 sort command. Thus one may ignore case,
2812 for example, with the following in your
2813 .vimrc: >
2814 let g:netrw_sort_options="i"
2815< default: ""
2816
Bram Moolenaarff034192013-04-24 18:51:19 +02002817 *g:netrw_sort_sequence* when sorting by name, first sort by the
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002818 comma-separated pattern sequence. Note that
Bram Moolenaara6878372014-03-22 21:02:50 +01002819 any filigree added to indicate filetypes
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002820 should be accounted for in your pattern.
Bram Moolenaar446cb832008-06-24 21:56:24 +00002821 default: '[\/]$,*,\.bak$,\.o$,\.h$,
2822 \.info$,\.swp$,\.obj$'
2823
Bram Moolenaarff034192013-04-24 18:51:19 +02002824 *g:netrw_special_syntax* If true, then certain files will be shown
Bram Moolenaar5b435d62012-04-05 17:33:26 +02002825 using special syntax in the browser:
Bram Moolenaar446cb832008-06-24 21:56:24 +00002826
2827 netrwBak : *.bak
2828 netrwCompress: *.gz *.bz2 *.Z *.zip
2829 netrwData : *.dat
2830 netrwHdr : *.h
2831 netrwLib : *.a *.so *.lib *.dll
2832 netrwMakefile: [mM]akefile *.mak
2833 netrwObj : *.o *.obj
2834 netrwTags : tags ANmenu ANtags
Bram Moolenaara6878372014-03-22 21:02:50 +01002835 netrwTilde : *
Bram Moolenaar446cb832008-06-24 21:56:24 +00002836 netrwTmp : tmp* *tmp
2837
2838 These syntax highlighting groups are linked
2839 to Folded or DiffChange by default
2840 (see |hl-Folded| and |hl-DiffChange|), but
2841 one may put lines like >
2842 hi link netrwCompress Visual
2843< into one's <.vimrc> to use one's own
Bram Moolenaara6878372014-03-22 21:02:50 +01002844 preferences. Alternatively, one may
2845 put such specifications into
2846 .vim/after/syntax/netrw.vim.
Bram Moolenaar446cb832008-06-24 21:56:24 +00002847
Bram Moolenaara6878372014-03-22 21:02:50 +01002848 As an example, I myself use a dark-background
2849 colorscheme with the following in
2850 .vim/after/syntax/netrw.vim: >
2851
2852 hi netrwCompress term=NONE cterm=NONE gui=NONE ctermfg=10 guifg=green ctermbg=0 guibg=black
2853 hi netrwData term=NONE cterm=NONE gui=NONE ctermfg=9 guifg=blue ctermbg=0 guibg=black
2854 hi netrwHdr term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1
2855 hi netrwLex term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1
2856 hi netrwYacc term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1
2857 hi netrwLib term=NONE cterm=NONE gui=NONE ctermfg=14 guifg=yellow
2858 hi netrwObj term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red
2859 hi netrwTilde term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red
2860 hi netrwTmp term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red
2861 hi netrwTags term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red
2862 hi netrwDoc term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=yellow2 guibg=Blue3
2863 hi netrwSymLink term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=grey60
2864<
Bram Moolenaarff034192013-04-24 18:51:19 +02002865 *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines,
Bram Moolenaar446cb832008-06-24 21:56:24 +00002866 messages, banners, and whatnot that one doesn't
2867 want masquerading as "directories" and "files".
2868 Use this pattern to remove such embedded
2869 messages. By default its value is:
2870 '^total\s\+\d\+$'
2871
Bram Moolenaare6ae6222013-05-21 21:01:10 +02002872 *g:netrw_ssh_cmd* One may specify an executable command
2873 to use instead of ssh for remote actions
2874 such as listing, file removal, etc.
2875 default: ssh
2876
Bram Moolenaar446cb832008-06-24 21:56:24 +00002877
Bram Moolenaarff034192013-04-24 18:51:19 +02002878 *g:netrw_tmpfile_escape* =' &;'
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002879 escape() is applied to all temporary files
Bram Moolenaar446cb832008-06-24 21:56:24 +00002880 to escape these characters.
2881
Bram Moolenaarff034192013-04-24 18:51:19 +02002882 *g:netrw_timefmt* specify format string to vim's strftime().
Bram Moolenaar446cb832008-06-24 21:56:24 +00002883 The default, "%c", is "the preferred date
2884 and time representation for the current
2885 locale" according to my manpage entry for
2886 strftime(); however, not all are satisfied
2887 with it. Some alternatives:
2888 "%a %d %b %Y %T",
2889 " %a %Y-%m-%d %I-%M-%S %p"
2890 default: "%c"
2891
Bram Moolenaarff034192013-04-24 18:51:19 +02002892 *g:netrw_use_noswf* netrw normally avoids writing swapfiles
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002893 for browser buffers. However, under some
Bram Moolenaar446cb832008-06-24 21:56:24 +00002894 systems this apparently is causing nasty
2895 ml_get errors to appear; if you're getting
2896 ml_get errors, try putting
2897 let g:netrw_use_noswf= 0
2898 in your .vimrc.
Bram Moolenaara6878372014-03-22 21:02:50 +01002899 default: 1
Bram Moolenaar446cb832008-06-24 21:56:24 +00002900
Bram Moolenaarff034192013-04-24 18:51:19 +02002901 *g:netrw_winsize* specify initial size of new windows made with
Bram Moolenaar446cb832008-06-24 21:56:24 +00002902 "o" (see |netrw-o|), "v" (see |netrw-v|),
Bram Moolenaar251e1912011-06-19 05:09:16 +02002903 |:Hexplore| or |:Vexplore|. The g:netrw_winsize
2904 is an integer describing the percentage of the
2905 current netrw buffer's window to be used for
2906 the new window.
Bram Moolenaar15146672011-10-20 22:22:38 +02002907 If g:netrw_winsize is less than zero, then
2908 the absolute value of g:netrw_winsize lines
2909 or columns will be used for the new window.
Bram Moolenaar13600302014-05-22 18:26:40 +02002910 If g:netrw_winsize is zero, then a normal
2911 split will be made (ie. |'equalalways'| will
2912 take effect, for example).
Bram Moolenaar251e1912011-06-19 05:09:16 +02002913 default: 50 (for 50%)
Bram Moolenaar446cb832008-06-24 21:56:24 +00002914
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002915 *g:netrw_wiw* =1 specifies the minimum window width to use
2916 when shrinking a netrw/Lexplore window
2917 (see |netrw-c-tab|).
2918
Bram Moolenaarff034192013-04-24 18:51:19 +02002919 *g:netrw_xstrlen* Controls how netrw computes string lengths,
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002920 including multi-byte characters' string
Bram Moolenaar446cb832008-06-24 21:56:24 +00002921 length. (thanks to N Weibull, T Mechelynck)
2922 =0: uses Vim's built-in strlen()
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002923 =1: number of codepoints (Latin a + combining
Bram Moolenaar446cb832008-06-24 21:56:24 +00002924 circumflex is two codepoints) (DEFAULT)
2925 =2: number of spacing codepoints (Latin a +
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002926 combining circumflex is one spacing
Bram Moolenaar446cb832008-06-24 21:56:24 +00002927 codepoint; a hard tab is one; wide and
2928 narrow CJK are one each; etc.)
2929 =3: virtual length (counting tabs as anything
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01002930 between 1 and |'tabstop'|, wide CJK as 2
Bram Moolenaar446cb832008-06-24 21:56:24 +00002931 rather than 1, Arabic alif as zero when
2932 immediately preceded by lam, one
2933 otherwise, etc)
2934
Bram Moolenaarff034192013-04-24 18:51:19 +02002935 *g:NetrwTopLvlMenu* This variable specifies the top level
Bram Moolenaar446cb832008-06-24 21:56:24 +00002936 menu name; by default, it's "Netrw.". If
2937 you wish to change this, do so in your
2938 .vimrc.
2939
2940NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* {{{2
2941
2942Netrw has been designed to handle user options by saving them, setting the
2943options to something that's compatible with netrw's needs, and then restoring
2944them. However, the autochdir option: >
2945 :set acd
Bram Moolenaara6878372014-03-22 21:02:50 +01002946is problematic. Autochdir sets the current directory to that containing the
Bram Moolenaar446cb832008-06-24 21:56:24 +00002947file you edit; this apparently also applies to directories. In other words,
2948autochdir sets the current directory to that containing the "file" (even if
2949that "file" is itself a directory).
2950
Bram Moolenaar15146672011-10-20 22:22:38 +02002951NETRW SETTINGS WINDOW *netrw-settings-window* {{{2
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00002952
2953With the NetrwSettings.vim plugin, >
2954 :NetrwSettings
2955will bring up a window with the many variables that netrw uses for its
Bram Moolenaar1afcace2005-11-25 19:54:28 +00002956settings. You may change any of their values; when you save the file, the
2957settings therein will be used. One may also press "?" on any of the lines for
2958help on what each of the variables do.
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00002959
Bram Moolenaar5b435d62012-04-05 17:33:26 +02002960(also see: |netrw-browser-var| |netrw-protocol| |netrw-variables|)
Bram Moolenaar9964e462007-05-05 17:54:07 +00002961
Bram Moolenaar5b8d8fd2005-08-16 23:01:50 +00002962
Bram Moolenaar69a7cb42004-06-20 12:51:53 +00002963==============================================================================
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002964OBTAINING A FILE *netrw-obtain* *netrw-O* {{{2
Bram Moolenaar446cb832008-06-24 21:56:24 +00002965
2966If there are no marked files:
2967
2968 When browsing a remote directory, one may obtain a file under the cursor
2969 (ie. get a copy on your local machine, but not edit it) by pressing the O
2970 key.
2971
2972If there are marked files:
2973
2974 The marked files will be obtained (ie. a copy will be transferred to your
2975 local machine, but not set up for editing).
2976
2977Only ftp and scp are supported for this operation (but since these two are
2978available for browsing, that shouldn't be a problem). The status bar will
2979then show, on its right hand side, a message like "Obtaining filename". The
2980statusline will be restored after the transfer is complete.
2981
2982Netrw can also "obtain" a file using the local browser. Netrw's display
2983of a directory is not necessarily the same as Vim's "current directory",
2984unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select
2985a file using the local browser (by putting the cursor on it) and pressing
2986"O" will then "obtain" the file; ie. copy it to Vim's current directory.
2987
2988Related topics:
2989 * To see what the current directory is, use |:pwd|
2990 * To make the currently browsed directory the current directory, see |netrw-c|
2991 * To automatically make the currently browsed directory the current
2992 directory, see |g:netrw_keepdir|.
2993
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002994 *netrw-newfile* *netrw-createfile*
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01002995OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%* {{{2
Bram Moolenaarc236c162008-07-13 17:41:49 +00002996
Bram Moolenaara6878372014-03-22 21:02:50 +01002997To open a new file in netrw's current directory, press "%". This map
2998will query the user for a new filename; an empty file by that name will
2999be placed in the netrw's current directory (ie. b:netrw_curdir).
Bram Moolenaarc236c162008-07-13 17:41:49 +00003000
Bram Moolenaar8d043172014-01-23 14:24:41 +01003001Related topics: |netrw-d|
3002
Bram Moolenaarc236c162008-07-13 17:41:49 +00003003
Bram Moolenaar446cb832008-06-24 21:56:24 +00003004PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2
3005
3006One may use a preview window by using the "p" key when the cursor is atop the
3007desired filename to be previewed. The display will then split to show both
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003008the browser (where the cursor will remain) and the file (see |:pedit|). By
3009default, the split will be taken horizontally; one may use vertical splitting
3010if one has set |g:netrw_preview| first.
Bram Moolenaar446cb832008-06-24 21:56:24 +00003011
Bram Moolenaar00a927d2010-05-14 23:24:24 +02003012An interesting set of netrw settings is: >
3013
3014 let g:netrw_preview = 1
3015 let g:netrw_liststyle = 3
3016 let g:netrw_winsize = 30
3017
3018These will:
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003019
Bram Moolenaar00a927d2010-05-14 23:24:24 +02003020 1. Make vertical splitting the default for previewing files
3021 2. Make the default listing style "tree"
3022 3. When a vertical preview window is opened, the directory listing
Bram Moolenaar5b435d62012-04-05 17:33:26 +02003023 will use only 30% of the columns available; the rest of the window
3024 is used for the preview window.
Bram Moolenaar446cb832008-06-24 21:56:24 +00003025
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003026 Related: if you like this idea, you may also find :Lexplore
3027 (|netrw-:Lexplore|) or |g:netrw_chgwin| of interest
3028
3029Also see: |g:netrw_chgwin| |netrw-P| |'previewwindow'|
Bram Moolenaara6878372014-03-22 21:02:50 +01003030
3031
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003032PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2
Bram Moolenaar446cb832008-06-24 21:56:24 +00003033
3034To edit a file or directory in the previously used (last accessed) window (see
3035:he |CTRL-W_p|), press a "P". If there's only one window, then the one window
Bram Moolenaar15146672011-10-20 22:22:38 +02003036will be horizontally split (by default).
Bram Moolenaar446cb832008-06-24 21:56:24 +00003037
3038If there's more than one window, the previous window will be re-used on
3039the selected file/directory. If the previous window's associated buffer
3040has been modified, and there's only one window with that buffer, then
3041the user will be asked if s/he wishes to save the buffer first (yes,
3042no, or cancel).
3043
Bram Moolenaarff034192013-04-24 18:51:19 +02003044Related Actions |netrw-cr| |netrw-o| |netrw-t| |netrw-v|
Bram Moolenaar15146672011-10-20 22:22:38 +02003045Associated setting variables:
3046 |g:netrw_alto| control above/below splitting
3047 |g:netrw_altv| control right/left splitting
3048 |g:netrw_preview| control horizontal vs vertical splitting
3049 |g:netrw_winsize| control initial sizing
3050
Bram Moolenaara6878372014-03-22 21:02:50 +01003051Also see: |g:netrw_chgwin| |netrw-p|
3052
Bram Moolenaar446cb832008-06-24 21:56:24 +00003053
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003054REFRESHING THE LISTING *netrw-refresh* *netrw-ctrl-l* *netrw-ctrl_l* {{{2
Bram Moolenaar446cb832008-06-24 21:56:24 +00003055
3056To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
3057hit the <cr> when atop the ./ directory entry in the listing. One may also
3058refresh a local directory by using ":e .".
3059
3060
Bram Moolenaarff034192013-04-24 18:51:19 +02003061REVERSING SORTING ORDER *netrw-r* *netrw-reverse* {{{2
3062
3063One may toggle between normal and reverse sorting order by pressing the
3064"r" key.
3065
3066Related topics: |netrw-s|
3067Associated setting variable: |g:netrw_sort_direction|
3068
3069
Bram Moolenaar446cb832008-06-24 21:56:24 +00003070RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2
3071
3072If there are no marked files: (see |netrw-mf|)
3073
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003074 Renaming files and directories involves moving the cursor to the
Bram Moolenaar446cb832008-06-24 21:56:24 +00003075 file/directory to be moved (renamed) and pressing "R". You will then be
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003076 queried for what you want the file/directory to be renamed to You may select
Bram Moolenaar446cb832008-06-24 21:56:24 +00003077 a range of lines with the "V" command (visual selection), and then
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003078 press "R"; you will be queried for each file as to what you want it
3079 renamed to.
Bram Moolenaar446cb832008-06-24 21:56:24 +00003080
3081If there are marked files: (see |netrw-mf|)
3082
3083 Marked files will be renamed (moved). You will be queried as above in
3084 order to specify where you want the file/directory to be moved.
3085
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003086 If you answer a renaming query with a "s/frompattern/topattern/", then
3087 subsequent files on the marked file list will be renamed by taking each
3088 name, applying that substitute, and renaming each file to the result.
3089 As an example : >
3090
3091 mr [query: reply with *.c]
3092 R [query: reply with s/^\(.*\)\.c$/\1.cpp/]
3093<
3094 This example will mark all *.c files and then rename them to *.cpp
3095 files.
3096
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003097 The ctrl-X character has special meaning for renaming files: >
3098
3099 <c-x> : a single ctrl-x tells netrw to ignore the portion of the response
3100 lying between the last '/' and the ctrl-x.
3101
3102 <c-x><c-x> : a pair of contiguous ctrl-x's tells netrw to ignore any
3103 portion of the string preceding the double ctrl-x's.
3104<
Bram Moolenaar446cb832008-06-24 21:56:24 +00003105 WARNING:~
3106
3107 Note that moving files is a dangerous operation; copies are safer. That's
3108 because a "move" for remote files is actually a copy + delete -- and if
3109 the copy fails and the delete does not, you may lose the file.
Bram Moolenaara6878372014-03-22 21:02:50 +01003110 Use at your own risk.
Bram Moolenaar446cb832008-06-24 21:56:24 +00003111
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003112The g:netrw_rename_cmd variable is used to implement remote renaming. By
3113default its value is:
Bram Moolenaar446cb832008-06-24 21:56:24 +00003114
3115 ssh HOSTNAME mv
3116
3117One may rename a block of files and directories by selecting them with
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003118V (|linewise-visual|) when using thin style
Bram Moolenaar446cb832008-06-24 21:56:24 +00003119
3120
Bram Moolenaar446cb832008-06-24 21:56:24 +00003121SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2
3122
3123One may select the sorting style by name, time, or (file) size. The "s" map
3124allows one to circulate amongst the three choices; the directory listing will
3125automatically be refreshed to reflect the selected style.
3126
3127Related topics: |netrw-r| |netrw-S|
3128Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
3129
3130
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003131SETTING EDITING WINDOW *netrw-editwindow* *netrw-C* *netrw-:NetrwC* {{{2
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003132
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003133One may select a netrw window for editing with the "C" mapping, using the
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003134:NetrwC [win#] command, or by setting |g:netrw_chgwin| to the selected window
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003135number. Subsequent selection of a file to edit (|netrw-cr|) will use that
3136window.
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003137
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003138 * C : by itself, will select the current window holding a netrw buffer
3139 for editing via |netrw-cr|. The C mapping is only available while in
3140 netrw buffers.
Bram Moolenaar13600302014-05-22 18:26:40 +02003141
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003142 * [count]C : the count will be used as the window number to be used
3143 for subsequent editing via |netrw-cr|.
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003144
3145 * :NetrwC will set |g:netrw_chgwin| to the current window
3146
3147 * :NetrwC win# will set |g:netrw_chgwin| to the specified window
3148 number
3149
Bram Moolenaar13600302014-05-22 18:26:40 +02003150Using >
3151 let g:netrw_chgwin= -1
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003152will restore the default editing behavior
3153(ie. editing will use the current window).
Bram Moolenaar13600302014-05-22 18:26:40 +02003154
Bram Moolenaar8d043172014-01-23 14:24:41 +01003155Related topics: |netrw-cr| |g:netrw_browse_split|
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003156Associated setting variables: |g:netrw_chgwin|
3157
3158
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003159SHRINKING OR EXPANDING A NETRW OR LEXPLORE WINDOW *netrw-c-tab* {{{2
3160
3161The <c-tab> key will toggle a netrw or |:Lexplore| window's width,
3162but only if |g:netrw_usetab| exists and is non-zero (and, of course,
3163only if your terminal supports differentiating <c-tab> from a plain
3164<tab>).
3165
3166 * If the current window is a netrw window, toggle its width
3167 (between |g:netrw_wiw| and its original width)
3168
3169 * Else if there is a |:Lexplore| window in the current tab, toggle
3170 its width
3171
3172 * Else bring up a |:Lexplore| window
3173
3174If |g:netrw_usetab| exists or is zero, or if there is a pre-existing mapping
3175for <c-tab>, then the <tab> will not be mapped. One may map something other
3176than a <c-tab>, too: (but you'll still need to have had g:netrw_usetab set) >
3177
3178 nmap <unique> (whatever) <Plug>NetrwShrink
3179<
3180Related topics: |:Lexplore|
3181Associated setting variable: |g:netrw_usetab|
3182
3183
3184USER SPECIFIED MAPS *netrw-usermaps* {{{1
3185
3186One may make customized user maps. Specify a variable, |g:Netrw_UserMaps|,
3187to hold a |List| of lists of keymap strings and function names: >
3188
3189 [["keymap-sequence","ExampleUserMapFunc"],...]
3190<
3191When netrw is setting up maps for a netrw buffer, if |g:Netrw_UserMaps|
3192exists, then the internal function netrw#UserMaps(islocal) is called.
3193This function goes through all the entries in the |g:Netrw_UserMaps| list:
3194
3195 * sets up maps: >
3196 nno <buffer> <silent> KEYMAP-SEQUENCE
3197 :call s:UserMaps(islocal,"ExampleUserMapFunc")
3198< * refreshes if result from that function call is the string
3199 "refresh"
3200 * if the result string is not "", then that string will be
3201 executed (:exe result)
3202 * if the result is a List, then the above two actions on results
3203 will be taken for every string in the result List
3204
3205The user function is passed one argument; it resembles >
3206
3207 fun! ExampleUserMapFunc(islocal)
3208<
3209where a:islocal is 1 if its a local-directory system call or 0 when
3210remote-directory system call.
3211
3212Use netrw#Expose("varname") to access netrw-internal (script-local)
3213 variables.
3214Use netrw#Modify("varname",newvalue) to change netrw-internal variables.
3215Use netrw#Call("funcname"[,args]) to call a netrw-internal function with
3216 specified arguments.
3217
3218Example: Get a copy of netrw's marked file list: >
3219
3220 let netrwmarkfilelist= netrw#Expose("netrwmarkfilelist")
3221<
3222Example: Modify the value of netrw's marked file list: >
3223
3224 call netrw#Modify("netrwmarkfilelist",[])
3225<
3226Example: Clear netrw's marked file list via a mapping on gu >
3227 " ExampleUserMap: {{{2
3228 fun! ExampleUserMap(islocal)
3229 call netrw#Modify("netrwmarkfilelist",[])
3230 call netrw#Modify('netrwmarkfilemtch_{bufnr("%")}',"")
3231 let retval= ["refresh"]
3232 return retval
3233 endfun
3234 let g:Netrw_UserMaps= [["gu","ExampleUserMap"]]
3235<
3236
Bram Moolenaar446cb832008-06-24 21:56:24 +0000323710. Problems and Fixes *netrw-problems* {{{1
Bram Moolenaarc0197e22004-09-13 20:26:32 +00003238
3239 (This section is likely to grow as I get feedback)
3240 (also see |netrw-debug|)
Bram Moolenaar488c6512005-08-11 20:09:58 +00003241 *netrw-p1*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00003242 P1. I use windows 95, and my ftp dumps four blank lines at the
3243 end of every read.
3244
3245 See |netrw-fixup|, and put the following into your
3246 <.vimrc> file:
3247
3248 let g:netrw_win95ftp= 1
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00003249
Bram Moolenaar488c6512005-08-11 20:09:58 +00003250 *netrw-p2*
Bram Moolenaar9964e462007-05-05 17:54:07 +00003251 P2. I use Windows, and my network browsing with ftp doesn't sort by
3252 time or size! -or- The remote system is a Windows server; why
3253 don't I get sorts by time or size?
Bram Moolenaarc0197e22004-09-13 20:26:32 +00003254
3255 Windows' ftp has a minimal support for ls (ie. it doesn't
3256 accept sorting options). It doesn't support the -F which
3257 gives an explanatory character (ABC/ for "ABC is a directory").
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003258 Netrw then uses "dir" to get both its thin and long listings.
Bram Moolenaar9964e462007-05-05 17:54:07 +00003259 If you think your ftp does support a full-up ls, put the
3260 following into your <.vimrc>: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00003261
Bram Moolenaar9964e462007-05-05 17:54:07 +00003262 let g:netrw_ftp_list_cmd = "ls -lF"
3263 let g:netrw_ftp_timelist_cmd= "ls -tlF"
3264 let g:netrw_ftp_sizelist_cmd= "ls -slF"
3265<
Bram Moolenaarc0197e22004-09-13 20:26:32 +00003266 Alternatively, if you have cygwin on your Windows box, put
Bram Moolenaar9964e462007-05-05 17:54:07 +00003267 into your <.vimrc>: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00003268
3269 let g:netrw_cygwin= 1
Bram Moolenaar9964e462007-05-05 17:54:07 +00003270<
3271 This problem also occurs when the remote system is Windows.
3272 In this situation, the various g:netrw_ftp_[time|size]list_cmds
3273 are as shown above, but the remote system will not correctly
3274 modify its listing behavior.
3275
Bram Moolenaarc0197e22004-09-13 20:26:32 +00003276
Bram Moolenaar488c6512005-08-11 20:09:58 +00003277 *netrw-p3*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00003278 P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw
3279 used ssh! That wasn't what I asked for...
3280
3281 Netrw has two methods for browsing remote directories: ssh
3282 and ftp. Unless you specify ftp specifically, ssh is used.
3283 When it comes time to do download a file (not just a directory
3284 listing), netrw will use the given protocol to do so.
3285
Bram Moolenaar488c6512005-08-11 20:09:58 +00003286 *netrw-p4*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00003287 P4. I would like long listings to be the default.
3288
Bram Moolenaar446cb832008-06-24 21:56:24 +00003289 Put the following statement into your |.vimrc|: >
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00003290
Bram Moolenaar446cb832008-06-24 21:56:24 +00003291 let g:netrw_liststyle= 1
3292<
3293 Check out |netrw-browser-var| for more customizations that
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00003294 you can set.
Bram Moolenaarc0197e22004-09-13 20:26:32 +00003295
Bram Moolenaar488c6512005-08-11 20:09:58 +00003296 *netrw-p5*
Bram Moolenaarc0197e22004-09-13 20:26:32 +00003297 P5. My times come up oddly in local browsing
3298
3299 Does your system's strftime() accept the "%c" to yield dates
Bram Moolenaarff034192013-04-24 18:51:19 +02003300 such as "Sun Apr 27 11:49:23 1997"? If not, do a
3301 "man strftime" and find out what option should be used. Then
3302 put it into your |.vimrc|: >
Bram Moolenaarc0197e22004-09-13 20:26:32 +00003303
Bram Moolenaar446cb832008-06-24 21:56:24 +00003304 let g:netrw_timefmt= "%X" (where X is the option)
3305<
Bram Moolenaar488c6512005-08-11 20:09:58 +00003306 *netrw-p6*
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00003307 P6. I want my current directory to track my browsing.
3308 How do I do that?
Bram Moolenaarc0197e22004-09-13 20:26:32 +00003309
Bram Moolenaar446cb832008-06-24 21:56:24 +00003310 Put the following line in your |.vimrc|:
3311>
Bram Moolenaar433f7c82006-03-21 21:29:36 +00003312 let g:netrw_keepdir= 0
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003313<
Bram Moolenaar9964e462007-05-05 17:54:07 +00003314 *netrw-p7*
3315 P7. I use Chinese (or other non-ascii) characters in my filenames, and
3316 netrw (Explore, Sexplore, Hexplore, etc) doesn't display them!
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00003317
Bram Moolenaar9964e462007-05-05 17:54:07 +00003318 (taken from an answer provided by Wu Yongwei on the vim
3319 mailing list)
Bram Moolenaara6878372014-03-22 21:02:50 +01003320 I now see the problem. Your code page is not 936, right? Vim
Bram Moolenaar9964e462007-05-05 17:54:07 +00003321 seems only able to open files with names that are valid in the
3322 current code page, as are many other applications that do not
3323 use the Unicode version of Windows APIs. This is an OS-related
3324 issue. You should not have such problems when the system
3325 locale uses UTF-8, such as modern Linux distros.
3326
3327 (...it is one more reason to recommend that people use utf-8!)
3328
3329 *netrw-p8*
3330 P8. I'm getting "ssh is not executable on your system" -- what do I
3331 do?
3332
3333 (Dudley Fox) Most people I know use putty for windows ssh. It
3334 is a free ssh/telnet application. You can read more about it
3335 here:
3336
3337 http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also:
3338
3339 (Marlin Unruh) This program also works for me. It's a single
3340 executable, so he/she can copy it into the Windows\System32
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003341 folder and create a shortcut to it.
Bram Moolenaar9964e462007-05-05 17:54:07 +00003342
3343 (Dudley Fox) You might also wish to consider plink, as it
3344 sounds most similar to what you are looking for. plink is an
3345 application in the putty suite.
3346
3347 http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink
3348
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003349 (Vissale Neang) Maybe you can try OpenSSH for windows, which
Bram Moolenaar9964e462007-05-05 17:54:07 +00003350 can be obtained from:
3351
3352 http://sshwindows.sourceforge.net/
3353
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003354 It doesn't need the full Cygwin package.
Bram Moolenaar9964e462007-05-05 17:54:07 +00003355
3356 (Antoine Mechelynck) For individual Unix-like programs needed
3357 for work in a native-Windows environment, I recommend getting
3358 them from the GnuWin32 project on sourceforge if it has them:
3359
3360 http://gnuwin32.sourceforge.net/
3361
3362 Unlike Cygwin, which sets up a Unix-like virtual machine on
3363 top of Windows, GnuWin32 is a rewrite of Unix utilities with
3364 Windows system calls, and its programs works quite well in the
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003365 cmd.exe "Dos box".
Bram Moolenaar9964e462007-05-05 17:54:07 +00003366
3367 (dave) Download WinSCP and use that to connect to the server.
3368 In Preferences > Editors, set gvim as your editor:
3369
3370 - Click "Add..."
3371 - Set External Editor (adjust path as needed, include
3372 the quotes and !.! at the end):
3373 "c:\Program Files\Vim\vim70\gvim.exe" !.!
3374 - Check that the filetype in the box below is
3375 {asterisk}.{asterisk} (all files), or whatever types
3376 you want (cec: change {asterisk} to * ; I had to
3377 write it that way because otherwise the helptags
Bram Moolenaar446cb832008-06-24 21:56:24 +00003378 system thinks it's a tag)
3379 - Make sure it's at the top of the listbox (click it,
3380 then click "Up" if it's not)
Bram Moolenaar9964e462007-05-05 17:54:07 +00003381 If using the Norton Commander style, you just have to hit <F4>
3382 to edit a file in a local copy of gvim.
3383
3384 (Vit Gottwald) How to generate public/private key and save
3385 public key it on server: >
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +02003386 http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey-gettingready
3387 (8.3 Getting ready for public key authentication)
Bram Moolenaar9964e462007-05-05 17:54:07 +00003388<
Bram Moolenaar446cb832008-06-24 21:56:24 +00003389 How to use a private key with 'pscp': >
3390
Bram Moolenaar5ac3b1a2010-07-27 22:50:36 +02003391 http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter5.html
3392 (5.2.4 Using public key authentication with PSCP)
Bram Moolenaar9964e462007-05-05 17:54:07 +00003393<
Bram Moolenaar446cb832008-06-24 21:56:24 +00003394 (Ben Schmidt) I find the ssh included with cwRsync is
3395 brilliant, and install cwRsync or cwRsyncServer on most
3396 Windows systems I come across these days. I guess COPSSH,
3397 packed by the same person, is probably even better for use as
3398 just ssh on Windows, and probably includes sftp, etc. which I
3399 suspect the cwRsync doesn't, though it might
3400
Bram Moolenaar9964e462007-05-05 17:54:07 +00003401 (cec) To make proper use of these suggestions above, you will
3402 need to modify the following user-settable variables in your
3403 .vimrc:
3404
Bram Moolenaar446cb832008-06-24 21:56:24 +00003405 |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd|
3406 |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd|
Bram Moolenaar9964e462007-05-05 17:54:07 +00003407
3408 The first one (|g:netrw_ssh_cmd|) is the most important; most
3409 of the others will use the string in g:netrw_ssh_cmd by
3410 default.
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003411
Bram Moolenaar9964e462007-05-05 17:54:07 +00003412 *netrw-p9* *netrw-ml_get*
3413 P9. I'm browsing, changing directory, and bang! ml_get errors
3414 appear and I have to kill vim. Any way around this?
3415
3416 Normally netrw attempts to avoid writing swapfiles for
3417 its temporary directory buffers. However, on some systems
3418 this attempt appears to be causing ml_get errors to
3419 appear. Please try setting |g:netrw_use_noswf| to 0
3420 in your <.vimrc>: >
3421 let g:netrw_use_noswf= 0
3422<
Bram Moolenaar446cb832008-06-24 21:56:24 +00003423 *netrw-p10*
3424 P10. I'm being pestered with "[something] is a directory" and
3425 "Press ENTER or type command to continue" prompts...
3426
3427 The "[something] is a directory" prompt is issued by Vim,
3428 not by netrw, and there appears to be no way to work around
3429 it. Coupled with the default cmdheight of 1, this message
3430 causes the "Press ENTER..." prompt. So: read |hit-enter|;
3431 I also suggest that you set your |'cmdheight'| to 2 (or more) in
3432 your <.vimrc> file.
3433
3434 *netrw-p11*
3435 P11. I want to have two windows; a thin one on the left and my editing
Bram Moolenaar251e1912011-06-19 05:09:16 +02003436 window on the right. How may I accomplish this?
Bram Moolenaar446cb832008-06-24 21:56:24 +00003437
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003438 You probably want netrw running as in a side window. If so, you
3439 will likely find that ":[N]Lexplore" does what you want. The
3440 optional "[N]" allows you to select the quantity of columns you
3441 wish the Lexplorer window to start with (see |g:netrw_winsize|
3442 for how this parameter works).
3443
3444 Previous solution:
3445
Bram Moolenaar446cb832008-06-24 21:56:24 +00003446 * Put the following line in your <.vimrc>:
3447 let g:netrw_altv = 1
3448 * Edit the current directory: :e .
3449 * Select some file, press v
3450 * Resize the windows as you wish (see |CTRL-W_<| and
3451 |CTRL-W_>|). If you're using gvim, you can drag
3452 the separating bar with your mouse.
3453 * When you want a new file, use ctrl-w h to go back to the
3454 netrw browser, select a file, then press P (see |CTRL-W_h|
3455 and |netrw-P|). If you're using gvim, you can press
3456 <leftmouse> in the browser window and then press the
3457 <middlemouse> to select the file.
Bram Moolenaarc0197e22004-09-13 20:26:32 +00003458
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003459
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003460 *netrw-p12*
3461 P12. My directory isn't sorting correctly, or unwanted letters are
3462 appearing in the listed filenames, or things aren't lining
3463 up properly in the wide listing, ...
3464
3465 This may be due to an encoding problem. I myself usually use
3466 utf-8, but really only use ascii (ie. bytes from 32-126).
3467 Multibyte encodings use two (or more) bytes per character.
3468 You may need to change |g:netrw_sepchr| and/or |g:netrw_xstrlen|.
3469
Bram Moolenaar00a927d2010-05-14 23:24:24 +02003470 *netrw-p13*
3471 P13. I'm a Windows + putty + ssh user, and when I attempt to browse,
3472 the directories are missing trailing "/"s so netrw treats them
3473 as file transfers instead of as attempts to browse
3474 subdirectories. How may I fix this?
3475
3476 (mikeyao) If you want to use vim via ssh and putty under Windows,
3477 try combining the use of pscp/psftp with plink. pscp/psftp will
3478 be used to connect and plink will be used to execute commands on
3479 the server, for example: list files and directory using 'ls'.
3480
3481 These are the settings I use to do this:
3482>
3483 " list files, it's the key setting, if you haven't set,
3484 " you will get a blank buffer
3485 let g:netrw_list_cmd = "plink HOSTNAME ls -Fa"
3486 " if you haven't add putty directory in system path, you should
3487 " specify scp/sftp command. For examples:
3488 "let g:netrw_sftp_cmd = "d:\\dev\\putty\\PSFTP.exe"
3489 "let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe"
3490<
Bram Moolenaar251e1912011-06-19 05:09:16 +02003491 *netrw-p14*
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003492 P14. I would like to speed up writes using Nwrite and scp/ssh
Bram Moolenaar251e1912011-06-19 05:09:16 +02003493 style connections. How? (Thomer M. Gil)
Bram Moolenaar00a927d2010-05-14 23:24:24 +02003494
Bram Moolenaar251e1912011-06-19 05:09:16 +02003495 Try using ssh's ControlMaster and ControlPath (see the ssh_config
3496 man page) to share multiple ssh connections over a single network
3497 connection. That cuts out the cryptographic handshake on each
3498 file write, sometimes speeding it up by an order of magnitude.
3499 (see http://thomer.com/howtos/netrw_ssh.html)
3500 (included by permission)
3501
3502 Add the following to your ~/.ssh/config: >
3503
3504 # you change "*" to the hostname you care about
3505 Host *
3506 ControlMaster auto
3507 ControlPath /tmp/%r@%h:%p
3508
3509< Then create an ssh connection to the host and leave it running: >
3510
3511 ssh -N host.domain.com
3512
3513< Now remotely open a file with Vim's Netrw and enjoy the
3514 zippiness: >
3515
3516 vim scp://host.domain.com//home/user/.bashrc
3517<
3518 *netrw-p15*
3519 P15. How may I use a double-click instead of netrw's usual single click
3520 to open a file or directory? (Ben Fritz)
3521
3522 First, disable netrw's mapping with >
3523 let g:netrw_mousemaps= 0
3524< and then create a netrw buffer only mapping in
3525 $HOME/.vim/after/ftplugin/netrw.vim: >
3526 nmap <buffer> <2-leftmouse> <CR>
3527< Note that setting g:netrw_mousemaps to zero will turn off
3528 all netrw's mouse mappings, not just the <leftmouse> one.
3529 (see |g:netrw_mousemaps|)
Bram Moolenaar00a927d2010-05-14 23:24:24 +02003530
Bram Moolenaar13600302014-05-22 18:26:40 +02003531 *netrw-p16*
3532 P16. When editing remote files (ex. :e ftp://hostname/path/file),
3533 under Windows I get an |E303| message complaining that its unable
3534 to open a swap file.
3535
3536 (romainl) It looks like you are starting Vim from a protected
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003537 directory. Start netrw from your $HOME or other writable
Bram Moolenaar13600302014-05-22 18:26:40 +02003538 directory.
3539
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003540 *netrw-p17*
3541 P17. Netrw is closing buffers on its own.
3542 What steps will reproduce the problem?
3543 1. :Explore, navigate directories, open a file
3544 2. :Explore, open another file
3545 3. Buffer opened in step 1 will be closed. o
3546 What is the expected output? What do you see instead?
3547 I expect both buffers to exist, but only the last one does.
3548
3549 (Lance) Problem is caused by "set autochdir" in .vimrc.
3550 (drchip) I am able to duplicate this problem with |'acd'| set.
3551 It appears that the buffers are not exactly closed;
3552 a ":ls!" will show them (although ":ls" does not).
3553
3554 *netrw-P18*
3555 P18. How to locally edit a file that's only available via
3556 another server accessible via ssh?
3557 See http://stackoverflow.com/questions/12469645/
3558 "Using Vim to Remotely Edit A File on ServerB Only
3559 Accessible From ServerA"
3560
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003561 *netrw-P19*
3562 P19. How do I get numbering on in directory listings?
3563 With |g:netrw_bufsettings|, you can control netrw's buffer
3564 settings; try putting >
3565 let g:netrw_bufsettings="noma nomod nu nobl nowrap ro nornu"
3566< in your .vimrc. If you'd like to have relative numbering
3567 instead, try >
3568 let g:netrw_bufsettings="noma nomod nonu nobl nowrap ro rnu"
3569<
3570 *netrw-P20*
3571 P20. How may I have gvim start up showing a directory listing?
3572 Try putting the following code snippet into your .vimrc: >
3573 augroup VimStartup
3574 au!
3575 au VimEnter * if expand("%") == "" && argc() == 0 &&
3576 \ (v:servername =~ 'GVIM\d*' || v:servername == "")
3577 \ | e . | endif
3578 augroup END
3579< You may use Lexplore instead of "e" if you're so inclined.
3580 This snippet assumes that you have client-server enabled
3581 (ie. a "huge" vim version).
3582
3583 *netrw-P21*
3584 P21. I've made a directory (or file) with an accented character, but
3585 netrw isn't letting me enter that directory/read that file:
3586
3587 Its likely that the shell or o/s is using a different encoding
3588 than you have vim (netrw) using. A patch to vim supporting
3589 "systemencoding" may address this issue in the future; for
3590 now, just have netrw use the proper encoding. For example: >
3591
3592 au FileType netrw set enc=latin1
3593<
3594 *netrw-P22*
3595 P22. I get an error message when I try to copy or move a file:
3596
3597 **error** (netrw) tried using g:netrw_localcopycmd<cp>; it doesn't work!
3598
3599 What's wrong?
3600
3601 Netrw uses several system level commands to do things (see
3602
3603 |g:netrw_localcopycmd|, |g:netrw_localmovecmd|,
3604 |g:netrw_localrmdir|, |g:netrw_mkdir_cmd|).
3605
3606 You may need to adjust the default commands for one or more of
3607 these commands by setting them properly in your .vimrc. Another
3608 source of difficulty is that these commands use vim's local
3609 directory, which may not be the same as the browsing directory
3610 shown by netrw (see |g:netrw_keepdir|).
3611
3612
Bram Moolenaarc0197e22004-09-13 20:26:32 +00003613==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +0000361411. Debugging Netrw Itself *netrw-debug* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00003615
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003616Step 1: check that the problem you've encountered hasn't already been resolved
3617by obtaining a copy of the latest (often developmental) netrw at:
3618
3619 http://www.drchip.org/astronaut/vim/index.html#NETRW
3620
3621The <netrw.vim> script is typically installed on systems as something like:
Bram Moolenaar488c6512005-08-11 20:09:58 +00003622>
Bram Moolenaar446cb832008-06-24 21:56:24 +00003623 /usr/local/share/vim/vim7x/plugin/netrwPlugin.vim
3624 /usr/local/share/vim/vim7x/autoload/netrw.vim
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003625 (see output of :echo &rtp)
Bram Moolenaar488c6512005-08-11 20:09:58 +00003626<
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003627which is loaded automatically at startup (assuming :set nocp). If you
3628installed a new netrw, then it will be located at >
3629
3630 $HOME/.vim/plugin/netrwPlugin.vim
3631 $HOME/.vim/autoload/netrw.vim
3632<
3633Step 2: assuming that you've installed the latest version of netrw,
3634check that your problem is really due to netrw. Create a file
3635called netrw.vimrc with the following contents: >
3636
3637 set nocp
3638 so $HOME/.vim/plugin/netrwPlugin.vim
3639<
3640Then run netrw as follows: >
3641
3642 vim -u netrw.vimrc --noplugins [some path here]
3643<
3644Perform whatever netrw commands you need to, and check that the problem is
3645still present. This procedure sidesteps any issues due to personal .vimrc
3646settings and other plugins. If the problem does not appear, then you need
3647to determine what setting in your .vimrc is causing the conflict with netrw
3648or which plugin.
3649
3650Step 3: If the problem still is present, then get a debugging trace from
3651netrw:
Bram Moolenaar071d4272004-06-13 20:20:40 +00003652
3653 1. Get the <Decho.vim> script, available as:
3654
Bram Moolenaar97d62492012-11-15 21:28:22 +01003655 http://www.drchip.org/astronaut/vim/index.html#DECHO
Bram Moolenaar071d4272004-06-13 20:20:40 +00003656 or
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00003657 http://vim.sourceforge.net/scripts/script.php?script_id=120
Bram Moolenaar071d4272004-06-13 20:20:40 +00003658
Bram Moolenaara6878372014-03-22 21:02:50 +01003659 Decho.vim is provided as a "vimball"; see |vimball-intro|.
Bram Moolenaarf6cf9872005-08-08 22:00:59 +00003660
Bram Moolenaar446cb832008-06-24 21:56:24 +00003661 2. Edit the <netrw.vim> file by typing: >
Bram Moolenaard4755bb2004-09-02 19:12:26 +00003662
3663 vim netrw.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +00003664 :DechoOn
Bram Moolenaard4755bb2004-09-02 19:12:26 +00003665 :wq
Bram Moolenaar446cb832008-06-24 21:56:24 +00003666<
3667 To restore to normal non-debugging behavior, re-edit <netrw.vim>
3668 and type >
Bram Moolenaar071d4272004-06-13 20:20:40 +00003669
Bram Moolenaard4755bb2004-09-02 19:12:26 +00003670 vim netrw.vim
3671 :DechoOff
3672 :wq
Bram Moolenaar446cb832008-06-24 21:56:24 +00003673<
Bram Moolenaard4755bb2004-09-02 19:12:26 +00003674 This command, provided by <Decho.vim>, will comment out all
3675 Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()).
3676
Bram Moolenaar446cb832008-06-24 21:56:24 +00003677 3. Then bring up vim and attempt to evoke the problem by doing a
3678 transfer or doing some browsing. A set of messages should appear
3679 concerning the steps that <netrw.vim> took in attempting to
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003680 read/write your file over the network in a separate tab or
3681 server vim window.
Bram Moolenaar071d4272004-06-13 20:20:40 +00003682
Bram Moolenaar9964e462007-05-05 17:54:07 +00003683 To save the file, use >
Bram Moolenaar8d043172014-01-23 14:24:41 +01003684
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +01003685 :tabnext
Bram Moolenaar9964e462007-05-05 17:54:07 +00003686 :set bt=
3687 :w! DBG
Bram Moolenaar8d043172014-01-23 14:24:41 +01003688
3689< Furthermore, it'd be helpful if you would type >
Bram Moolenaara6878372014-03-22 21:02:50 +01003690 :Dsep <command>
3691< where <command> is the command you're about to type next,
3692 thereby making it easier to associate which part of the
3693 debugging trace is due to which command.
Bram Moolenaar8d043172014-01-23 14:24:41 +01003694
Bram Moolenaara6878372014-03-22 21:02:50 +01003695 Please send that information to <netrw.vim>'s maintainer along
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003696 with the o/s you're using and the vim version that you're using
Bram Moolenaara6878372014-03-22 21:02:50 +01003697 (see |:version|) >
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00003698 NdrOchip at ScampbellPfamily.AbizM - NOSPAM
Bram Moolenaar9964e462007-05-05 17:54:07 +00003699<
Bram Moolenaar071d4272004-06-13 20:20:40 +00003700==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000370112. History *netrw-history* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00003702
Bram Moolenaara0f849e2015-10-30 14:37:44 +01003703 v154: Feb 26, 2015 * (Yuri Kanivetsky) reported a situation where
3704 a file was not treated properly as a file
3705 due to g:netrw_keepdir == 1
3706 Mar 25, 2015 * (requested by Ben Friz) one may now sort by
3707 extension
3708 Mar 28, 2015 * (requested by Matt Brooks) netrw has a lot
3709 of buffer-local mappings; however, some
3710 plugins (such as vim-surround) set up
3711 conflicting mappings that cause vim to wait.
3712 The "<nowait>" modifier has been included
3713 with most of netrw's mappings to avoid that
3714 delay.
3715 Jun 26, 2015 * |netrw-gn| mapping implemted
3716 * :Ntree NotADir resulted in having
3717 the tree listing expand in the error messages
3718 window. Fixed.
3719 Jun 29, 2015 * Attempting to delete a file remotely caused
3720 an error with "keepsol" mentioned; fixed.
3721 Jul 08, 2015 * Several changes to keep the |:jumps| table
3722 correct when working with
3723 |g:netrw_fastbrowse| set to 2
3724 * wide listing with accented characters fixed
3725 (using %-S instead of %-s with a |printf()|
3726 Jul 13, 2015 * (Daniel Hahler) CheckIfKde() could be true
3727 but kfmclient not installed. Changed order
3728 in netrw#BrowseX(): checks if kde and
3729 kfmclient, then will use xdg-open on a unix
3730 system (if xdg-open is executable)
3731 Aug 11, 2015 * (McDonnell) tree listing mode wouldn't
3732 select a file in a open subdirectory.
3733 * (McDonnell) when multiple subdirectories
3734 were concurrently open in tree listing
3735 mode, a ctrl-L wouldn't refresh properly.
3736 * The netrw:target menu showed duplicate
3737 entries
3738 Oct 13, 2015 * (mattn) provided an exception to handle
3739 windows with shellslash set but no shell
3740 Oct 23, 2015 * if g:netrw_usetab and <c-tab> now used
3741 to control whether NetrwShrink is used
3742 (see |netrw-c-tab|)
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003743 v153: May 13, 2014 * added another |g:netrw_ffkeep| usage {{{2
3744 May 14, 2014 * changed s:PerformListing() so that it
3745 always sets ft=netrw for netrw buffers
3746 (ie. even when syntax highlighting is
3747 off, not available, etc)
3748 May 16, 2014 * introduced the |netrw-ctrl-r| functionality
3749 May 17, 2014 * introduced the |netrw-:NetrwMB| functionality
3750 * mb and mB (|netrw-mb|, |netrw-mB|) will
3751 add/remove marked files from bookmark list
3752 May 20, 2014 * (Enno Nagel) reported that :Lex <dirname>
3753 wasn't working. Fixed.
3754 May 26, 2014 * restored test to prevent leftmouse window
3755 resizing from causing refresh.
3756 (see s:NetrwLeftmouse())
3757 * fixed problem where a refresh caused cursor
3758 to go just under the banner instead of
3759 staying put
3760 May 28, 2014 * (László Bimba) provided a patch for opening
3761 the |:Lexplore| window 100% high, optionally
3762 on the right, and will work with remote
3763 files.
3764 May 29, 2014 * implemented :NetrwC (see |netrw-:NetrwC|)
3765 Jun 01, 2014 * Removed some "silent"s from commands used
3766 to implemented scp://... and pscp://...
3767 directory listing. Permits request for
3768 password to appear.
3769 Jun 05, 2014 * (Enno Nagel) reported that user maps "/"
3770 caused problems with "b" and "w", which
3771 are mapped (for wide listings only) to
3772 skip over files rather than just words.
3773 Jun 10, 2014 * |g:netrw_gx| introduced to allow users to
3774 override default "<cfile>" with the gx
3775 (|netrw-gx|) map
3776 Jun 11, 2014 * gx (|netrw-gx|), with |'autowrite'| set,
3777 will write modified files. s:NetrwBrowseX()
3778 will now save, turn off, and restore the
3779 |'autowrite'| setting.
3780 Jun 13, 2014 * added visual map for gx use
3781 Jun 15, 2014 * (Enno Nagel) reported that with having hls
3782 set and wide listing style in use, that the
3783 b and w maps caused unwanted highlighting.
3784 Jul 05, 2014 * |netrw-mv| and |netrw-mX| commands included
3785 Jul 09, 2014 * |g:netrw_keepj| included, allowing optional
3786 keepj
3787 Jul 09, 2014 * fixing bugs due to previous update
3788 Jul 21, 2014 * (Bruno Sutic) provided an updated
3789 netrw_gitignore.vim
3790 Jul 30, 2014 * (Yavuz Yetim) reported that editing two
3791 remote files of the same name caused the
3792 second instance to have a "temporary"
3793 name. Fixed: now they use the same buffer.
3794 Sep 18, 2014 * (Yasuhiro Matsumoto) provided a patch which
3795 allows scp and windows local paths to work.
3796 Oct 07, 2014 * gx (see |netrw-gx|) when atop a directory,
3797 will now do |gf| instead
3798 Nov 06, 2014 * For cygwin: cygstart will be available for
3799 netrw#BrowseX() to use if its executable.
3800 Nov 07, 2014 * Began support for file://... urls. Will use
3801 |g:netrw_file_cmd| (typically elinks or links)
3802 Dec 02, 2014 * began work on having mc (|netrw-mc|) copy
3803 directories. Works for linux machines,
3804 cygwin+vim, but not for windows+gvim.
3805 Dec 02, 2014 * in tree mode, netrw was not opening
3806 directories via symbolic links.
3807 Dec 02, 2014 * added resolved link information to
3808 thin and tree modes
3809 Dec 30, 2014 * (issue#231) |:ls| was not showing
3810 remote-file buffers reliably. Fixed.
3811 v152: Apr 08, 2014 * uses the |'noswapfile'| option (requires {{{2
Bram Moolenaar13600302014-05-22 18:26:40 +02003812 vim 7.4 with patch 213)
3813 * (Enno Nagel) turn |'rnu'| off in netrw
3814 buffers.
3815 * (Quinn Strahl) suggested that netrw
3816 allow regular window splitting to occur,
3817 thereby allowing |'equalalways'| to take
3818 effect.
3819 * (qingtian zhao) normally, netrw will
3820 save and restore the |'fileformat'|;
3821 however, sometimes that isn't wanted
3822 Apr 14, 2014 * whenever netrw marks a buffer as ro,
3823 it will also mark it as nomod.
3824 Apr 16, 2014 * sftp protocol now supported by
3825 netrw#Obtain(); this means that one
3826 may use "mc" to copy a remote file
3827 to a local file using sftp, and that
3828 the |netrw-O| command can obtain remote
3829 files via sftp.
3830 * added [count]C support (see |netrw-C|)
3831 Apr 18, 2014 * when |g:netrw_chgwin| is one more than
3832 the last window, then vertically split
3833 the last window and use it as the
3834 chgwin window.
3835 May 09, 2014 * SavePosn was "saving filename under cursor"
3836 from a non-netrw window when using :Rex.
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003837 v151: Jan 22, 2014 * extended :Rexplore to return to buffer {{{2
Bram Moolenaara6878372014-03-22 21:02:50 +01003838 prior to Explore or editing a directory
3839 * (Ken Takata) netrw gave error when
3840 clipboard was disabled. Sol'n: Placed
3841 several if has("clipboard") tests in.
3842 * Fixed ftp://X@Y@Z// problem; X@Y now
3843 part of user id, and only Z is part of
3844 hostname.
3845 * (A Loumiotis) reported that completion
3846 using a directory name containing spaces
3847 did not work. Fixed with a retry in
3848 netrw#Explore() which removes the
3849 backslashes vim inserted.
3850 Feb 26, 2014 * :Rexplore now records the current file
3851 using w:netrw_rexfile when returning via
3852 |:Rexplore|
3853 Mar 08, 2014 * (David Kotchan) provided some patches
3854 allowing netrw to work properly with
3855 windows shares.
3856 * Multiple one-liner help messages available
3857 by pressing <cr> while atop the "Quick
3858 Help" line
3859 * worked on ShellCmdPost, FocusGained event
3860 handling.
3861 * |:Lexplore| path: will be used to update
3862 a left-side netrw browsing directory.
3863 Mar 12, 2014 * |:netrw-s-cr|: use <s-cr> to close
3864 tree directory implemented
3865 Mar 13, 2014 * (Tony Mechylynck) reported that using
3866 the browser with ftp on a directory,
3867 and selecting a gzipped txt file, that
3868 an E19 occurred (which was issued by
3869 gzip.vim). Fixed.
3870 Mar 14, 2014 * Implemented :MF and :MT (see |netrw-:MF|
3871 and |netrw-:MT|, respectively)
3872 Mar 17, 2014 * |:Ntree| [dir] wasn't working properly; fixed
3873 Mar 18, 2014 * Changed all uses of set to setl
3874 Mar 18, 2014 * Commented the netrw_btkeep line in
3875 s:NetrwOptionSave(); the effect is that
3876 netrw buffers will remain as |'bt'|=nofile.
3877 This should prevent swapfiles being created
3878 for netrw buffers.
3879 Mar 20, 2014 * Changed all uses of lcd to use s:NetrwLcd()
3880 instead. Consistent error handling results
3881 and it also handles Window's shares
3882 * Fixed |netrw-d| command when applied with ftp
3883 * https: support included for netrw#NetRead()
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003884 v150: Jul 12, 2013 * removed a "keepalt" to allow ":e #" to {{{2
Bram Moolenaar8d043172014-01-23 14:24:41 +01003885 return to the netrw directory listing
3886 Jul 13, 2013 * (Jonas Diemer) suggested changing
3887 a <cWORD> to <cfile>.
3888 Jul 21, 2013 * (Yuri Kanivetsky) reported that netrw's
3889 use of mkdir did not produce directories
Bram Moolenaara6878372014-03-22 21:02:50 +01003890 following the user's umask.
Bram Moolenaar8d043172014-01-23 14:24:41 +01003891 Aug 27, 2013 * introduced |g:netrw_altfile| option
3892 Sep 05, 2013 * s:Strlen() now uses |strdisplaywidth()|
3893 when available, by default
3894 Sep 12, 2013 * (Selyano Baldo) reported that netrw wasn't
3895 opening some directories properly from the
3896 command line.
3897 Nov 09, 2013 * |:Lexplore| introduced
3898 * (Ondrej Platek) reported an issue with
3899 netrw's trees (P15). Fixed.
3900 * (Jorge Solis) reported that "t" in
3901 tree mode caused netrw to forget its
3902 line position.
3903 Dec 05, 2013 * Added <s-leftmouse> file marking
3904 (see |netrw-mf|)
3905 Dec 05, 2013 * (Yasuhiro Matsumoto) Explore should use
3906 strlen() instead s:Strlen() when handling
3907 multibyte chars with strpart()
3908 (ie. strpart() is byte oriented, not
3909 display-width oriented).
3910 Dec 09, 2013 * (Ken Takata) Provided a patch; File sizes
3911 and a portion of timestamps were wrongly
3912 highlighted with the directory color when
3913 setting `:let g:netrw_liststyle=1` on Windows.
3914 * (Paul Domaskis) noted that sometimes
3915 cursorline was activating in non-netrw
3916 windows. All but one setting of cursorline
3917 was done via setl; there was one that was
3918 overlooked. Fixed.
3919 Dec 24, 2013 * (esquifit) asked that netrw allow the
3920 /cygdrive prefix be a user-alterable
3921 parameter.
3922 Jan 02, 2014 * Fixed a problem with netrw-based ballon
3923 evaluation (ie. netrw#NetrwBaloonHelp()
3924 not having been loaded error messages)
3925 Jan 03, 2014 * Fixed a problem with tree listings
3926 * New command installed: |:Ntree|
3927 Jan 06, 2014 * (Ivan Brennan) reported a problem with
3928 |netrw-P|. Fixed.
3929 Jan 06, 2014 * Fixed a problem with |netrw-P| when the
3930 modified file was to be abandoned.
3931 Jan 15, 2014 * (Matteo Cavalleri) reported that when the
3932 banner is suppressed and tree listing is
3933 used, a blank line was left at the top of
3934 the display. Fixed.
3935 Jan 20, 2014 * (Gideon Go) reported that, in tree listing
3936 style, with a previous window open, that
3937 the wrong directory was being used to open
3938 a file. Fixed. (P21)
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003939 v149: Apr 18, 2013 * in wide listing format, now have maps for {{{2
Bram Moolenaare6ae6222013-05-21 21:01:10 +02003940 w and b to move to next/previous file
3941 Apr 26, 2013 * one may now copy files in the same
3942 directory; netrw will issue requests for
3943 what names the files should be copied under
3944 Apr 29, 2013 * Trying Benzinger's problem again. Seems
3945 that commenting out the BufEnter and
3946 installing VimEnter (only) works. Weird
3947 problem! (tree listing, vim -O Dir1 Dir2)
3948 May 01, 2013 * :Explore ftp://... wasn't working. Fixed.
3949 May 02, 2013 * introduced |g:netrw_bannerbackslash| as
3950 requested by Paul Domaskis.
Bram Moolenaar8d043172014-01-23 14:24:41 +01003951 Jul 03, 2013 * Explore now avoids splitting when a buffer
3952 will be hidden.
Bram Moolenaar8feef4f2015-01-07 16:57:10 +01003953 v148: Apr 16, 2013 * changed Netrw's Style menu to allow direct {{{2
Bram Moolenaarff034192013-04-24 18:51:19 +02003954 choice of listing style, hiding style, and
3955 sorting style
Bram Moolenaar071d4272004-06-13 20:20:40 +00003956
3957==============================================================================
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100395813. Todo *netrw-todo* {{{1
3959
396007/29/09 : banner :|g:netrw_banner| can be used to suppress the
3961 suppression banner. This feature is new and experimental,
3962 so its in the process of being debugged.
396309/04/09 : "gp" : See if it can be made to work for remote systems.
3964 : See if it can be made to work with marked files.
3965
3966==============================================================================
396714. Credits *netrw-credits* {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +00003968
3969 Vim editor by Bram Moolenaar (Thanks, Bram!)
3970 dav support by C Campbell
3971 fetch support by Bram Moolenaar and C Campbell
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00003972 ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM>
Bram Moolenaar071d4272004-06-13 20:20:40 +00003973 http support by Bram Moolenaar <bram@moolenaar.net>
3974 rcp
3975 rsync support by C Campbell (suggested by Erik Warendorph)
3976 scp support by raf <raf@comdyn.com.au>
3977 sftp support by C Campbell
3978
3979 inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell
3980
3981 Jérôme Augé -- also using new buffer method with ftp+.netrc
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00003982 Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use,
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003983 fetch,...
Bram Moolenaar071d4272004-06-13 20:20:40 +00003984 Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution
3985 Erik Warendorph -- for several suggestions (g:netrw_..._cmd
3986 variables, rsync etc)
Bram Moolenaar482aaeb2005-09-29 18:26:07 +00003987 Doug Claar -- modifications to test for success with ftp
Bram Moolenaar7aa9f6a2007-05-10 18:00:30 +00003988 operation
Bram Moolenaar071d4272004-06-13 20:20:40 +00003989
3990==============================================================================
Bram Moolenaar446cb832008-06-24 21:56:24 +00003991Modelines: {{{1
Bram Moolenaar83bab712005-08-01 21:58:57 +00003992 vim:tw=78:ts=8:ft=help:norl:fdm=marker