Bram Moolenaar | b1c9198 | 2018-05-17 17:04:55 +0200 | [diff] [blame] | 1 | *pi_netrw.txt* For Vim version 8.1. Last change: 2017 Nov 03 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 3 | ------------------------------------------------ |
| 4 | NETRW REFERENCE MANUAL by Charles E. Campbell |
| 5 | ------------------------------------------------ |
| 6 | Author: Charles E. Campbell <NdrOchip@ScampbellPfamily.AbizM> |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 7 | (remove NOSPAM from Campbell's email first) |
| 8 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 9 | Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright* |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 10 | 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 Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 19 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 20 | *netrw* |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 21 | *dav* *ftp* *netrw-file* *rcp* *scp* |
| 22 | *davs* *http* *netrw.vim* *rsync* *sftp* |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 23 | *fetch* *network* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 24 | |
| 25 | ============================================================================== |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 26 | 1. Contents *netrw-contents* {{{1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 27 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 28 | 1. Contents..............................................|netrw-contents| |
| 29 | 2. Starting With Netrw...................................|netrw-start| |
| 30 | 3. Netrw Reference.......................................|netrw-ref| |
| 31 | EXTERNAL APPLICATIONS AND PROTOCOLS.................|netrw-externapp| |
| 32 | READING.............................................|netrw-read| |
| 33 | WRITING.............................................|netrw-write| |
| 34 | SOURCING............................................|netrw-source| |
| 35 | DIRECTORY LISTING...................................|netrw-dirlist| |
| 36 | CHANGING THE USERID AND PASSWORD....................|netrw-chgup| |
| 37 | VARIABLES AND SETTINGS..............................|netrw-variables| |
| 38 | PATHS...............................................|netrw-path| |
| 39 | 4. Network-Oriented File Transfer........................|netrw-xfer| |
| 40 | NETRC...............................................|netrw-netrc| |
| 41 | PASSWORD............................................|netrw-passwd| |
| 42 | 5. Activation............................................|netrw-activate| |
| 43 | 6. Transparent Remote File Editing.......................|netrw-transparent| |
| 44 | 7. Ex Commands...........................................|netrw-ex| |
| 45 | 8. Variables and Options.................................|netrw-variables| |
| 46 | 9. Browsing..............................................|netrw-browse| |
| 47 | Introduction To Browsing............................|netrw-intro-browse| |
| 48 | Quick Reference: Maps...............................|netrw-browse-maps| |
| 49 | Quick Reference: Commands...........................|netrw-browse-cmds| |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 50 | Banner Display......................................|netrw-I| |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 51 | Bookmarking A Directory.............................|netrw-mb| |
| 52 | Browsing............................................|netrw-cr| |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 53 | Squeezing the Current Tree-Listing Directory........|netrw-s-cr| |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 54 | 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 Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 61 | Customizing Browsing With A Special Handler.........|netrw-x| |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 62 | 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| |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 75 | Making The Browsing Directory The Current Directory.|netrw-cd| |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 76 | Marking Files.......................................|netrw-mf| |
| 77 | Unmarking Files.....................................|netrw-mF| |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 78 | Marking Files By Location List......................|netrw-qL| |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 79 | Marking Files By QuickFix List......................|netrw-qF| |
| 80 | Marking Files By Regular Expression.................|netrw-mr| |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 81 | Marked Files: Arbitrary Shell Command...............|netrw-mx| |
| 82 | Marked Files: Arbitrary Shell Command, En Bloc......|netrw-mX| |
| 83 | Marked Files: Arbitrary Vim Command.................|netrw-mv| |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 84 | Marked Files: Argument List.........................|netrw-ma| |netrw-mA| |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 85 | Marked Files: Buffer List...........................|netrw-cb| |netrw-cB| |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 86 | Marked Files: Compression And Decompression.........|netrw-mz| |
| 87 | Marked Files: Copying...............................|netrw-mc| |
| 88 | Marked Files: Diff..................................|netrw-md| |
| 89 | Marked Files: Editing...............................|netrw-me| |
| 90 | Marked Files: Grep..................................|netrw-mg| |
| 91 | Marked Files: Hiding and Unhiding by Suffix.........|netrw-mh| |
| 92 | Marked Files: Moving................................|netrw-mm| |
| 93 | Marked Files: Printing..............................|netrw-mp| |
| 94 | Marked Files: Sourcing..............................|netrw-ms| |
| 95 | Marked Files: Setting the Target Directory..........|netrw-mt| |
| 96 | Marked Files: Tagging...............................|netrw-mT| |
| 97 | Marked Files: Target Directory Using Bookmarks......|netrw-Tb| |
| 98 | Marked Files: Target Directory Using History........|netrw-Th| |
| 99 | Marked Files: Unmarking.............................|netrw-mu| |
| 100 | Netrw Browser Variables.............................|netrw-browser-var| |
| 101 | Netrw Browsing And Option Incompatibilities.........|netrw-incompatible| |
| 102 | Netrw Settings Window...............................|netrw-settings-window| |
| 103 | Obtaining A File....................................|netrw-O| |
| 104 | Preview Window......................................|netrw-p| |
| 105 | Previous Window.....................................|netrw-P| |
| 106 | Refreshing The Listing..............................|netrw-ctrl-l| |
| 107 | Reversing Sorting Order.............................|netrw-r| |
| 108 | Renaming Files Or Directories.......................|netrw-R| |
| 109 | Selecting Sorting Style.............................|netrw-s| |
| 110 | Setting Editing Window..............................|netrw-C| |
| 111 | 10. Problems and Fixes....................................|netrw-problems| |
| 112 | 11. Debugging Netrw Itself................................|netrw-debug| |
| 113 | 12. History...............................................|netrw-history| |
| 114 | 13. Todo..................................................|netrw-todo| |
| 115 | 14. Credits...............................................|netrw-credits| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 116 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 117 | {Vi does not have any of this} |
| 118 | |
| 119 | ============================================================================== |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 120 | 2. Starting With Netrw *netrw-start* {{{1 |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 121 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 122 | Netrw makes reading files, writing files, browsing over a network, and |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 123 | local browsing easy! First, make sure that you have plugins enabled, so |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 124 | you'll need to have at least the following in your <.vimrc>: |
| 125 | (or see |netrw-activate|) > |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 126 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 127 | set nocp " 'compatible' is not set |
| 128 | filetype plugin on " plugins are enabled |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 129 | < |
| 130 | (see |'cp'| and |:filetype-plugin-on|) |
| 131 | |
| 132 | Netrw supports "transparent" editing of files on other machines using urls |
| 133 | (see |netrw-transparent|). As an example of this, let's assume you have an |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 134 | account on some other machine; if you can use scp, try: > |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 135 | |
| 136 | vim scp://hostname/path/to/file |
| 137 | < |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 138 | Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|! |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 139 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 140 | So, what if you have ftp, not ssh/scp? That's easy, too; try > |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 141 | |
| 142 | vim ftp://hostname/path/to/file |
| 143 | < |
| 144 | Want to make ftp simpler to use? See if your ftp supports a file called |
| 145 | <.netrc> -- typically it goes in your home directory, has read/write |
| 146 | permissions for only the user to read (ie. not group, world, other, etc), |
| 147 | and has lines resembling > |
| 148 | |
| 149 | machine HOSTNAME login USERID password "PASSWORD" |
| 150 | machine HOSTNAME login USERID password "PASSWORD" |
| 151 | ... |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 152 | default login USERID password "PASSWORD" |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 153 | < |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 154 | Windows' ftp doesn't support .netrc; however, one may have in one's .vimrc: > |
| 155 | |
Bram Moolenaar | e6ae622 | 2013-05-21 21:01:10 +0200 | [diff] [blame] | 156 | let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\MyUserName\MACHINE' |
Bram Moolenaar | 97d6249 | 2012-11-15 21:28:22 +0100 | [diff] [blame] | 157 | < |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 158 | Netrw will substitute the host's machine name for "MACHINE" from the URL it is |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 159 | attempting to open, and so one may specify > |
| 160 | userid |
| 161 | password |
Bram Moolenaar | e6ae622 | 2013-05-21 21:01:10 +0200 | [diff] [blame] | 162 | for each site in a separate file: c:\Users\MyUserName\MachineName. |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 163 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 164 | Now about browsing -- when you just want to look around before editing a |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 165 | file. For browsing on your current host, just "edit" a directory: > |
| 166 | |
| 167 | vim . |
| 168 | vim /home/userid/path |
| 169 | < |
| 170 | For browsing on a remote host, "edit" a directory (but make sure that |
| 171 | the directory name is followed by a "/"): > |
| 172 | |
| 173 | vim scp://hostname/ |
| 174 | vim ftp://hostname/path/to/dir/ |
| 175 | < |
| 176 | See |netrw-browse| for more! |
| 177 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 178 | There are more protocols supported by netrw than just scp and ftp, too: see the |
| 179 | next section, |netrw-externapp|, on how to use these external applications with |
| 180 | netrw and vim. |
| 181 | |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 182 | PREVENTING LOADING *netrw-noload* |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 183 | |
| 184 | If you want to use plugins, but for some reason don't wish to use netrw, then |
| 185 | you need to avoid loading both the plugin and the autoload portions of netrw. |
| 186 | You may do so by placing the following two lines in your <.vimrc>: > |
| 187 | |
| 188 | :let g:loaded_netrw = 1 |
| 189 | :let g:loaded_netrwPlugin = 1 |
| 190 | < |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 191 | |
| 192 | ============================================================================== |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 193 | 3. Netrw Reference *netrw-ref* {{{1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 194 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 195 | Netrw supports several protocols in addition to scp and ftp as mentioned |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 196 | in |netrw-start|. These include dav, fetch, http,... well, just look |
| 197 | at the list in |netrw-externapp|. Each protocol is associated with a |
| 198 | variable which holds the default command supporting that protocol. |
| 199 | |
| 200 | EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 201 | |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 202 | Protocol Variable Default Value |
| 203 | -------- ---------------- ------------- |
| 204 | dav: *g:netrw_dav_cmd* = "cadaver" if cadaver is executable |
| 205 | dav: g:netrw_dav_cmd = "curl -o" elseif curl is available |
| 206 | fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available |
| 207 | ftp: *g:netrw_ftp_cmd* = "ftp" |
| 208 | http: *g:netrw_http_cmd* = "elinks" if elinks is available |
| 209 | http: g:netrw_http_cmd = "links" elseif links is available |
| 210 | http: g:netrw_http_cmd = "curl" elseif curl is available |
| 211 | http: g:netrw_http_cmd = "wget" elseif wget is available |
| 212 | http: g:netrw_http_cmd = "fetch" elseif fetch is available |
| 213 | http: *g:netrw_http_put_cmd* = "curl -T" |
| 214 | rcp: *g:netrw_rcp_cmd* = "rcp" |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 215 | rsync: *g:netrw_rsync_cmd* = "rsync" (see |g:netrw_rsync_sep|) |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 216 | scp: *g:netrw_scp_cmd* = "scp -q" |
| 217 | sftp: *g:netrw_sftp_cmd* = "sftp" |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 218 | file: *g:netrw_file_cmd* = "elinks" or "links" |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 219 | |
| 220 | *g:netrw_http_xcmd* : the option string for http://... protocols are |
| 221 | specified via this variable and may be independently overridden. By |
| 222 | default, the option arguments for the http-handling commands are: > |
| 223 | |
| 224 | elinks : "-source >" |
Bram Moolenaar | 97d6249 | 2012-11-15 21:28:22 +0100 | [diff] [blame] | 225 | links : "-dump >" |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 226 | curl : "-L -o" |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 227 | wget : "-q -O" |
| 228 | fetch : "-o" |
| 229 | < |
| 230 | For example, if your system has elinks, and you'd rather see the |
| 231 | page using an attempt at rendering the text, you may wish to have > |
| 232 | let g:netrw_http_xcmd= "-dump >" |
| 233 | < in your .vimrc. |
| 234 | |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 235 | g:netrw_http_put_cmd: this option specifies both the executable and |
| 236 | any needed options. This command does a PUT operation to the url. |
| 237 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 238 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 239 | READING *netrw-read* *netrw-nread* {{{2 |
| 240 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 241 | Generally, one may just use the URL notation with a normal editing |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 242 | command, such as > |
| 243 | |
| 244 | :e ftp://[user@]machine/path |
| 245 | < |
| 246 | Netrw also provides the Nread command: |
| 247 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 248 | :Nread ? give help |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 249 | :Nread "machine:path" uses rcp |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 250 | :Nread "machine path" uses ftp w/ <.netrc> |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 251 | :Nread "machine id password path" uses ftp |
| 252 | :Nread "dav://machine[:port]/path" uses cadaver |
| 253 | :Nread "fetch://[user@]machine/path" uses fetch |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 254 | :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 255 | :Nread "http://[user@]machine/path" uses http uses wget |
| 256 | :Nread "rcp://[user@]machine/path" uses rcp |
| 257 | :Nread "rsync://[user@]machine[:port]/path" uses rsync |
| 258 | :Nread "scp://[user@]machine[[:#]port]/path" uses scp |
| 259 | :Nread "sftp://[user@]machine/path" uses sftp |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 260 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 261 | WRITING *netrw-write* *netrw-nwrite* {{{2 |
| 262 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 263 | One may just use the URL notation with a normal file writing |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 264 | command, such as > |
| 265 | |
| 266 | :w ftp://[user@]machine/path |
| 267 | < |
| 268 | Netrw also provides the Nwrite command: |
| 269 | |
Bram Moolenaar | 433f7c8 | 2006-03-21 21:29:36 +0000 | [diff] [blame] | 270 | :Nwrite ? give help |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 271 | :Nwrite "machine:path" uses rcp |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 272 | :Nwrite "machine path" uses ftp w/ <.netrc> |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 273 | :Nwrite "machine id password path" uses ftp |
| 274 | :Nwrite "dav://machine[:port]/path" uses cadaver |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 275 | :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 276 | :Nwrite "rcp://[user@]machine/path" uses rcp |
| 277 | :Nwrite "rsync://[user@]machine[:port]/path" uses rsync |
| 278 | :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp |
| 279 | :Nwrite "sftp://[user@]machine/path" uses sftp |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 280 | http: not supported! |
| 281 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 282 | SOURCING *netrw-source* {{{2 |
| 283 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 284 | One may just use the URL notation with the normal file sourcing |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 285 | command, such as > |
| 286 | |
| 287 | :so ftp://[user@]machine/path |
| 288 | < |
| 289 | Netrw also provides the Nsource command: |
| 290 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 291 | :Nsource ? give help |
| 292 | :Nsource "dav://machine[:port]/path" uses cadaver |
| 293 | :Nsource "fetch://[user@]machine/path" uses fetch |
| 294 | :Nsource "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> |
| 295 | :Nsource "http://[user@]machine/path" uses http uses wget |
| 296 | :Nsource "rcp://[user@]machine/path" uses rcp |
| 297 | :Nsource "rsync://[user@]machine[:port]/path" uses rsync |
| 298 | :Nsource "scp://[user@]machine[[:#]port]/path" uses scp |
| 299 | :Nsource "sftp://[user@]machine/path" uses sftp |
| 300 | |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 301 | DIRECTORY LISTING *netrw-trailingslash* *netrw-dirlist* {{{2 |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 302 | |
| 303 | One may browse a directory to get a listing by simply attempting to |
| 304 | edit the directory: > |
| 305 | |
| 306 | :e scp://[user]@hostname/path/ |
| 307 | :e ftp://[user]@hostname/path/ |
| 308 | < |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 309 | For remote directory listings (ie. those using scp or ftp), that |
| 310 | trailing "/" is necessary (the slash tells netrw to treat the argument |
| 311 | as a directory to browse instead of as a file to download). |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 312 | |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 313 | The Nread command may also be used to accomplish this (again, that |
| 314 | trailing slash is necessary): > |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 315 | |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 316 | :Nread [protocol]://[user]@hostname/path/ |
| 317 | < |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 318 | *netrw-login* *netrw-password* |
| 319 | CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2 |
Bram Moolenaar | 7aa9f6a | 2007-05-10 18:00:30 +0000 | [diff] [blame] | 320 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 321 | Attempts to use ftp will prompt you for a user-id and a password. |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 322 | These will be saved in global variables |g:netrw_uid| and |
| 323 | |s:netrw_passwd|; subsequent use of ftp will re-use those two strings, |
| 324 | thereby simplifying use of ftp. However, if you need to use a |
| 325 | different user id and/or password, you'll want to call |NetUserPass()| |
Bram Moolenaar | 7aa9f6a | 2007-05-10 18:00:30 +0000 | [diff] [blame] | 326 | first. To work around the need to enter passwords, check if your ftp |
| 327 | supports a <.netrc> file in your home directory. Also see |
| 328 | |netrw-passwd| (and if you're using ssh/scp hoping to figure out how |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 329 | to not need to use passwords for scp, look at |netrw-ssh-hack|). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 330 | |
| 331 | :NetUserPass [uid [password]] -- prompts as needed |
| 332 | :call NetUserPass() -- prompts for uid and password |
| 333 | :call NetUserPass("uid") -- prompts for password |
| 334 | :call NetUserPass("uid","password") -- sets global uid and password |
| 335 | |
Bram Moolenaar | e6ae622 | 2013-05-21 21:01:10 +0200 | [diff] [blame] | 336 | (Related topics: |ftp| |netrw-userpass| |netrw-start|) |
| 337 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 338 | NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2 |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 339 | (Also see: |
| 340 | |netrw-browser-var| : netrw browser option variables |
| 341 | |netrw-protocol| : file transfer protocol option variables |
| 342 | |netrw-settings| : additional file transfer options |
| 343 | |netrw-browser-options| : these options affect browsing directories |
| 344 | ) |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 345 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 346 | Netrw provides a lot of variables which allow you to customize netrw to your |
| 347 | preferences. One way to look at them is via the command :NetrwSettings (see |
| 348 | |netrw-settings|) which will display your current netrw settings. Most such |
| 349 | settings are described below, in |netrw-browser-options|, and in |
| 350 | |netrw-externapp|: |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 351 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 352 | *b:netrw_lastfile* last file Network-read/written retained on a |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 353 | per-buffer basis (supports plain :Nw ) |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 354 | |
Bram Moolenaar | 5ac3b1a | 2010-07-27 22:50:36 +0200 | [diff] [blame] | 355 | *g:netrw_bufsettings* the settings that netrw buffers have |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 356 | (default) noma nomod nonu nowrap ro nobl |
Bram Moolenaar | 5ac3b1a | 2010-07-27 22:50:36 +0200 | [diff] [blame] | 357 | |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 358 | *g:netrw_chgwin* specifies a window number where subsequent file edits |
| 359 | will take place. (also see |netrw-C|) |
| 360 | (default) -1 |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 361 | |
Bram Moolenaar | 5ac3b1a | 2010-07-27 22:50:36 +0200 | [diff] [blame] | 362 | *g:Netrw_funcref* specifies a function (or functions) to be called when |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 363 | netrw edits a file. The file is first edited, and |
| 364 | then the function reference (|Funcref|) is called. |
| 365 | This variable may also hold a |List| of Funcrefs. |
| 366 | (default) not defined. (the capital in g:Netrw... |
| 367 | is required by its holding a function reference) |
Bram Moolenaar | 5ac3b1a | 2010-07-27 22:50:36 +0200 | [diff] [blame] | 368 | > |
| 369 | Example: place in .vimrc; affects all file opening |
| 370 | fun! MyFuncRef() |
| 371 | endfun |
| 372 | let g:Netrw_funcref= function("MyFuncRef") |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 373 | |
Bram Moolenaar | 5ac3b1a | 2010-07-27 22:50:36 +0200 | [diff] [blame] | 374 | < |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 375 | *g:Netrw_UserMaps* specifies a function or |List| of functions which can |
| 376 | be used to set up user-specified maps and functionality. |
| 377 | See |netrw-usermaps| |
| 378 | |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 379 | *g:netrw_ftp* if it doesn't exist, use default ftp |
| 380 | =0 use default ftp (uid password) |
| 381 | =1 use alternate ftp method (user uid password) |
| 382 | If you're having trouble with ftp, try changing the |
| 383 | value of this variable to see if the alternate ftp |
| 384 | method works for your setup. |
| 385 | |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 386 | *g:netrw_ftp_options* Chosen by default, these options are supposed to |
| 387 | turn interactive prompting off and to restrain ftp |
| 388 | from attempting auto-login upon initial connection. |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 389 | However, it appears that not all ftp implementations |
| 390 | support this (ex. ncftp). |
| 391 | ="-i -n" |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 392 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 393 | *g:netrw_ftpextracmd* default: doesn't exist |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 394 | If this variable exists, then any string it contains |
| 395 | will be placed into the commands set to your ftp |
| 396 | client. As an example: |
| 397 | ="passive" |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 398 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 399 | *g:netrw_ftpmode* ="binary" (default) |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 400 | ="ascii" |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 401 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 402 | *g:netrw_ignorenetrc* =0 (default for linux, cygwin) |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 403 | =1 If you have a <.netrc> file but it doesn't work and |
| 404 | you want it ignored, then set this variable as |
| 405 | shown. (default for Windows + cmd.exe) |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 406 | |
| 407 | *g:netrw_menu* =0 disable netrw's menu |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 408 | =1 (default) netrw's menu enabled |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 409 | |
| 410 | *g:netrw_nogx* if this variable exists, then the "gx" map will not |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 411 | be available (see |netrw-gx|) |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 412 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 413 | *g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 414 | *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 415 | |
| 416 | *g:netrw_preview* =0 (default) preview window shown in a horizontally |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 417 | split window |
| 418 | =1 preview window shown in a vertically split window. |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 419 | Also affects the "previous window" (see |netrw-P|) |
| 420 | in the same way. |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 421 | The |g:netrw_alto| variable may be used to provide |
| 422 | additional splitting control: |
| 423 | g:netrw_preview g:netrw_alto result |
| 424 | 0 0 |:aboveleft| |
| 425 | 0 1 |:belowright| |
| 426 | 1 0 |:topleft| |
| 427 | 1 1 |:botright| |
| 428 | To control sizing, see |g:netrw_winsize| |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 429 | |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 430 | *g:netrw_scpport* = "-P" : option to use to set port for scp |
| 431 | *g:netrw_sshport* = "-p" : option to use to set port for ssh |
Bram Moolenaar | 7aa9f6a | 2007-05-10 18:00:30 +0000 | [diff] [blame] | 432 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 433 | *g:netrw_sepchr* =\0xff |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 434 | =\0x01 for enc == euc-jp (and perhaps it should be for |
| 435 | others, too, please let me know) |
| 436 | Separates priority codes from filenames internally. |
| 437 | See |netrw-p12|. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 438 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 439 | *g:netrw_silent* =0 : transfers done normally |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 440 | =1 : transfers done silently |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 441 | |
Bram Moolenaar | 7aa9f6a | 2007-05-10 18:00:30 +0000 | [diff] [blame] | 442 | *g:netrw_use_errorwindow* =1 : messages from netrw will use a separate one |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 443 | line window. This window provides reliable |
Bram Moolenaar | 8ada2cc | 2010-07-29 20:43:36 +0200 | [diff] [blame] | 444 | delivery of messages. (default) |
| 445 | =0 : messages from netrw will use echoerr ; |
| 446 | messages don't always seem to show up this |
| 447 | way, but one doesn't have to quit the window. |
Bram Moolenaar | 7aa9f6a | 2007-05-10 18:00:30 +0000 | [diff] [blame] | 448 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 449 | *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 450 | lines that o/s's ftp "provides" on transfers |
| 451 | =0 force normal ftp behavior (no trailing line removal) |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 452 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 453 | *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 454 | permits network browsing to use ls with time and |
| 455 | size sorting (default if windows) |
| 456 | =0 assume Windows' scp accepts windows-style paths |
| 457 | Network browsing uses dir instead of ls |
| 458 | This option is ignored if you're using unix |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 459 | |
| 460 | *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 461 | =1 use WinNT's rcp in binary mode (default) |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 462 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 463 | PATHS *netrw-path* {{{2 |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 464 | |
| 465 | Paths to files are generally user-directory relative for most protocols. |
| 466 | It is possible that some protocol will make paths relative to some |
| 467 | associated directory, however. |
| 468 | > |
| 469 | example: vim scp://user@host/somefile |
| 470 | example: vim scp://user@host/subdir1/subdir2/somefile |
| 471 | < |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 472 | where "somefile" is in the "user"'s home directory. If you wish to get a |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 473 | file using root-relative paths, use the full path: |
| 474 | > |
| 475 | example: vim scp://user@host//somefile |
| 476 | example: vim scp://user@host//subdir1/subdir2/somefile |
| 477 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 478 | |
| 479 | ============================================================================== |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 480 | 4. Network-Oriented File Transfer *netrw-xfer* {{{1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 481 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 482 | Network-oriented file transfer under Vim is implemented by a vim script |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 483 | (<netrw.vim>) using plugin techniques. It currently supports both reading and |
| 484 | writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch, |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 485 | dav/cadaver, rsync, or sftp. |
| 486 | |
| 487 | http is currently supported read-only via use of wget or fetch. |
| 488 | |
| 489 | <netrw.vim> is a standard plugin which acts as glue between Vim and the |
| 490 | various file transfer programs. It uses autocommand events (BufReadCmd, |
| 491 | FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. > |
| 492 | |
| 493 | ex. vim ftp://hostname/path/to/file |
| 494 | < |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 495 | The characters preceding the colon specify the protocol to use; in the |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 496 | example, it's ftp. The <netrw.vim> script then formulates a command or a |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 497 | series of commands (typically ftp) which it issues to an external program |
| 498 | (ftp, scp, etc) which does the actual file transfer/protocol. Files are read |
| 499 | from/written to a temporary file (under Unix/Linux, /tmp/...) which the |
| 500 | <netrw.vim> script will clean up. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 501 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 502 | Now, a word about Jan Minář's "FTP User Name and Password Disclosure"; first, |
| 503 | ftp is not a secure protocol. User names and passwords are transmitted "in |
| 504 | the clear" over the internet; any snooper tool can pick these up; this is not |
| 505 | a netrw thing, this is a ftp thing. If you're concerned about this, please |
| 506 | try to use scp or sftp instead. |
| 507 | |
| 508 | Netrw re-uses the user id and password during the same vim session and so long |
| 509 | as the remote hostname remains the same. |
| 510 | |
| 511 | Jan seems to be a bit confused about how netrw handles ftp; normally multiple |
| 512 | commands are performed in a "ftp session", and he seems to feel that the |
| 513 | uid/password should only be retained over one ftp session. However, netrw |
| 514 | does every ftp operation in a separate "ftp session"; so remembering the |
| 515 | uid/password for just one "ftp session" would be the same as not remembering |
| 516 | the uid/password at all. IMHO this would rapidly grow tiresome as one |
| 517 | browsed remote directories, for example. |
| 518 | |
| 519 | On the other hand, thanks go to Jan M. for pointing out the many |
| 520 | vulnerabilities that netrw (and vim itself) had had in handling "crafted" |
| 521 | filenames. The |shellescape()| and |fnameescape()| functions were written in |
Bram Moolenaar | 5ac3b1a | 2010-07-27 22:50:36 +0200 | [diff] [blame] | 522 | response by Bram Moolenaar to handle these sort of problems, and netrw has |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 523 | been modified to use them. Still, my advice is, if the "filename" looks like |
| 524 | a vim command that you aren't comfortable with having executed, don't open it. |
| 525 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 526 | *netrw-putty* *netrw-pscp* *netrw-psftp* |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 527 | One may modify any protocol's implementing external application by setting a |
| 528 | variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to |
Bram Moolenaar | 433f7c8 | 2006-03-21 21:29:36 +0000 | [diff] [blame] | 529 | "scp -q"). As an example, consider using PuTTY: > |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 530 | |
| 531 | let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch' |
| 532 | let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"' |
Bram Moolenaar | 433f7c8 | 2006-03-21 21:29:36 +0000 | [diff] [blame] | 533 | < |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 534 | (note: it has been reported that windows 7 with putty v0.6's "-batch" option |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 535 | doesn't work, so its best to leave it off for that system) |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 536 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 537 | See |netrw-p8| for more about putty, pscp, psftp, etc. |
| 538 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 539 | Ftp, an old protocol, seems to be blessed by numerous implementations. |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 540 | Unfortunately, some implementations are noisy (ie., add junk to the end of the |
| 541 | file). Thus, concerned users may decide to write a NetReadFixup() function |
| 542 | that will clean up after reading with their ftp. Some Unix systems (ie., |
| 543 | FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is |
| 544 | not noisy and more convenient, actually, for <netrw.vim> to use. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 545 | Consequently, if "fetch" is available (ie. executable), it may be preferable |
| 546 | to use it for ftp://... based transfers. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 547 | |
| 548 | For rcp, scp, sftp, and http, one may use network-oriented file transfers |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 549 | transparently; ie. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 550 | > |
| 551 | vim rcp://[user@]machine/path |
| 552 | vim scp://[user@]machine/path |
| 553 | < |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 554 | If your ftp supports <.netrc>, then it too can be transparently used |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 555 | if the needed triad of machine name, user id, and password are present in |
| 556 | that file. Your ftp must be able to use the <.netrc> file on its own, however. |
| 557 | > |
| 558 | vim ftp://[user@]machine[[:#]portnumber]/path |
| 559 | < |
Bram Moolenaar | adc2182 | 2011-04-01 18:03:16 +0200 | [diff] [blame] | 560 | Windows provides an ftp (typically c:\Windows\System32\ftp.exe) which uses |
| 561 | an option, -s:filename (filename can and probably should be a full path) |
| 562 | which contains ftp commands which will be automatically run whenever ftp |
| 563 | starts. You may use this feature to enter a user and password for one site: > |
| 564 | userid |
| 565 | password |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 566 | < *netrw-windows-netrc* *netrw-windows-s* |
| 567 | If |g:netrw_ftp_cmd| contains -s:[path/]MACHINE, then (on Windows machines |
| 568 | only) netrw will substitute the current machine name requested for ftp |
| 569 | connections for MACHINE. Hence one can have multiple machine.ftp files |
| 570 | containing login and password for ftp. Example: > |
Bram Moolenaar | adc2182 | 2011-04-01 18:03:16 +0200 | [diff] [blame] | 571 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 572 | let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE' |
| 573 | vim ftp://myhost.somewhere.net/ |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 574 | |
Bram Moolenaar | adc2182 | 2011-04-01 18:03:16 +0200 | [diff] [blame] | 575 | will use a file > |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 576 | |
Bram Moolenaar | adc2182 | 2011-04-01 18:03:16 +0200 | [diff] [blame] | 577 | C:\Users\Myself\myhost.ftp |
| 578 | < |
| 579 | Often, ftp will need to query the user for the userid and password. |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 580 | The latter will be done "silently"; ie. asterisks will show up instead of |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 581 | the actually-typed-in password. Netrw will retain the userid and password |
| 582 | for subsequent read/writes from the most recent transfer so subsequent |
| 583 | transfers (read/write) to or from that machine will take place without |
| 584 | additional prompting. |
| 585 | |
| 586 | *netrw-urls* |
| 587 | +=================================+============================+============+ |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 588 | | Reading | Writing | Uses | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 589 | +=================================+============================+============+ |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 590 | | DAV: | | | |
| 591 | | dav://host/path | | cadaver | |
| 592 | | :Nread dav://host/path | :Nwrite dav://host/path | cadaver | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 593 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 594 | | DAV + SSL: | | | |
| 595 | | davs://host/path | | cadaver | |
| 596 | | :Nread davs://host/path | :Nwrite davs://host/path | cadaver | |
| 597 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 598 | | FETCH: | | | |
| 599 | | fetch://[user@]host/path | | | |
| 600 | | fetch://[user@]host:http/path | Not Available | fetch | |
| 601 | | :Nread fetch://[user@]host/path| | | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 602 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 603 | | FILE: | | | |
| 604 | | file:///* | file:///* | | |
| 605 | | file://localhost/* | file://localhost/* | | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 606 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 607 | | FTP: (*3) | (*3) | | |
| 608 | | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) | |
| 609 | | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc | |
| 610 | | :Nread host path | :Nwrite host path | ftp+.netrc | |
| 611 | | :Nread host uid pass path | :Nwrite host uid pass path | ftp | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 612 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 613 | | HTTP: wget is executable: (*4) | | | |
| 614 | | http://[user@]host/path | Not Available | wget | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 615 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 616 | | HTTP: fetch is executable (*4) | | | |
| 617 | | http://[user@]host/path | Not Available | fetch | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 618 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 619 | | RCP: | | | |
| 620 | | rcp://[user@]host/path | rcp://[user@]host/path | rcp | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 621 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 622 | | RSYNC: | | | |
| 623 | | rsync://[user@]host/path | rsync://[user@]host/path | rsync | |
| 624 | | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync | |
| 625 | | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 626 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 627 | | SCP: | | | |
| 628 | | scp://[user@]host/path | scp://[user@]host/path | scp | |
| 629 | | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 630 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 631 | | SFTP: | | | |
| 632 | | sftp://[user@]host/path | sftp://[user@]host/path | sftp | |
| 633 | | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 634 | +=================================+============================+============+ |
| 635 | |
| 636 | (*1) For an absolute path use scp://machine//path. |
| 637 | |
| 638 | (*2) if <.netrc> is present, it is assumed that it will |
| 639 | work with your ftp client. Otherwise the script will |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 640 | prompt for user-id and password. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 641 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 642 | (*3) for ftp, "machine" may be machine#port or machine:port |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 643 | if a different port is needed than the standard ftp port |
| 644 | |
| 645 | (*4) for http:..., if wget is available it will be used. Otherwise, |
| 646 | if fetch is available it will be used. |
| 647 | |
| 648 | Both the :Nread and the :Nwrite ex-commands can accept multiple filenames. |
| 649 | |
| 650 | |
| 651 | NETRC *netrw-netrc* |
| 652 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 653 | The <.netrc> file, typically located in your home directory, contains lines |
| 654 | therein which map a hostname (machine name) to the user id and password you |
| 655 | prefer to use with it. |
| 656 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 657 | The typical syntax for lines in a <.netrc> file is given as shown below. |
Bram Moolenaar | c01140a | 2006-03-24 22:21:52 +0000 | [diff] [blame] | 658 | Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 659 | > |
| 660 | machine {full machine name} login {user-id} password "{password}" |
| 661 | default login {user-id} password "{password}" |
| 662 | |
| 663 | Your ftp client must handle the use of <.netrc> on its own, but if the |
| 664 | <.netrc> file exists, an ftp transfer will not ask for the user-id or |
| 665 | password. |
| 666 | |
| 667 | Note: |
| 668 | Since this file contains passwords, make very sure nobody else can |
| 669 | read this file! Most programs will refuse to use a .netrc that is |
| 670 | readable for others. Don't forget that the system administrator can |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 671 | still read the file! Ie. for Linux/Unix: chmod 600 .netrc |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 672 | |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 673 | Even though Windows' ftp clients typically do not support .netrc, netrw has |
| 674 | a work-around: see |netrw-windows-s|. |
| 675 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 676 | |
| 677 | PASSWORD *netrw-passwd* |
| 678 | |
| 679 | The script attempts to get passwords for ftp invisibly using |inputsecret()|, |
Bram Moolenaar | 8ada2cc | 2010-07-29 20:43:36 +0200 | [diff] [blame] | 680 | a built-in Vim function. See |netrw-userpass| for how to change the password |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 681 | after one has set it. |
| 682 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 683 | Unfortunately there doesn't appear to be a way for netrw to feed a password to |
| 684 | scp. Thus every transfer via scp will require re-entry of the password. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 685 | However, |netrw-ssh-hack| can help with this problem. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 686 | |
| 687 | |
| 688 | ============================================================================== |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 689 | 5. Activation *netrw-activate* {{{1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 690 | |
Bram Moolenaar | c01140a | 2006-03-24 22:21:52 +0000 | [diff] [blame] | 691 | Network-oriented file transfers are available by default whenever Vim's |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 692 | |'nocompatible'| mode is enabled. Netrw's script files reside in your |
| 693 | system's plugin, autoload, and syntax directories; just the |
| 694 | plugin/netrwPlugin.vim script is sourced automatically whenever you bring up |
| 695 | vim. The main script in autoload/netrw.vim is only loaded when you actually |
| 696 | use netrw. I suggest that, at a minimum, you have at least the following in |
| 697 | your <.vimrc> customization file: > |
Bram Moolenaar | c01140a | 2006-03-24 22:21:52 +0000 | [diff] [blame] | 698 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 699 | set nocp |
| 700 | if version >= 600 |
| 701 | filetype plugin indent on |
| 702 | endif |
| 703 | < |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 704 | By also including the following lines in your .vimrc, one may have netrw |
| 705 | immediately activate when using [g]vim without any filenames, showing the |
| 706 | current directory: > |
| 707 | |
| 708 | " Augroup VimStartup: |
| 709 | augroup VimStartup |
| 710 | au! |
| 711 | au VimEnter * if expand("%") == "" | e . | endif |
| 712 | augroup END |
| 713 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 714 | |
| 715 | ============================================================================== |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 716 | 6. Transparent Remote File Editing *netrw-transparent* {{{1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 717 | |
| 718 | Transparent file transfers occur whenever a regular file read or write |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 719 | (invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd| |
| 720 | events) is made. Thus one may read, write, or source files across networks |
| 721 | just as easily as if they were local files! > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 722 | |
| 723 | vim ftp://[user@]machine/path |
| 724 | ... |
| 725 | :wq |
| 726 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 727 | See |netrw-activate| for more on how to encourage your vim to use plugins |
| 728 | such as netrw. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 729 | |
Bram Moolenaar | c01140a | 2006-03-24 22:21:52 +0000 | [diff] [blame] | 730 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 731 | ============================================================================== |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 732 | 7. Ex Commands *netrw-ex* {{{1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 733 | |
Bram Moolenaar | c01140a | 2006-03-24 22:21:52 +0000 | [diff] [blame] | 734 | The usual read/write commands are supported. There are also a few |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 735 | additional commands available. Often you won't need to use Nwrite or |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 736 | Nread as shown in |netrw-transparent| (ie. simply use > |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 737 | :e URL |
| 738 | :r URL |
| 739 | :w URL |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 740 | instead, as appropriate) -- see |netrw-urls|. In the explanations |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 741 | below, a {netfile} is a URL to a remote file. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 742 | |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 743 | *:Nwrite* *:Nw* |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 744 | :[range]Nw[rite] Write the specified lines to the current |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 745 | file as specified in b:netrw_lastfile. |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 746 | (related: |netrw-nwrite|) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 747 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 748 | :[range]Nw[rite] {netfile} [{netfile}]... |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 749 | Write the specified lines to the {netfile}. |
| 750 | |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 751 | *:Nread* *:Nr* |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 752 | :Nr[ead] Read the lines from the file specified in b:netrw_lastfile |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 753 | into the current buffer. (related: |netrw-nread|) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 754 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 755 | :Nr[ead] {netfile} {netfile}... |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 756 | Read the {netfile} after the current line. |
| 757 | |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 758 | *:Nsource* *:Ns* |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 759 | :Ns[ource] {netfile} |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 760 | Source the {netfile}. |
| 761 | To start up vim using a remote .vimrc, one may use |
| 762 | the following (all on one line) (tnx to Antoine Mechelynck) > |
| 763 | vim -u NORC -N |
| 764 | --cmd "runtime plugin/netrwPlugin.vim" |
| 765 | --cmd "source scp://HOSTNAME/.vimrc" |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 766 | < (related: |netrw-source|) |
| 767 | |
| 768 | :call NetUserPass() *NetUserPass()* |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 769 | If g:netrw_uid and s:netrw_passwd don't exist, |
| 770 | this function will query the user for them. |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 771 | (related: |netrw-userpass|) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 772 | |
| 773 | :call NetUserPass("userid") |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 774 | This call will set the g:netrw_uid and, if |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 775 | the password doesn't exist, will query the user for it. |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 776 | (related: |netrw-userpass|) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 777 | |
| 778 | :call NetUserPass("userid","passwd") |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 779 | This call will set both the g:netrw_uid and s:netrw_passwd. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 780 | The user-id and password are used by ftp transfers. One may |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 781 | effectively remove the user-id and password by using empty |
| 782 | strings (ie. ""). |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 783 | (related: |netrw-userpass|) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 784 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 785 | :NetrwSettings This command is described in |netrw-settings| -- used to |
| 786 | display netrw settings and change netrw behavior. |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 787 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 788 | |
| 789 | ============================================================================== |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 790 | 8. Variables and Options *netrw-var* *netrw-settings* {{{1 |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 791 | |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 792 | (also see: |netrw-options| |netrw-variables| |netrw-protocol| |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 793 | |netrw-browser-settings| |netrw-browser-options| ) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 794 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 795 | The <netrw.vim> script provides several variables which act as options to |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 796 | affect <netrw.vim>'s file transfer behavior. These variables typically may be |
| 797 | set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|) |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 798 | *netrw-options* |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 799 | > |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 800 | ------------- |
| 801 | Netrw Options |
| 802 | ------------- |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 803 | Option Meaning |
| 804 | -------------- ----------------------------------------------- |
| 805 | < |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 806 | b:netrw_col Holds current cursor position (during NetWrite) |
| 807 | g:netrw_cygwin =1 assume scp under windows is from cygwin |
| 808 | (default/windows) |
| 809 | =0 assume scp under windows accepts windows |
| 810 | style paths (default/else) |
| 811 | g:netrw_ftp =0 use default ftp (uid password) |
| 812 | g:netrw_ftpmode ="binary" (default) |
| 813 | ="ascii" (your choice) |
| 814 | g:netrw_ignorenetrc =1 (default) |
| 815 | if you have a <.netrc> file but you don't |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 816 | want it used, then set this variable. Its |
| 817 | mere existence is enough to cause <.netrc> |
| 818 | to be ignored. |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 819 | b:netrw_lastfile Holds latest method/machine/path. |
| 820 | b:netrw_line Holds current line number (during NetWrite) |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 821 | g:netrw_silent =0 transfers done normally |
| 822 | =1 transfers done silently |
| 823 | g:netrw_uid Holds current user-id for ftp. |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 824 | g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default) |
| 825 | =1 use WinNT/2K/XP's rcp, binary mode |
| 826 | g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc |
| 827 | =1 use default method to do ftp > |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 828 | ----------------------------------------------------------------------- |
| 829 | < |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 830 | *netrw-internal-variables* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 831 | The script will also make use of the following variables internally, albeit |
| 832 | temporarily. |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 833 | > |
| 834 | ------------------- |
| 835 | Temporary Variables |
| 836 | ------------------- |
| 837 | Variable Meaning |
| 838 | -------- ------------------------------------ |
| 839 | < |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 840 | b:netrw_method Index indicating rcp/ftp+.netrc/ftp |
| 841 | w:netrw_method (same as b:netrw_method) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 842 | g:netrw_machine Holds machine name parsed from input |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 843 | b:netrw_fname Holds filename being accessed > |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 844 | ------------------------------------------------------------ |
| 845 | < |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 846 | *netrw-protocol* |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 847 | |
| 848 | Netrw supports a number of protocols. These protocols are invoked using the |
| 849 | variables listed below, and may be modified by the user. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 850 | > |
| 851 | ------------------------ |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 852 | Protocol Control Options |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 853 | ------------------------ |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 854 | Option Type Setting Meaning |
| 855 | --------- -------- -------------- --------------------------- |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 856 | < netrw_ftp variable =doesn't exist userid set by "user userid" |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 857 | =0 userid set by "user userid" |
| 858 | =1 userid set by "userid" |
| 859 | NetReadFixup function =doesn't exist no change |
| 860 | =exists Allows user to have files |
| 861 | read via ftp automatically |
| 862 | transformed however they wish |
| 863 | by NetReadFixup() |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 864 | g:netrw_dav_cmd var ="cadaver" if cadaver is executable |
| 865 | g:netrw_dav_cmd var ="curl -o" elseif curl is executable |
| 866 | g:netrw_fetch_cmd var ="fetch -o" if fetch is available |
| 867 | g:netrw_ftp_cmd var ="ftp" |
| 868 | g:netrw_http_cmd var ="fetch -o" if fetch is available |
| 869 | g:netrw_http_cmd var ="wget -O" else if wget is available |
| 870 | g:netrw_http_put_cmd var ="curl -T" |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 871 | |g:netrw_list_cmd| var ="ssh USEPORT HOSTNAME ls -Fa" |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 872 | g:netrw_rcp_cmd var ="rcp" |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 873 | g:netrw_rsync_cmd var ="rsync" |
| 874 | *g:netrw_rsync_sep* var ="/" used to separate the hostname |
| 875 | from the file spec |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 876 | g:netrw_scp_cmd var ="scp -q" |
| 877 | g:netrw_sftp_cmd var ="sftp" > |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 878 | ------------------------------------------------------------------------- |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 879 | < |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 880 | *netrw-ftp* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 881 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 882 | The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|) |
| 883 | specify the external program to use handle the ftp protocol. They may |
Bram Moolenaar | 5ac3b1a | 2010-07-27 22:50:36 +0200 | [diff] [blame] | 884 | include command line options (such as -p for passive mode). Example: > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 885 | |
Bram Moolenaar | 5ac3b1a | 2010-07-27 22:50:36 +0200 | [diff] [blame] | 886 | let g:netrw_ftp_cmd= "ftp -p" |
| 887 | < |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 888 | Browsing is supported by using the |g:netrw_list_cmd|; the substring |
| 889 | "HOSTNAME" will be changed via substitution with whatever the current request |
| 890 | is for a hostname. |
| 891 | |
| 892 | Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's |
| 893 | that give trouble . In order to best understand how to use these options if |
| 894 | ftp is giving you troubles, a bit of discussion is provided on how netrw does |
| 895 | ftp reads. |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 896 | |
| 897 | For ftp, netrw typically builds up lines of one of the following formats in a |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 898 | temporary file: |
| 899 | > |
| 900 | IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1 |
| 901 | ---------------------------------- ------------------------------ |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 902 | < |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 903 | open machine [port] open machine [port] |
| 904 | user userid password userid password |
| 905 | [g:netrw_ftpmode] password |
Bram Moolenaar | 8ada2cc | 2010-07-29 20:43:36 +0200 | [diff] [blame] | 906 | [g:netrw_ftpextracmd] [g:netrw_ftpmode] |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 907 | get filename tempfile [g:netrw_extracmd] |
| 908 | get filename tempfile > |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 909 | --------------------------------------------------------------------- |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 910 | < |
Bram Moolenaar | 8ada2cc | 2010-07-29 20:43:36 +0200 | [diff] [blame] | 911 | The |g:netrw_ftpmode| and |g:netrw_ftpextracmd| are optional. |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 912 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 913 | Netrw then executes the lines above by use of a filter: |
| 914 | > |
| 915 | :%! {g:netrw_ftp_cmd} -i [-n] |
| 916 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 917 | where |
| 918 | g:netrw_ftp_cmd is usually "ftp", |
| 919 | -i tells ftp not to be interactive |
| 920 | -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>) |
| 921 | |
| 922 | If <.netrc> exists it will be used to avoid having to query the user for |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 923 | userid and password. The transferred file is put into a temporary file. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 924 | The temporary file is then read into the main editing session window that |
| 925 | requested it and the temporary file deleted. |
| 926 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 927 | If your ftp doesn't accept the "user" command and immediately just demands a |
| 928 | userid, then try putting "let netrw_ftp=1" in your <.vimrc>. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 929 | |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 930 | *netrw-cadaver* |
| 931 | To handle the SSL certificate dialog for untrusted servers, one may pull |
| 932 | down the certificate and place it into /usr/ssl/cert.pem. This operation |
| 933 | renders the server treatment as "trusted". |
| 934 | |
Bram Moolenaar | 433f7c8 | 2006-03-21 21:29:36 +0000 | [diff] [blame] | 935 | *netrw-fixup* *netreadfixup* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 936 | If your ftp for whatever reason generates unwanted lines (such as AUTH |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 937 | messages) you may write a NetReadFixup() function: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 938 | > |
| 939 | function! NetReadFixup(method,line1,line2) |
| 940 | " a:line1: first new line in current file |
| 941 | " a:line2: last new line in current file |
| 942 | if a:method == 1 "rcp |
| 943 | elseif a:method == 2 "ftp + <.netrc> |
| 944 | elseif a:method == 3 "ftp + machine,uid,password,filename |
| 945 | elseif a:method == 4 "scp |
| 946 | elseif a:method == 5 "http/wget |
| 947 | elseif a:method == 6 "dav/cadaver |
| 948 | elseif a:method == 7 "rsync |
| 949 | elseif a:method == 8 "fetch |
| 950 | elseif a:method == 9 "sftp |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 951 | else " complain |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 952 | endif |
| 953 | endfunction |
| 954 | > |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 955 | The NetReadFixup() function will be called if it exists and thus allows you to |
| 956 | customize your reading process. As a further example, <netrw.vim> contains |
| 957 | just such a function to handle Windows 95 ftp. For whatever reason, Windows |
| 958 | 95's ftp dumps four blank lines at the end of a transfer, and so it is |
| 959 | desirable to automate their removal. Here's some code taken from <netrw.vim> |
| 960 | itself: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 961 | > |
| 962 | if has("win95") && g:netrw_win95ftp |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 963 | fun! NetReadFixup(method, line1, line2) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 964 | if method == 3 " ftp (no <.netrc>) |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 965 | let fourblanklines= line2 - 3 |
| 966 | silent fourblanklines.",".line2."g/^\s*/d" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 967 | endif |
| 968 | endfunction |
| 969 | endif |
| 970 | > |
Bram Moolenaar | e6ae622 | 2013-05-21 21:01:10 +0200 | [diff] [blame] | 971 | (Related topics: |ftp| |netrw-userpass| |netrw-start|) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 972 | |
| 973 | ============================================================================== |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 974 | 9. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1 |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 975 | *netrw-browser* *netrw-dir* *netrw-list* |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 976 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 977 | INTRODUCTION TO BROWSING *netrw-intro-browse* {{{2 |
| 978 | (Quick References: |netrw-quickmaps| |netrw-quickcoms|) |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 979 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 980 | Netrw supports the browsing of directories on your local system and on remote |
| 981 | hosts; browsing includes listing files and directories, entering directories, |
| 982 | editing files therein, deleting files/directories, making new directories, |
| 983 | moving (renaming) files and directories, copying files and directories, etc. |
| 984 | One may mark files and execute any system command on them! The Netrw browser |
| 985 | generally implements the previous explorer's maps and commands for remote |
| 986 | directories, although details (such as pertinent global variable names) |
| 987 | necessarily differ. To browse a directory, simply "edit" it! > |
Bram Moolenaar | 269ec65 | 2004-07-29 08:43:53 +0000 | [diff] [blame] | 988 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 989 | vim /your/directory/ |
| 990 | vim . |
| 991 | vim c:\your\directory\ |
| 992 | < |
| 993 | (Related topics: |netrw-cr| |netrw-o| |netrw-p| |netrw-P| |netrw-t| |
| 994 | |netrw-mf| |netrw-mx| |netrw-D| |netrw-R| |netrw-v| ) |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 995 | |
| 996 | The Netrw remote file and directory browser handles two protocols: ssh and |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 997 | ftp. The protocol in the url, if it is ftp, will cause netrw also to use ftp |
| 998 | in its remote browsing. Specifying any other protocol will cause it to be |
| 999 | used for file transfers; but the ssh protocol will be used to do remote |
| 1000 | browsing. |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 1001 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1002 | To use Netrw's remote directory browser, simply attempt to read a "file" with |
| 1003 | a trailing slash and it will be interpreted as a request to list a directory: |
| 1004 | > |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 1005 | vim [protocol]://[user@]hostname/path/ |
Bram Moolenaar | 4ea8fe1 | 2006-03-09 22:32:39 +0000 | [diff] [blame] | 1006 | < |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1007 | where [protocol] is typically scp or ftp. As an example, try: > |
Bram Moolenaar | 4ea8fe1 | 2006-03-09 22:32:39 +0000 | [diff] [blame] | 1008 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1009 | vim ftp://ftp.home.vim.org/pub/vim/ |
| 1010 | < |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1011 | For local directories, the trailing slash is not required. Again, because it's |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1012 | easy to miss: to browse remote directories, the URL must terminate with a |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1013 | slash! |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1014 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1015 | If you'd like to avoid entering the password repeatedly for remote directory |
| 1016 | listings with ssh or scp, see |netrw-ssh-hack|. To avoid password entry with |
| 1017 | ftp, see |netrw-netrc| (if your ftp supports it). |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1018 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1019 | There are several things you can do to affect the browser's display of files: |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1020 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1021 | * To change the listing style, press the "i" key (|netrw-i|). |
| 1022 | Currently there are four styles: thin, long, wide, and tree. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1023 | To make that change "permanent", see |g:netrw_liststyle|. |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1024 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1025 | * To hide files (don't want to see those xyz~ files anymore?) see |
| 1026 | |netrw-ctrl-h|. |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1027 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1028 | * Press s to sort files by name, time, or size. |
| 1029 | |
| 1030 | See |netrw-browse-cmds| for all the things you can do with netrw! |
| 1031 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1032 | *netrw-getftype* *netrw-filigree* *netrw-ftype* |
| 1033 | The |getftype()| function is used to append a bit of filigree to indicate |
| 1034 | filetype to locally listed files: |
| 1035 | |
| 1036 | directory : / |
| 1037 | executable : * |
| 1038 | fifo : | |
| 1039 | links : @ |
| 1040 | sockets : = |
| 1041 | |
| 1042 | The filigree also affects the |g:netrw_sort_sequence|. |
| 1043 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1044 | |
| 1045 | QUICK HELP *netrw-quickhelp* {{{2 |
| 1046 | (Use ctrl-] to select a topic)~ |
| 1047 | Intro to Browsing...............................|netrw-intro-browse| |
| 1048 | Quick Reference: Maps.........................|netrw-quickmap| |
| 1049 | Quick Reference: Commands.....................|netrw-browse-cmds| |
| 1050 | Hiding |
| 1051 | Edit hiding list..............................|netrw-ctrl-h| |
| 1052 | Hiding Files or Directories...................|netrw-a| |
| 1053 | Hiding/Unhiding by suffix.....................|netrw-mh| |
| 1054 | Hiding dot-files.............................|netrw-gh| |
| 1055 | Listing Style |
| 1056 | Select listing style (thin/long/wide/tree)....|netrw-i| |
| 1057 | Associated setting variable...................|g:netrw_liststyle| |
| 1058 | Shell command used to perform listing.........|g:netrw_list_cmd| |
| 1059 | Quick file info...............................|netrw-qf| |
| 1060 | Sorted by |
| 1061 | Select sorting style (name/time/size).........|netrw-s| |
| 1062 | Editing the sorting sequence..................|netrw-S| |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 1063 | Sorting options...............................|g:netrw_sort_options| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1064 | Associated setting variable...................|g:netrw_sort_sequence| |
| 1065 | Reverse sorting order.........................|netrw-r| |
| 1066 | |
| 1067 | |
| 1068 | *netrw-quickmap* *netrw-quickmaps* |
| 1069 | QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 1070 | > |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1071 | --- ----------------- ---- |
| 1072 | Map Quick Explanation Link |
| 1073 | --- ----------------- ---- |
| 1074 | < <F1> Causes Netrw to issue help |
| 1075 | <cr> Netrw will enter the directory or read the file |netrw-cr| |
| 1076 | <del> Netrw will attempt to remove the file/directory |netrw-del| |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 1077 | <c-h> Edit file hiding list |netrw-ctrl-h| |
| 1078 | <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l| |
| 1079 | <c-r> Browse using a gvim server |netrw-ctrl-r| |
| 1080 | <c-tab> Shrink/expand a netrw/explore window |netrw-c-tab| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1081 | - Makes Netrw go up one directory |netrw--| |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1082 | a Cycles between normal display, |netrw-a| |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 1083 | hiding (suppress display of files matching g:netrw_list_hide) |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1084 | and showing (display only files which match g:netrw_list_hide) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1085 | c Make browsing directory the current directory |netrw-c| |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1086 | C Setting the editing window |netrw-C| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1087 | d Make a directory |netrw-d| |
| 1088 | D Attempt to remove the file(s)/directory(ies) |netrw-D| |
| 1089 | gb Go to previous bookmarked directory |netrw-gb| |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1090 | gd Force treatment as directory |netrw-gd| |
| 1091 | gf Force treatment as file |netrw-gf| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1092 | gh Quick hide/unhide of dot-files |netrw-gh| |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 1093 | gn Make top of tree the directory below the cursor |netrw-gn| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1094 | i Cycle between thin, long, wide, and tree listings |netrw-i| |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1095 | I Toggle the displaying of the banner |netrw-I| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1096 | mb Bookmark current directory |netrw-mb| |
| 1097 | mc Copy marked files to marked-file target directory |netrw-mc| |
| 1098 | md Apply diff to marked files (up to 3) |netrw-md| |
| 1099 | me Place marked files on arg list and edit them |netrw-me| |
| 1100 | mf Mark a file |netrw-mf| |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1101 | mF Unmark files |netrw-mF| |
| 1102 | mg Apply vimgrep to marked files |netrw-mg| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1103 | mh Toggle marked file suffices' presence on hiding list |netrw-mh| |
| 1104 | mm Move marked files to marked-file target directory |netrw-mm| |
| 1105 | mp Print marked files |netrw-mp| |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1106 | mr Mark files using a shell-style |regexp| |netrw-mr| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1107 | mt Current browsing directory becomes markfile target |netrw-mt| |
| 1108 | mT Apply ctags to marked files |netrw-mT| |
| 1109 | mu Unmark all marked files |netrw-mu| |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1110 | mv Apply arbitrary vim command to marked files |netrw-mv| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1111 | mx Apply arbitrary shell command to marked files |netrw-mx| |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1112 | mX Apply arbitrary shell command to marked files en bloc|netrw-mX| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1113 | mz Compress/decompress marked files |netrw-mz| |
| 1114 | o Enter the file/directory under the cursor in a new |netrw-o| |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 1115 | browser window. A horizontal split is used. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1116 | O Obtain a file specified by cursor |netrw-O| |
| 1117 | p Preview the file |netrw-p| |
| 1118 | P Browse in the previously used window |netrw-P| |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1119 | qb List bookmarked directories and history |netrw-qb| |
| 1120 | qf Display information on file |netrw-qf| |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1121 | qF Mark files using a quickfix list |netrw-qF| |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 1122 | qL Mark files using a |location-list| |netrw-qL| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1123 | r Reverse sorting order |netrw-r| |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 1124 | R Rename the designated file(s)/directory(ies) |netrw-R| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1125 | s Select sorting style: by name, time, or file size |netrw-s| |
| 1126 | S Specify suffix priority for name-sorting |netrw-S| |
| 1127 | t Enter the file/directory under the cursor in a new tab|netrw-t| |
| 1128 | u Change to recently-visited directory |netrw-u| |
| 1129 | U Change to subsequently-visited directory |netrw-U| |
| 1130 | v Enter the file/directory under the cursor in a new |netrw-v| |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 1131 | browser window. A vertical split is used. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1132 | x View file with an associated program |netrw-x| |
Bram Moolenaar | 97d6249 | 2012-11-15 21:28:22 +0100 | [diff] [blame] | 1133 | X Execute filename under cursor via |system()| |netrw-X| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1134 | |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 1135 | % Open a new file in netrw's current directory |netrw-%| |
| 1136 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1137 | *netrw-mouse* *netrw-leftmouse* *netrw-middlemouse* *netrw-rightmouse* |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1138 | <leftmouse> (gvim only) selects word under mouse as if a <cr> |
| 1139 | had been pressed (ie. edit file, change directory) |
| 1140 | <middlemouse> (gvim only) same as P selecting word under mouse; |
| 1141 | see |netrw-P| |
| 1142 | <rightmouse> (gvim only) delete file/directory using word under |
| 1143 | mouse |
| 1144 | <2-leftmouse> (gvim only) when: |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 1145 | * in a netrw-selected file, AND |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1146 | * |g:netrw_retmap| == 1 AND |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 1147 | * the user doesn't already have a <2-leftmouse> |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 1148 | mapping defined before netrw is autoloaded, |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1149 | then a double clicked leftmouse button will return |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1150 | to the netrw browser window. See |g:netrw_retmap|. |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 1151 | <s-leftmouse> (gvim only) like mf, will mark files. Dragging |
| 1152 | the shifted leftmouse will mark multiple files. |
| 1153 | (see |netrw-mf|) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1154 | |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 1155 | (to disable mouse buttons while browsing: |g:netrw_mousemaps|) |
| 1156 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1157 | *netrw-quickcom* *netrw-quickcoms* |
| 1158 | QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2 |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 1159 | :NetrwClean[!]............................................|netrw-clean| |
| 1160 | :NetrwSettings............................................|netrw-settings| |
| 1161 | :Ntree....................................................|netrw-ntree| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1162 | :Explore[!] [dir] Explore directory of current file......|netrw-explore| |
| 1163 | :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore| |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1164 | :Lexplore[!] [dir] Left Explorer Toggle...................|netrw-explore| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1165 | :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| |
| 1166 | :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| |
| 1167 | :Rexplore Return to Explorer.....................|netrw-explore| |
| 1168 | :Sexplore[!] [dir] Split & Explore directory .............|netrw-explore| |
| 1169 | :Texplore[!] [dir] Tab & Explore..........................|netrw-explore| |
| 1170 | :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| |
| 1171 | |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 1172 | |
| 1173 | BANNER DISPLAY *netrw-I* |
| 1174 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1175 | One may toggle the displaying of the banner by pressing "I". |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 1176 | |
| 1177 | Also See: |g:netrw_banner| |
| 1178 | |
| 1179 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1180 | BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2 |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1181 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1182 | One may easily "bookmark" the currently browsed directory by using > |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1183 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1184 | mb |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 1185 | < |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1186 | *.netrwbook* |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1187 | Bookmarks are retained in between sessions of vim in a file called .netrwbook |
| 1188 | as a |List|, which is typically stored in the first directory on the user's |
| 1189 | '|runtimepath|'; entries are kept in sorted order. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1190 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1191 | If there are marked files and/or directories, mb will add them to the bookmark |
| 1192 | list. |
| 1193 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1194 | *netrw-:NetrwMB* |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1195 | Addtionally, one may use :NetrwMB to bookmark files or directories. > |
| 1196 | |
| 1197 | :NetrwMB[!] [files/directories] |
| 1198 | |
| 1199 | < No bang: enters files/directories into Netrw's bookmark system |
| 1200 | |
| 1201 | No argument and in netrw buffer: |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 1202 | if there are marked files : bookmark marked files |
| 1203 | otherwise : bookmark file/directory under cursor |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1204 | No argument and not in netrw buffer: bookmarks current open file |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 1205 | Has arguments : |glob()|s each arg and bookmarks them |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1206 | |
| 1207 | With bang: deletes files/directories from Netrw's bookmark system |
| 1208 | |
| 1209 | The :NetrwMB command is available outside of netrw buffers (once netrw has been |
| 1210 | invoked in the session). |
| 1211 | |
| 1212 | The file ".netrwbook" holds bookmarks when netrw (and vim) is not active. By |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1213 | default, its stored on the first directory on the user's |'runtimepath'|. |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1214 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1215 | Related Topics: |
| 1216 | |netrw-gb| how to return (go) to a bookmark |
| 1217 | |netrw-mB| how to delete bookmarks |
| 1218 | |netrw-qb| how to list bookmarks |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1219 | |g:netrw_home| controls where .netrwbook is kept |
Bram Moolenaar | 4a85b41 | 2006-04-23 22:40:29 +0000 | [diff] [blame] | 1220 | |
| 1221 | |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 1222 | BROWSING *netrw-enter* *netrw-cr* {{{2 |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1223 | |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 1224 | Browsing is simple: move the cursor onto a file or directory of interest. |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1225 | Hitting the <cr> (the return key) will select the file or directory. |
| 1226 | Directories will themselves be listed, and files will be opened using the |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1227 | protocol given in the original read request. |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1228 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1229 | CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that |
| 1230 | two or more spaces delimit filenames and directory names for the long and |
| 1231 | wide listing formats. Thus, if your filename or directory name has two or |
| 1232 | more sequential spaces embedded in it, or any trailing spaces, then you'll |
| 1233 | need to use the "thin" format to select it. |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1234 | |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 1235 | The |g:netrw_browse_split| option, which is zero by default, may be used to |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1236 | cause the opening of files to be done in a new window or tab instead of the |
| 1237 | default. When the option is one or two, the splitting will be taken |
| 1238 | horizontally or vertically, respectively. When the option is set to three, a |
| 1239 | <cr> will cause the file to appear in a new tab. |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 1240 | |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1241 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1242 | When using the gui (gvim), one may select a file by pressing the <leftmouse> |
| 1243 | button. In addition, if |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 1244 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1245 | * |g:netrw_retmap| == 1 AND (its default value is 0) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1246 | * in a netrw-selected file, AND |
| 1247 | * the user doesn't already have a <2-leftmouse> mapping defined before |
| 1248 | netrw is loaded |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1249 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1250 | then a doubly-clicked leftmouse button will return to the netrw browser |
| 1251 | window. |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1252 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1253 | Netrw attempts to speed up browsing, especially for remote browsing where one |
| 1254 | may have to enter passwords, by keeping and re-using previously obtained |
| 1255 | directory listing buffers. The |g:netrw_fastbrowse| variable is used to |
| 1256 | control this behavior; one may have slow browsing (no buffer re-use), medium |
| 1257 | speed browsing (re-use directory buffer listings only for remote directories), |
| 1258 | and fast browsing (re-use directory buffer listings as often as possible). |
| 1259 | The price for such re-use is that when changes are made (such as new files |
| 1260 | are introduced into a directory), the listing may become out-of-date. One may |
| 1261 | always refresh directory listing buffers by pressing ctrl-L (see |
| 1262 | |netrw-ctrl-l|). |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 1263 | |
| 1264 | *netrw-s-cr* |
| 1265 | Squeezing the Current Tree-Listing Directory~ |
| 1266 | |
| 1267 | When the tree listing style is enabled (see |netrw-i|) and one is using |
| 1268 | gvim, then the <s-cr> mapping may be used to squeeze (close) the |
| 1269 | directory currently containing the cursor. |
| 1270 | |
| 1271 | Otherwise, one may remap a key combination of one's own choice to get |
| 1272 | this effect: > |
| 1273 | |
| 1274 | nmap <buffer> <silent> <nowait> YOURKEYCOMBO <Plug>NetrwTreeSqueeze |
| 1275 | < |
| 1276 | Put this line in $HOME/ftplugin/netrw/netrw.vim; it needs to be generated |
| 1277 | for netrw buffers only. |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 1278 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1279 | Related topics: |
| 1280 | |netrw-ctrl-r| |netrw-o| |netrw-p| |
| 1281 | |netrw-P| |netrw-t| |netrw-v| |
| 1282 | Associated setting variables: |
| 1283 | |g:netrw_browse_split| |g:netrw_fastbrowse| |
| 1284 | |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd| |
| 1285 | |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_browse_reject| |
| 1286 | |g:netrw_ssh_cmd| |g:netrw_use_noswf| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1287 | |
| 1288 | |
| 1289 | BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2 |
| 1290 | |
| 1291 | Normally one enters a file or directory using the <cr>. However, the "o" map |
| 1292 | allows one to open a new window to hold the new directory listing or file. A |
| 1293 | horizontal split is used. (for vertical splitting, see |netrw-v|) |
| 1294 | |
| 1295 | Normally, the o key splits the window horizontally with the new window and |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 1296 | cursor at the top. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1297 | |
| 1298 | Associated setting variables: |g:netrw_alto| |g:netrw_winsize| |
| 1299 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1300 | Related topics: |
| 1301 | |netrw-ctrl-r| |netrw-o| |netrw-p| |
| 1302 | |netrw-P| |netrw-t| |netrw-v| |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 1303 | Associated setting variables: |
| 1304 | |g:netrw_alto| control above/below splitting |
| 1305 | |g:netrw_winsize| control initial sizing |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1306 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1307 | BROWSING WITH A NEW TAB *netrw-t* {{{2 |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1308 | |
| 1309 | Normally one enters a file or directory using the <cr>. The "t" map |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1310 | allows one to open a new window holding the new directory listing or file in |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 1311 | a new tab. |
| 1312 | |
| 1313 | If you'd like to have the new listing in a background tab, use |gT|. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1314 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1315 | Related topics: |
| 1316 | |netrw-ctrl-r| |netrw-o| |netrw-p| |
| 1317 | |netrw-P| |netrw-t| |netrw-v| |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 1318 | Associated setting variables: |
| 1319 | |g:netrw_winsize| control initial sizing |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1320 | |
| 1321 | BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2 |
| 1322 | |
| 1323 | Normally one enters a file or directory using the <cr>. However, the "v" map |
| 1324 | allows one to open a new window to hold the new directory listing or file. A |
| 1325 | vertical split is used. (for horizontal splitting, see |netrw-o|) |
| 1326 | |
| 1327 | Normally, the v key splits the window vertically with the new window and |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 1328 | cursor at the left. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1329 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1330 | There is only one tree listing buffer; using "v" on a displayed subdirectory |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1331 | will split the screen, but the same buffer will be shown twice. |
| 1332 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1333 | Related topics: |
| 1334 | |netrw-ctrl-r| |netrw-o| |netrw-p| |
| 1335 | |netrw-P| |netrw-t| |netrw-v| |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 1336 | Associated setting variables: |
| 1337 | |g:netrw_altv| control right/left splitting |
| 1338 | |g:netrw_winsize| control initial sizing |
| 1339 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1340 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1341 | BROWSING USING A GVIM SERVER *netrw-ctrl-r* {{{2 |
| 1342 | |
| 1343 | One may keep a browsing gvim separate from the gvim being used to edit. |
| 1344 | Use the <c-r> map on a file (not a directory) in the netrw browser, and it |
| 1345 | will use a gvim server (see |g:netrw_servername|). Subsequent use of <cr> |
| 1346 | (see |netrw-cr|) will re-use that server for editing files. |
| 1347 | |
| 1348 | Related topics: |
| 1349 | |netrw-ctrl-r| |netrw-o| |netrw-p| |
| 1350 | |netrw-P| |netrw-t| |netrw-v| |
| 1351 | Associated setting variables: |
| 1352 | |g:netrw_servername| : sets name of server |
| 1353 | |g:netrw_browse_split| : controls how <cr> will open files |
| 1354 | |
| 1355 | |
| 1356 | CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2 |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 1357 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 1358 | The "i" map cycles between the thin, long, wide, and tree listing formats. |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1359 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1360 | The thin listing format gives just the files' and directories' names. |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 1361 | |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 1362 | The long listing is either based on the "ls" command via ssh for remote |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1363 | directories or displays the filename, file size (in bytes), and the time and |
| 1364 | date of last modification for local directories. With the long listing |
| 1365 | format, netrw is not able to recognize filenames which have trailing spaces. |
| 1366 | Use the thin listing format for such files. |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 1367 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 1368 | The wide listing format uses two or more contiguous spaces to delineate |
| 1369 | filenames; when using that format, netrw won't be able to recognize or use |
| 1370 | filenames which have two or more contiguous spaces embedded in the name or any |
| 1371 | trailing spaces. The thin listing format will, however, work with such files. |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 1372 | The wide listing format is the most compact. |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 1373 | |
| 1374 | The tree listing format has a top directory followed by files and directories |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 1375 | preceded by one or more "|"s, which indicate the directory depth. One may |
| 1376 | open and close directories by pressing the <cr> key while atop the directory |
| 1377 | name. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1378 | |
| 1379 | One may make a preferred listing style your default; see |g:netrw_liststyle|. |
| 1380 | As an example, by putting the following line in your .vimrc, > |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1381 | let g:netrw_liststyle= 3 |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1382 | the tree style will become your default listing style. |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 1383 | |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 1384 | One typical way to use the netrw tree display is to: > |
| 1385 | |
| 1386 | vim . |
| 1387 | (use i until a tree display shows) |
| 1388 | navigate to a file |
| 1389 | v (edit as desired in vertically split window) |
| 1390 | ctrl-w h (to return to the netrw listing) |
| 1391 | P (edit newly selected file in the previous window) |
| 1392 | ctrl-w h (to return to the netrw listing) |
| 1393 | P (edit newly selected file in the previous window) |
| 1394 | ...etc... |
| 1395 | < |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1396 | Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen| |
| 1397 | |g:netrw_timefmt| |g:netrw_list_cmd| |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 1398 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1399 | CHANGE FILE PERMISSION *netrw-gp* {{{2 |
| 1400 | |
| 1401 | "gp" will ask you for a new permission for the file named under the cursor. |
| 1402 | Currently, this only works for local files. |
| 1403 | |
| 1404 | Associated setting variables: |g:netrw_chgperm| |
| 1405 | |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1406 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1407 | CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2 |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1408 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1409 | To change directory back to a bookmarked directory, use |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1410 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1411 | {cnt}gb |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1412 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1413 | Any count may be used to reference any of the bookmarks. |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 1414 | Note that |netrw-qb| shows both bookmarks and history; to go |
| 1415 | to a location stored in the history see |netrw-u| and |netrw-U|. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1416 | |
| 1417 | Related Topics: |
| 1418 | |netrw-mB| how to delete bookmarks |
| 1419 | |netrw-mb| how to make a bookmark |
| 1420 | |netrw-qb| how to list bookmarks |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1421 | |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1422 | |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 1423 | CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2 |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 1424 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1425 | Every time you change to a new directory (new for the current session), netrw |
| 1426 | will save the directory in a recently-visited directory history list (unless |
| 1427 | |g:netrw_dirhistmax| is zero; by default, it holds ten entries). With the "u" |
| 1428 | map, one can change to an earlier directory (predecessor). To do the |
| 1429 | opposite, see |netrw-U|. |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 1430 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1431 | The "u" map also accepts counts to go back in the history several slots. For |
| 1432 | your convenience, qb (see |netrw-qb|) lists the history number which may be |
| 1433 | used in that count. |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 1434 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1435 | *.netrwhist* |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 1436 | See |g:netrw_dirhistmax| for how to control the quantity of history stack |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1437 | slots. The file ".netrwhist" holds history when netrw (and vim) is not |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1438 | active. By default, its stored on the first directory on the user's |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1439 | |'runtimepath'|. |
| 1440 | |
| 1441 | Related Topics: |
| 1442 | |netrw-U| changing to a successor directory |
| 1443 | |g:netrw_home| controls where .netrwhist is kept |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 1444 | |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 1445 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1446 | CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2 |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 1447 | |
| 1448 | With the "U" map, one can change to a later directory (successor). |
| 1449 | This map is the opposite of the "u" map. (see |netrw-u|) Use the |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 1450 | qb map to list both the bookmarks and history. (see |netrw-qb|) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1451 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 1452 | The "U" map also accepts counts to go forward in the history several slots. |
| 1453 | |
| 1454 | See |g:netrw_dirhistmax| for how to control the quantity of history stack |
| 1455 | slots. |
| 1456 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1457 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 1458 | CHANGING TREE TOP *netrw-ntree* *:Ntree* *netrw-gn* {{{2 |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 1459 | |
| 1460 | One may specify a new tree top for tree listings using > |
| 1461 | |
| 1462 | :Ntree [dirname] |
| 1463 | |
| 1464 | Without a "dirname", the current line is used (and any leading depth |
| 1465 | information is elided). |
| 1466 | With a "dirname", the specified directory name is used. |
| 1467 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 1468 | The "gn" map will take the word below the cursor and use that for |
| 1469 | changing the top of the tree listing. |
| 1470 | |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 1471 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1472 | NETRW CLEAN *netrw-clean* *:NetrwClean* {{{2 |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1473 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1474 | With :NetrwClean one may easily remove netrw from one's home directory; |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1475 | more precisely, from the first directory on your |'runtimepath'|. |
| 1476 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1477 | With :NetrwClean!, netrw will attempt to remove netrw from all directories on |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 1478 | your |'runtimepath'|. Of course, you have to have write/delete permissions |
| 1479 | correct to do this. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1480 | |
| 1481 | With either form of the command, netrw will first ask for confirmation |
| 1482 | that the removal is in fact what you want to do. If netrw doesn't have |
| 1483 | permission to remove a file, it will issue an error message. |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 1484 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 1485 | *netrw-gx* |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1486 | CUSTOMIZING BROWSING WITH A SPECIAL HANDLER *netrw-x* *netrw-handler* {{{2 |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 1487 | (also see |netrw_filehandler|) |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1488 | |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 1489 | Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1490 | best seen with a special handler (ie. a tool provided with your computer's |
| 1491 | operating system). Netrw allows one to invoke such special handlers by: > |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 1492 | |
| 1493 | * when Exploring, hit the "x" key |
| 1494 | * when editing, hit gx with the cursor atop the special filename |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1495 | < (latter not available if the |g:netrw_nogx| variable exists) |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 1496 | |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 1497 | Netrw determines which special handler by the following method: |
| 1498 | |
| 1499 | * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to |
| 1500 | view files. Examples of useful settings (place into your <.vimrc>): > |
| 1501 | |
| 1502 | :let g:netrw_browsex_viewer= "kfmclient exec" |
| 1503 | < or > |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1504 | :let g:netrw_browsex_viewer= "xdg-open" |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 1505 | < |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1506 | If g:netrw_browsex_viewer == '-', then netrwFileHandlers#Invoke() will be |
| 1507 | used instead (see |netrw_filehandler|). |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1508 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1509 | * for Windows 32 or 64, the URL and FileProtocolHandler dlls are used. |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 1510 | * for Gnome (with gnome-open): gnome-open is used. |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1511 | * for KDE (with kfmclient) : kfmclient is used |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1512 | * for Mac OS X : open is used. |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1513 | * otherwise the netrwFileHandler plugin is used. |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 1514 | |
| 1515 | The file's suffix is used by these various approaches to determine an |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1516 | appropriate application to use to "handle" these files. Such things as |
| 1517 | OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps, |
| 1518 | *.eps) can be handled. |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 1519 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1520 | The gx mapping extends to all buffers; apply "gx" while atop a word and netrw |
| 1521 | will apply a special handler to it (like "x" works when in a netrw buffer). |
| 1522 | One may also use visual mode (see |visual-start|) to select the text that the |
| 1523 | special handler will use. Normally gx uses expand("<cfile>") to pick up the |
| 1524 | text under the cursor; one may change what |expand()| uses via the |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1525 | |g:netrw_gx| variable (options include "<cword>", "<cWORD>"). Note that |
| 1526 | expand("<cfile>") depends on the |'isfname'| setting. Alternatively, one may |
| 1527 | select the text to be used by gx by making a visual selection (see |
| 1528 | |visual-block|) and then pressing gx. |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1529 | |
| 1530 | Associated setting variables: |
| 1531 | |g:netrw_gx| control how gx picks up the text under the cursor |
| 1532 | |g:netrw_nogx| prevent gx map while editing |
Bram Moolenaar | aa3b15d | 2016-04-21 08:53:19 +0200 | [diff] [blame] | 1533 | |g:netrw_suppress_gx_mesg| controls gx's suppression of browser messages |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1534 | |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 1535 | *netrw_filehandler* |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 1536 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1537 | When |g:netrw_browsex_viewer| exists and is "-", then netrw will attempt to |
| 1538 | handle the special file with a vim function. The "x" map applies a function |
| 1539 | to a file, based on its extension. Of course, the handler function must exist |
| 1540 | for it to be called! |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1541 | > |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1542 | Ex. mypgm.html x -> NFH_html("scp://user@host/some/path/mypgm.html") |
| 1543 | |
| 1544 | < Users may write their own netrw File Handler functions to |
| 1545 | support more suffixes with special handling. See |
| 1546 | <autoload/netrwFileHandlers.vim> for examples on how to make |
| 1547 | file handler functions. As an example: > |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1548 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 1549 | " NFH_suffix(filename) |
| 1550 | fun! NFH_suffix(filename) |
| 1551 | ..do something special with filename.. |
| 1552 | endfun |
| 1553 | < |
| 1554 | These functions need to be defined in some file in your .vim/plugin |
| 1555 | (vimfiles\plugin) directory. Vim's function names may not have punctuation |
| 1556 | characters (except for the underscore) in them. To support suffices that |
| 1557 | contain such characters, netrw will first convert the suffix using the |
| 1558 | following table: > |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 1559 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1560 | @ -> AT ! -> EXCLAMATION % -> PERCENT |
| 1561 | : -> COLON = -> EQUAL ? -> QUESTION |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 1562 | , -> COMMA - -> MINUS ; -> SEMICOLON |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1563 | $ -> DOLLAR + -> PLUS ~ -> TILDE |
| 1564 | < |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 1565 | So, for example: > |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 1566 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 1567 | file.rcs,v -> NFH_rcsCOMMAv() |
| 1568 | < |
| 1569 | If more such translations are necessary, please send me email: > |
| 1570 | NdrOchip at ScampbellPfamily.AbizM - NOSPAM |
| 1571 | with a request. |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 1572 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1573 | Associated setting variable: |g:netrw_browsex_viewer| |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1574 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1575 | *netrw-curdir* |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1576 | DELETING BOOKMARKS *netrw-mB* {{{2 |
| 1577 | |
| 1578 | To delete a bookmark, use > |
| 1579 | |
| 1580 | {cnt}mB |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1581 | |
| 1582 | If there are marked files, then mB will remove them from the |
| 1583 | bookmark list. |
| 1584 | |
| 1585 | Alternatively, one may use :NetrwMB! (see |netrw-:NetrwMB|). > |
| 1586 | |
| 1587 | :NetrwMB! [files/directories] |
| 1588 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1589 | Related Topics: |
| 1590 | |netrw-gb| how to return (go) to a bookmark |
| 1591 | |netrw-mb| how to make a bookmark |
| 1592 | |netrw-qb| how to list bookmarks |
| 1593 | |
| 1594 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1595 | DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2 |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1596 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1597 | If files have not been marked with |netrw-mf|: (local marked file list) |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1598 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1599 | Deleting/removing files and directories involves moving the cursor to the |
| 1600 | file/directory to be deleted and pressing "D". Directories must be empty |
| 1601 | first before they can be successfully removed. If the directory is a |
| 1602 | softlink to a directory, then netrw will make two requests to remove the |
| 1603 | directory before succeeding. Netrw will ask for confirmation before doing |
| 1604 | the removal(s). You may select a range of lines with the "V" command |
| 1605 | (visual selection), and then pressing "D". |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 1606 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1607 | If files have been marked with |netrw-mf|: (local marked file list) |
| 1608 | |
| 1609 | Marked files (and empty directories) will be deleted; again, you'll be |
| 1610 | asked to confirm the deletion before it actually takes place. |
| 1611 | |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 1612 | A further approach is to delete files which match a pattern. |
| 1613 | |
| 1614 | * use :MF pattern (see |netrw-:MF|); then press "D". |
| 1615 | |
| 1616 | * use mr (see |netrw-mr|) which will prompt you for pattern. |
| 1617 | This will cause the matching files to be marked. Then, |
| 1618 | press "D". |
| 1619 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1620 | If your vim has 7.4 with patch#1107, then |g:netrw_localrmdir| no longer |
| 1621 | is used to remove directories; instead, vim's |delete()| is used with |
| 1622 | the "d" option. Please note that only empty directories may be deleted |
| 1623 | with the "D" mapping. Regular files are deleted with |delete()|, too. |
| 1624 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1625 | The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 1626 | used to control the attempts to remove remote files and directories. The |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1627 | g:netrw_rm_cmd is used with files, and its default value is: |
| 1628 | |
| 1629 | g:netrw_rm_cmd: ssh HOSTNAME rm |
| 1630 | |
| 1631 | The g:netrw_rmdir_cmd variable is used to support the removal of directories. |
| 1632 | Its default value is: |
| 1633 | |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 1634 | |g:netrw_rmdir_cmd|: ssh HOSTNAME rmdir |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1635 | |
| 1636 | If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt |
| 1637 | to remove it again using the g:netrw_rmf_cmd variable. Its default value is: |
| 1638 | |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 1639 | |g:netrw_rmf_cmd|: ssh HOSTNAME rm -f |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1640 | |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 1641 | Related topics: |netrw-d| |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 1642 | Associated setting variable: |g:netrw_localrmdir| |g:netrw_rm_cmd| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1643 | |g:netrw_rmdir_cmd| |g:netrw_ssh_cmd| |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1644 | |
| 1645 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1646 | *netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore* |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 1647 | *netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore* *netrw-lexplore* |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1648 | DIRECTORY EXPLORATION COMMANDS {{{2 |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1649 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1650 | :[N]Explore[!] [dir]... Explore directory of current file *:Explore* |
| 1651 | :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore* |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1652 | :[N]Lexplore[!] [dir]... Left Explorer Toggle *:Lexplore* |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1653 | :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore* |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1654 | :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore* |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1655 | :Texplore [dir]... Tab & Explore *:Texplore* |
| 1656 | :Rexplore ... Return to/from Explorer *:Rexplore* |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1657 | |
| 1658 | Used with :Explore **/pattern : (also see |netrw-starstar|) |
| 1659 | :Nexplore............. go to next matching file *:Nexplore* |
| 1660 | :Pexplore............. go to previous matching file *:Pexplore* |
| 1661 | |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 1662 | *netrw-:Explore* |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1663 | :Explore will open the local-directory browser on the current file's |
| 1664 | directory (or on directory [dir] if specified). The window will be |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1665 | split only if the file has been modified and |'hidden'| is not set, |
| 1666 | otherwise the browsing window will take over that window. Normally |
| 1667 | the splitting is taken horizontally. |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 1668 | Also see: |netrw-:Rexplore| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1669 | :Explore! is like :Explore, but will use vertical splitting. |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1670 | |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 1671 | *netrw-:Hexplore* |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1672 | :Hexplore [dir] does an :Explore with |:belowright| horizontal splitting. |
| 1673 | :Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting. |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1674 | |
| 1675 | *netrw-:Lexplore* |
| 1676 | :[N]Lexplore [dir] toggles a full height Explorer window on the left hand side |
| 1677 | of the current tab. It will open a netrw window on the current |
| 1678 | directory if [dir] is omitted; a :Lexplore [dir] will show the |
| 1679 | specified directory in the left-hand side browser display no matter |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 1680 | from which window the command is issued. |
| 1681 | |
| 1682 | By default, :Lexplore will change an uninitialized |g:netrw_chgwin| |
| 1683 | to 2; edits will thus preferentially be made in window#2. |
| 1684 | |
| 1685 | The [N] specifies a |g:netrw_winsize| just for the new :Lexplore |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1686 | window. |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 1687 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1688 | Those who like this method often also like tree style displays; |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1689 | see |g:netrw_liststyle|. |
| 1690 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1691 | :[N]Lexplore! [dir] is similar to :Lexplore, except that the full-height |
| 1692 | Explorer window will open on the right hand side and an |
| 1693 | uninitialized |g:netrw_chgwin| will be set to 1 (eg. edits will |
| 1694 | preferentially occur in the leftmost window). |
| 1695 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 1696 | Also see: |netrw-C| |g:netrw_browse_split| |g:netrw_wiw| |
| 1697 | |netrw-p| |netrw-P| |g:netrw_chgwin| |
| 1698 | |netrw-c-tab| |g:netrw_winsize| |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1699 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1700 | *netrw-:Sexplore* |
| 1701 | :[N]Sexplore will always split the window before invoking the local-directory |
| 1702 | browser. As with Explore, the splitting is normally done |
| 1703 | horizontally. |
| 1704 | :[N]Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically. |
| 1705 | |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 1706 | *netrw-:Texplore* |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 1707 | :Texplore [dir] does a |:tabnew| before generating the browser window |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1708 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1709 | *netrw-:Vexplore* |
| 1710 | :[N]Vexplore [dir] does an :Explore with |:leftabove| vertical splitting. |
| 1711 | :[N]Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1712 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1713 | The optional parameters are: |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1714 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1715 | [N]: This parameter will override |g:netrw_winsize| to specify the quantity of |
| 1716 | rows and/or columns the new explorer window should have. |
| 1717 | Otherwise, the |g:netrw_winsize| variable, if it has been specified by the |
| 1718 | user, is used to control the quantity of rows and/or columns new |
| 1719 | explorer windows should have. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1720 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1721 | [dir]: By default, these explorer commands use the current file's directory. |
| 1722 | However, one may explicitly provide a directory (path) to use instead; |
| 1723 | ie. > |
| 1724 | |
| 1725 | :Explore /some/path |
| 1726 | < |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 1727 | *netrw-:Rexplore* |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1728 | :Rexplore This command is a little different from the other Explore commands |
| 1729 | as it doesn't necessarily open an Explorer window. |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 1730 | |
| 1731 | Return to Explorer~ |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1732 | When one edits a file using netrw which can occur, for example, |
| 1733 | when pressing <cr> while the cursor is atop a filename in a netrw |
| 1734 | browser window, a :Rexplore issued while editing that file will |
| 1735 | return the display to that of the last netrw browser display in |
| 1736 | that window. |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 1737 | |
| 1738 | Return from Explorer~ |
| 1739 | Conversely, when one is editing a directory, issuing a :Rexplore |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 1740 | will return to editing the file that was last edited in that |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 1741 | window. |
| 1742 | |
| 1743 | The <2-leftmouse> map (which is only available under gvim and |
| 1744 | cooperative terms) does the same as :Rexplore. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1745 | |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 1746 | Also see: |g:netrw_alto| |g:netrw_altv| |g:netrw_winsize| |
| 1747 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1748 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1749 | *netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat* *netrw-grep* |
| 1750 | EXPLORING WITH STARS AND PATTERNS {{{2 |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1751 | |
| 1752 | When Explore, Sexplore, Hexplore, or Vexplore are used with one of the |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 1753 | following four patterns Explore generates a list of files which satisfy the |
| 1754 | request for the local file system. These exploration patterns will not work |
| 1755 | with remote file browsing. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1756 | |
| 1757 | */filepat files in current directory which satisfy filepat |
| 1758 | **/filepat files in current directory or below which satisfy the |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1759 | file pattern |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1760 | *//pattern files in the current directory which contain the |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1761 | pattern (vimgrep is used) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1762 | **//pattern files in the current directory or below which contain |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1763 | the pattern (vimgrep is used) |
Bram Moolenaar | 572cb56 | 2005-08-05 21:35:02 +0000 | [diff] [blame] | 1764 | < |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1765 | The cursor will be placed on the first file in the list. One may then |
| 1766 | continue to go to subsequent files on that list via |:Nexplore| or to |
| 1767 | preceding files on that list with |:Pexplore|. Explore will update the |
| 1768 | directory and place the cursor appropriately. |
| 1769 | |
| 1770 | A plain > |
| 1771 | :Explore |
| 1772 | will clear the explore list. |
| 1773 | |
| 1774 | If your console or gui produces recognizable shift-up or shift-down sequences, |
| 1775 | then you'll likely find using shift-downarrow and shift-uparrow convenient. |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1776 | They're mapped by netrw as follows: |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1777 | |
| 1778 | <s-down> == Nexplore, and |
| 1779 | <s-up> == Pexplore. |
| 1780 | |
| 1781 | As an example, consider |
| 1782 | > |
| 1783 | :Explore */*.c |
| 1784 | :Nexplore |
| 1785 | :Nexplore |
| 1786 | :Pexplore |
| 1787 | < |
| 1788 | The status line will show, on the right hand side of the status line, a |
| 1789 | message like "Match 3 of 20". |
| 1790 | |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 1791 | Associated setting variables: |
| 1792 | |g:netrw_keepdir| |g:netrw_browse_split| |
| 1793 | |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject| |
| 1794 | |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd| |
| 1795 | |g:netrw_ftp_timelist_cmd| |g:netrw_list_cmd| |
| 1796 | |g:netrw_liststyle| |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1797 | |
| 1798 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1799 | DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2 |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1800 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1801 | With the cursor atop a filename, pressing "qf" will reveal the file's size |
| 1802 | and last modification timestamp. Currently this capability is only available |
| 1803 | for local files. |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 1804 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1805 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1806 | EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2 |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1807 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1808 | The "<ctrl-h>" map brings up a requestor allowing the user to change the |
| 1809 | file/directory hiding list contained in |g:netrw_list_hide|. The hiding list |
| 1810 | consists of one or more patterns delimited by commas. Files and/or |
| 1811 | directories satisfying these patterns will either be hidden (ie. not shown) or |
| 1812 | be the only ones displayed (see |netrw-a|). |
| 1813 | |
| 1814 | The "gh" mapping (see |netrw-gh|) quickly alternates between the usual |
| 1815 | hiding list and the hiding of files or directories that begin with ".". |
| 1816 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1817 | As an example, > |
| 1818 | let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+' |
| 1819 | Effectively, this makes the effect of a |netrw-gh| command the initial setting. |
| 1820 | What it means: |
| 1821 | |
| 1822 | \(^\|\s\s\) : if the line begins with the following, -or- |
| 1823 | two consecutive spaces are encountered |
| 1824 | \zs : start the hiding match now |
| 1825 | \. : if it now begins with a dot |
| 1826 | \S\+ : and is followed by one or more non-whitespace |
| 1827 | characters |
| 1828 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1829 | Associated setting variables: |g:netrw_hide| |g:netrw_list_hide| |
| 1830 | Associated topics: |netrw-a| |netrw-gh| |netrw-mh| |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1831 | |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 1832 | *netrw-sort-sequence* |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1833 | EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2 |
| 1834 | |
| 1835 | When "Sorted by" is name, one may specify priority via the sorting sequence |
| 1836 | (g:netrw_sort_sequence). The sorting sequence typically prioritizes the |
| 1837 | name-listing by suffix, although any pattern will do. Patterns are delimited |
| 1838 | by commas. The default sorting sequence is (all one line): |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1839 | |
| 1840 | For Unix: > |
| 1841 | '[\/]$,\<core\%(\.\d\+\)\=,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$, |
| 1842 | \.info$,\.swp$,\.bak$,\~$' |
| 1843 | < |
| 1844 | Otherwise: > |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1845 | '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$, |
| 1846 | \.swp$,\.bak$,\~$' |
| 1847 | < |
| 1848 | The lone * is where all filenames not covered by one of the other patterns |
| 1849 | will end up. One may change the sorting sequence by modifying the |
| 1850 | g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by |
| 1851 | using the "S" map. |
| 1852 | |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 1853 | Related topics: |netrw-s| |netrw-S| |
| 1854 | Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1855 | |
| 1856 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1857 | EXECUTING FILE UNDER CURSOR VIA SYSTEM() *netrw-X* {{{2 |
Bram Moolenaar | 97d6249 | 2012-11-15 21:28:22 +0100 | [diff] [blame] | 1858 | |
| 1859 | Pressing X while the cursor is atop an executable file will yield a prompt |
| 1860 | using the filename asking for any arguments. Upon pressing a [return], netrw |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 1861 | will then call |system()| with that command and arguments. The result will be |
| 1862 | displayed by |:echomsg|, and so |:messages| will repeat display of the result. |
| 1863 | Ansi escape sequences will be stripped out. |
| 1864 | |
| 1865 | See |cmdline-window| for directions for more on how to edit the arguments. |
Bram Moolenaar | 97d6249 | 2012-11-15 21:28:22 +0100 | [diff] [blame] | 1866 | |
| 1867 | |
Bram Moolenaar | adc2182 | 2011-04-01 18:03:16 +0200 | [diff] [blame] | 1868 | FORCING TREATMENT AS A FILE OR DIRECTORY *netrw-gd* *netrw-gf* {{{2 |
| 1869 | |
| 1870 | Remote symbolic links (ie. those listed via ssh or ftp) are problematic |
| 1871 | in that it is difficult to tell whether they link to a file or to a |
| 1872 | directory. |
| 1873 | |
| 1874 | To force treatment as a file: use > |
Bram Moolenaar | 97d6249 | 2012-11-15 21:28:22 +0100 | [diff] [blame] | 1875 | gf |
Bram Moolenaar | adc2182 | 2011-04-01 18:03:16 +0200 | [diff] [blame] | 1876 | < |
| 1877 | To force treatment as a directory: use > |
Bram Moolenaar | 97d6249 | 2012-11-15 21:28:22 +0100 | [diff] [blame] | 1878 | gd |
Bram Moolenaar | adc2182 | 2011-04-01 18:03:16 +0200 | [diff] [blame] | 1879 | < |
| 1880 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1881 | GOING UP *netrw--* {{{2 |
| 1882 | |
| 1883 | To go up a directory, press "-" or press the <cr> when atop the ../ directory |
| 1884 | entry in the listing. |
| 1885 | |
| 1886 | Netrw will use the command in |g:netrw_list_cmd| to perform the directory |
| 1887 | listing operation after changing HOSTNAME to the host specified by the |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 1888 | user-prpvided url. By default netrw provides the command as: > |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1889 | |
| 1890 | ssh HOSTNAME ls -FLa |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 1891 | < |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1892 | where the HOSTNAME becomes the [user@]hostname as requested by the attempt to |
| 1893 | read. Naturally, the user may override this command with whatever is |
| 1894 | preferred. The NetList function which implements remote browsing |
| 1895 | expects that directories will be flagged by a trailing slash. |
| 1896 | |
| 1897 | |
| 1898 | HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2 |
| 1899 | |
| 1900 | Netrw's browsing facility allows one to use the hiding list in one of three |
| 1901 | ways: ignore it, hide files which match, and show only those files which |
| 1902 | match. |
| 1903 | |
| 1904 | If no files have been marked via |netrw-mf|: |
| 1905 | |
| 1906 | The "a" map allows the user to cycle through the three hiding modes. |
| 1907 | |
| 1908 | The |g:netrw_list_hide| variable holds a comma delimited list of patterns |
| 1909 | based on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list. |
| 1910 | (also see |netrw-ctrl-h|) To set the hiding list, use the <c-h> map. As an |
| 1911 | example, to hide files which begin with a ".", one may use the <c-h> map to |
| 1912 | set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*' |
| 1913 | in one's <.vimrc>). One may then use the "a" key to show all files, hide |
| 1914 | matching files, or to show only the matching files. |
| 1915 | |
| 1916 | Example: \.[ch]$ |
| 1917 | This hiding list command will hide/show all *.c and *.h files. |
| 1918 | |
| 1919 | Example: \.c$,\.h$ |
| 1920 | This hiding list command will also hide/show all *.c and *.h |
| 1921 | files. |
| 1922 | |
| 1923 | Don't forget to use the "a" map to select the mode (normal/hiding/show) you |
| 1924 | want! |
| 1925 | |
| 1926 | If files have been marked using |netrw-mf|, then this command will: |
| 1927 | |
| 1928 | if showing all files or non-hidden files: |
| 1929 | modify the g:netrw_list_hide list by appending the marked files to it |
| 1930 | and showing only non-hidden files. |
| 1931 | |
| 1932 | else if showing hidden files only: |
| 1933 | modify the g:netrw_list_hide list by removing the marked files from it |
| 1934 | and showing only non-hidden files. |
| 1935 | endif |
| 1936 | |
| 1937 | *netrw-gh* *netrw-hide* |
| 1938 | As a quick shortcut, one may press > |
| 1939 | gh |
| 1940 | to toggle between hiding files which begin with a period (dot) and not hiding |
| 1941 | them. |
| 1942 | |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 1943 | Associated setting variables: |g:netrw_list_hide| |g:netrw_hide| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1944 | Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh| |
| 1945 | |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 1946 | *netrw-gitignore* |
| 1947 | Netrw provides a helper function 'netrw_gitignore#Hide()' that, when used with |
| 1948 | |g:netrw_list_hide| automatically hides all git-ignored files. |
| 1949 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1950 | 'netrw_gitignore#Hide' searches for patterns in the following files: > |
| 1951 | |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 1952 | './.gitignore' |
| 1953 | './.git/info/exclude' |
| 1954 | global gitignore file: `git config --global core.excludesfile` |
| 1955 | system gitignore file: `git config --system core.excludesfile` |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1956 | < |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 1957 | Files that do not exist, are ignored. |
| 1958 | Git-ignore patterns are taken from existing files, and converted to patterns for |
| 1959 | hiding files. For example, if you had '*.log' in your '.gitignore' file, it |
| 1960 | would be converted to '.*\.log'. |
| 1961 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1962 | To use this function, simply assign its output to |g:netrw_list_hide| option. > |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 1963 | |
| 1964 | Example: let g:netrw_list_hide= netrw_gitignore#Hide() |
| 1965 | Git-ignored files are hidden in Netrw. |
| 1966 | |
| 1967 | Example: let g:netrw_list_hide= netrw_gitignore#Hide('my_gitignore_file') |
| 1968 | Function can take additional files with git-ignore patterns. |
| 1969 | |
| 1970 | Example: g:netrw_list_hide= netrw_gitignore#Hide() . '.*\.swp$' |
| 1971 | Combining 'netrw_gitignore#Hide' with custom patterns. |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 1972 | < |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 1973 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1974 | IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2 |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1975 | |
| 1976 | Especially with the remote directory browser, constantly entering the password |
| 1977 | is tedious. |
| 1978 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 1979 | For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength |
Bram Moolenaar | 7aa9f6a | 2007-05-10 18:00:30 +0000 | [diff] [blame] | 1980 | tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip |
| 1981 | for setting up no-password ssh and scp and discusses associated security |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 1982 | issues. It used to be available at http://hacks.oreilly.com/pub/h/66 , |
| 1983 | but apparently that address is now being redirected to some "hackzine". |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 1984 | I'll attempt a summary based on that article and on a communication from |
| 1985 | Ben Schmidt: |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1986 | |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 1987 | 1. Generate a public/private key pair on the local machine |
| 1988 | (ssh client): > |
| 1989 | ssh-keygen -t rsa |
| 1990 | (saving the file in ~/.ssh/id_rsa as prompted) |
| 1991 | < |
| 1992 | 2. Just hit the <CR> when asked for passphrase (twice) for no |
| 1993 | passphrase. If you do use a passphrase, you will also need to use |
| 1994 | ssh-agent so you only have to type the passphrase once per session. |
| 1995 | If you don't use a passphrase, simply logging onto your local |
| 1996 | computer or getting access to the keyfile in any way will suffice |
| 1997 | to access any ssh servers which have that key authorized for login. |
| 1998 | |
| 1999 | 3. This creates two files: > |
| 2000 | ~/.ssh/id_rsa |
| 2001 | ~/.ssh/id_rsa.pub |
| 2002 | < |
| 2003 | 4. On the target machine (ssh server): > |
| 2004 | cd |
| 2005 | mkdir -p .ssh |
| 2006 | chmod 0700 .ssh |
| 2007 | < |
| 2008 | 5. On your local machine (ssh client): (one line) > |
| 2009 | ssh {serverhostname} |
| 2010 | cat '>>' '~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub |
| 2011 | < |
| 2012 | or, for OpenSSH, (one line) > |
| 2013 | ssh {serverhostname} |
| 2014 | cat '>>' '~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub |
| 2015 | < |
| 2016 | You can test it out with > |
| 2017 | ssh {serverhostname} |
| 2018 | and you should be log onto the server machine without further need to type |
| 2019 | anything. |
| 2020 | |
| 2021 | If you decided to use a passphrase, do: > |
| 2022 | ssh-agent $SHELL |
| 2023 | ssh-add |
| 2024 | ssh {serverhostname} |
| 2025 | You will be prompted for your key passphrase when you use ssh-add, but not |
| 2026 | subsequently when you use ssh. For use with vim, you can use > |
| 2027 | ssh-agent vim |
| 2028 | and, when next within vim, use > |
| 2029 | :!ssh-add |
| 2030 | Alternatively, you can apply ssh-agent to the terminal you're planning on |
| 2031 | running vim in: > |
| 2032 | ssh-agent xterm & |
| 2033 | and do ssh-add whenever you need. |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 2034 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 2035 | For Windows, folks on the vim mailing list have mentioned that Pageant helps |
| 2036 | with avoiding the constant need to enter the password. |
Bram Moolenaar | 433f7c8 | 2006-03-21 21:29:36 +0000 | [diff] [blame] | 2037 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2038 | Kingston Fung wrote about another way to avoid constantly needing to enter |
| 2039 | passwords: |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 2040 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2041 | In order to avoid the need to type in the password for scp each time, you |
| 2042 | provide a hack in the docs to set up a non password ssh account. I found a |
| 2043 | better way to do that: I can use a regular ssh account which uses a |
| 2044 | password to access the material without the need to key-in the password |
| 2045 | each time. It's good for security and convenience. I tried ssh public key |
| 2046 | authorization + ssh-agent, implementing this, and it works! Here are two |
| 2047 | links with instructions: |
| 2048 | |
| 2049 | http://www.ibm.com/developerworks/library/l-keyc2/ |
| 2050 | http://sial.org/howto/openssh/publickey-auth/ |
| 2051 | |
| 2052 | |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 2053 | Ssh hints: |
| 2054 | |
| 2055 | Thomer Gil has provided a hint on how to speed up netrw+ssh: |
| 2056 | http://thomer.com/howtos/netrw_ssh.html |
| 2057 | |
| 2058 | Alex Young has several hints on speeding ssh up: |
| 2059 | http://usevim.com/2012/03/16/editing-remote-files/ |
| 2060 | |
| 2061 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2062 | LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2 |
| 2063 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2064 | Pressing "qb" (query bookmarks) will list both the bookmarked directories and |
| 2065 | directory traversal history. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2066 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2067 | Related Topics: |
| 2068 | |netrw-gb| how to return (go) to a bookmark |
| 2069 | |netrw-mb| how to make a bookmark |
| 2070 | |netrw-mB| how to delete bookmarks |
| 2071 | |netrw-u| change to a predecessor directory via the history stack |
| 2072 | |netrw-U| change to a successor directory via the history stack |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2073 | |
| 2074 | MAKING A NEW DIRECTORY *netrw-d* {{{2 |
| 2075 | |
| 2076 | With the "d" map one may make a new directory either remotely (which depends |
| 2077 | on the global variable g:netrw_mkdir_cmd) or locally (which depends on the |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 2078 | global variable g:netrw_localmkdir). Netrw will issue a request for the new |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2079 | directory's name. A bare <CR> at that point will abort the making of the |
| 2080 | directory. Attempts to make a local directory that already exists (as either |
| 2081 | a file or a directory) will be detected, reported on, and ignored. |
| 2082 | |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 2083 | Related topics: |netrw-D| |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 2084 | Associated setting variables: |g:netrw_localmkdir| |g:netrw_mkdir_cmd| |
| 2085 | |g:netrw_remote_mkdir| |netrw-%| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2086 | |
| 2087 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2088 | MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-cd* {{{2 |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2089 | |
| 2090 | By default, |g:netrw_keepdir| is 1. This setting means that the current |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2091 | directory will not track the browsing directory. (done for backwards |
| 2092 | compatibility with v6's file explorer). |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2093 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2094 | Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2095 | track netrw's browsing directory. |
| 2096 | |
| 2097 | However, given the default setting for g:netrw_keepdir of 1 where netrw |
| 2098 | maintains its own separate notion of the current directory, in order to make |
| 2099 | the two directories the same, use the "c" map (just type c). That map will |
| 2100 | set Vim's notion of the current directory to netrw's current browsing |
| 2101 | directory. |
| 2102 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2103 | *netrw-c* : This map's name has been changed from "c" to cd (see |netrw-cd|). |
| 2104 | This change was done to allow for |netrw-cb| and |netrw-cB| maps. |
| 2105 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2106 | Associated setting variable: |g:netrw_keepdir| |
| 2107 | |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2108 | MARKING FILES *netrw-:MF* *netrw-mf* {{{2 |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2109 | (also see |netrw-mr|) |
| 2110 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2111 | Netrw provides several ways to mark files: |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2112 | |
| 2113 | * One may mark files with the cursor atop a filename and |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 2114 | then pressing "mf". |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2115 | |
| 2116 | * With gvim, in addition one may mark files with |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 2117 | <s-leftmouse>. (see |netrw-mouse|) |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2118 | |
| 2119 | * One may use the :MF command, which takes a list of |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 2120 | files (for local directories, the list may include |
| 2121 | wildcards -- see |glob()|) > |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2122 | |
| 2123 | :MF *.c |
| 2124 | < |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 2125 | (Note that :MF uses |<f-args>| to break the line |
| 2126 | at spaces) |
| 2127 | |
| 2128 | * Mark files using the |argument-list| (|netrw-mA|) |
| 2129 | |
| 2130 | * Mark files based upon a |location-list| (|netrw-qL|) |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 2131 | |
| 2132 | * Mark files based upon the quickfix list (|netrw-qF|) |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 2133 | (|quickfix-error-lists|) |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2134 | |
| 2135 | The following netrw maps make use of marked files: |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2136 | |
| 2137 | |netrw-a| Hide marked files/directories |
| 2138 | |netrw-D| Delete marked files/directories |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 2139 | |netrw-ma| Move marked files' names to |arglist| |
| 2140 | |netrw-mA| Move |arglist| filenames to marked file list |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2141 | |netrw-mb| Append marked files to bookmarks |
| 2142 | |netrw-mB| Delete marked files from bookmarks |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2143 | |netrw-mc| Copy marked files to target |
| 2144 | |netrw-md| Apply vimdiff to marked files |
| 2145 | |netrw-me| Edit marked files |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2146 | |netrw-mF| Unmark marked files |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2147 | |netrw-mg| Apply vimgrep to marked files |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2148 | |netrw-mm| Move marked files to target |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2149 | |netrw-mp| Print marked files |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2150 | |netrw-ms| Netrw will source marked files |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2151 | |netrw-mt| Set target for |netrw-mm| and |netrw-mc| |
| 2152 | |netrw-mT| Generate tags using marked files |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2153 | |netrw-mv| Apply vim command to marked files |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2154 | |netrw-mx| Apply shell command to marked files |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2155 | |netrw-mX| Apply shell command to marked files, en bloc |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2156 | |netrw-mz| Compress/Decompress marked files |
| 2157 | |netrw-O| Obtain marked files |
| 2158 | |netrw-R| Rename marked files |
| 2159 | |
| 2160 | One may unmark files one at a time the same way one marks them; ie. place |
| 2161 | the cursor atop a marked file and press "mf". This process also works |
| 2162 | with <s-leftmouse> using gvim. One may unmark all files by pressing |
| 2163 | "mu" (see |netrw-mu|). |
| 2164 | |
Bram Moolenaar | adc2182 | 2011-04-01 18:03:16 +0200 | [diff] [blame] | 2165 | Marked files are highlighted using the "netrwMarkFile" highlighting group, |
| 2166 | which by default is linked to "Identifier" (see Identifier under |
| 2167 | |group-name|). You may change the highlighting group by putting something |
| 2168 | like > |
| 2169 | |
| 2170 | highlight clear netrwMarkFile |
| 2171 | hi link netrwMarkFile ..whatever.. |
| 2172 | < |
| 2173 | into $HOME/.vim/after/syntax/netrw.vim . |
| 2174 | |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 2175 | If the mouse is enabled and works with your vim, you may use <s-leftmouse> to |
| 2176 | mark one or more files. You may mark multiple files by dragging the shifted |
| 2177 | leftmouse. (see |netrw-mouse|) |
| 2178 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2179 | *markfilelist* *global_markfilelist* *local_markfilelist* |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2180 | All marked files are entered onto the global marked file list; there is only |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2181 | one such list. In addition, every netrw buffer also has its own buffer-local |
| 2182 | marked file list; since netrw buffers are associated with specific |
| 2183 | directories, this means that each directory has its own local marked file |
| 2184 | list. The various commands which operate on marked files use one or the other |
| 2185 | of the marked file lists. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2186 | |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2187 | Known Problem: if one is using tree mode (|g:netrw_liststyle|) and several |
| 2188 | directories have files with the same name, then marking such a file will |
| 2189 | result in all such files being highlighted as if they were all marked. The |
| 2190 | |markfilelist|, however, will only have the selected file in it. This problem |
| 2191 | is unlikely to be fixed. |
| 2192 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2193 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2194 | UNMARKING FILES *netrw-mF* {{{2 |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2195 | (also see |netrw-mf|, |netrw-mu|) |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2196 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2197 | The "mF" command will unmark all files in the current buffer. One may also use |
| 2198 | mf (|netrw-mf|) on a specific, already marked, file to unmark just that file. |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2199 | |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 2200 | MARKING FILES BY LOCATION LIST *netrw-qL* {{{2 |
| 2201 | (also see |netrw-mf|) |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2202 | |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 2203 | One may convert |location-list|s into a marked file list using "qL". |
| 2204 | You may then proceed with commands such as me (|netrw-me|) to edit them. |
| 2205 | |
| 2206 | |
| 2207 | MARKING FILES BY QUICKFIX LIST *netrw-qF* {{{2 |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2208 | (also see |netrw-mf|) |
| 2209 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2210 | One may convert |quickfix-error-lists| into a marked file list using "qF". |
| 2211 | You may then proceed with commands such as me (|netrw-me|) to edit them. |
| 2212 | Quickfix error lists are generated, for example, by calls to |:vimgrep|. |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2213 | |
| 2214 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2215 | MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2 |
| 2216 | (also see |netrw-mf|) |
| 2217 | |
| 2218 | One may also mark files by pressing "mr"; netrw will then issue a prompt, |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2219 | "Enter regexp: ". You may then enter a shell-style regular expression such |
| 2220 | as *.c$ (see |glob()|). For remote systems, glob() doesn't work -- so netrw |
| 2221 | converts "*" into ".*" (see |regexp|) and marks files based on that. In the |
| 2222 | future I may make it possible to use |regexp|s instead of glob()-style |
| 2223 | expressions (yet-another-option). |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2224 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2225 | See |cmdline-window| for directions on more on how to edit the regular |
| 2226 | expression. |
| 2227 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2228 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2229 | MARKED FILES, ARBITRARY VIM COMMAND *netrw-mv* {{{2 |
| 2230 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2231 | (uses the local marked-file list) |
| 2232 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2233 | The "mv" map causes netrw to execute an arbitrary vim command on each file on |
| 2234 | the local marked file list, individually: |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2235 | |
| 2236 | * 1split |
| 2237 | * sil! keepalt e file |
| 2238 | * run vim command |
| 2239 | * sil! keepalt wq! |
| 2240 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2241 | A prompt, "Enter vim command: ", will be issued to elicit the vim command you |
| 2242 | wish used. See |cmdline-window| for directions for more on how to edit the |
| 2243 | command. |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2244 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2245 | |
| 2246 | MARKED FILES, ARBITRARY SHELL COMMAND *netrw-mx* {{{2 |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2247 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2248 | (uses the local marked-file list) |
| 2249 | |
| 2250 | Upon activation of the "mx" map, netrw will query the user for some (external) |
| 2251 | command to be applied to all marked files. All "%"s in the command will be |
| 2252 | substituted with the name of each marked file in turn. If no "%"s are in the |
| 2253 | command, then the command will be followed by a space and a marked filename. |
| 2254 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2255 | Example: |
| 2256 | (mark files) |
| 2257 | mx |
| 2258 | Enter command: cat |
| 2259 | |
| 2260 | The result is a series of shell commands: |
| 2261 | cat 'file1' |
| 2262 | cat 'file2' |
| 2263 | ... |
| 2264 | |
| 2265 | |
| 2266 | MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOC *netrw-mX* {{{2 |
| 2267 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2268 | (uses the global marked-file list) |
| 2269 | |
| 2270 | Upon activation of the 'mX' map, netrw will query the user for some (external) |
| 2271 | command to be applied to all marked files on the global marked file list. The |
| 2272 | "en bloc" means that one command will be executed on all the files at once: > |
| 2273 | |
| 2274 | command files |
| 2275 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2276 | This approach is useful, for example, to select files and make a tarball: > |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2277 | |
| 2278 | (mark files) |
| 2279 | mX |
| 2280 | Enter command: tar cf mynewtarball.tar |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2281 | < |
| 2282 | The command that will be run with this example: |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2283 | |
| 2284 | tar cf mynewtarball.tar 'file1' 'file2' ... |
| 2285 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2286 | |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 2287 | MARKED FILES: ARGUMENT LIST *netrw-ma* *netrw-mA* |
| 2288 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2289 | (uses the global marked-file list) |
| 2290 | |
| 2291 | Using ma, one moves filenames from the marked file list to the argument list. |
| 2292 | Using mA, one moves filenames from the argument list to the marked file list. |
| 2293 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2294 | See Also: |netrw-cb| |netrw-cB| |netrw-qF| |argument-list| |:args| |
| 2295 | |
| 2296 | |
| 2297 | MARKED FILES: BUFFER LIST *netrw-cb* *netrw-cB* |
| 2298 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2299 | (uses the global marked-file list) |
| 2300 | |
| 2301 | Using cb, one moves filenames from the marked file list to the buffer list. |
| 2302 | Using cB, one copies filenames from the buffer list to the marked file list. |
| 2303 | |
| 2304 | See Also: |netrw-ma| |netrw-mA| |netrw-qF| |buffer-list| |:buffers| |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 2305 | |
| 2306 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2307 | MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2 |
| 2308 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2309 | (uses the local marked file list) |
| 2310 | |
| 2311 | If any marked files are compressed, then "mz" will decompress them. |
| 2312 | If any marked files are decompressed, then "mz" will compress them |
| 2313 | using the command specified by |g:netrw_compress|; by default, |
| 2314 | that's "gzip". |
| 2315 | |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 2316 | For decompression, netrw uses a |Dictionary| of suffices and their |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2317 | associated decompressing utilities; see |g:netrw_decompress|. |
| 2318 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2319 | Remember that one can mark multiple files by regular expression |
| 2320 | (see |netrw-mr|); this is particularly useful to facilitate compressing and |
| 2321 | decompressing a large number of files. |
| 2322 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2323 | Associated setting variables: |g:netrw_compress| |g:netrw_decompress| |
| 2324 | |
| 2325 | MARKED FILES: COPYING *netrw-mc* {{{2 |
| 2326 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2327 | (Uses the global marked file list) |
| 2328 | |
| 2329 | Select a target directory with mt (|netrw-mt|). Then change directory, |
Bram Moolenaar | adc2182 | 2011-04-01 18:03:16 +0200 | [diff] [blame] | 2330 | select file(s) (see |netrw-mf|), and press "mc". The copy is done |
| 2331 | from the current window (where one does the mf) to the target. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2332 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2333 | If one does not have a target directory set with |netrw-mt|, then netrw |
| 2334 | will query you for a directory to copy to. |
| 2335 | |
| 2336 | One may also copy directories and their contents (local only) to a target |
| 2337 | directory. |
| 2338 | |
| 2339 | Associated setting variables: |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2340 | |g:netrw_localcopycmd| |g:netrw_localcopycmdopt| |
| 2341 | |g:netrw_localcopydircmd| |g:netrw_localcopydircmdopt| |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2342 | |g:netrw_ssh_cmd| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2343 | |
| 2344 | MARKED FILES: DIFF *netrw-md* {{{2 |
| 2345 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2346 | (uses the global marked file list) |
| 2347 | |
| 2348 | Use |vimdiff| to visualize difference between selected files (two or |
| 2349 | three may be selected for this). Uses the global marked file list. |
| 2350 | |
| 2351 | MARKED FILES: EDITING *netrw-me* {{{2 |
| 2352 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2353 | (uses the global marked file list) |
| 2354 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2355 | The "me" command will place the marked files on the |arglist| and commence |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2356 | editing them. One may return the to explorer window with |:Rexplore|. |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2357 | (use |:n| and |:p| to edit next and previous files in the arglist) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2358 | |
| 2359 | MARKED FILES: GREP *netrw-mg* {{{2 |
| 2360 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2361 | (uses the global marked file list) |
| 2362 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2363 | The "mg" command will apply |:vimgrep| to the marked files. |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2364 | The command will ask for the requested pattern; one may then enter: > |
| 2365 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2366 | /pattern/[g][j] |
| 2367 | ! /pattern/[g][j] |
| 2368 | pattern |
| 2369 | < |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2370 | With /pattern/, editing will start with the first item on the |quickfix| list |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 2371 | that vimgrep sets up (see |:copen|, |:cnext|, |:cprevious|, |:cclose|). The |:vimgrep| |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2372 | command is in use, so without 'g' each line is added to quickfix list only |
| 2373 | once; with 'g' every match is included. |
| 2374 | |
| 2375 | With /pattern/j, "mg" will winnow the current marked file list to just those |
| 2376 | marked files also possessing the specified pattern. Thus, one may use > |
| 2377 | |
| 2378 | mr ...file-pattern... |
| 2379 | mg /pattern/j |
| 2380 | < |
| 2381 | to have a marked file list satisfying the file-pattern but also restricted to |
| 2382 | files containing some desired pattern. |
| 2383 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2384 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2385 | MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2 |
| 2386 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2387 | (uses the local marked file list) |
| 2388 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2389 | The "mh" command extracts the suffices of the marked files and toggles their |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2390 | presence on the hiding list. Please note that marking the same suffix |
| 2391 | this way multiple times will result in the suffix's presence being toggled |
| 2392 | for each file (so an even quantity of marked files having the same suffix |
| 2393 | is the same as not having bothered to select them at all). |
| 2394 | |
| 2395 | Related topics: |netrw-a| |g:netrw_list_hide| |
| 2396 | |
| 2397 | MARKED FILES: MOVING *netrw-mm* {{{2 |
| 2398 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2399 | (uses the global marked file list) |
| 2400 | |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 2401 | WARNING: moving files is more dangerous than copying them. |
| 2402 | A file being moved is first copied and then deleted; if the |
| 2403 | copy operation fails and the delete succeeds, you will lose |
| 2404 | the file. Either try things out with unimportant files |
| 2405 | first or do the copy and then delete yourself using mc and D. |
| 2406 | Use at your own risk! |
| 2407 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2408 | Select a target directory with mt (|netrw-mt|). Then change directory, |
Bram Moolenaar | adc2182 | 2011-04-01 18:03:16 +0200 | [diff] [blame] | 2409 | select file(s) (see |netrw-mf|), and press "mm". The move is done |
| 2410 | from the current window (where one does the mf) to the target. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2411 | |
| 2412 | Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd| |
| 2413 | |
| 2414 | MARKED FILES: PRINTING *netrw-mp* {{{2 |
| 2415 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2416 | (uses the local marked file list) |
| 2417 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2418 | When "mp" is used, netrw will apply the |:hardcopy| command to marked files. |
| 2419 | What netrw does is open each file in a one-line window, execute hardcopy, then |
| 2420 | close the one-line window. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2421 | |
| 2422 | |
| 2423 | MARKED FILES: SOURCING *netrw-ms* {{{2 |
| 2424 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2425 | (uses the local marked file list) |
| 2426 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2427 | With "ms", netrw will source the marked files (using vim's |:source| command) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2428 | |
| 2429 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2430 | MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2 |
| 2431 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2432 | |
| 2433 | Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|): |
| 2434 | |
| 2435 | * If the cursor is atop a file name, then the netrw window's currently |
| 2436 | displayed directory is used for the copy/move-to target. |
| 2437 | |
| 2438 | * Also, if the cursor is in the banner, then the netrw window's currently |
| 2439 | displayed directory is used for the copy/move-to target. |
| 2440 | Unless the target already is the current directory. In which case, |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2441 | typing "mf" clears the target. |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2442 | |
| 2443 | * However, if the cursor is atop a directory name, then that directory is |
| 2444 | used for the copy/move-to target |
| 2445 | |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2446 | * One may use the :MT [directory] command to set the target *netrw-:MT* |
| 2447 | This command uses |<q-args>|, so spaces in the directory name are |
| 2448 | permitted without escaping. |
| 2449 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2450 | * With mouse-enabled vim or with gvim, one may select a target by using |
| 2451 | <c-leftmouse> |
| 2452 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2453 | There is only one copy/move-to target at a time in a vim session; ie. the |
| 2454 | target is a script variable (see |s:var|) and is shared between all netrw |
| 2455 | windows (in an instance of vim). |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2456 | |
| 2457 | When using menus and gvim, netrw provides a "Targets" entry which allows one |
| 2458 | to pick a target from the list of bookmarks and history. |
| 2459 | |
| 2460 | Related topics: |
| 2461 | Marking Files......................................|netrw-mf| |
| 2462 | Marking Files by Regular Expression................|netrw-mr| |
| 2463 | Marked Files: Target Directory Using Bookmarks.....|netrw-Tb| |
| 2464 | Marked Files: Target Directory Using History.......|netrw-Th| |
| 2465 | |
| 2466 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2467 | MARKED FILES: TAGGING *netrw-mT* {{{2 |
| 2468 | (See |netrw-mf| and |netrw-mr| for how to mark files) |
| 2469 | (uses the global marked file list) |
| 2470 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2471 | The "mT" mapping will apply the command in |g:netrw_ctags| (by default, it is |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2472 | "ctags") to marked files. For remote browsing, in order to create a tags file |
| 2473 | netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for |
| 2474 | this to work on remote systems. For your local system, see |ctags| on how to |
| 2475 | get a version. I myself use hdrtags, currently available at |
Bram Moolenaar | 97d6249 | 2012-11-15 21:28:22 +0100 | [diff] [blame] | 2476 | http://www.drchip.org/astronaut/src/index.html , and have > |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2477 | |
| 2478 | let g:netrw_ctags= "hdrtag" |
| 2479 | < |
| 2480 | in my <.vimrc>. |
| 2481 | |
| 2482 | When a remote set of files are tagged, the resulting tags file is "obtained"; |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2483 | ie. a copy is transferred to the local system's directory. The now local tags |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2484 | file is then modified so that one may use it through the network. The |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2485 | modification made concerns the names of the files in the tags; each filename is |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2486 | preceded by the netrw-compatible URL used to obtain it. When one subsequently |
| 2487 | uses one of the go to tag actions (|tags|), the URL will be used by netrw to |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2488 | edit the desired file and go to the tag. |
| 2489 | |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 2490 | Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2491 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2492 | MARKED FILES: TARGET DIRECTORY USING BOOKMARKS *netrw-Tb* {{{2 |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2493 | |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2494 | Sets the marked file copy/move-to target. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2495 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2496 | The |netrw-qb| map will give you a list of bookmarks (and history). |
| 2497 | One may choose one of the bookmarks to become your marked file |
| 2498 | target by using [count]Tb (default count: 1). |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2499 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2500 | Related topics: |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2501 | Copying files to target............................|netrw-mc| |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2502 | Listing Bookmarks and History......................|netrw-qb| |
| 2503 | Marked Files: Setting The Target Directory.........|netrw-mt| |
| 2504 | Marked Files: Target Directory Using History.......|netrw-Th| |
| 2505 | Marking Files......................................|netrw-mf| |
| 2506 | Marking Files by Regular Expression................|netrw-mr| |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2507 | Moving files to target.............................|netrw-mm| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2508 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2509 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2510 | MARKED FILES: TARGET DIRECTORY USING HISTORY *netrw-Th* {{{2 |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2511 | |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2512 | Sets the marked file copy/move-to target. |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2513 | |
| 2514 | The |netrw-qb| map will give you a list of history (and bookmarks). |
| 2515 | One may choose one of the history entries to become your marked file |
| 2516 | target by using [count]Th (default count: 0; ie. the current directory). |
| 2517 | |
| 2518 | Related topics: |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2519 | Copying files to target............................|netrw-mc| |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2520 | Listing Bookmarks and History......................|netrw-qb| |
| 2521 | Marked Files: Setting The Target Directory.........|netrw-mt| |
| 2522 | Marked Files: Target Directory Using Bookmarks.....|netrw-Tb| |
| 2523 | Marking Files......................................|netrw-mf| |
| 2524 | Marking Files by Regular Expression................|netrw-mr| |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2525 | Moving files to target.............................|netrw-mm| |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2526 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2527 | |
| 2528 | MARKED FILES: UNMARKING *netrw-mu* {{{2 |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2529 | (See |netrw-mf|, |netrw-mF|) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2530 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2531 | The "mu" mapping will unmark all currently marked files. This command differs |
| 2532 | from "mF" as the latter only unmarks files in the current directory whereas |
| 2533 | "mu" will unmark global and all buffer-local marked files. |
| 2534 | (see |netrw-mF|) |
| 2535 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2536 | |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 2537 | *netrw-browser-settings* |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2538 | NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2 |
| 2539 | |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 2540 | (if you're interested in the netrw file transfer settings, see |netrw-options| |
| 2541 | and |netrw-protocol|) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2542 | |
| 2543 | The <netrw.vim> browser provides settings in the form of variables which |
| 2544 | you may modify; by placing these settings in your <.vimrc>, you may customize |
| 2545 | your browsing preferences. (see also: |netrw-settings|) |
| 2546 | > |
| 2547 | --- ----------- |
| 2548 | Var Explanation |
| 2549 | --- ----------- |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 2550 | < *g:netrw_altfile* some like |CTRL-^| to return to the last |
| 2551 | edited file. Choose that by setting this |
| 2552 | parameter to 1. |
| 2553 | Others like |CTRL-^| to return to the |
| 2554 | netrw browsing buffer. Choose that by setting |
| 2555 | this parameter to 0. |
| 2556 | default: =0 |
| 2557 | |
| 2558 | *g:netrw_alto* change from above splitting to below splitting |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2559 | by setting this variable (see |netrw-o|) |
| 2560 | default: =&sb (see |'sb'|) |
| 2561 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2562 | *g:netrw_altv* change from left splitting to right splitting |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2563 | by setting this variable (see |netrw-v|) |
| 2564 | default: =&spr (see |'spr'|) |
| 2565 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2566 | *g:netrw_banner* enable/suppress the banner |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2567 | =0: suppress the banner |
| 2568 | =1: banner is enabled (default) |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2569 | |
Bram Moolenaar | e6ae622 | 2013-05-21 21:01:10 +0200 | [diff] [blame] | 2570 | *g:netrw_bannerbackslash* if this variable exists and is not zero, the |
| 2571 | banner will be displayed with backslashes |
| 2572 | rather than forward slashes. |
| 2573 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2574 | *g:netrw_browse_split* when browsing, <cr> will open the file by: |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2575 | =0: re-using the same window (default) |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2576 | =1: horizontally splitting the window first |
| 2577 | =2: vertically splitting the window first |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2578 | =3: open file in new tab |
| 2579 | =4: act like "P" (ie. open previous window) |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2580 | Note that |g:netrw_preview| may be used |
| 2581 | to get vertical splitting instead of |
| 2582 | horizontal splitting. |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2583 | =[servername,tab-number,window-number] |
| 2584 | Given a |List| such as this, a remote server |
| 2585 | named by the "servername" will be used for |
| 2586 | editing. It will also use the specified tab |
| 2587 | and window numbers to perform editing |
| 2588 | (see |clientserver|, |netrw-ctrl-r|) |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2589 | This option does not affect the production of |
| 2590 | |:Lexplore| windows. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2591 | |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 2592 | Related topics: |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2593 | |g:netrw_alto| |g:netrw_altv| |
| 2594 | |netrw-C| |netrw-cr| |
| 2595 | |netrw-ctrl-r| |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 2596 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2597 | *g:netrw_browsex_viewer* specify user's preference for a viewer: > |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2598 | "kfmclient exec" |
| 2599 | "gnome-open" |
| 2600 | < If > |
| 2601 | "-" |
| 2602 | < is used, then netrwFileHandler() will look for |
| 2603 | a script/function to handle the given |
| 2604 | extension. (see |netrw_filehandler|). |
| 2605 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2606 | *g:netrw_chgperm* Unix/Linux: "chmod PERM FILENAME" |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2607 | Windows: "cacls FILENAME /e /p PERM" |
| 2608 | Used to change access permission for a file. |
| 2609 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2610 | *g:netrw_compress* ="gzip" |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2611 | Will compress marked files with this |
| 2612 | command |
| 2613 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2614 | *g:Netrw_corehandler* Allows one to specify something additional |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 2615 | to do when handling <core> files via netrw's |
| 2616 | browser's "x" command (see |netrw-x|). If |
| 2617 | present, g:Netrw_corehandler specifies |
| 2618 | either one or more function references |
| 2619 | (see |Funcref|). (the capital g:Netrw... |
| 2620 | is required its holding a function reference) |
| 2621 | |
| 2622 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2623 | *g:netrw_ctags* ="ctags" |
| 2624 | The default external program used to create |
| 2625 | tags |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 2626 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2627 | *g:netrw_cursor* = 2 (default) |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2628 | This option controls the use of the |
Bram Moolenaar | adc2182 | 2011-04-01 18:03:16 +0200 | [diff] [blame] | 2629 | |'cursorline'| (cul) and |'cursorcolumn'| |
| 2630 | (cuc) settings by netrw: |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2631 | |
Bram Moolenaar | adc2182 | 2011-04-01 18:03:16 +0200 | [diff] [blame] | 2632 | Value Thin-Long-Tree Wide |
| 2633 | =0 u-cul u-cuc u-cul u-cuc |
| 2634 | =1 u-cul u-cuc cul u-cuc |
| 2635 | =2 cul u-cuc cul u-cuc |
| 2636 | =3 cul u-cuc cul cuc |
| 2637 | =4 cul cuc cul cuc |
| 2638 | |
| 2639 | Where |
| 2640 | u-cul : user's |'cursorline'| setting used |
| 2641 | u-cuc : user's |'cursorcolumn'| setting used |
| 2642 | cul : |'cursorline'| locally set |
| 2643 | cuc : |'cursorcolumn'| locally set |
| 2644 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2645 | *g:netrw_decompress* = { ".gz" : "gunzip" , |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2646 | ".bz2" : "bunzip2" , |
| 2647 | ".zip" : "unzip" , |
| 2648 | ".tar" : "tar -xf"} |
| 2649 | A dictionary mapping suffices to |
| 2650 | decompression programs. |
| 2651 | |
Bram Moolenaar | adc2182 | 2011-04-01 18:03:16 +0200 | [diff] [blame] | 2652 | *g:netrw_dirhistmax* =10: controls maximum quantity of past |
| 2653 | history. May be zero to supppress |
| 2654 | history. |
| 2655 | (related: |netrw-qb| |netrw-u| |netrw-U|) |
| 2656 | |
Bram Moolenaar | 97d6249 | 2012-11-15 21:28:22 +0100 | [diff] [blame] | 2657 | *g:netrw_dynamic_maxfilenamelen* =32: enables dynamic determination of |
| 2658 | |g:netrw_maxfilenamelen|, which affects |
| 2659 | local file long listing. |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2660 | |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 2661 | *g:netrw_errorlvl* =0: error levels greater than or equal to |
| 2662 | this are permitted to be displayed |
| 2663 | 0: notes |
| 2664 | 1: warnings |
| 2665 | 2: errors |
| 2666 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2667 | *g:netrw_fastbrowse* =0: slow speed directory browsing; |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 2668 | never re-uses directory listings; |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2669 | always obtains directory listings. |
| 2670 | =1: medium speed directory browsing; |
| 2671 | re-use directory listings only |
| 2672 | when remote directory browsing. |
| 2673 | (default value) |
| 2674 | =2: fast directory browsing; |
| 2675 | only obtains directory listings when the |
| 2676 | directory hasn't been seen before |
| 2677 | (or |netrw-ctrl-l| is used). |
| 2678 | |
| 2679 | Fast browsing retains old directory listing |
| 2680 | buffers so that they don't need to be |
| 2681 | re-acquired. This feature is especially |
| 2682 | important for remote browsing. However, if |
| 2683 | a file is introduced or deleted into or from |
| 2684 | such directories, the old directory buffer |
| 2685 | becomes out-of-date. One may always refresh |
| 2686 | such a directory listing with |netrw-ctrl-l|. |
| 2687 | This option gives the user the choice of |
| 2688 | trading off accuracy (ie. up-to-date listing) |
| 2689 | versus speed. |
| 2690 | |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 2691 | *g:netrw_ffkeep* (default: doesn't exist) |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2692 | If this variable exists and is zero, then |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 2693 | netrw will not do a save and restore for |
| 2694 | |'fileformat'|. |
| 2695 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2696 | *g:netrw_fname_escape* =' ?&;%' |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2697 | Used on filenames before remote reading/writing |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2698 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2699 | *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2700 | that can show up as "directories" and "files" |
| 2701 | in the listing. This pattern is used to |
| 2702 | remove such embedded messages. By default its |
| 2703 | value is: |
| 2704 | '^total\s\+\d\+$\| |
| 2705 | ^Trying\s\+\d\+.*$\| |
| 2706 | ^KERBEROS_V\d rejected\| |
| 2707 | ^Security extensions not\| |
| 2708 | No such file\| |
| 2709 | : connect to address [0-9a-fA-F:]* |
| 2710 | : No route to host$' |
| 2711 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2712 | *g:netrw_ftp_list_cmd* options for passing along to ftp for directory |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2713 | listing. Defaults: |
| 2714 | unix or g:netrw_cygwin set: : "ls -lF" |
| 2715 | otherwise "dir" |
| 2716 | |
| 2717 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2718 | *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2719 | listing, sorted by size of file. |
| 2720 | Defaults: |
| 2721 | unix or g:netrw_cygwin set: : "ls -slF" |
| 2722 | otherwise "dir" |
| 2723 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2724 | *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2725 | listing, sorted by time of last modification. |
| 2726 | Defaults: |
| 2727 | unix or g:netrw_cygwin set: : "ls -tlF" |
| 2728 | otherwise "dir" |
| 2729 | |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 2730 | *g:netrw_glob_escape* ='[]*?`{~$' (unix) |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 2731 | ='[]*?`{$' (windows |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2732 | These characters in directory names are |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2733 | escaped before applying glob() |
| 2734 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2735 | *g:netrw_gx* ="<cfile>" |
| 2736 | This option controls how gx (|netrw-gx|) picks |
| 2737 | up the text under the cursor. See |expand()| |
| 2738 | for possibilities. |
| 2739 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2740 | *g:netrw_hide* Controlled by the "a" map (see |netrw-a|) |
| 2741 | =0 : show all |
| 2742 | =1 : show not-hidden files |
| 2743 | =2 : show hidden files only |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2744 | default: =0 |
| 2745 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2746 | *g:netrw_home* The home directory for where bookmarks and |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2747 | history are saved (as .netrwbook and |
| 2748 | .netrwhist). |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2749 | Netrw uses |expand()|on the string. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2750 | default: the first directory on the |
| 2751 | |'runtimepath'| |
| 2752 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2753 | *g:netrw_keepdir* =1 (default) keep current directory immune from |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2754 | the browsing directory. |
| 2755 | =0 keep the current directory the same as the |
| 2756 | browsing directory. |
| 2757 | The current browsing directory is contained in |
| 2758 | b:netrw_curdir (also see |netrw-c|) |
| 2759 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2760 | *g:netrw_keepj* ="keepj" (default) netrw attempts to keep the |
| 2761 | |:jumps| table unaffected. |
| 2762 | ="" netrw will not use |:keepjumps| with |
| 2763 | exceptions only for the |
| 2764 | saving/restoration of position. |
| 2765 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2766 | *g:netrw_list_cmd* command for listing remote directories |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2767 | default: (if ssh is executable) |
| 2768 | "ssh HOSTNAME ls -FLa" |
| 2769 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2770 | *g:netrw_list_cmd_options* If this variable exists, then its contents are |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2771 | appended to the g:netrw_list_cmd. For |
| 2772 | example, use "2>/dev/null" to get rid of banner |
| 2773 | messages on unix systems. |
| 2774 | |
| 2775 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2776 | *g:netrw_liststyle* Set the default listing style: |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2777 | = 0: thin listing (one file per line) |
| 2778 | = 1: long listing (one file per line with time |
| 2779 | stamp information and file size) |
| 2780 | = 2: wide listing (multiple files in columns) |
| 2781 | = 3: tree style listing |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 2782 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2783 | *g:netrw_list_hide* comma separated pattern list for hiding files |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2784 | Patterns are regular expressions (see |regexp|) |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 2785 | There's some special support for git-ignore |
| 2786 | files: you may add the output from the helper |
| 2787 | function 'netrw_gitignore#Hide() automatically |
| 2788 | hiding all gitignored files. |
| 2789 | For more details see |netrw-gitignore|. |
| 2790 | |
| 2791 | Examples: |
| 2792 | let g:netrw_list_hide= '.*\.swp$' |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2793 | let g:netrw_list_hide= netrw_gitignore#Hide().'.*\.swp$' |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 2794 | default: "" |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2795 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2796 | *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin |
| 2797 | =expand("$COMSPEC") Windows |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2798 | Copies marked files (|netrw-mf|) to target |
| 2799 | directory (|netrw-mt|, |netrw-mc|) |
| 2800 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2801 | *g:netrw_localcopycmdopt* ='' Linux/Unix/MacOS/Cygwin |
| 2802 | =' \c copy' Windows |
| 2803 | Options for the |g:netrw_localcopycmd| |
| 2804 | |
| 2805 | *g:netrw_localcopydircmd* ="cp" Linux/Unix/MacOS/Cygwin |
| 2806 | =expand("$COMSPEC") Windows |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2807 | Copies directories to target directory. |
| 2808 | (|netrw-mc|, |netrw-mt|) |
| 2809 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2810 | *g:netrw_localcopydircmdopt* =" -R" Linux/Unix/MacOS/Cygwin |
| 2811 | =" /c xcopy /e /c /h/ /i /k" Windows |
| 2812 | Options for |g:netrw_localcopydircmd| |
Bram Moolenaar | e6ae622 | 2013-05-21 21:01:10 +0200 | [diff] [blame] | 2813 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2814 | *g:netrw_localmkdir* ="mkdir" Linux/Unix/MacOS/Cygwin |
| 2815 | =expand("$COMSPEC") Windows |
| 2816 | command for making a local directory |
| 2817 | |
| 2818 | *g:netrw_localmkdiropt* ="" Linux/Unix/MacOS/Cygwin |
| 2819 | =" /c mkdir" Windows |
| 2820 | Options for |g:netrw_localmkdir| |
| 2821 | |
| 2822 | *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin |
| 2823 | =expand("$COMSPEC") Windows |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2824 | Moves marked files (|netrw-mf|) to target |
| 2825 | directory (|netrw-mt|, |netrw-mm|) |
| 2826 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2827 | *g:netrw_localmovecmdopt* ="" Linux/Unix/MacOS/Cygwin |
| 2828 | =" /c move" Windows |
| 2829 | Options for |g:netrw_localmovecmd| |
| 2830 | |
| 2831 | *g:netrw_localrmdir* ="rmdir" Linux/Unix/MacOS/Cygwin |
| 2832 | =expand("$COMSPEC") Windows |
| 2833 | Remove directory command (rmdir) |
| 2834 | This variable is only used if your vim is |
| 2835 | earlier than 7.4 or if your vim doesn't |
| 2836 | have patch#1107. Otherwise, |delete()| |
| 2837 | is used with the "d" option. |
| 2838 | |
| 2839 | *g:netrw_localrmdiropt* ="" Linux/Unix/MacOS/Cygwin |
| 2840 | =" /c rmdir" Windows |
| 2841 | Options for |g:netrw_localrmdir| |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2842 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2843 | *g:netrw_maxfilenamelen* =32 by default, selected so as to make long |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2844 | listings fit on 80 column displays. |
| 2845 | If your screen is wider, and you have file |
| 2846 | or directory names longer than 32 bytes, |
| 2847 | you may set this option to keep listings |
| 2848 | columnar. |
| 2849 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2850 | *g:netrw_mkdir_cmd* command for making a remote directory |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 2851 | via ssh (also see |g:netrw_remote_mkdir|) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2852 | default: "ssh USEPORT HOSTNAME mkdir" |
| 2853 | |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 2854 | *g:netrw_mousemaps* =1 (default) enables mouse buttons while |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2855 | browsing to: |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2856 | leftmouse : open file/directory |
| 2857 | shift-leftmouse : mark file |
| 2858 | middlemouse : same as P |
| 2859 | rightmouse : remove file/directory |
| 2860 | =0: disables mouse maps |
| 2861 | |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 2862 | *g:netrw_nobeval* doesn't exist (default) |
| 2863 | If this variable exists, then balloon |
| 2864 | evaluation will be suppressed |
| 2865 | (see |'ballooneval'|) |
| 2866 | |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 2867 | *g:netrw_sizestyle* not defined: actual bytes (default) |
| 2868 | ="b" : actual bytes (default) |
| 2869 | ="h" : human-readable (ex. 5k, 4m, 3g) |
| 2870 | uses 1000 base |
| 2871 | ="H" : human-readable (ex. 5K, 4M, 3G) |
| 2872 | uses 1024 base |
| 2873 | The long listing (|netrw-i|) and query-file |
| 2874 | maps (|netrw-qf|) will display file size |
| 2875 | using the specified style. |
| 2876 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2877 | *g:netrw_usetab* if this variable exists and is non-zero, then |
| 2878 | the <tab> map supporting shrinking/expanding a |
| 2879 | Lexplore or netrw window will be enabled. |
| 2880 | (see |netrw-c-tab|) |
| 2881 | |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2882 | *g:netrw_remote_mkdir* command for making a remote directory |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 2883 | via ftp (also see |g:netrw_mkdir_cmd|) |
| 2884 | default: "mkdir" |
| 2885 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2886 | *g:netrw_retmap* if it exists and is set to one, then: |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2887 | * if in a netrw-selected file, AND |
| 2888 | * no normal-mode <2-leftmouse> mapping exists, |
| 2889 | then the <2-leftmouse> will be mapped for easy |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2890 | return to the netrw browser window. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2891 | example: click once to select and open a file, |
| 2892 | double-click to return. |
| 2893 | |
| 2894 | Note that one may instead choose to: |
| 2895 | * let g:netrw_retmap= 1, AND |
| 2896 | * nmap <silent> YourChoice <Plug>NetrwReturn |
| 2897 | and have another mapping instead of |
| 2898 | <2-leftmouse> to invoke the return. |
| 2899 | |
| 2900 | You may also use the |:Rexplore| command to do |
| 2901 | the same thing. |
| 2902 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2903 | default: =0 |
| 2904 | |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 2905 | *g:netrw_rm_cmd* command for removing remote files |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2906 | default: "ssh USEPORT HOSTNAME rm" |
| 2907 | |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 2908 | *g:netrw_rmdir_cmd* command for removing remote directories |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2909 | default: "ssh USEPORT HOSTNAME rmdir" |
| 2910 | |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 2911 | *g:netrw_rmf_cmd* command for removing remote softlinks |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2912 | default: "ssh USEPORT HOSTNAME rm -f" |
| 2913 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 2914 | *g:netrw_servername* use this variable to provide a name for |
| 2915 | |netrw-ctrl-r| to use for its server. |
| 2916 | default: "NETRWSERVER" |
| 2917 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 2918 | *g:netrw_sort_by* sort by "name", "time", "size", or |
| 2919 | "exten". |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2920 | default: "name" |
| 2921 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2922 | *g:netrw_sort_direction* sorting direction: "normal" or "reverse" |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2923 | default: "normal" |
| 2924 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2925 | *g:netrw_sort_options* sorting is done using |:sort|; this |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 2926 | variable's value is appended to the |
| 2927 | sort command. Thus one may ignore case, |
| 2928 | for example, with the following in your |
| 2929 | .vimrc: > |
| 2930 | let g:netrw_sort_options="i" |
| 2931 | < default: "" |
| 2932 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2933 | *g:netrw_sort_sequence* when sorting by name, first sort by the |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2934 | comma-separated pattern sequence. Note that |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2935 | any filigree added to indicate filetypes |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2936 | should be accounted for in your pattern. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2937 | default: '[\/]$,*,\.bak$,\.o$,\.h$, |
| 2938 | \.info$,\.swp$,\.obj$' |
| 2939 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2940 | *g:netrw_special_syntax* If true, then certain files will be shown |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 2941 | using special syntax in the browser: |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2942 | |
| 2943 | netrwBak : *.bak |
| 2944 | netrwCompress: *.gz *.bz2 *.Z *.zip |
| 2945 | netrwData : *.dat |
| 2946 | netrwHdr : *.h |
| 2947 | netrwLib : *.a *.so *.lib *.dll |
| 2948 | netrwMakefile: [mM]akefile *.mak |
| 2949 | netrwObj : *.o *.obj |
| 2950 | netrwTags : tags ANmenu ANtags |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2951 | netrwTilde : * |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2952 | netrwTmp : tmp* *tmp |
| 2953 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2954 | In addition, those groups mentioned in |
| 2955 | |'suffixes'| are also added to the special |
| 2956 | file highlighting group. |
| 2957 | These syntax highlighting groups are linked |
| 2958 | to netrwGray or Folded by default |
| 2959 | (see |hl-Folded|), but one may put lines like > |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2960 | hi link netrwCompress Visual |
| 2961 | < into one's <.vimrc> to use one's own |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2962 | preferences. Alternatively, one may |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 2963 | put such specifications into > |
| 2964 | .vim/after/syntax/netrw.vim. |
| 2965 | < The netrwGray highlighting is set up by |
| 2966 | netrw when > |
| 2967 | * netrwGray has not been previously |
| 2968 | defined |
| 2969 | * the gui is running |
| 2970 | < As an example, I myself use a dark-background |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 2971 | colorscheme with the following in |
| 2972 | .vim/after/syntax/netrw.vim: > |
| 2973 | |
| 2974 | hi netrwCompress term=NONE cterm=NONE gui=NONE ctermfg=10 guifg=green ctermbg=0 guibg=black |
| 2975 | hi netrwData term=NONE cterm=NONE gui=NONE ctermfg=9 guifg=blue ctermbg=0 guibg=black |
| 2976 | hi netrwHdr term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 |
| 2977 | hi netrwLex term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 |
| 2978 | hi netrwYacc term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 |
| 2979 | hi netrwLib term=NONE cterm=NONE gui=NONE ctermfg=14 guifg=yellow |
| 2980 | hi netrwObj term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red |
| 2981 | hi netrwTilde term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red |
| 2982 | hi netrwTmp term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red |
| 2983 | hi netrwTags term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red |
| 2984 | hi netrwDoc term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=yellow2 guibg=Blue3 |
| 2985 | hi netrwSymLink term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=grey60 |
| 2986 | < |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 2987 | *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines, |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2988 | messages, banners, and whatnot that one doesn't |
| 2989 | want masquerading as "directories" and "files". |
| 2990 | Use this pattern to remove such embedded |
| 2991 | messages. By default its value is: |
| 2992 | '^total\s\+\d\+$' |
| 2993 | |
Bram Moolenaar | e6ae622 | 2013-05-21 21:01:10 +0200 | [diff] [blame] | 2994 | *g:netrw_ssh_cmd* One may specify an executable command |
| 2995 | to use instead of ssh for remote actions |
| 2996 | such as listing, file removal, etc. |
| 2997 | default: ssh |
| 2998 | |
Bram Moolenaar | aa3b15d | 2016-04-21 08:53:19 +0200 | [diff] [blame] | 2999 | *g:netrw_suppress_gx_mesg* =1 : browsers sometimes produce messages |
| 3000 | which are normally unwanted intermixed |
| 3001 | with the page. |
| 3002 | However, when using links, for example, |
| 3003 | those messages are what the browser produces. |
| 3004 | By setting this option to 0, netrw will not |
| 3005 | suppress browser messages. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3006 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 3007 | *g:netrw_tmpfile_escape* =' &;' |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3008 | escape() is applied to all temporary files |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3009 | to escape these characters. |
| 3010 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 3011 | *g:netrw_timefmt* specify format string to vim's strftime(). |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3012 | The default, "%c", is "the preferred date |
| 3013 | and time representation for the current |
| 3014 | locale" according to my manpage entry for |
| 3015 | strftime(); however, not all are satisfied |
| 3016 | with it. Some alternatives: |
| 3017 | "%a %d %b %Y %T", |
| 3018 | " %a %Y-%m-%d %I-%M-%S %p" |
| 3019 | default: "%c" |
| 3020 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 3021 | *g:netrw_use_noswf* netrw normally avoids writing swapfiles |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3022 | for browser buffers. However, under some |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3023 | systems this apparently is causing nasty |
| 3024 | ml_get errors to appear; if you're getting |
| 3025 | ml_get errors, try putting |
| 3026 | let g:netrw_use_noswf= 0 |
| 3027 | in your .vimrc. |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 3028 | default: 1 |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3029 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 3030 | *g:netrw_winsize* specify initial size of new windows made with |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3031 | "o" (see |netrw-o|), "v" (see |netrw-v|), |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 3032 | |:Hexplore| or |:Vexplore|. The g:netrw_winsize |
| 3033 | is an integer describing the percentage of the |
| 3034 | current netrw buffer's window to be used for |
| 3035 | the new window. |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 3036 | If g:netrw_winsize is less than zero, then |
| 3037 | the absolute value of g:netrw_winsize lines |
| 3038 | or columns will be used for the new window. |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 3039 | If g:netrw_winsize is zero, then a normal |
| 3040 | split will be made (ie. |'equalalways'| will |
| 3041 | take effect, for example). |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 3042 | default: 50 (for 50%) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3043 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3044 | *g:netrw_wiw* =1 specifies the minimum window width to use |
| 3045 | when shrinking a netrw/Lexplore window |
| 3046 | (see |netrw-c-tab|). |
| 3047 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 3048 | *g:netrw_xstrlen* Controls how netrw computes string lengths, |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3049 | including multi-byte characters' string |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3050 | length. (thanks to N Weibull, T Mechelynck) |
| 3051 | =0: uses Vim's built-in strlen() |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3052 | =1: number of codepoints (Latin a + combining |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3053 | circumflex is two codepoints) (DEFAULT) |
| 3054 | =2: number of spacing codepoints (Latin a + |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3055 | combining circumflex is one spacing |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3056 | codepoint; a hard tab is one; wide and |
| 3057 | narrow CJK are one each; etc.) |
| 3058 | =3: virtual length (counting tabs as anything |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3059 | between 1 and |'tabstop'|, wide CJK as 2 |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3060 | rather than 1, Arabic alif as zero when |
| 3061 | immediately preceded by lam, one |
| 3062 | otherwise, etc) |
| 3063 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 3064 | *g:NetrwTopLvlMenu* This variable specifies the top level |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3065 | menu name; by default, it's "Netrw.". If |
| 3066 | you wish to change this, do so in your |
| 3067 | .vimrc. |
| 3068 | |
| 3069 | NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* {{{2 |
| 3070 | |
| 3071 | Netrw has been designed to handle user options by saving them, setting the |
| 3072 | options to something that's compatible with netrw's needs, and then restoring |
| 3073 | them. However, the autochdir option: > |
| 3074 | :set acd |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 3075 | is problematic. Autochdir sets the current directory to that containing the |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3076 | file you edit; this apparently also applies to directories. In other words, |
| 3077 | autochdir sets the current directory to that containing the "file" (even if |
| 3078 | that "file" is itself a directory). |
| 3079 | |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 3080 | NETRW SETTINGS WINDOW *netrw-settings-window* {{{2 |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 3081 | |
| 3082 | With the NetrwSettings.vim plugin, > |
| 3083 | :NetrwSettings |
| 3084 | will bring up a window with the many variables that netrw uses for its |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 3085 | settings. You may change any of their values; when you save the file, the |
| 3086 | settings therein will be used. One may also press "?" on any of the lines for |
| 3087 | help on what each of the variables do. |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 3088 | |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 3089 | (also see: |netrw-browser-var| |netrw-protocol| |netrw-variables|) |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3090 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 3091 | |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 3092 | ============================================================================== |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3093 | OBTAINING A FILE *netrw-obtain* *netrw-O* {{{2 |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3094 | |
| 3095 | If there are no marked files: |
| 3096 | |
| 3097 | When browsing a remote directory, one may obtain a file under the cursor |
| 3098 | (ie. get a copy on your local machine, but not edit it) by pressing the O |
| 3099 | key. |
| 3100 | |
| 3101 | If there are marked files: |
| 3102 | |
| 3103 | The marked files will be obtained (ie. a copy will be transferred to your |
| 3104 | local machine, but not set up for editing). |
| 3105 | |
| 3106 | Only ftp and scp are supported for this operation (but since these two are |
| 3107 | available for browsing, that shouldn't be a problem). The status bar will |
| 3108 | then show, on its right hand side, a message like "Obtaining filename". The |
| 3109 | statusline will be restored after the transfer is complete. |
| 3110 | |
| 3111 | Netrw can also "obtain" a file using the local browser. Netrw's display |
| 3112 | of a directory is not necessarily the same as Vim's "current directory", |
| 3113 | unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select |
| 3114 | a file using the local browser (by putting the cursor on it) and pressing |
| 3115 | "O" will then "obtain" the file; ie. copy it to Vim's current directory. |
| 3116 | |
| 3117 | Related topics: |
| 3118 | * To see what the current directory is, use |:pwd| |
| 3119 | * To make the currently browsed directory the current directory, see |netrw-c| |
| 3120 | * To automatically make the currently browsed directory the current |
| 3121 | directory, see |g:netrw_keepdir|. |
| 3122 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3123 | *netrw-newfile* *netrw-createfile* |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3124 | OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%* {{{2 |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 3125 | |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 3126 | To open a new file in netrw's current directory, press "%". This map |
| 3127 | will query the user for a new filename; an empty file by that name will |
| 3128 | be placed in the netrw's current directory (ie. b:netrw_curdir). |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 3129 | |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 3130 | Related topics: |netrw-d| |
| 3131 | |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 3132 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3133 | PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2 |
| 3134 | |
| 3135 | One may use a preview window by using the "p" key when the cursor is atop the |
| 3136 | desired filename to be previewed. The display will then split to show both |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3137 | the browser (where the cursor will remain) and the file (see |:pedit|). By |
| 3138 | default, the split will be taken horizontally; one may use vertical splitting |
| 3139 | if one has set |g:netrw_preview| first. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3140 | |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 3141 | An interesting set of netrw settings is: > |
| 3142 | |
| 3143 | let g:netrw_preview = 1 |
| 3144 | let g:netrw_liststyle = 3 |
| 3145 | let g:netrw_winsize = 30 |
| 3146 | |
| 3147 | These will: |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3148 | |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 3149 | 1. Make vertical splitting the default for previewing files |
| 3150 | 2. Make the default listing style "tree" |
| 3151 | 3. When a vertical preview window is opened, the directory listing |
Bram Moolenaar | 5b435d6 | 2012-04-05 17:33:26 +0200 | [diff] [blame] | 3152 | will use only 30% of the columns available; the rest of the window |
| 3153 | is used for the preview window. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3154 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3155 | Related: if you like this idea, you may also find :Lexplore |
| 3156 | (|netrw-:Lexplore|) or |g:netrw_chgwin| of interest |
| 3157 | |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 3158 | Also see: |g:netrw_chgwin| |netrw-P| |'previewwindow'| |CTRL-W_z| |:pclose| |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 3159 | |
| 3160 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3161 | PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2 |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3162 | |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 3163 | To edit a file or directory under the cursor in the previously used (last |
| 3164 | accessed) window (see :he |CTRL-W_p|), press a "P". If there's only one |
| 3165 | window, then the one window will be horizontally split (by default). |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3166 | |
| 3167 | If there's more than one window, the previous window will be re-used on |
| 3168 | the selected file/directory. If the previous window's associated buffer |
| 3169 | has been modified, and there's only one window with that buffer, then |
| 3170 | the user will be asked if s/he wishes to save the buffer first (yes, |
| 3171 | no, or cancel). |
| 3172 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 3173 | Related Actions |netrw-cr| |netrw-o| |netrw-t| |netrw-v| |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 3174 | Associated setting variables: |
| 3175 | |g:netrw_alto| control above/below splitting |
| 3176 | |g:netrw_altv| control right/left splitting |
| 3177 | |g:netrw_preview| control horizontal vs vertical splitting |
| 3178 | |g:netrw_winsize| control initial sizing |
| 3179 | |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 3180 | Also see: |g:netrw_chgwin| |netrw-p| |
| 3181 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3182 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3183 | REFRESHING THE LISTING *netrw-refresh* *netrw-ctrl-l* *netrw-ctrl_l* {{{2 |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3184 | |
| 3185 | To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or |
| 3186 | hit the <cr> when atop the ./ directory entry in the listing. One may also |
| 3187 | refresh a local directory by using ":e .". |
| 3188 | |
| 3189 | |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 3190 | REVERSING SORTING ORDER *netrw-r* *netrw-reverse* {{{2 |
| 3191 | |
| 3192 | One may toggle between normal and reverse sorting order by pressing the |
| 3193 | "r" key. |
| 3194 | |
| 3195 | Related topics: |netrw-s| |
| 3196 | Associated setting variable: |g:netrw_sort_direction| |
| 3197 | |
| 3198 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3199 | RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2 |
| 3200 | |
| 3201 | If there are no marked files: (see |netrw-mf|) |
| 3202 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3203 | Renaming files and directories involves moving the cursor to the |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3204 | file/directory to be moved (renamed) and pressing "R". You will then be |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3205 | queried for what you want the file/directory to be renamed to. You may |
| 3206 | select a range of lines with the "V" command (visual selection), and then |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3207 | press "R"; you will be queried for each file as to what you want it |
| 3208 | renamed to. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3209 | |
| 3210 | If there are marked files: (see |netrw-mf|) |
| 3211 | |
| 3212 | Marked files will be renamed (moved). You will be queried as above in |
| 3213 | order to specify where you want the file/directory to be moved. |
| 3214 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3215 | If you answer a renaming query with a "s/frompattern/topattern/", then |
| 3216 | subsequent files on the marked file list will be renamed by taking each |
| 3217 | name, applying that substitute, and renaming each file to the result. |
| 3218 | As an example : > |
| 3219 | |
| 3220 | mr [query: reply with *.c] |
| 3221 | R [query: reply with s/^\(.*\)\.c$/\1.cpp/] |
| 3222 | < |
| 3223 | This example will mark all *.c files and then rename them to *.cpp |
| 3224 | files. |
| 3225 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3226 | The ctrl-X character has special meaning for renaming files: > |
| 3227 | |
| 3228 | <c-x> : a single ctrl-x tells netrw to ignore the portion of the response |
| 3229 | lying between the last '/' and the ctrl-x. |
| 3230 | |
| 3231 | <c-x><c-x> : a pair of contiguous ctrl-x's tells netrw to ignore any |
| 3232 | portion of the string preceding the double ctrl-x's. |
| 3233 | < |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3234 | WARNING:~ |
| 3235 | |
| 3236 | Note that moving files is a dangerous operation; copies are safer. That's |
| 3237 | because a "move" for remote files is actually a copy + delete -- and if |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3238 | the copy fails and the delete succeeds you may lose the file. |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 3239 | Use at your own risk. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3240 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3241 | The *g:netrw_rename_cmd* variable is used to implement remote renaming. By |
| 3242 | default its value is: > |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3243 | |
| 3244 | ssh HOSTNAME mv |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3245 | < |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3246 | One may rename a block of files and directories by selecting them with |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3247 | V (|linewise-visual|) when using thin style. |
| 3248 | |
| 3249 | See |cmdline-editing| for more on how to edit the command line; in particular, |
| 3250 | you'll find <ctrl-f> (initiates cmdline window editing) and <ctrl-c> (uses the |
| 3251 | command line under the cursor) useful in conjunction with the R command. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3252 | |
| 3253 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3254 | SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2 |
| 3255 | |
| 3256 | One may select the sorting style by name, time, or (file) size. The "s" map |
| 3257 | allows one to circulate amongst the three choices; the directory listing will |
| 3258 | automatically be refreshed to reflect the selected style. |
| 3259 | |
| 3260 | Related topics: |netrw-r| |netrw-S| |
| 3261 | Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence| |
| 3262 | |
| 3263 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3264 | SETTING EDITING WINDOW *netrw-editwindow* *netrw-C* *netrw-:NetrwC* {{{2 |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3265 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3266 | One may select a netrw window for editing with the "C" mapping, using the |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3267 | :NetrwC [win#] command, or by setting |g:netrw_chgwin| to the selected window |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3268 | number. Subsequent selection of a file to edit (|netrw-cr|) will use that |
| 3269 | window. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3270 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3271 | * C : by itself, will select the current window holding a netrw buffer |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3272 | for subsequent editing via |netrw-cr|. The C mapping is only available |
| 3273 | while in netrw buffers. |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 3274 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3275 | * [count]C : the count will be used as the window number to be used |
| 3276 | for subsequent editing via |netrw-cr|. |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3277 | |
| 3278 | * :NetrwC will set |g:netrw_chgwin| to the current window |
| 3279 | |
| 3280 | * :NetrwC win# will set |g:netrw_chgwin| to the specified window |
| 3281 | number |
| 3282 | |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 3283 | Using > |
| 3284 | let g:netrw_chgwin= -1 |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3285 | will restore the default editing behavior |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3286 | (ie. subsequent editing will use the current window). |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 3287 | |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 3288 | Related topics: |netrw-cr| |g:netrw_browse_split| |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3289 | Associated setting variables: |g:netrw_chgwin| |
| 3290 | |
| 3291 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3292 | SHRINKING OR EXPANDING A NETRW OR LEXPLORE WINDOW *netrw-c-tab* {{{2 |
| 3293 | |
| 3294 | The <c-tab> key will toggle a netrw or |:Lexplore| window's width, |
| 3295 | but only if |g:netrw_usetab| exists and is non-zero (and, of course, |
| 3296 | only if your terminal supports differentiating <c-tab> from a plain |
| 3297 | <tab>). |
| 3298 | |
| 3299 | * If the current window is a netrw window, toggle its width |
| 3300 | (between |g:netrw_wiw| and its original width) |
| 3301 | |
| 3302 | * Else if there is a |:Lexplore| window in the current tab, toggle |
| 3303 | its width |
| 3304 | |
| 3305 | * Else bring up a |:Lexplore| window |
| 3306 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3307 | If |g:netrw_usetab| exists and is zero, or if there is a pre-existing mapping |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 3308 | for <c-tab>, then the <c-tab> will not be mapped. One may map something other |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3309 | than a <c-tab>, too: (but you'll still need to have had |g:netrw_usetab| set). > |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3310 | |
| 3311 | nmap <unique> (whatever) <Plug>NetrwShrink |
| 3312 | < |
| 3313 | Related topics: |:Lexplore| |
| 3314 | Associated setting variable: |g:netrw_usetab| |
| 3315 | |
| 3316 | |
| 3317 | USER SPECIFIED MAPS *netrw-usermaps* {{{1 |
| 3318 | |
| 3319 | One may make customized user maps. Specify a variable, |g:Netrw_UserMaps|, |
| 3320 | to hold a |List| of lists of keymap strings and function names: > |
| 3321 | |
| 3322 | [["keymap-sequence","ExampleUserMapFunc"],...] |
| 3323 | < |
| 3324 | When netrw is setting up maps for a netrw buffer, if |g:Netrw_UserMaps| |
| 3325 | exists, then the internal function netrw#UserMaps(islocal) is called. |
| 3326 | This function goes through all the entries in the |g:Netrw_UserMaps| list: |
| 3327 | |
| 3328 | * sets up maps: > |
| 3329 | nno <buffer> <silent> KEYMAP-SEQUENCE |
| 3330 | :call s:UserMaps(islocal,"ExampleUserMapFunc") |
| 3331 | < * refreshes if result from that function call is the string |
| 3332 | "refresh" |
| 3333 | * if the result string is not "", then that string will be |
| 3334 | executed (:exe result) |
| 3335 | * if the result is a List, then the above two actions on results |
| 3336 | will be taken for every string in the result List |
| 3337 | |
| 3338 | The user function is passed one argument; it resembles > |
| 3339 | |
| 3340 | fun! ExampleUserMapFunc(islocal) |
| 3341 | < |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3342 | where a:islocal is 1 if its a local-directory system call or 0 when |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3343 | remote-directory system call. |
| 3344 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3345 | *netrw-call* *netrw-expose* *netrw-modify* |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3346 | Use netrw#Expose("varname") to access netrw-internal (script-local) |
| 3347 | variables. |
| 3348 | Use netrw#Modify("varname",newvalue) to change netrw-internal variables. |
| 3349 | Use netrw#Call("funcname"[,args]) to call a netrw-internal function with |
| 3350 | specified arguments. |
| 3351 | |
| 3352 | Example: Get a copy of netrw's marked file list: > |
| 3353 | |
| 3354 | let netrwmarkfilelist= netrw#Expose("netrwmarkfilelist") |
| 3355 | < |
| 3356 | Example: Modify the value of netrw's marked file list: > |
| 3357 | |
| 3358 | call netrw#Modify("netrwmarkfilelist",[]) |
| 3359 | < |
| 3360 | Example: Clear netrw's marked file list via a mapping on gu > |
| 3361 | " ExampleUserMap: {{{2 |
| 3362 | fun! ExampleUserMap(islocal) |
| 3363 | call netrw#Modify("netrwmarkfilelist",[]) |
| 3364 | call netrw#Modify('netrwmarkfilemtch_{bufnr("%")}',"") |
| 3365 | let retval= ["refresh"] |
| 3366 | return retval |
| 3367 | endfun |
| 3368 | let g:Netrw_UserMaps= [["gu","ExampleUserMap"]] |
| 3369 | < |
| 3370 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3371 | 10. Problems and Fixes *netrw-problems* {{{1 |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 3372 | |
| 3373 | (This section is likely to grow as I get feedback) |
| 3374 | (also see |netrw-debug|) |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 3375 | *netrw-p1* |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 3376 | P1. I use windows 95, and my ftp dumps four blank lines at the |
| 3377 | end of every read. |
| 3378 | |
| 3379 | See |netrw-fixup|, and put the following into your |
| 3380 | <.vimrc> file: |
| 3381 | |
| 3382 | let g:netrw_win95ftp= 1 |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 3383 | |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 3384 | *netrw-p2* |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3385 | P2. I use Windows, and my network browsing with ftp doesn't sort by |
| 3386 | time or size! -or- The remote system is a Windows server; why |
| 3387 | don't I get sorts by time or size? |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 3388 | |
| 3389 | Windows' ftp has a minimal support for ls (ie. it doesn't |
| 3390 | accept sorting options). It doesn't support the -F which |
| 3391 | gives an explanatory character (ABC/ for "ABC is a directory"). |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3392 | Netrw then uses "dir" to get both its thin and long listings. |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3393 | If you think your ftp does support a full-up ls, put the |
| 3394 | following into your <.vimrc>: > |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 3395 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3396 | let g:netrw_ftp_list_cmd = "ls -lF" |
| 3397 | let g:netrw_ftp_timelist_cmd= "ls -tlF" |
| 3398 | let g:netrw_ftp_sizelist_cmd= "ls -slF" |
| 3399 | < |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 3400 | Alternatively, if you have cygwin on your Windows box, put |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3401 | into your <.vimrc>: > |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 3402 | |
| 3403 | let g:netrw_cygwin= 1 |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3404 | < |
| 3405 | This problem also occurs when the remote system is Windows. |
| 3406 | In this situation, the various g:netrw_ftp_[time|size]list_cmds |
| 3407 | are as shown above, but the remote system will not correctly |
| 3408 | modify its listing behavior. |
| 3409 | |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 3410 | |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 3411 | *netrw-p3* |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 3412 | P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw |
| 3413 | used ssh! That wasn't what I asked for... |
| 3414 | |
| 3415 | Netrw has two methods for browsing remote directories: ssh |
| 3416 | and ftp. Unless you specify ftp specifically, ssh is used. |
| 3417 | When it comes time to do download a file (not just a directory |
| 3418 | listing), netrw will use the given protocol to do so. |
| 3419 | |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 3420 | *netrw-p4* |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 3421 | P4. I would like long listings to be the default. |
| 3422 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3423 | Put the following statement into your |.vimrc|: > |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 3424 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3425 | let g:netrw_liststyle= 1 |
| 3426 | < |
| 3427 | Check out |netrw-browser-var| for more customizations that |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 3428 | you can set. |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 3429 | |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 3430 | *netrw-p5* |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 3431 | P5. My times come up oddly in local browsing |
| 3432 | |
| 3433 | Does your system's strftime() accept the "%c" to yield dates |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 3434 | such as "Sun Apr 27 11:49:23 1997"? If not, do a |
| 3435 | "man strftime" and find out what option should be used. Then |
| 3436 | put it into your |.vimrc|: > |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 3437 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3438 | let g:netrw_timefmt= "%X" (where X is the option) |
| 3439 | < |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 3440 | *netrw-p6* |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 3441 | P6. I want my current directory to track my browsing. |
| 3442 | How do I do that? |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 3443 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3444 | Put the following line in your |.vimrc|: |
| 3445 | > |
Bram Moolenaar | 433f7c8 | 2006-03-21 21:29:36 +0000 | [diff] [blame] | 3446 | let g:netrw_keepdir= 0 |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3447 | < |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3448 | *netrw-p7* |
| 3449 | P7. I use Chinese (or other non-ascii) characters in my filenames, and |
| 3450 | netrw (Explore, Sexplore, Hexplore, etc) doesn't display them! |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 3451 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3452 | (taken from an answer provided by Wu Yongwei on the vim |
| 3453 | mailing list) |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 3454 | I now see the problem. Your code page is not 936, right? Vim |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3455 | seems only able to open files with names that are valid in the |
| 3456 | current code page, as are many other applications that do not |
| 3457 | use the Unicode version of Windows APIs. This is an OS-related |
| 3458 | issue. You should not have such problems when the system |
| 3459 | locale uses UTF-8, such as modern Linux distros. |
| 3460 | |
| 3461 | (...it is one more reason to recommend that people use utf-8!) |
| 3462 | |
| 3463 | *netrw-p8* |
| 3464 | P8. I'm getting "ssh is not executable on your system" -- what do I |
| 3465 | do? |
| 3466 | |
| 3467 | (Dudley Fox) Most people I know use putty for windows ssh. It |
| 3468 | is a free ssh/telnet application. You can read more about it |
| 3469 | here: |
| 3470 | |
| 3471 | http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also: |
| 3472 | |
| 3473 | (Marlin Unruh) This program also works for me. It's a single |
| 3474 | executable, so he/she can copy it into the Windows\System32 |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3475 | folder and create a shortcut to it. |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3476 | |
| 3477 | (Dudley Fox) You might also wish to consider plink, as it |
| 3478 | sounds most similar to what you are looking for. plink is an |
| 3479 | application in the putty suite. |
| 3480 | |
| 3481 | http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink |
| 3482 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3483 | (Vissale Neang) Maybe you can try OpenSSH for windows, which |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3484 | can be obtained from: |
| 3485 | |
| 3486 | http://sshwindows.sourceforge.net/ |
| 3487 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3488 | It doesn't need the full Cygwin package. |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3489 | |
| 3490 | (Antoine Mechelynck) For individual Unix-like programs needed |
| 3491 | for work in a native-Windows environment, I recommend getting |
| 3492 | them from the GnuWin32 project on sourceforge if it has them: |
| 3493 | |
| 3494 | http://gnuwin32.sourceforge.net/ |
| 3495 | |
| 3496 | Unlike Cygwin, which sets up a Unix-like virtual machine on |
| 3497 | top of Windows, GnuWin32 is a rewrite of Unix utilities with |
| 3498 | Windows system calls, and its programs works quite well in the |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3499 | cmd.exe "Dos box". |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3500 | |
| 3501 | (dave) Download WinSCP and use that to connect to the server. |
| 3502 | In Preferences > Editors, set gvim as your editor: |
| 3503 | |
| 3504 | - Click "Add..." |
| 3505 | - Set External Editor (adjust path as needed, include |
| 3506 | the quotes and !.! at the end): |
| 3507 | "c:\Program Files\Vim\vim70\gvim.exe" !.! |
| 3508 | - Check that the filetype in the box below is |
| 3509 | {asterisk}.{asterisk} (all files), or whatever types |
| 3510 | you want (cec: change {asterisk} to * ; I had to |
| 3511 | write it that way because otherwise the helptags |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3512 | system thinks it's a tag) |
| 3513 | - Make sure it's at the top of the listbox (click it, |
| 3514 | then click "Up" if it's not) |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3515 | If using the Norton Commander style, you just have to hit <F4> |
| 3516 | to edit a file in a local copy of gvim. |
| 3517 | |
| 3518 | (Vit Gottwald) How to generate public/private key and save |
| 3519 | public key it on server: > |
Bram Moolenaar | 5ac3b1a | 2010-07-27 22:50:36 +0200 | [diff] [blame] | 3520 | http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey-gettingready |
| 3521 | (8.3 Getting ready for public key authentication) |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3522 | < |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3523 | How to use a private key with 'pscp': > |
| 3524 | |
Bram Moolenaar | 5ac3b1a | 2010-07-27 22:50:36 +0200 | [diff] [blame] | 3525 | http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter5.html |
| 3526 | (5.2.4 Using public key authentication with PSCP) |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3527 | < |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3528 | (Ben Schmidt) I find the ssh included with cwRsync is |
| 3529 | brilliant, and install cwRsync or cwRsyncServer on most |
| 3530 | Windows systems I come across these days. I guess COPSSH, |
| 3531 | packed by the same person, is probably even better for use as |
| 3532 | just ssh on Windows, and probably includes sftp, etc. which I |
| 3533 | suspect the cwRsync doesn't, though it might |
| 3534 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3535 | (cec) To make proper use of these suggestions above, you will |
| 3536 | need to modify the following user-settable variables in your |
| 3537 | .vimrc: |
| 3538 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3539 | |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd| |
| 3540 | |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd| |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3541 | |
| 3542 | The first one (|g:netrw_ssh_cmd|) is the most important; most |
| 3543 | of the others will use the string in g:netrw_ssh_cmd by |
| 3544 | default. |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3545 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3546 | *netrw-p9* *netrw-ml_get* |
| 3547 | P9. I'm browsing, changing directory, and bang! ml_get errors |
| 3548 | appear and I have to kill vim. Any way around this? |
| 3549 | |
| 3550 | Normally netrw attempts to avoid writing swapfiles for |
| 3551 | its temporary directory buffers. However, on some systems |
| 3552 | this attempt appears to be causing ml_get errors to |
| 3553 | appear. Please try setting |g:netrw_use_noswf| to 0 |
| 3554 | in your <.vimrc>: > |
| 3555 | let g:netrw_use_noswf= 0 |
| 3556 | < |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3557 | *netrw-p10* |
| 3558 | P10. I'm being pestered with "[something] is a directory" and |
| 3559 | "Press ENTER or type command to continue" prompts... |
| 3560 | |
| 3561 | The "[something] is a directory" prompt is issued by Vim, |
| 3562 | not by netrw, and there appears to be no way to work around |
| 3563 | it. Coupled with the default cmdheight of 1, this message |
| 3564 | causes the "Press ENTER..." prompt. So: read |hit-enter|; |
| 3565 | I also suggest that you set your |'cmdheight'| to 2 (or more) in |
| 3566 | your <.vimrc> file. |
| 3567 | |
| 3568 | *netrw-p11* |
| 3569 | P11. I want to have two windows; a thin one on the left and my editing |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 3570 | window on the right. How may I accomplish this? |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3571 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3572 | You probably want netrw running as in a side window. If so, you |
| 3573 | will likely find that ":[N]Lexplore" does what you want. The |
| 3574 | optional "[N]" allows you to select the quantity of columns you |
Bram Moolenaar | d7464be | 2015-11-01 16:49:04 +0100 | [diff] [blame] | 3575 | wish the |:Lexplore|r window to start with (see |g:netrw_winsize| |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3576 | for how this parameter works). |
| 3577 | |
| 3578 | Previous solution: |
| 3579 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3580 | * Put the following line in your <.vimrc>: |
| 3581 | let g:netrw_altv = 1 |
| 3582 | * Edit the current directory: :e . |
| 3583 | * Select some file, press v |
| 3584 | * Resize the windows as you wish (see |CTRL-W_<| and |
| 3585 | |CTRL-W_>|). If you're using gvim, you can drag |
| 3586 | the separating bar with your mouse. |
| 3587 | * When you want a new file, use ctrl-w h to go back to the |
| 3588 | netrw browser, select a file, then press P (see |CTRL-W_h| |
| 3589 | and |netrw-P|). If you're using gvim, you can press |
| 3590 | <leftmouse> in the browser window and then press the |
| 3591 | <middlemouse> to select the file. |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 3592 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3593 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3594 | *netrw-p12* |
| 3595 | P12. My directory isn't sorting correctly, or unwanted letters are |
| 3596 | appearing in the listed filenames, or things aren't lining |
| 3597 | up properly in the wide listing, ... |
| 3598 | |
| 3599 | This may be due to an encoding problem. I myself usually use |
| 3600 | utf-8, but really only use ascii (ie. bytes from 32-126). |
| 3601 | Multibyte encodings use two (or more) bytes per character. |
| 3602 | You may need to change |g:netrw_sepchr| and/or |g:netrw_xstrlen|. |
| 3603 | |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 3604 | *netrw-p13* |
| 3605 | P13. I'm a Windows + putty + ssh user, and when I attempt to browse, |
| 3606 | the directories are missing trailing "/"s so netrw treats them |
| 3607 | as file transfers instead of as attempts to browse |
| 3608 | subdirectories. How may I fix this? |
| 3609 | |
| 3610 | (mikeyao) If you want to use vim via ssh and putty under Windows, |
| 3611 | try combining the use of pscp/psftp with plink. pscp/psftp will |
| 3612 | be used to connect and plink will be used to execute commands on |
| 3613 | the server, for example: list files and directory using 'ls'. |
| 3614 | |
| 3615 | These are the settings I use to do this: |
| 3616 | > |
| 3617 | " list files, it's the key setting, if you haven't set, |
| 3618 | " you will get a blank buffer |
| 3619 | let g:netrw_list_cmd = "plink HOSTNAME ls -Fa" |
| 3620 | " if you haven't add putty directory in system path, you should |
| 3621 | " specify scp/sftp command. For examples: |
| 3622 | "let g:netrw_sftp_cmd = "d:\\dev\\putty\\PSFTP.exe" |
| 3623 | "let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe" |
| 3624 | < |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 3625 | *netrw-p14* |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3626 | P14. I would like to speed up writes using Nwrite and scp/ssh |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 3627 | style connections. How? (Thomer M. Gil) |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 3628 | |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 3629 | Try using ssh's ControlMaster and ControlPath (see the ssh_config |
| 3630 | man page) to share multiple ssh connections over a single network |
| 3631 | connection. That cuts out the cryptographic handshake on each |
| 3632 | file write, sometimes speeding it up by an order of magnitude. |
| 3633 | (see http://thomer.com/howtos/netrw_ssh.html) |
| 3634 | (included by permission) |
| 3635 | |
| 3636 | Add the following to your ~/.ssh/config: > |
| 3637 | |
| 3638 | # you change "*" to the hostname you care about |
| 3639 | Host * |
| 3640 | ControlMaster auto |
| 3641 | ControlPath /tmp/%r@%h:%p |
| 3642 | |
| 3643 | < Then create an ssh connection to the host and leave it running: > |
| 3644 | |
| 3645 | ssh -N host.domain.com |
| 3646 | |
| 3647 | < Now remotely open a file with Vim's Netrw and enjoy the |
| 3648 | zippiness: > |
| 3649 | |
| 3650 | vim scp://host.domain.com//home/user/.bashrc |
| 3651 | < |
| 3652 | *netrw-p15* |
| 3653 | P15. How may I use a double-click instead of netrw's usual single click |
| 3654 | to open a file or directory? (Ben Fritz) |
| 3655 | |
| 3656 | First, disable netrw's mapping with > |
| 3657 | let g:netrw_mousemaps= 0 |
| 3658 | < and then create a netrw buffer only mapping in |
| 3659 | $HOME/.vim/after/ftplugin/netrw.vim: > |
| 3660 | nmap <buffer> <2-leftmouse> <CR> |
| 3661 | < Note that setting g:netrw_mousemaps to zero will turn off |
| 3662 | all netrw's mouse mappings, not just the <leftmouse> one. |
| 3663 | (see |g:netrw_mousemaps|) |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 3664 | |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 3665 | *netrw-p16* |
| 3666 | P16. When editing remote files (ex. :e ftp://hostname/path/file), |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3667 | under Windows I get an |E303| message complaining that its unable |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 3668 | to open a swap file. |
| 3669 | |
| 3670 | (romainl) It looks like you are starting Vim from a protected |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3671 | directory. Start netrw from your $HOME or other writable |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 3672 | directory. |
| 3673 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3674 | *netrw-p17* |
| 3675 | P17. Netrw is closing buffers on its own. |
| 3676 | What steps will reproduce the problem? |
| 3677 | 1. :Explore, navigate directories, open a file |
| 3678 | 2. :Explore, open another file |
| 3679 | 3. Buffer opened in step 1 will be closed. o |
| 3680 | What is the expected output? What do you see instead? |
| 3681 | I expect both buffers to exist, but only the last one does. |
| 3682 | |
| 3683 | (Lance) Problem is caused by "set autochdir" in .vimrc. |
| 3684 | (drchip) I am able to duplicate this problem with |'acd'| set. |
| 3685 | It appears that the buffers are not exactly closed; |
| 3686 | a ":ls!" will show them (although ":ls" does not). |
| 3687 | |
| 3688 | *netrw-P18* |
| 3689 | P18. How to locally edit a file that's only available via |
| 3690 | another server accessible via ssh? |
| 3691 | See http://stackoverflow.com/questions/12469645/ |
| 3692 | "Using Vim to Remotely Edit A File on ServerB Only |
| 3693 | Accessible From ServerA" |
| 3694 | |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3695 | *netrw-P19* |
| 3696 | P19. How do I get numbering on in directory listings? |
| 3697 | With |g:netrw_bufsettings|, you can control netrw's buffer |
| 3698 | settings; try putting > |
| 3699 | let g:netrw_bufsettings="noma nomod nu nobl nowrap ro nornu" |
| 3700 | < in your .vimrc. If you'd like to have relative numbering |
| 3701 | instead, try > |
| 3702 | let g:netrw_bufsettings="noma nomod nonu nobl nowrap ro rnu" |
| 3703 | < |
| 3704 | *netrw-P20* |
| 3705 | P20. How may I have gvim start up showing a directory listing? |
| 3706 | Try putting the following code snippet into your .vimrc: > |
| 3707 | augroup VimStartup |
| 3708 | au! |
| 3709 | au VimEnter * if expand("%") == "" && argc() == 0 && |
| 3710 | \ (v:servername =~ 'GVIM\d*' || v:servername == "") |
| 3711 | \ | e . | endif |
| 3712 | augroup END |
| 3713 | < You may use Lexplore instead of "e" if you're so inclined. |
| 3714 | This snippet assumes that you have client-server enabled |
| 3715 | (ie. a "huge" vim version). |
| 3716 | |
| 3717 | *netrw-P21* |
| 3718 | P21. I've made a directory (or file) with an accented character, but |
| 3719 | netrw isn't letting me enter that directory/read that file: |
| 3720 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3721 | Its likely that the shell or o/s is using a different encoding |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3722 | than you have vim (netrw) using. A patch to vim supporting |
| 3723 | "systemencoding" may address this issue in the future; for |
| 3724 | now, just have netrw use the proper encoding. For example: > |
| 3725 | |
| 3726 | au FileType netrw set enc=latin1 |
| 3727 | < |
| 3728 | *netrw-P22* |
| 3729 | P22. I get an error message when I try to copy or move a file: |
| 3730 | |
| 3731 | **error** (netrw) tried using g:netrw_localcopycmd<cp>; it doesn't work! |
| 3732 | |
| 3733 | What's wrong? |
| 3734 | |
| 3735 | Netrw uses several system level commands to do things (see |
| 3736 | |
| 3737 | |g:netrw_localcopycmd|, |g:netrw_localmovecmd|, |
| 3738 | |g:netrw_localrmdir|, |g:netrw_mkdir_cmd|). |
| 3739 | |
| 3740 | You may need to adjust the default commands for one or more of |
| 3741 | these commands by setting them properly in your .vimrc. Another |
| 3742 | source of difficulty is that these commands use vim's local |
| 3743 | directory, which may not be the same as the browsing directory |
| 3744 | shown by netrw (see |g:netrw_keepdir|). |
| 3745 | |
| 3746 | |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 3747 | ============================================================================== |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3748 | 11. Debugging Netrw Itself *netrw-debug* {{{1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3749 | |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3750 | Step 1: check that the problem you've encountered hasn't already been resolved |
| 3751 | by obtaining a copy of the latest (often developmental) netrw at: |
| 3752 | |
| 3753 | http://www.drchip.org/astronaut/vim/index.html#NETRW |
| 3754 | |
| 3755 | The <netrw.vim> script is typically installed on systems as something like: |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 3756 | > |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3757 | /usr/local/share/vim/vim7x/plugin/netrwPlugin.vim |
| 3758 | /usr/local/share/vim/vim7x/autoload/netrw.vim |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3759 | (see output of :echo &rtp) |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 3760 | < |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3761 | which is loaded automatically at startup (assuming :set nocp). If you |
| 3762 | installed a new netrw, then it will be located at > |
| 3763 | |
| 3764 | $HOME/.vim/plugin/netrwPlugin.vim |
| 3765 | $HOME/.vim/autoload/netrw.vim |
| 3766 | < |
| 3767 | Step 2: assuming that you've installed the latest version of netrw, |
| 3768 | check that your problem is really due to netrw. Create a file |
| 3769 | called netrw.vimrc with the following contents: > |
| 3770 | |
| 3771 | set nocp |
| 3772 | so $HOME/.vim/plugin/netrwPlugin.vim |
| 3773 | < |
| 3774 | Then run netrw as follows: > |
| 3775 | |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 3776 | vim -u netrw.vimrc --noplugins -i NONE [some path here] |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3777 | < |
| 3778 | Perform whatever netrw commands you need to, and check that the problem is |
| 3779 | still present. This procedure sidesteps any issues due to personal .vimrc |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 3780 | settings, .viminfo file, and other plugins. If the problem does not appear, |
| 3781 | then you need to determine which setting in your .vimrc is causing the |
| 3782 | conflict with netrw or which plugin(s) is/are involved. |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3783 | |
| 3784 | Step 3: If the problem still is present, then get a debugging trace from |
| 3785 | netrw: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3786 | |
| 3787 | 1. Get the <Decho.vim> script, available as: |
| 3788 | |
Bram Moolenaar | 97d6249 | 2012-11-15 21:28:22 +0100 | [diff] [blame] | 3789 | http://www.drchip.org/astronaut/vim/index.html#DECHO |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3790 | or |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 3791 | http://vim.sourceforge.net/scripts/script.php?script_id=120 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3792 | |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 3793 | Decho.vim is provided as a "vimball"; see |vimball-intro|. |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 3794 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3795 | 2. Edit the <netrw.vim> file by typing: > |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 3796 | |
| 3797 | vim netrw.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3798 | :DechoOn |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 3799 | :wq |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3800 | < |
| 3801 | To restore to normal non-debugging behavior, re-edit <netrw.vim> |
| 3802 | and type > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3803 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 3804 | vim netrw.vim |
| 3805 | :DechoOff |
| 3806 | :wq |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3807 | < |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 3808 | This command, provided by <Decho.vim>, will comment out all |
| 3809 | Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()). |
| 3810 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3811 | 3. Then bring up vim and attempt to evoke the problem by doing a |
| 3812 | transfer or doing some browsing. A set of messages should appear |
| 3813 | concerning the steps that <netrw.vim> took in attempting to |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3814 | read/write your file over the network in a separate tab or |
| 3815 | server vim window. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3816 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3817 | To save the file, use > |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 3818 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3819 | :tabnext |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3820 | :set bt= |
| 3821 | :w! DBG |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 3822 | |
| 3823 | < Furthermore, it'd be helpful if you would type > |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 3824 | :Dsep <command> |
| 3825 | < where <command> is the command you're about to type next, |
| 3826 | thereby making it easier to associate which part of the |
| 3827 | debugging trace is due to which command. |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 3828 | |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 3829 | Please send that information to <netrw.vim>'s maintainer along |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 3830 | with the o/s you're using and the vim version that you're using |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 3831 | (see |:version|) > |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 3832 | NdrOchip at ScampbellPfamily.AbizM - NOSPAM |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3833 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3834 | ============================================================================== |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 3835 | 12. History *netrw-history* {{{1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3836 | |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3837 | v162: Sep 19, 2016 * (haya14busa) pointed out two syntax errors |
| 3838 | with a patch; these are now fixed. |
| 3839 | Oct 26, 2016 * I started using mate-terminal and found that |
| 3840 | x and gx (|netrw-x| and |netrw-gx|) were no |
| 3841 | longer working. Fixed (using atril when |
| 3842 | $DESKTOP_SESSION is "mate"). |
| 3843 | Nov 04, 2016 * (Martin Vuille) pointed out that @+ was |
| 3844 | being restored with keepregstar rather than |
| 3845 | keepregplus. |
| 3846 | Nov 09, 2016 * Broke apart the command from the options, |
| 3847 | mostly for Windows. Introduced new netrw |
| 3848 | settings: |g:netrw_localcopycmdopt| |
| 3849 | |g:netrw_localcopydircmdopt| |g:netrw_localmkdiropt| |
| 3850 | |g:netrw_localmovecmdopt| |g:netrw_localrmdiropt| |
| 3851 | Nov 21, 2016 * (mattn) provided a patch for preview; swapped |
| 3852 | winwidth() with winheight() |
| 3853 | Nov 22, 2016 * (glacambre) reported that files containing |
| 3854 | spaces weren't being obtained properly via |
| 3855 | scp. Fix: apparently using single quotes |
| 3856 | such as with 'file name' wasn't enough; the |
| 3857 | spaces inside the quotes also had to be |
| 3858 | escaped (ie. 'file\ name'). |
| 3859 | * Also fixed obtain (|netrw-O|) to be able to |
| 3860 | obtain files with spaces in their names |
| 3861 | Dec 20, 2016 * (xc1427) Reported that using "I" (|netrw-I|) |
| 3862 | when atop "Hiding" in the banner also caused |
| 3863 | the active-banner hiding control to occur |
| 3864 | Jan 03, 2017 * (Enno Nagel) reported that attempting to |
| 3865 | apply netrw to a directory that was without |
| 3866 | read permission caused a syntax error. |
| 3867 | Jan 13, 2017 * (Ingo Karkat) provided a patch which makes |
| 3868 | using netrw#Call() better. Now returns |
| 3869 | value of internal routines return, for example. |
| 3870 | Jan 13, 2017 * (Ingo Karkat) changed netrw#FileUrlRead to |
| 3871 | use |:edit| instead of |:read|. I also |
| 3872 | changed the routine name to netrw#FileUrlEdit. |
| 3873 | Jan 16, 2017 * (Sayem) reported a problem where :Lexplore |
| 3874 | could generate a new listing buffer and |
| 3875 | window instead of toggling the netrw display. |
| 3876 | Unfortunately, the directions for eliciting |
| 3877 | the problem weren't complete, so I may or |
| 3878 | may not have fixed that issue. |
| 3879 | Feb 06, 2017 * Implemented cb and cB. Changed "c" to "cd". |
| 3880 | (see |netrw-cb|, |netrw-cB|, and |netrw-cd|) |
| 3881 | Mar 21, 2017 * previously, netrw would specify (safe) settings |
| 3882 | even when the setting was already safe for |
| 3883 | netrw. Netrw now attempts to leave such |
| 3884 | already-netrw-safe settings alone. |
| 3885 | (affects s:NetrwOptionRestore() and |
| 3886 | s:NetrwSafeOptions(); also introduced |
| 3887 | s:NetrwRestoreSetting()) |
| 3888 | Jun 26, 2017 * (Christian Brabandt) provided a patch to |
| 3889 | allow curl to follow redirects (ie. -L |
| 3890 | option) |
| 3891 | Jun 26, 2017 * (Callum Howard) reported a problem with |
| 3892 | :Lexpore not removing the Lexplore window |
| 3893 | after a change-directory |
| 3894 | Aug 30, 2017 * (Ingo Karkat) one cannot switch to the |
| 3895 | previously edited file (e.g. with CTRL-^) |
| 3896 | after editing a file:// URL. Patch to |
| 3897 | have a "keepalt" included. |
| 3898 | Oct 17, 2017 * (Adam Faryna) reported that gn (|netrw-gn|) |
| 3899 | did not work on directories in the current |
| 3900 | tree |
| 3901 | v157: Apr 20, 2016 * (Nicola) had set up a "nmap <expr> ..." with |
| 3902 | a function that returned a 0 while silently |
| 3903 | invoking a shell command. The shell command |
| 3904 | activated a ShellCmdPost event which in turn |
| 3905 | called s:LocalBrowseRefresh(). That looks |
| 3906 | over all netrw buffers for changes needing |
| 3907 | refreshes. However, inside a |:map-<expr>|, |
| 3908 | tab and window changes are disallowed. Fixed. |
| 3909 | (affects netrw's s:LocalBrowseRefresh()) |
| 3910 | * |g:netrw_localrmdir| not used any more, but |
| 3911 | the relevant patch that causes |delete()| to |
| 3912 | take over was #1107 (not #1109). |
| 3913 | * |expand()| is now used on |g:netrw_home|; |
| 3914 | consequently, g:netrw_home may now use |
| 3915 | environment variables |
| 3916 | * s:NetrwLeftmouse and s:NetrwCLeftmouse will |
| 3917 | return without doing anything if invoked |
| 3918 | when inside a non-netrw window |
| 3919 | Jun 15, 2016 * gx now calls netrw#GX() which returns |
| 3920 | the word under the cursor. The new |
| 3921 | wrinkle: if one is in a netrw buffer, |
| 3922 | then netrw's s:NetrwGetWord(). |
| 3923 | Jun 22, 2016 * Netrw was executing all its associated |
| 3924 | Filetype commands silently; I'm going |
| 3925 | to try doing that "noisily" and see if |
| 3926 | folks have a problem with that. |
| 3927 | Aug 12, 2016 * Changed order of tool selection for |
| 3928 | handling http://... viewing. |
| 3929 | (Nikolay Aleksandrovich Pavlov) |
| 3930 | Aug 21, 2016 * Included hiding/showing/all for tree |
| 3931 | listings |
| 3932 | * Fixed refresh (^L) for tree listings |
Bram Moolenaar | aa3b15d | 2016-04-21 08:53:19 +0200 | [diff] [blame] | 3933 | v156: Feb 18, 2016 * Changed =~ to =~# where appropriate |
| 3934 | Feb 23, 2016 * s:ComposePath(base,subdir) now uses |
| 3935 | fnameescape() on the base portion |
| 3936 | Mar 01, 2016 * (gt_macki) reported where :Explore would |
| 3937 | make file unlisted. Fixed (tst943) |
| 3938 | Apr 04, 2016 * (reported by John Little) netrw normally |
| 3939 | suppresses browser messages, but sometimes |
| 3940 | those "messages" are what is wanted. |
| 3941 | See |g:netrw_suppress_gx_mesg| |
| 3942 | Apr 06, 2016 * (reported by Carlos Pita) deleting a remote |
| 3943 | file was giving an error message. Fixed. |
| 3944 | Apr 08, 2016 * (Charles Cooper) had a problem with an |
| 3945 | undefined b:netrw_curdir. He also provided |
| 3946 | a fix. |
| 3947 | Apr 20, 2016 * Changed s:NetrwGetBuffer(); now uses |
| 3948 | dictionaries. Also fixed the "No Name" |
| 3949 | buffer problem. |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 3950 | v155: Oct 29, 2015 * (Timur Fayzrakhmanov) reported that netrw's |
| 3951 | mapping of ctrl-l was not allowing refresh of |
| 3952 | other windows when it was done in a netrw |
| 3953 | window. |
| 3954 | Nov 05, 2015 * Improved s:TreeSqueezeDir() to use search() |
| 3955 | instead of a loop |
| 3956 | * NetrwBrowse() will return line to |
| 3957 | w:netrw_bannercnt if cursor ended up in |
| 3958 | banner |
| 3959 | Nov 16, 2015 * Added a <Plug>NetrwTreeSqueeze (|netrw-s-cr|) |
| 3960 | Nov 17, 2015 * Commented out imaps -- perhaps someone can |
| 3961 | tell me how they're useful and should be |
| 3962 | retained? |
| 3963 | Nov 20, 2015 * Added |netrw-ma| and |netrw-mA| support |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3964 | Nov 20, 2015 * gx (|netrw-gx|) on a URL downloaded the |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 3965 | file in addition to simply bringing up the |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 3966 | URL in a browser. Fixed. |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 3967 | Nov 23, 2015 * Added |g:netrw_sizestyle| support |
| 3968 | Nov 27, 2015 * Inserted a lot of <c-u>s into various netrw |
| 3969 | maps. |
| 3970 | Jan 05, 2016 * |netrw-qL| implemented to mark files based |
| 3971 | upon |location-list|s; similar to |netrw-qF|. |
| 3972 | Jan 19, 2016 * using - call delete(directoryname,"d") - |
| 3973 | instead of using g:netrw_localrmdir if |
| 3974 | v7.4 + patch#1107 is available |
| 3975 | Jan 28, 2016 * changed to using |winsaveview()| and |
| 3976 | |winrestview()| |
| 3977 | Jan 28, 2016 * s:NetrwTreePath() now does a save and |
| 3978 | restore of view |
| 3979 | Feb 08, 2016 * Fixed a tree-listing problem with remote |
| 3980 | directories |
Bram Moolenaar | a0f849e | 2015-10-30 14:37:44 +0100 | [diff] [blame] | 3981 | v154: Feb 26, 2015 * (Yuri Kanivetsky) reported a situation where |
| 3982 | a file was not treated properly as a file |
| 3983 | due to g:netrw_keepdir == 1 |
| 3984 | Mar 25, 2015 * (requested by Ben Friz) one may now sort by |
| 3985 | extension |
| 3986 | Mar 28, 2015 * (requested by Matt Brooks) netrw has a lot |
| 3987 | of buffer-local mappings; however, some |
| 3988 | plugins (such as vim-surround) set up |
| 3989 | conflicting mappings that cause vim to wait. |
| 3990 | The "<nowait>" modifier has been included |
| 3991 | with most of netrw's mappings to avoid that |
| 3992 | delay. |
| 3993 | Jun 26, 2015 * |netrw-gn| mapping implemted |
| 3994 | * :Ntree NotADir resulted in having |
| 3995 | the tree listing expand in the error messages |
| 3996 | window. Fixed. |
| 3997 | Jun 29, 2015 * Attempting to delete a file remotely caused |
| 3998 | an error with "keepsol" mentioned; fixed. |
| 3999 | Jul 08, 2015 * Several changes to keep the |:jumps| table |
| 4000 | correct when working with |
| 4001 | |g:netrw_fastbrowse| set to 2 |
| 4002 | * wide listing with accented characters fixed |
| 4003 | (using %-S instead of %-s with a |printf()| |
| 4004 | Jul 13, 2015 * (Daniel Hahler) CheckIfKde() could be true |
| 4005 | but kfmclient not installed. Changed order |
| 4006 | in netrw#BrowseX(): checks if kde and |
| 4007 | kfmclient, then will use xdg-open on a unix |
| 4008 | system (if xdg-open is executable) |
| 4009 | Aug 11, 2015 * (McDonnell) tree listing mode wouldn't |
| 4010 | select a file in a open subdirectory. |
| 4011 | * (McDonnell) when multiple subdirectories |
| 4012 | were concurrently open in tree listing |
| 4013 | mode, a ctrl-L wouldn't refresh properly. |
| 4014 | * The netrw:target menu showed duplicate |
| 4015 | entries |
| 4016 | Oct 13, 2015 * (mattn) provided an exception to handle |
| 4017 | windows with shellslash set but no shell |
| 4018 | Oct 23, 2015 * if g:netrw_usetab and <c-tab> now used |
| 4019 | to control whether NetrwShrink is used |
| 4020 | (see |netrw-c-tab|) |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 4021 | v153: May 13, 2014 * added another |g:netrw_ffkeep| usage {{{2 |
| 4022 | May 14, 2014 * changed s:PerformListing() so that it |
| 4023 | always sets ft=netrw for netrw buffers |
| 4024 | (ie. even when syntax highlighting is |
| 4025 | off, not available, etc) |
| 4026 | May 16, 2014 * introduced the |netrw-ctrl-r| functionality |
| 4027 | May 17, 2014 * introduced the |netrw-:NetrwMB| functionality |
| 4028 | * mb and mB (|netrw-mb|, |netrw-mB|) will |
| 4029 | add/remove marked files from bookmark list |
| 4030 | May 20, 2014 * (Enno Nagel) reported that :Lex <dirname> |
| 4031 | wasn't working. Fixed. |
| 4032 | May 26, 2014 * restored test to prevent leftmouse window |
| 4033 | resizing from causing refresh. |
| 4034 | (see s:NetrwLeftmouse()) |
| 4035 | * fixed problem where a refresh caused cursor |
| 4036 | to go just under the banner instead of |
| 4037 | staying put |
| 4038 | May 28, 2014 * (László Bimba) provided a patch for opening |
| 4039 | the |:Lexplore| window 100% high, optionally |
| 4040 | on the right, and will work with remote |
| 4041 | files. |
| 4042 | May 29, 2014 * implemented :NetrwC (see |netrw-:NetrwC|) |
| 4043 | Jun 01, 2014 * Removed some "silent"s from commands used |
| 4044 | to implemented scp://... and pscp://... |
| 4045 | directory listing. Permits request for |
| 4046 | password to appear. |
| 4047 | Jun 05, 2014 * (Enno Nagel) reported that user maps "/" |
| 4048 | caused problems with "b" and "w", which |
| 4049 | are mapped (for wide listings only) to |
| 4050 | skip over files rather than just words. |
| 4051 | Jun 10, 2014 * |g:netrw_gx| introduced to allow users to |
| 4052 | override default "<cfile>" with the gx |
| 4053 | (|netrw-gx|) map |
| 4054 | Jun 11, 2014 * gx (|netrw-gx|), with |'autowrite'| set, |
| 4055 | will write modified files. s:NetrwBrowseX() |
| 4056 | will now save, turn off, and restore the |
| 4057 | |'autowrite'| setting. |
| 4058 | Jun 13, 2014 * added visual map for gx use |
| 4059 | Jun 15, 2014 * (Enno Nagel) reported that with having hls |
| 4060 | set and wide listing style in use, that the |
| 4061 | b and w maps caused unwanted highlighting. |
| 4062 | Jul 05, 2014 * |netrw-mv| and |netrw-mX| commands included |
| 4063 | Jul 09, 2014 * |g:netrw_keepj| included, allowing optional |
| 4064 | keepj |
| 4065 | Jul 09, 2014 * fixing bugs due to previous update |
| 4066 | Jul 21, 2014 * (Bruno Sutic) provided an updated |
| 4067 | netrw_gitignore.vim |
| 4068 | Jul 30, 2014 * (Yavuz Yetim) reported that editing two |
| 4069 | remote files of the same name caused the |
| 4070 | second instance to have a "temporary" |
| 4071 | name. Fixed: now they use the same buffer. |
| 4072 | Sep 18, 2014 * (Yasuhiro Matsumoto) provided a patch which |
| 4073 | allows scp and windows local paths to work. |
| 4074 | Oct 07, 2014 * gx (see |netrw-gx|) when atop a directory, |
| 4075 | will now do |gf| instead |
| 4076 | Nov 06, 2014 * For cygwin: cygstart will be available for |
| 4077 | netrw#BrowseX() to use if its executable. |
| 4078 | Nov 07, 2014 * Began support for file://... urls. Will use |
| 4079 | |g:netrw_file_cmd| (typically elinks or links) |
| 4080 | Dec 02, 2014 * began work on having mc (|netrw-mc|) copy |
| 4081 | directories. Works for linux machines, |
| 4082 | cygwin+vim, but not for windows+gvim. |
| 4083 | Dec 02, 2014 * in tree mode, netrw was not opening |
| 4084 | directories via symbolic links. |
| 4085 | Dec 02, 2014 * added resolved link information to |
| 4086 | thin and tree modes |
| 4087 | Dec 30, 2014 * (issue#231) |:ls| was not showing |
| 4088 | remote-file buffers reliably. Fixed. |
| 4089 | v152: Apr 08, 2014 * uses the |'noswapfile'| option (requires {{{2 |
Bram Moolenaar | 1360030 | 2014-05-22 18:26:40 +0200 | [diff] [blame] | 4090 | vim 7.4 with patch 213) |
| 4091 | * (Enno Nagel) turn |'rnu'| off in netrw |
| 4092 | buffers. |
| 4093 | * (Quinn Strahl) suggested that netrw |
| 4094 | allow regular window splitting to occur, |
| 4095 | thereby allowing |'equalalways'| to take |
| 4096 | effect. |
| 4097 | * (qingtian zhao) normally, netrw will |
| 4098 | save and restore the |'fileformat'|; |
| 4099 | however, sometimes that isn't wanted |
| 4100 | Apr 14, 2014 * whenever netrw marks a buffer as ro, |
| 4101 | it will also mark it as nomod. |
| 4102 | Apr 16, 2014 * sftp protocol now supported by |
| 4103 | netrw#Obtain(); this means that one |
| 4104 | may use "mc" to copy a remote file |
| 4105 | to a local file using sftp, and that |
| 4106 | the |netrw-O| command can obtain remote |
| 4107 | files via sftp. |
| 4108 | * added [count]C support (see |netrw-C|) |
| 4109 | Apr 18, 2014 * when |g:netrw_chgwin| is one more than |
| 4110 | the last window, then vertically split |
| 4111 | the last window and use it as the |
| 4112 | chgwin window. |
| 4113 | May 09, 2014 * SavePosn was "saving filename under cursor" |
| 4114 | from a non-netrw window when using :Rex. |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 4115 | v151: Jan 22, 2014 * extended :Rexplore to return to buffer {{{2 |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 4116 | prior to Explore or editing a directory |
| 4117 | * (Ken Takata) netrw gave error when |
| 4118 | clipboard was disabled. Sol'n: Placed |
| 4119 | several if has("clipboard") tests in. |
| 4120 | * Fixed ftp://X@Y@Z// problem; X@Y now |
| 4121 | part of user id, and only Z is part of |
| 4122 | hostname. |
| 4123 | * (A Loumiotis) reported that completion |
| 4124 | using a directory name containing spaces |
| 4125 | did not work. Fixed with a retry in |
| 4126 | netrw#Explore() which removes the |
| 4127 | backslashes vim inserted. |
| 4128 | Feb 26, 2014 * :Rexplore now records the current file |
| 4129 | using w:netrw_rexfile when returning via |
| 4130 | |:Rexplore| |
| 4131 | Mar 08, 2014 * (David Kotchan) provided some patches |
| 4132 | allowing netrw to work properly with |
| 4133 | windows shares. |
| 4134 | * Multiple one-liner help messages available |
| 4135 | by pressing <cr> while atop the "Quick |
| 4136 | Help" line |
| 4137 | * worked on ShellCmdPost, FocusGained event |
| 4138 | handling. |
| 4139 | * |:Lexplore| path: will be used to update |
| 4140 | a left-side netrw browsing directory. |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 4141 | Mar 12, 2014 * |netrw-s-cr|: use <s-cr> to close |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 4142 | tree directory implemented |
| 4143 | Mar 13, 2014 * (Tony Mechylynck) reported that using |
| 4144 | the browser with ftp on a directory, |
| 4145 | and selecting a gzipped txt file, that |
| 4146 | an E19 occurred (which was issued by |
| 4147 | gzip.vim). Fixed. |
| 4148 | Mar 14, 2014 * Implemented :MF and :MT (see |netrw-:MF| |
| 4149 | and |netrw-:MT|, respectively) |
| 4150 | Mar 17, 2014 * |:Ntree| [dir] wasn't working properly; fixed |
| 4151 | Mar 18, 2014 * Changed all uses of set to setl |
| 4152 | Mar 18, 2014 * Commented the netrw_btkeep line in |
| 4153 | s:NetrwOptionSave(); the effect is that |
| 4154 | netrw buffers will remain as |'bt'|=nofile. |
| 4155 | This should prevent swapfiles being created |
| 4156 | for netrw buffers. |
| 4157 | Mar 20, 2014 * Changed all uses of lcd to use s:NetrwLcd() |
| 4158 | instead. Consistent error handling results |
| 4159 | and it also handles Window's shares |
| 4160 | * Fixed |netrw-d| command when applied with ftp |
| 4161 | * https: support included for netrw#NetRead() |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 4162 | v150: Jul 12, 2013 * removed a "keepalt" to allow ":e #" to {{{2 |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 4163 | return to the netrw directory listing |
| 4164 | Jul 13, 2013 * (Jonas Diemer) suggested changing |
| 4165 | a <cWORD> to <cfile>. |
| 4166 | Jul 21, 2013 * (Yuri Kanivetsky) reported that netrw's |
| 4167 | use of mkdir did not produce directories |
Bram Moolenaar | a687837 | 2014-03-22 21:02:50 +0100 | [diff] [blame] | 4168 | following the user's umask. |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 4169 | Aug 27, 2013 * introduced |g:netrw_altfile| option |
| 4170 | Sep 05, 2013 * s:Strlen() now uses |strdisplaywidth()| |
| 4171 | when available, by default |
| 4172 | Sep 12, 2013 * (Selyano Baldo) reported that netrw wasn't |
| 4173 | opening some directories properly from the |
| 4174 | command line. |
| 4175 | Nov 09, 2013 * |:Lexplore| introduced |
| 4176 | * (Ondrej Platek) reported an issue with |
| 4177 | netrw's trees (P15). Fixed. |
| 4178 | * (Jorge Solis) reported that "t" in |
| 4179 | tree mode caused netrw to forget its |
| 4180 | line position. |
| 4181 | Dec 05, 2013 * Added <s-leftmouse> file marking |
| 4182 | (see |netrw-mf|) |
| 4183 | Dec 05, 2013 * (Yasuhiro Matsumoto) Explore should use |
| 4184 | strlen() instead s:Strlen() when handling |
| 4185 | multibyte chars with strpart() |
| 4186 | (ie. strpart() is byte oriented, not |
| 4187 | display-width oriented). |
| 4188 | Dec 09, 2013 * (Ken Takata) Provided a patch; File sizes |
| 4189 | and a portion of timestamps were wrongly |
| 4190 | highlighted with the directory color when |
| 4191 | setting `:let g:netrw_liststyle=1` on Windows. |
| 4192 | * (Paul Domaskis) noted that sometimes |
| 4193 | cursorline was activating in non-netrw |
| 4194 | windows. All but one setting of cursorline |
| 4195 | was done via setl; there was one that was |
| 4196 | overlooked. Fixed. |
| 4197 | Dec 24, 2013 * (esquifit) asked that netrw allow the |
| 4198 | /cygdrive prefix be a user-alterable |
| 4199 | parameter. |
| 4200 | Jan 02, 2014 * Fixed a problem with netrw-based ballon |
| 4201 | evaluation (ie. netrw#NetrwBaloonHelp() |
| 4202 | not having been loaded error messages) |
| 4203 | Jan 03, 2014 * Fixed a problem with tree listings |
| 4204 | * New command installed: |:Ntree| |
| 4205 | Jan 06, 2014 * (Ivan Brennan) reported a problem with |
| 4206 | |netrw-P|. Fixed. |
| 4207 | Jan 06, 2014 * Fixed a problem with |netrw-P| when the |
| 4208 | modified file was to be abandoned. |
| 4209 | Jan 15, 2014 * (Matteo Cavalleri) reported that when the |
| 4210 | banner is suppressed and tree listing is |
| 4211 | used, a blank line was left at the top of |
| 4212 | the display. Fixed. |
| 4213 | Jan 20, 2014 * (Gideon Go) reported that, in tree listing |
| 4214 | style, with a previous window open, that |
| 4215 | the wrong directory was being used to open |
| 4216 | a file. Fixed. (P21) |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 4217 | v149: Apr 18, 2013 * in wide listing format, now have maps for {{{2 |
Bram Moolenaar | e6ae622 | 2013-05-21 21:01:10 +0200 | [diff] [blame] | 4218 | w and b to move to next/previous file |
| 4219 | Apr 26, 2013 * one may now copy files in the same |
| 4220 | directory; netrw will issue requests for |
| 4221 | what names the files should be copied under |
| 4222 | Apr 29, 2013 * Trying Benzinger's problem again. Seems |
| 4223 | that commenting out the BufEnter and |
| 4224 | installing VimEnter (only) works. Weird |
| 4225 | problem! (tree listing, vim -O Dir1 Dir2) |
| 4226 | May 01, 2013 * :Explore ftp://... wasn't working. Fixed. |
| 4227 | May 02, 2013 * introduced |g:netrw_bannerbackslash| as |
| 4228 | requested by Paul Domaskis. |
Bram Moolenaar | 8d04317 | 2014-01-23 14:24:41 +0100 | [diff] [blame] | 4229 | Jul 03, 2013 * Explore now avoids splitting when a buffer |
| 4230 | will be hidden. |
Bram Moolenaar | 8feef4f | 2015-01-07 16:57:10 +0100 | [diff] [blame] | 4231 | v148: Apr 16, 2013 * changed Netrw's Style menu to allow direct {{{2 |
Bram Moolenaar | ff03419 | 2013-04-24 18:51:19 +0200 | [diff] [blame] | 4232 | choice of listing style, hiding style, and |
| 4233 | sorting style |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4234 | |
| 4235 | ============================================================================== |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 4236 | 13. Todo *netrw-todo* {{{1 |
| 4237 | |
| 4238 | 07/29/09 : banner :|g:netrw_banner| can be used to suppress the |
| 4239 | suppression banner. This feature is new and experimental, |
| 4240 | so its in the process of being debugged. |
| 4241 | 09/04/09 : "gp" : See if it can be made to work for remote systems. |
| 4242 | : See if it can be made to work with marked files. |
| 4243 | |
| 4244 | ============================================================================== |
| 4245 | 14. Credits *netrw-credits* {{{1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4246 | |
| 4247 | Vim editor by Bram Moolenaar (Thanks, Bram!) |
| 4248 | dav support by C Campbell |
| 4249 | fetch support by Bram Moolenaar and C Campbell |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 4250 | ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4251 | http support by Bram Moolenaar <bram@moolenaar.net> |
| 4252 | rcp |
| 4253 | rsync support by C Campbell (suggested by Erik Warendorph) |
| 4254 | scp support by raf <raf@comdyn.com.au> |
| 4255 | sftp support by C Campbell |
| 4256 | |
| 4257 | inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell |
| 4258 | |
| 4259 | Jérôme Augé -- also using new buffer method with ftp+.netrc |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 4260 | Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use, |
Bram Moolenaar | 7aa9f6a | 2007-05-10 18:00:30 +0000 | [diff] [blame] | 4261 | fetch,... |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4262 | Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution |
| 4263 | Erik Warendorph -- for several suggestions (g:netrw_..._cmd |
| 4264 | variables, rsync etc) |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 4265 | Doug Claar -- modifications to test for success with ftp |
Bram Moolenaar | 7aa9f6a | 2007-05-10 18:00:30 +0000 | [diff] [blame] | 4266 | operation |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4267 | |
| 4268 | ============================================================================== |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 4269 | Modelines: {{{1 |
Bram Moolenaar | 91f84f6 | 2018-07-29 15:07:52 +0200 | [diff] [blame^] | 4270 | vim:tw=78:ts=8:noet:ft=help:norl:fdm=marker |