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