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