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