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