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