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