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