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