Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 1 | *pi_netrw.txt* For Vim version 7.0. Last change: Jan 27, 2006 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2 | |
| 3 | VIM REFERENCE MANUAL by Charles E. Campbell, Jr. |
| 4 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 5 | |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 6 | *dav* *http* *network* *rcp* *scp* |
| 7 | *fetch* *netrw* *Nread* *rsync* *sftp* |
| 8 | *ftp* *netrw.vim* *Nwrite* *netrw-file* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9 | |
| 10 | ============================================================================== |
| 11 | 0. Contents *netrw-contents* |
| 12 | |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 13 | 1. Starting With Netrw.................................|netrw-start| |
| 14 | 2. Netrw Reference......................................|netrw-ref| |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 15 | CONTROLLING EXTERNAL APPLICTIONS...................|netrw-externapp| |
| 16 | READING............................................|netrw-read| |
| 17 | WRITING............................................|netrw-write| |
| 18 | DIRECTORY LISTING..................................|netrw-dirlist| |
| 19 | CHANGING THE USERID AND PASSWORD...................|netrw-chgup| |
| 20 | VARIABLES..........................................|netrw-variables| |
| 21 | PATHS..............................................|netrw-path| |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 22 | 3. Network-Oriented File Transfer.......................|netrw-xfer| |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 23 | NETRC..............................................|netrw-netrc| |
| 24 | PASSWORD...........................................|netrw-passwd| |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 25 | 4. Activation...........................................|netrw-activate| |
| 26 | 5. Transparent File Transfer............................|netrw-transparent| |
| 27 | 6. Ex Commands..........................................|netrw-ex| |
| 28 | 7. Variables and Options................................|netrw-var| |
| 29 | 8. Directory Browsing...................................|netrw-browse| {{{1 |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 30 | Maps...............................................|netrw-maps| |
| 31 | Exploring..........................................|netrw-explore-cmds| |
| 32 | Quick Reference Commands Table.....................|netrw-browse-cmds| |
| 33 | Netrw Browser Variables............................|netrw-browse-var| |
| 34 | Introduction To Directory Browsing.................|netrw-browse-intro| |
| 35 | Directory Exploring Commands.......................|netrw-explore| |
| 36 | Refreshing The Listing.............................|netrw-ctrl-l| |
| 37 | Going Up...........................................|netrw--| |
| 38 | Browsing...........................................|netrw-cr| |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 39 | Obtaining A File...................................|netrw-O| |
| 40 | Thin, Long, and Wide Listings......................|netrw-i| |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 41 | Making A New Directory.............................|netrw-d| |
| 42 | Deleting Files Or Directories......................|netrw-delete| |
| 43 | Renaming Files Or Directories......................|netrw-move| |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 44 | Hiding Files Or Directories........................|netrw-a| |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 45 | Edit File Or Directory Hiding List.................|netrw-ctrl-h| |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 46 | Browsing With A Horizontally Split Window..........|netrw-o| |
| 47 | Preview Window.....................................|netrw-p| |
| 48 | Selecting Sorting Style............................|netrw-s| |
| 49 | Editing The Sorting Sequence.......................|netrw-S| |
| 50 | Reversing Sorting Order............................|netrw-r| |
| 51 | Changing To A Predecessor Directory................|netrw-u| |
| 52 | Changing To A Successor Directory..................|netrw-U| |
| 53 | Browsing With A Vertically Split Window............|netrw-v| |
| 54 | Customizing Browsing With A User Function..........|netrw-x| |
| 55 | Making The Browsing Directory The Current Directory|netrw-c| |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 56 | Bookmarking A Directory............................|netrw-b| |netrw-Nb| |
| 57 | Changing To A Bookmarked Directory.................|netrw-B| |netrw-NB| |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 58 | Listing Bookmarks And History......................|netrw-q| |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 59 | Improving Directory Browsing.......................|netrw-listhack| }}}1 |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 60 | 9. Problems and Fixes...................................|netrw-problems| |
| 61 | 10. Debugging............................................|netrw-debug| |
| 62 | 11. History..............................................|netrw-history| |
| 63 | 12. Credits..............................................|netrw-credits| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 64 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 65 | The Netrw plugin is generally sourced automatically as it is a |
| 66 | |standard-plugin|. That said, to make use of netrw, one must |
| 67 | have plugins available which can be done with the following |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 68 | two lines in your <.vimrc>: > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 69 | |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 70 | set nocp " 'compatible' is not set |
| 71 | filetype plugin on " plugins are enabled |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 72 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 73 | You can avoid loading this plugin by setting the "loaded_netrw" variable |
| 74 | in your <.vimrc> file: > |
| 75 | |
| 76 | :let loaded_netrw = 1 |
| 77 | |
| 78 | {Vi does not have any of this} |
| 79 | |
| 80 | ============================================================================== |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 81 | 1. Starting With Netrw *netrw-start* |
| 82 | |
| 83 | Netrw makes reading, writing, and browsing over a network connection easy! |
| 84 | First, make sure that you have plugins enabled, so you'll need to have at |
| 85 | least the following in your <.vimrc>: (or see |netrw-activate|) > |
| 86 | |
| 87 | set nocp " 'compatible' is not set |
| 88 | filetype plugin on " plugins are enabled |
| 89 | < |
| 90 | (see |'cp'| and |:filetype-plugin-on|) |
| 91 | |
| 92 | Netrw supports "transparent" editing of files on other machines using urls |
| 93 | (see |netrw-transparent|). As an example of this, let's assume you have an |
| 94 | account on some other machine; try > |
| 95 | |
| 96 | vim scp://hostname/path/to/file |
| 97 | < |
| 98 | if you have an ssh connection. Want to make ssh/scp easier to use? Check |
| 99 | out |netrw-listhack|! |
| 100 | |
| 101 | What if you have ftp, not ssh/scp? That's easy, too; try > |
| 102 | |
| 103 | vim ftp://hostname/path/to/file |
| 104 | < |
| 105 | Want to make ftp simpler to use? See if your ftp supports a file called |
| 106 | <.netrc> -- typically it goes in your home directory, has read/write |
| 107 | permissions for only the user to read (ie. not group, world, other, etc), |
| 108 | and has lines resembling > |
| 109 | |
| 110 | machine HOSTNAME login USERID password "PASSWORD" |
| 111 | machine HOSTNAME login USERID password "PASSWORD" |
| 112 | ... |
| 113 | default login USERID password "PASSWORD" |
| 114 | < |
| 115 | How about browsing -- ie. you just want to look around before editing a |
| 116 | file. For browsing on your current host, just "edit" a directory: > |
| 117 | |
| 118 | vim . |
| 119 | vim /home/userid/path |
| 120 | < |
| 121 | For browsing on a remote host, "edit" a directory (but make sure that |
| 122 | the directory name is followed by a "/"): > |
| 123 | |
| 124 | vim scp://hostname/ |
| 125 | vim ftp://hostname/path/to/dir/ |
| 126 | < |
| 127 | See |netrw-browse| for more! |
| 128 | |
| 129 | There's more protocols supported than scp and ftp, too: see the next |
| 130 | section, |netrw-externapp|. |
| 131 | |
| 132 | ============================================================================== |
| 133 | 2. Netrw Reference *netrw-ref* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 134 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 135 | CONTROLLING EXTERNAL APPLICTIONS *netrw-externapp* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 136 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 137 | Protocol Variable Default Value |
| 138 | -------- ---------------- ------------- |
| 139 | dav: *g:netrw_dav_cmd* = "cadaver" |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 140 | fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 141 | ftp: *g:netrw_ftp_cmd* = "ftp" |
| 142 | http: *g:netrw_http_cmd* = "fetch -o" if fetch is available |
| 143 | http: g:netrw_http_cmd = "wget -q -O" If wget is available |
| 144 | rcp: *g:netrw_rcp_cmd* = "rcp" |
| 145 | rsync: *g:netrw_rsync_cmd* = "rsync -a" |
| 146 | scp: *g:netrw_scp_cmd* = "scp -q" |
| 147 | sftp: *g:netrw_sftp_cmd* = "sftp" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 148 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 149 | READING *netrw-read* *netrw-nread* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 150 | :Nread ? give help |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 151 | :Nread "machine:path" uses rcp |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 152 | :Nread "machine path" uses ftp w/ <.netrc> |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 153 | :Nread "machine id password path" uses ftp |
| 154 | :Nread "dav://machine[:port]/path" uses cadaver |
| 155 | :Nread "fetch://[user@]machine/path" uses fetch |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 156 | :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 157 | :Nread "http://[user@]machine/path" uses http uses wget |
| 158 | :Nread "rcp://[user@]machine/path" uses rcp |
| 159 | :Nread "rsync://[user@]machine[:port]/path" uses rsync |
| 160 | :Nread "scp://[user@]machine[[:#]port]/path" uses scp |
| 161 | :Nread "sftp://[user@]machine/path" uses sftp |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 162 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 163 | WRITING *netrw-write* *netrw-nwrite* |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 164 | :Nwrite ? give help |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 165 | :Nwrite "machine:path" uses rcp |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 166 | :Nwrite "machine path" uses ftp w/ <.netrc> |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 167 | :Nwrite "machine id password path" uses ftp |
| 168 | :Nwrite "dav://machine[:port]/path" uses cadaver |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 169 | :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 170 | :Nwrite "rcp://[user@]machine/path" uses rcp |
| 171 | :Nwrite "rsync://[user@]machine[:port]/path" uses rsync |
| 172 | :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp |
| 173 | :Nwrite "sftp://[user@]machine/path" uses sftp |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 174 | http: not supported! |
| 175 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 176 | DIRECTORY LISTING *netrw-dirlist* |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 177 | :Nread [protocol]://[user]@hostname/path/ |
| 178 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 179 | CHANGING USERID AND PASSWORD *netrw-chgup* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 180 | Attempts to use ftp will prompt you for a user-id and a password. |
| 181 | These will be saved in g:netrw_uid and g:netrw_passwd Subsequent uses |
| 182 | of ftp will re-use those. If you need to use a different user id |
| 183 | and/or password, you'll want to call NetUserPass() first. |
| 184 | |
| 185 | :NetUserPass [uid [password]] -- prompts as needed |
| 186 | :call NetUserPass() -- prompts for uid and password |
| 187 | :call NetUserPass("uid") -- prompts for password |
| 188 | :call NetUserPass("uid","password") -- sets global uid and password |
| 189 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 190 | VARIABLES *netrw-variables* |
| 191 | *b:netrw_lastfile* last file Network-read/written retained on a per-buffer |
| 192 | basis (supports plain :Nw ) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 193 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 194 | *s:netrw_line* during :Nw/NetWrite, holds current line number |
| 195 | *s:netrw_col* during :Nw/NetWrite, holds current column number |
| 196 | s:netrw_line and s:netrw_col are used to |
| 197 | restore the cursor position on writes |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 198 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 199 | *g:netrw_ftp* if it doesn't exist, use default ftp |
| 200 | =0 use default ftp (uid password) |
| 201 | =1 use alternate ftp method (user uid password) |
| 202 | If you're having trouble with ftp, try changing the |
| 203 | value of this variable to see if the alternate ftp |
| 204 | method works for your setup. |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 205 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 206 | *g:netrw_ftpmode* ="binary" (default) |
| 207 | ="ascii" |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 208 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 209 | *g:netrw_ignorenetrc* =0 (default) |
| 210 | =1 If you have a <.netrc> file but it doesn't work and |
| 211 | you want it ignored, then set this variable as shown. |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 212 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 213 | *g:netrw_uid* (ftp) user-id, retained on a per-session basis |
| 214 | *g:netrw_passwd* (ftp) password, retained on a per-session basis |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 215 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 216 | *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank |
| 217 | lines that o/s's ftp "provides" on transfers |
| 218 | =0 force normal ftp behavior (no trailing line removal) |
| 219 | |
| 220 | *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also |
| 221 | permits network browsing to use ls with time and |
| 222 | size sorting (default if windows) |
| 223 | =0 assume Windows' scp accepts windows-style paths |
| 224 | Network browsing uses dir instead of ls |
| 225 | This option is ignored if you're using unix |
| 226 | |
| 227 | *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP |
| 228 | =1 use WinNT's rcp in binary mode (default) |
| 229 | |
| 230 | PATHS *netrw-path* |
| 231 | |
| 232 | Paths to files are generally user-directory relative for most protocols. |
| 233 | It is possible that some protocol will make paths relative to some |
| 234 | associated directory, however. |
| 235 | > |
| 236 | example: vim scp://user@host/somefile |
| 237 | example: vim scp://user@host/subdir1/subdir2/somefile |
| 238 | < |
| 239 | where "somefile" is the "user"'s home directory. If you wish to get a |
| 240 | file using root-relative paths, use the full path: |
| 241 | > |
| 242 | example: vim scp://user@host//somefile |
| 243 | example: vim scp://user@host//subdir1/subdir2/somefile |
| 244 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 245 | |
| 246 | ============================================================================== |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 247 | 3. Network-Oriented File Transfer *netrw-xfer* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 248 | |
| 249 | 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] | 250 | (<netrw.vim>) using plugin techniques. It currently supports both reading and |
| 251 | writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch, |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 252 | dav/cadaver, rsync, or sftp. |
| 253 | |
| 254 | http is currently supported read-only via use of wget or fetch. |
| 255 | |
| 256 | <netrw.vim> is a standard plugin which acts as glue between Vim and the |
| 257 | various file transfer programs. It uses autocommand events (BufReadCmd, |
| 258 | FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. > |
| 259 | |
| 260 | ex. vim ftp://hostname/path/to/file |
| 261 | < |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 262 | The characters preceding the colon specify the protocol to use; in the |
| 263 | example, its ftp. The <netrw.vim> script then formulates a command or a |
| 264 | series of commands (typically ftp) which it issues to an external program |
| 265 | (ftp, scp, etc) which does the actual file transfer/protocol. Files are read |
| 266 | from/written to a temporary file (under Unix/Linux, /tmp/...) which the |
| 267 | <netrw.vim> script will clean up. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 268 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 269 | One may modify any protocol's implementing external application by setting a |
| 270 | variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to |
| 271 | "scp -q"). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 272 | |
| 273 | Ftp, an old protocol, seems to be blessed by numerous implementations. |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 274 | Unfortunately, some implementations are noisy (ie., add junk to the end of the |
| 275 | file). Thus, concerned users may decide to write a NetReadFixup() function |
| 276 | that will clean up after reading with their ftp. Some Unix systems (ie., |
| 277 | FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is |
| 278 | not noisy and more convenient, actually, for <netrw.vim> to use. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 279 | Consequently, if "fetch" is executable, it will be used to do reads for |
| 280 | ftp://... (and http://...) . See |netrw-var| for more about this. |
| 281 | |
| 282 | 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] | 283 | transparently; ie. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 284 | > |
| 285 | vim rcp://[user@]machine/path |
| 286 | vim scp://[user@]machine/path |
| 287 | < |
| 288 | If your ftp supports <.netrc>, then it too can be just as transparently used |
| 289 | if the needed triad of machine name, user id, and password are present in |
| 290 | that file. Your ftp must be able to use the <.netrc> file on its own, however. |
| 291 | > |
| 292 | vim ftp://[user@]machine[[:#]portnumber]/path |
| 293 | < |
| 294 | However, ftp will often need to query the user for the userid and password. |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 295 | 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] | 296 | the actually-typed-in password. Netrw will retain the userid and password |
| 297 | for subsequent read/writes from the most recent transfer so subsequent |
| 298 | transfers (read/write) to or from that machine will take place without |
| 299 | additional prompting. |
| 300 | |
| 301 | *netrw-urls* |
| 302 | +=================================+============================+============+ |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 303 | | Reading | Writing | Uses | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 304 | +=================================+============================+============+ |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 305 | | DAV: | | | |
| 306 | | dav://host/path | | cadaver | |
| 307 | | :Nread dav://host/path | :Nwrite dav://host/path | cadaver | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 308 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 309 | | FETCH: | | | |
| 310 | | fetch://[user@]host/path | | | |
| 311 | | fetch://[user@]host:http/path | Not Available | fetch | |
| 312 | | :Nread fetch://[user@]host/path| | | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 313 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 314 | | FILE: | | | |
| 315 | | file:///* | file:///* | | |
| 316 | | file://localhost/* | file://localhost/* | | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 317 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 318 | | FTP: (*3) | (*3) | | |
| 319 | | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) | |
| 320 | | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc | |
| 321 | | :Nread host path | :Nwrite host path | ftp+.netrc | |
| 322 | | :Nread host uid pass path | :Nwrite host uid pass path | ftp | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 323 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 324 | | HTTP: wget is executable: (*4) | | | |
| 325 | | http://[user@]host/path | Not Available | wget | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 326 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 327 | | HTTP: fetch is executable (*4) | | | |
| 328 | | http://[user@]host/path | Not Available | fetch | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 329 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 330 | | RCP: | | | |
| 331 | | rcp://[user@]host/path | rcp://[user@]host/path | rcp | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 332 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 333 | | RSYNC: | | | |
| 334 | | rsync://[user@]host/path | rsync://[user@]host/path | rsync | |
| 335 | | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync | |
| 336 | | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 337 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 338 | | SCP: | | | |
| 339 | | scp://[user@]host/path | scp://[user@]host/path | scp | |
| 340 | | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 341 | +---------------------------------+----------------------------+------------+ |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 342 | | SFTP: | | | |
| 343 | | sftp://[user@]host/path | sftp://[user@]host/path | sftp | |
| 344 | | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 345 | +=================================+============================+============+ |
| 346 | |
| 347 | (*1) For an absolute path use scp://machine//path. |
| 348 | |
| 349 | (*2) if <.netrc> is present, it is assumed that it will |
| 350 | work with your ftp client. Otherwise the script will |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 351 | prompt for user-id and pasword. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 352 | |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 353 | (*3) for ftp, "machine" may be machine#port or machine:port |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 354 | if a different port is needed than the standard ftp port |
| 355 | |
| 356 | (*4) for http:..., if wget is available it will be used. Otherwise, |
| 357 | if fetch is available it will be used. |
| 358 | |
| 359 | Both the :Nread and the :Nwrite ex-commands can accept multiple filenames. |
| 360 | |
| 361 | |
| 362 | NETRC *netrw-netrc* |
| 363 | |
| 364 | The typical syntax for lines in a <.netrc> file is given as shown below. |
| 365 | Ftp under Unix usually support <.netrc>; Windows' ftp usually doesn't. |
| 366 | > |
| 367 | machine {full machine name} login {user-id} password "{password}" |
| 368 | default login {user-id} password "{password}" |
| 369 | |
| 370 | Your ftp client must handle the use of <.netrc> on its own, but if the |
| 371 | <.netrc> file exists, an ftp transfer will not ask for the user-id or |
| 372 | password. |
| 373 | |
| 374 | Note: |
| 375 | Since this file contains passwords, make very sure nobody else can |
| 376 | read this file! Most programs will refuse to use a .netrc that is |
| 377 | readable for others. Don't forget that the system administrator can |
| 378 | still read the file! |
| 379 | |
| 380 | |
| 381 | PASSWORD *netrw-passwd* |
| 382 | |
| 383 | The script attempts to get passwords for ftp invisibly using |inputsecret()|, |
| 384 | a built-in Vim function. See |netrw-uidpass| for how to change the password |
| 385 | after one has set it. |
| 386 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 387 | Unfortunately there doesn't appear to be a way for netrw to feed a password to |
| 388 | scp. Thus every transfer via scp will require re-entry of the password. |
| 389 | However, |netrw-listhack| can help with this problem. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 390 | |
| 391 | |
| 392 | ============================================================================== |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 393 | 4. Activation *netrw-activate* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 394 | |
| 395 | Network-oriented file transfers are available by default whenever |
| 396 | |'nocompatible'| mode is enabled. The <netrw.vim> file resides in your |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 397 | system's vim-plugin directory and is sourced automatically whenever you bring |
| 398 | up vim. I suggest that, at a minimum, you have at least the following in your |
| 399 | <.vimrc> customization file: > |
| 400 | set nocp |
| 401 | if version >= 600 |
| 402 | filetype plugin indent on |
| 403 | endif |
| 404 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 405 | |
| 406 | ============================================================================== |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 407 | 5. Transparent File Transfer *netrw-transparent* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 408 | |
| 409 | Transparent file transfers occur whenever a regular file read or write |
| 410 | (invoked via an |:autocmd| for |BufReadCmd| or |BufWriteCmd| events) is made. |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 411 | Thus one may use files across networks just as simply as if they were local. > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 412 | |
| 413 | vim ftp://[user@]machine/path |
| 414 | ... |
| 415 | :wq |
| 416 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 417 | See |netrw-activate| for more on how to encourage your vim to use plugins |
| 418 | such as netrw. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 419 | |
| 420 | ============================================================================== |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 421 | 6. Ex Commands *netrw-ex* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 422 | |
| 423 | The usual read/write commands are supported. There are also a couple of |
| 424 | additional commands available. |
| 425 | |
| 426 | :[range]Nw Write the specified lines to the current |
| 427 | file as specified in b:netrw_lastfile. |
| 428 | |
| 429 | :[range]Nw {netfile} [{netfile}]... |
| 430 | Write the specified lines to the {netfile}. |
| 431 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 432 | :Nread Read the specified lines into the current |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 433 | buffer from the file specified in |
| 434 | b:netrw_lastfile. |
| 435 | |
| 436 | :Nread {netfile} {netfile}... |
| 437 | Read the {netfile} after the current line. |
| 438 | |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 439 | *netrw-uidpass* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 440 | :call NetUserPass() |
| 441 | If b:netrw_uid and b:netrw_passwd don't exist, |
| 442 | this function query the user for them. |
| 443 | |
| 444 | :call NetUserPass("userid") |
| 445 | This call will set the b:netrw_uid and, if |
| 446 | the password doesn't exist, will query the user for it. |
| 447 | |
| 448 | :call NetUserPass("userid","passwd") |
| 449 | This call will set both the b:netrw_uid and b:netrw_passwd. |
| 450 | The user-id and password are used by ftp transfers. One may |
| 451 | effectively remove the user-id and password by using "" |
| 452 | strings. |
| 453 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 454 | :NetrwSettings This command is desribed in |netrw-settings| -- used to |
| 455 | display netrw settings and change netrw behavior |
| 456 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 457 | |
| 458 | ============================================================================== |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 459 | 7. Variables and Options *netrw-options* *netrw-var* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 460 | |
| 461 | The script <netrw.vim> uses several variables which can affect <netrw.vim>'s |
| 462 | behavior. These variables typically may be set in the user's <.vimrc> file: |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 463 | (also see |netrw-settings|) > |
| 464 | |
| 465 | ------------- |
| 466 | Netrw Options |
| 467 | ------------- |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 468 | Option Meaning |
| 469 | -------------- ----------------------------------------------- |
| 470 | < |
| 471 | b:netrw_col Holds current cursor position (during NetWrite) |
| 472 | g:netrw_cygwin =1 assume scp under windows is from cygwin |
| 473 | (default/windows) |
| 474 | =0 assume scp under windows accepts windows |
| 475 | style paths (default/else) |
| 476 | g:netrw_ftp =0 use default ftp (uid password) |
| 477 | g:netrw_ftpmode ="binary" (default) |
| 478 | ="ascii" (your choice) |
| 479 | g:netrw_ignorenetrc =1 (default) |
| 480 | if you have a <.netrc> file but you don't |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 481 | want it used, then set this variable. Its |
| 482 | mere existence is enough to cause <.netrc> |
| 483 | to be ignored. |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 484 | b:netrw_lastfile Holds latest method/machine/path. |
| 485 | b:netrw_line Holds current line number (during NetWrite) |
| 486 | g:netrw_passwd Holds current password for ftp. |
| 487 | g:netrw_silent =0 transfers done normally |
| 488 | =1 transfers done silently |
| 489 | g:netrw_uid Holds current user-id for ftp. |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 490 | =1 use alternate ftp (user uid password) |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 491 | (see |netrw-options|) |
| 492 | g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default) |
| 493 | =1 use WinNT/2K/XP's rcp, binary mode |
| 494 | g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc |
| 495 | =1 use default method to do ftp > |
| 496 | ----------------------------------------------------------------------- |
| 497 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 498 | The script will also make use of the following variables internally, albeit |
| 499 | temporarily. |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 500 | > |
| 501 | ------------------- |
| 502 | Temporary Variables |
| 503 | ------------------- |
| 504 | Variable Meaning |
| 505 | -------- ------------------------------------ |
| 506 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 507 | g:netrw_method Index indicating rcp/ftp+.netrc/ftp |
| 508 | g:netrw_machine Holds machine name parsed from input |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 509 | g:netrw_fname Holds filename being accessed > |
| 510 | ------------------------------------------------------------ |
| 511 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 512 | *netrw-protocol* |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 513 | |
| 514 | Netrw supports a number of protocols. These protocols are invoked using the |
| 515 | variables listed below, and may be modified by the user. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 516 | > |
| 517 | ------------------------ |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 518 | Protocol Control Options |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 519 | ------------------------ |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 520 | Option Type Setting Meaning |
| 521 | --------- -------- -------------- --------------------------- |
| 522 | < |
| 523 | netrw_ftp variable =doesn't exist userid set by "user userid" |
| 524 | =0 userid set by "user userid" |
| 525 | =1 userid set by "userid" |
| 526 | NetReadFixup function =doesn't exist no change |
| 527 | =exists Allows user to have files |
| 528 | read via ftp automatically |
| 529 | transformed however they wish |
| 530 | by NetReadFixup() |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 531 | g:netrw_dav_cmd variable ="cadaver" |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 532 | g:netrw_fetch_cmd variable ="fetch -o" if fetch is available |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 533 | g:netrw_ftp_cmd variable ="ftp" |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 534 | g:netrw_http_cmd variable ="fetch -o" if fetch is available |
| 535 | g:netrw_http_cmd variable ="wget -O" else if wget is available |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 536 | g:netrw_list_cmd variable ="ssh HOSTNAME ls -Fa" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 537 | g:netrw_rcp_cmd variable ="rcp" |
| 538 | g:netrw_rsync_cmd variable ="rsync -a" |
| 539 | g:netrw_scp_cmd variable ="scp -q" |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 540 | g:netrw_sftp_cmd variable ="sftp" > |
| 541 | ------------------------------------------------------------------------- |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 542 | < |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 543 | *netrw-ftp* |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 544 | The first two options (netrw_ftp and NetReadFixup) both help with certain |
| 545 | ftp's that give trouble otherwise. In order to best understand how to use |
| 546 | these options if ftp is giving you troubles, a bit of discussion follows on |
| 547 | how netrw does ftp reads. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 548 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 549 | The g:netrw_..._cmd variables specify the external program to use handle the |
| 550 | associated protocol (rcp, ftp, etc), plus any options. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 551 | |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 552 | The g:netrw_list_cmd's HOSTNAME entry will be changed via substitution with |
| 553 | whatever the current request is for a hostname. |
| 554 | |
| 555 | 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] | 556 | temporary file: |
| 557 | > |
| 558 | IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1 |
| 559 | ---------------------------------- ------------------------------ |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 560 | < |
| 561 | open machine [port] open machine [port] |
| 562 | user userid password userid password |
| 563 | [g:netrw_ftpmode] password |
| 564 | get filename tempfile [g:netrw_ftpmode] |
| 565 | get filename tempfile > |
| 566 | --------------------------------------------------------------------- |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 567 | < |
| 568 | Netrw then executes the lines above by use of a filter: |
| 569 | > |
| 570 | :%! {g:netrw_ftp_cmd} -i [-n] |
| 571 | < |
| 572 | |
| 573 | where |
| 574 | g:netrw_ftp_cmd is usually "ftp", |
| 575 | -i tells ftp not to be interactive |
| 576 | -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>) |
| 577 | |
| 578 | 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] | 579 | userid and password. The transferred file is put into a temporary file. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 580 | The temporary file is then read into the main editing session window that |
| 581 | requested it and the temporary file deleted. |
| 582 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 583 | If your ftp doesn't accept the "user" command and immediately just demands a |
| 584 | userid, then try putting "let netrw_ftp=1" in your <.vimrc>. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 585 | |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 586 | *netrw-cadaver* |
| 587 | To handle the SSL certificate dialog for untrusted servers, one may pull |
| 588 | down the certificate and place it into /usr/ssl/cert.pem. This operation |
| 589 | renders the server treatment as "trusted". |
| 590 | |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 591 | *netrw-fixup* *netreadfixup* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 592 | If your ftp for whatever reason generates unwanted lines (such as AUTH |
| 593 | messages) you may write a NetReadFixup(tmpfile) function: |
| 594 | > |
| 595 | function! NetReadFixup(method,line1,line2) |
| 596 | " a:line1: first new line in current file |
| 597 | " a:line2: last new line in current file |
| 598 | if a:method == 1 "rcp |
| 599 | elseif a:method == 2 "ftp + <.netrc> |
| 600 | elseif a:method == 3 "ftp + machine,uid,password,filename |
| 601 | elseif a:method == 4 "scp |
| 602 | elseif a:method == 5 "http/wget |
| 603 | elseif a:method == 6 "dav/cadaver |
| 604 | elseif a:method == 7 "rsync |
| 605 | elseif a:method == 8 "fetch |
| 606 | elseif a:method == 9 "sftp |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 607 | else " complain |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 608 | endif |
| 609 | endfunction |
| 610 | > |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 611 | The NetReadFixup() function will be called if it exists and thus allows you to |
| 612 | customize your reading process. As a further example, <netrw.vim> contains |
| 613 | just such a function to handle Windows 95 ftp. For whatever reason, Windows |
| 614 | 95's ftp dumps four blank lines at the end of a transfer, and so it is |
| 615 | desirable to automate their removal. Here's some code taken from <netrw.vim> |
| 616 | itself: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 617 | > |
| 618 | if has("win95") && g:netrw_win95ftp |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 619 | fun! NetReadFixup(method, line1, line2) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 620 | if method == 3 " ftp (no <.netrc>) |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 621 | let fourblanklines= line2 - 3 |
| 622 | silent fourblanklines.",".line2."g/^\s*/d" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 623 | endif |
| 624 | endfunction |
| 625 | endif |
| 626 | > |
| 627 | |
| 628 | ============================================================================== |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 629 | 8. Directory Browsing *netrw-browse* *netrw-dir* *netrw-list* *netrw-help* |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 630 | |
| 631 | MAPS *netrw-maps* |
| 632 | ?................Help.......................................|netrw-help| |
| 633 | <cr>.............Browsing...................................|netrw-cr| |
| 634 | <del>............Deleting Files or Directories..............|netrw-delete| |
| 635 | -................Going Up...................................|netrw--| |
| 636 | a................Hiding Files or Directories................|netrw-a| |
| 637 | b................Bookmarking a Directory....................|netrw-b| |
| 638 | B................Changing to a Bookmarked Directory.........|netrw-B| |
| 639 | c................Make Browsing Directory The Current Dir....|netrw-c| |
| 640 | d................Make A New Directory.......................|netrw-d| |
| 641 | D................Deleting Files or Directories..............|netrw-D| |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 642 | <c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h| |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 643 | i................Long Listing...............................|netrw-i| |
| 644 | <c-l>............Refreshing the Listing.....................|netrw-ctrl-l| |
| 645 | o................Browsing with a Horizontal Split...........|netrw-o| |
| 646 | p................Preview Window.............................|netrw-p| |
| 647 | q................Listing Bookmarks and History..............|netrw-q| |
| 648 | r................Reversing Sorting Order....................|netrw-r| |
| 649 | R................Renaming Files or Directories..............|netrw-R| |
| 650 | s................Selecting Sorting Style....................|netrw-s| |
| 651 | S................Editing the Sorting Sequence...............|netrw-S| |
| 652 | u................Changing to a Predecessor Directory........|netrw-u| |
| 653 | U................Changing to a Successor Directory..........|netrw-U| |
| 654 | v................Browsing with a Vertical Split.............|netrw-v| |
| 655 | x................Customizing Browsing.......................|netrw-x| |
| 656 | |
| 657 | COMMANDS *netrw-explore-cmds* |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 658 | :Explore[!] [dir] Explore directory of current file........|netrw-explore| |
| 659 | :Sexplore[!] [dir] Split & Explore directory ...............|netrw-explore| |
| 660 | :Hexplore[!] [dir] Horizontal Split & Explore...............|netrw-explore| |
| 661 | :Vexplore[!] [dir] Vertical Split & Explore.................|netrw-explore| |
| 662 | :Pexplore[!] [dir] Vertical Split & Explore.................|netrw-explore| |
| 663 | :Nexplore[!] [dir] Vertical Split & Explore.................|netrw-explore| |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 664 | :NetrwSettings.............................................|netrw-settings| |
Bram Moolenaar | 269ec65 | 2004-07-29 08:43:53 +0000 | [diff] [blame] | 665 | |
| 666 | QUICK REFERENCE COMMANDS TABLE *netrw-browse-cmds* |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 667 | > |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 668 | ------- ----------- |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 669 | Command Explanation |
| 670 | ------- ----------- |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 671 | < ? Causes Netrw to issue help |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 672 | <cr> Netrw will enter the directory or read the file |netrw-cr| |
| 673 | <del> Netrw will attempt to remove the file/directory |netrw-del| |
| 674 | - Makes Netrw go up one directory |netrw--| |
| 675 | a Toggles between normal display, |netrw-a| |
| 676 | hiding (suppress display of files matching g:netrw_list_hide) |
| 677 | showing (display only files which match g:netrw_list_hide) |
| 678 | b bookmark current directory; use Nb if compact listing |
| 679 | in use |netrw-b| |
| 680 | B go to previous bookmarked directory; use Nb if compact |
| 681 | listing is in use |netrw-B| |
| 682 | c Make current browsing directory the current directory |netrw-c| |
| 683 | d Make a directory |netrw-d| |
| 684 | D Netrw will attempt to remove the file(s)/directory(ies) |netrw-D| |
| 685 | <c-h> Edit file hiding list |netrw-ctrl-h| |
| 686 | i Toggles between long and short listing |netrw-i| |
| 687 | <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l| |
| 688 | Nb Same as b, but always available |netrw-Nb| |
| 689 | NB Same as B, but always available |netrw-NB| |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 690 | o Enter the file/directory under the cursor in a new browser |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 691 | window. A horizontal split is used. |netrw-o| |
| 692 | O Obtain a file specified by cursor |netrw-O| |
| 693 | p Preview the file |netrw-p| |
| 694 | P Browse in the previously used window |netrw-P| |
| 695 | r Reverse sorting order |netrw-r| |
| 696 | R Rename the designed file(s)/directory(ies) |netrw-R| |
| 697 | s Select sorting style: by name, time, or file size |netrw-s| |
| 698 | S Specify suffix priority for name-sorting |netrw-S| |
| 699 | u Change to recently-visited directory |netrw-u| |
| 700 | U Change to subsequently-visited directory |netrw-U| |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 701 | v Enter the file/directory under the cursor in a new browser |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 702 | window. A vertical split is used. |netrw-v| |
| 703 | x Apply a function to a file. (special browsers) |netrw-x| |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 704 | |
Bram Moolenaar | 269ec65 | 2004-07-29 08:43:53 +0000 | [diff] [blame] | 705 | NETRW BROWSER VARIABLES *netrw-browse-var* |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 706 | > |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 707 | --- ----------- |
| 708 | Var Explanation |
| 709 | --- ----------- |
| 710 | < *g:netrw_alto* change from above splitting to below splitting |
| 711 | by setting this variable (see |netrw-o|) |
| 712 | default: =0 |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 713 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 714 | *g:netrw_altv* change from left splitting to right splitting |
| 715 | by setting this variable (see |netrw-v|) |
| 716 | default: =0 |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 717 | |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 718 | *g:netrw_browse_split* when browsing, <cr> will open the file by: |
| 719 | =0: re-using the same window |
| 720 | =1: horizontally splitting the window first |
| 721 | =2: vertically splitting the window first |
| 722 | *g:netrw_browsex_viewer* specify user's preference for a viewer: > |
| 723 | "kfmclient exec" |
| 724 | "gnome-open" |
| 725 | < If > |
| 726 | "-" |
| 727 | < is used, then netrwFileHandler() will look for |
| 728 | a script/function to handle the given |
| 729 | extension. (see |netrw_filehandler|). |
| 730 | < |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 731 | *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings |
| 732 | that can show up as "directories" and "files" |
| 733 | in the listing. This pattern is used to |
| 734 | remove such embedded messages. By default its |
| 735 | value is: |
| 736 | '^total\s\+\d\+$\| |
| 737 | ^Trying\s\+\d\+.*$\| |
| 738 | ^KERBEROS_V\d rejected\| |
| 739 | ^Security extensions not\| |
| 740 | No such file\| |
| 741 | : connect to address [0-9a-fA-F:]* |
| 742 | : No route to host$' |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 743 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 744 | *g:netrw_ftp_list_cmd* options for passing along to ftp for directory |
| 745 | listing. Defaults: |
| 746 | unix or g:netrw_cygwin set: : "ls -lF" |
| 747 | otherwise "dir" |
| 748 | |
| 749 | *g:netrw_hide* if true, the hiding list is used |
| 750 | default: =0 |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 751 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 752 | *g:netrw_keepdir* =1 (default) keep current directory immune from |
| 753 | the browsing directory. |
| 754 | =0 keep the current directory the same as the |
| 755 | browsing directory. |
| 756 | The current browsing directory is contained in |
| 757 | b:netrw_curdir |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 758 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 759 | *g:netrw_list_cmd* command for listing remote directories |
| 760 | default: (if ssh is executable) |
| 761 | "ssh HOSTNAME ls -FLa" |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 762 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 763 | *g:netrw_longlist* if =1, then long listing will be default |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 764 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 765 | *g:netrw_list_hide* comma separated pattern list for hiding files |
| 766 | default: "" |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 767 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 768 | *g:netrw_local_mkdir* command for making a local directory |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 769 | default: "mkdir" |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 770 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 771 | *g:netrw_local_rmdir* remove directory command (rmdir) |
| 772 | default: "rmdir" |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 773 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 774 | *g:netrw_maxfilenamelen* =32 by default, selected so as to make long |
| 775 | listings fit on 80 column displays. |
| 776 | If your screen is wider, and you have file |
| 777 | or directory names longer than 32 bytes, |
| 778 | you may set this option to keep listings |
| 779 | columnar. |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 780 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 781 | *g:netrw_mkdir_cmd* command for making a remote directory |
| 782 | default: "ssh HOSTNAME mkdir" |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 783 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 784 | *g:netrw_rm_cmd* command for removing files |
| 785 | default: "ssh HOSTNAME rm" |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 786 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 787 | *g:netrw_rmdir_cmd* command for removing directories |
| 788 | default: "ssh HOSTNAME rmdir" |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 789 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 790 | *g:netrw_rmf_cmd* command for removing softlinks |
| 791 | default: "ssh HOSTNAME rm -f" |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 792 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 793 | *g:netrw_sort_by* sort by "name", "time", or "size" |
| 794 | default: "name" |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 795 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 796 | *g:netrw_sort_direction* sorting direction: "normal" or "reverse" |
| 797 | default: "normal" |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 798 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 799 | *g:netrw_sort_sequence* when sorting by name, first sort by the |
| 800 | comma-separated pattern sequence |
| 801 | default: '[\/]$,*,\.bak$,\.o$,\.h$, |
| 802 | \.info$,\.swp$,\.obj$' |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 803 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 804 | *g:netrw_ssh_cmd* One may specify an executable command |
| 805 | to use instead of ssh for remote actions |
| 806 | such as listing, file removal, etc. |
| 807 | default: ssh |
| 808 | |
| 809 | *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines, |
| 810 | messages, banners, and whatnot that one doesn't |
| 811 | want masquerading as "directories" and "files". |
| 812 | Use this pattern to remove such embedded |
| 813 | messages. By default its value is: |
| 814 | '^total\s\+\d\+$' |
| 815 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 816 | *g:netrw_timefmt* specify format string to strftime() (%c) |
| 817 | default: "%c" |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 818 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 819 | *g:netrw_winsize* specify initial size of new o/v windows |
| 820 | default: "" |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 821 | |
| 822 | INTRODUCTION TO DIRECTORY BROWSING *netrw-browse-intro* |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 823 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 824 | Netrw supports the browsing of directories on the local system and on remote |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 825 | hosts, including listing files and directories, entering directories, editing |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 826 | files therein, deleting files/directories, making new directories, and moving |
| 827 | (renaming) files and directories. The Netrw browser generally implements the |
| 828 | previous explorer maps and commands for remote directories, although details |
| 829 | (such as pertinent global variable names) necessarily differ. |
| 830 | |
| 831 | The Netrw remote file and directory browser handles two protocols: ssh and |
| 832 | ftp. The protocol in the url, if it is ftp, will cause netrw to use ftp |
| 833 | in its remote browsing. Any other protocol will be used for file transfers, |
| 834 | but otherwise the ssh protocol will be used to do remote directory browsing. |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 835 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 836 | To use Netrw's remote directory browser, simply attempt to read a "file" with a |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 837 | trailing slash and it will be interpreted as a request to list a directory: |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 838 | |
| 839 | vim [protocol]://[user@]hostname/path/ |
| 840 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 841 | For local directories, the trailing slash is not required. |
| 842 | |
| 843 | If you'd like to avoid entering the password in for remote directory listings |
| 844 | with ssh or scp, see |netrw-listhack|. |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 845 | |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 846 | *netrw-explore* *netrw-pexplore* |
| 847 | *netrw-hexplore* *netrw-sexplore* |
| 848 | DIRECTORY EXPLORING COMMANDS *netrw-nexplore* *netrw-vexplore* |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 849 | |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 850 | :Explore[!] [dir]... Explore directory of current file *:Explore* |
| 851 | :Sexplore[!] [dir]... Split&Explore directory of current file *:Sexplore* |
| 852 | :Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore* |
| 853 | :Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore* |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 854 | |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 855 | Used with :Explore **/pattern : |
| 856 | :Nexplore............. go to next matching file *:Nexplore* |
| 857 | :Pexplore............. go to previous matching file *:Pexplore* |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 858 | |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 859 | :Explore will open the local-directory browser on the current file's |
| 860 | directory (or on directory [dir] if specified). The window will be |
| 861 | split only if the file has been modified, otherwise the browsing |
| 862 | window will take over that window. Normally the splitting is taken |
| 863 | horizontally. |
| 864 | :Explore! is like :Explore, but will use vertical splitting. |
| 865 | :Sexplore will always split the window before invoking the local-directory |
| 866 | browser. As with Explore, the splitting is normally done |
| 867 | horizontally. |
| 868 | :Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically. |
| 869 | :Hexplore [dir] does an :Explore with |:belowright| horizontal splitting. |
| 870 | :Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting. |
| 871 | :Vexplore [dir] does an :Explore with |:leftabove| vertical splitting. |
| 872 | :Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting. |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 873 | |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 874 | By default, these commands use the current file's directory. However, one |
| 875 | may explicitly provide a directory (path) to use. |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 876 | |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 877 | (Following needs v7.0 or later) *netrw-starstar* |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 878 | When Explore, Sexplore, Hexplore, or Vexplore are used with a **, |
| 879 | such as: |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 880 | > |
| 881 | :Explore **/filename_pattern |
| 882 | < |
| 883 | netrw will attempt to find a (sub)directory which matches the filename |
| 884 | pattern. Internally, it produces a list of files which match the pattern |
| 885 | and their paths; to that extent it resembles the Unix operation: |
| 886 | > |
| 887 | find $(pwd) -name "$1" -exec "echo" "{}" ";" 2> /dev/null |
| 888 | < |
| 889 | The directory display is updated to show the subdirectory containing a |
| 890 | matching file. One may then proceed to the next (or previous) matching files' |
| 891 | directories by using Nexplore or Pexplore, respectively. If your console or |
| 892 | gui produces recognizable shift-up or shift-down sequences, then you'll likely |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 893 | find using shift-downarrow and shift-uparrow convenient. They're mapped by |
| 894 | netrw: |
Bram Moolenaar | 572cb56 | 2005-08-05 21:35:02 +0000 | [diff] [blame] | 895 | |
| 896 | <s-down> == Nexplore, and |
| 897 | <s-up> == Pexplore. |
| 898 | |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 899 | As an example, consider |
| 900 | > |
Bram Moolenaar | 572cb56 | 2005-08-05 21:35:02 +0000 | [diff] [blame] | 901 | :Explore **/*.c |
| 902 | :Nexplore |
| 903 | :Nexplore |
| 904 | :Pexplore |
| 905 | < |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 906 | The status line will show, on the right hand side of the status line, a |
| 907 | message like "Match 3 of 20". |
| 908 | |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 909 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 910 | REFRESHING THE LISTING *netrw-ctrl-l* |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 911 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 912 | To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or |
| 913 | hit the <cr> when atop the ./ directory entry in the listing. One may also |
| 914 | refresh a local directory by using ":e .". |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 915 | |
| 916 | |
| 917 | GOING UP *netrw--* |
| 918 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 919 | To go up a directory, press "-" or press the <cr> when atop the ../ directory |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 920 | entry in the listing. |
| 921 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 922 | Netrw will use the command in |g:netrw_list_cmd| to perform the directory |
| 923 | listing operation after changing HOSTNAME to the host specified by the |
| 924 | user-provided url. By default netrw provides the command as: |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 925 | |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 926 | ssh HOSTNAME ls -FLa |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 927 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 928 | where the HOSTNAME becomes the [user@]hostname as requested by the attempt to |
| 929 | read. Naturally, the user may override this command with whatever is |
| 930 | preferred. The NetList function which implements remote directory browsing |
| 931 | expects that directories will be flagged by a trailing slash. |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 932 | |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 933 | |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 934 | BROWSING *netrw-cr* |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 935 | |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 936 | 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] | 937 | Hitting the <cr> (the return key) will select the file or directory. |
| 938 | Directories will themselves be listed, and files will be opened using the |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 939 | protocol given in the original read request. |
| 940 | |
| 941 | CAVEAT: There are three forms of listing (see |netrw-i|). Netrw assumes |
| 942 | that two or more spaces delimit filenames and directory names for the long |
| 943 | and wide listing formats. Thus, if your filename or directory name has two |
| 944 | or more spaces embedded in it, or any trailing spaces, then you'll need to |
| 945 | use the "thin" format to select it. |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 946 | |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 947 | The |g:netrw_browse_split| option, which is zero by default, may be used to |
| 948 | cause the opening of files to be done in a new window. The splitting will |
| 949 | be done horizontally if the option is one and vertically if the option is |
| 950 | two. |
| 951 | |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 952 | |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 953 | OBTAINING A FILE *netrw-O* |
| 954 | |
| 955 | When browsing a remote directory, one may obtain a file under the cursor (ie. |
| 956 | get a copy on your local machine, but not edit it) by pressing the O key. |
| 957 | Only ftp and scp are supported for this operation (but since these two are |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 958 | available for browsing, that shouldn't be a problem). The status bar |
| 959 | will then show, on its right hand side, a message like "Obtaining filename". |
| 960 | The statusline will be restored after the transfer is complete. |
| 961 | |
| 962 | Netrw can also "obtain" a file using the local browser. Netrw's display |
| 963 | of a directory is not necessarily the same as Vim's "current directory", |
| 964 | unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select |
| 965 | a file using the local browser (by putting the cursor on it) and pressing |
| 966 | "O" will then "obtain" the file; ie. copy it to Vim's current directory. |
| 967 | |
| 968 | Related topics: |
| 969 | * To see what the current directory is, use |:pwd| |
| 970 | * To make the currently browsed directory the current directory, see |netrw-c| |
| 971 | * To automatically make the currently browsed directory the current |
| 972 | directory, see |g:netrw_keepdir|. |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 973 | |
| 974 | |
| 975 | THIN, LONG, AND WIDE LISTINGS *netrw-i* |
| 976 | |
| 977 | The "i" map cycles between the thin, long, and wide listing formats. |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 978 | |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 979 | The short listing format gives just the files' and directories' names. |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 980 | |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 981 | 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] | 982 | directories or displays the filename, file size (in bytes), and the time and |
| 983 | date of last modification for local directories. With the long listing |
| 984 | format, netrw is not able to recognize filenames which have trailing spaces. |
| 985 | Use the thin listing format for such files. |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 986 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 987 | The wide listing format has a multi-column display of the various files in the |
| 988 | netrw current directory, rather like the Unix "ls" presents. In this mode the |
| 989 | "b" and "B" maps are not available; instead, use Nb (|netrw-Nb|) and NB |
| 990 | (|netrw-NB|). The wide listing format uses two or more contiguous spaces to |
| 991 | delineate filenames; when using that format, netrw won't be able to recognize |
| 992 | or use filenames which have two or more contiguous spaces embedded in the name |
| 993 | or any trailing spaces. The thin listing format will, however, work with such |
| 994 | files. |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 995 | |
| 996 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 997 | MAKING A NEW DIRECTORY *netrw-d* |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 998 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 999 | With the "d" map one may make a new directory either remotely (which depends |
| 1000 | on the global variable g:netrw_mkdir_cmd) or locally (which depends on the |
| 1001 | global variable g:netrw_local_mkdir). Netrw will issue a request for the new |
| 1002 | directory's name. A bare <CR> at that point will abort the making of the |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 1003 | directory. Attempts to make a local directory that already exists (as either |
| 1004 | a file or a directory) will be detected, reported on, and ignored. |
| 1005 | |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1006 | |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 1007 | DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1008 | |
| 1009 | Deleting/removing files and directories involves moving the cursor to the |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1010 | file/directory to be deleted and pressing "D". Directories must be empty |
| 1011 | first before they can be successfully removed. If the directory is a softlink |
| 1012 | to a directory, then netrw will make two requests to remove the directory |
| 1013 | before succeeding. Netrw will ask for confirmation before doing the |
| 1014 | removal(s). You may select a range of lines with the "V" command (visual |
| 1015 | selection), and then pressing "D". |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1016 | |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1017 | The g:netrw_rm_cmd, g:netrw_rmf_cmd, and g:netrw_rmdir_cmd variables are used |
| 1018 | to control the attempts to remove files and directories. The g:netrw_rm_cmd |
| 1019 | is used with files, and its default value is: |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1020 | |
| 1021 | g:netrw_rm_cmd: ssh HOSTNAME rm |
| 1022 | |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1023 | The g:netrw_rmdir_cmd variable is used to support the removal of directories. |
| 1024 | Its default value is: |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1025 | |
| 1026 | g:netrw_rmdir_cmd: ssh HOSTNAME rmdir |
| 1027 | |
| 1028 | If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1029 | to remove it again using the g:netrw_rmf_cmd variable. Its default value is: |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1030 | |
| 1031 | g:netrw_rmf_cmd: ssh HOSTNAME rm -f |
| 1032 | |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1033 | |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 1034 | RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1035 | |
| 1036 | Renaming/moving files and directories involves moving the cursor to the |
| 1037 | file/directory to be moved (renamed) and pressing "R". You will then be |
| 1038 | queried for where you want the file/directory to be moved. You may select a |
| 1039 | range of lines with the "V" command (visual selection), and then pressing "R". |
| 1040 | |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1041 | The g:netrw_rename_cmd variable is used to implement renaming. By default its |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1042 | value is: |
| 1043 | |
| 1044 | ssh HOSTNAME mv |
| 1045 | |
Bram Moolenaar | 269ec65 | 2004-07-29 08:43:53 +0000 | [diff] [blame] | 1046 | One may rename a block of files and directories by selecting them with |
| 1047 | the V (|linewise-visual|). |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1048 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1049 | |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 1050 | HIDING FILES OR DIRECTORIES *netrw-a* |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1051 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1052 | Netrw's browsing facility allows one to use the hiding list in one of three |
| 1053 | ways: ignore it, hide files which match, and show only those files which |
| 1054 | match. The "a" map allows the user to cycle about these three ways. |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1055 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1056 | The g:netrw_list_hide variable holds a comma delimited list of patterns (ex. |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 1057 | \.obj) which specify the hiding list. (also see |netrw-ctrl-h|) To set the hiding |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1058 | list, use the <c-h> map. As an example, to hide files which begin with a ".", |
| 1059 | one may use the <c-h> map to set the hiding list to '^\..*' (or one may put |
| 1060 | let g:netrw_list_hide= '^\..*' in one's <.vimrc>). One may then use the "a" |
| 1061 | key to show all files, hide matching files, or to show only the matching |
| 1062 | files. |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1063 | |
| 1064 | |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 1065 | EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1066 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1067 | The "<ctrl-h>" map brings up a requestor allowing the user to change the |
Bram Moolenaar | 269ec65 | 2004-07-29 08:43:53 +0000 | [diff] [blame] | 1068 | file/directory hiding list. The hiding list consists of one or more patterns |
| 1069 | delimited by commas. Files and/or directories satisfying these patterns will |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1070 | either be hidden (ie. not shown) or be the only ones displayed (see |
| 1071 | |netrw-a|). |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1072 | |
| 1073 | |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1074 | BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1075 | |
Bram Moolenaar | 269ec65 | 2004-07-29 08:43:53 +0000 | [diff] [blame] | 1076 | Normally one enters a file or directory using the <cr>. However, the "o" map |
| 1077 | allows one to open a new window to hold the new directory listing or file. A |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1078 | horizontal split is used. (for vertical splitting, see |netrw-v|) |
| 1079 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1080 | Normally, the o key splits the window horizontally with the new window and |
| 1081 | cursor at the top. To change to splitting the window horizontally with the |
| 1082 | new window and cursor at the bottom, have |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1083 | |
| 1084 | let g:netrw_alto = 1 |
| 1085 | |
| 1086 | in your <.vimrc>. |
| 1087 | |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1088 | |
| 1089 | PREVIEW WINDOW *netrw-p* *netrw-preview* |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1090 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1091 | One may use a preview window (currently only for local browsing) by using the |
| 1092 | "p" key when the cursor is atop the desired filename to be previewed. |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1093 | |
| 1094 | |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 1095 | PREVIOUS WINDOW *netrw-P* *netrw-prvwin* |
| 1096 | |
| 1097 | To edit a file or directory in the previously used window (see :he |CTRL-W_P|), |
| 1098 | press a "P". If there's only one window, then the one window will be |
| 1099 | horizontally split (above/below splitting is controlled by |g:netrw_alto|, |
| 1100 | and its initial size is controlled by |g:netrw_winsize|). |
| 1101 | |
| 1102 | If there's more than one window, the previous window will be re-used on |
| 1103 | the selected file/directory. If the previous window's associated buffer |
| 1104 | has been modified, and there's only one window with that buffer, then |
| 1105 | the user will be asked if s/he wishes to save the buffer first (yes, |
| 1106 | no, or cancel). |
| 1107 | |
| 1108 | |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1109 | SELECTING SORTING STYLE *netrw-s* *netrw-sort* |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1110 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1111 | One may select the sorting style by name, time, or (file) size. The "s" map |
| 1112 | allows one to circulate amongst the three choices; the directory listing will |
| 1113 | automatically be refreshed to reflect the selected style. |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1114 | |
| 1115 | |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1116 | EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1117 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1118 | When "Sorted by" is name, one may specify priority via the sorting sequence |
| 1119 | (g:netrw_sort_sequence). The sorting sequence typically prioritizes the |
| 1120 | name-listing by suffix, although any pattern will do. Patterns are delimited |
| 1121 | by commas. The default sorting sequence is: |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1122 | > |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 1123 | [\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$ |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1124 | < |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1125 | The lone * is where all filenames not covered by one of the other patterns |
| 1126 | will end up. One may change the sorting sequence by modifying the |
| 1127 | g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by |
| 1128 | using the "S" map. |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1129 | |
| 1130 | |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1131 | REVERSING SORTING ORDER *netrw-r* *netrw-reverse* |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1132 | |
| 1133 | One may toggle between normal and reverse sorting order by pressing the |
| 1134 | "r" key. |
| 1135 | |
| 1136 | |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1137 | CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 1138 | |
| 1139 | Every time you change to a new directory (new for the current session), |
| 1140 | netrw will save the directory in a recently-visited directory history |
| 1141 | list (unless g:netrw_dirhistmax is zero; by default, its ten). With the |
| 1142 | "u" map, one can change to an earlier directory (predecessor). To do |
| 1143 | the opposite, see |netrw-U|. |
| 1144 | |
| 1145 | |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1146 | CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 1147 | |
| 1148 | With the "U" map, one can change to a later directory (successor). |
| 1149 | This map is the opposite of the "u" map. (see |netrw-u|) Use the |
| 1150 | q map to list both the bookmarks and history. (see |netrw-q|) |
| 1151 | |
| 1152 | |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1153 | BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* |
| 1154 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1155 | Normally one enters a file or directory using the <cr>. However, the "v" map |
| 1156 | allows one to open a new window to hold the new directory listing or file. A |
| 1157 | vertical split is used. (for horizontal splitting, see |netrw-o|) |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1158 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1159 | Normally, the v key splits the window vertically with the new window and |
| 1160 | cursor at the left. To change to splitting the window vertically with the new |
| 1161 | window and cursor at the right, have |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1162 | |
| 1163 | let g:netrw_altv = 1 |
| 1164 | |
| 1165 | in your <.vimrc>. |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1166 | |
| 1167 | |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 1168 | CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler* *gx* |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1169 | |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 1170 | Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are |
| 1171 | best seen with a special handler (ie. a tool provided with your computer). |
| 1172 | Netrw allows one to invoke such special handlers by: > |
| 1173 | |
| 1174 | * when Exploring, hit the "x" key |
| 1175 | * when editing, hit gx with the cursor atop the special filename |
| 1176 | < |
| 1177 | Netrw determines which special handler by the following method: |
| 1178 | |
| 1179 | * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to |
| 1180 | view files. Examples of useful settings (place into your <.vimrc>): > |
| 1181 | |
| 1182 | :let g:netrw_browsex_viewer= "kfmclient exec" |
| 1183 | < or > |
| 1184 | :let g:netrw_browsex_viewer= "gnome-open" |
| 1185 | < |
| 1186 | If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be |
| 1187 | invoked first (see |netrw_filehandler|). |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1188 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 1189 | * for Windows 32 or 64, the url and FileProtocolHandler dlls are used. |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 1190 | * for Gnome (with gnome-open): gnome-open is used. |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 1191 | * for KDE (with kfmclient): kfmclient is used. |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1192 | * otherwise the netrwFileHandler plugin is used. |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 1193 | |
| 1194 | 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] | 1195 | appropriate application to use to "handle" these files. Such things as |
| 1196 | OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps, |
| 1197 | *.eps) can be handled. |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 1198 | |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 1199 | *netrw_filehandler* |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1200 | The netrwFileHandler applies a user-defined function to a file, based on its |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1201 | extension. Of course, the handler function must exist for it to be called! |
| 1202 | > |
| 1203 | Ex. mypgm.html x -> |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1204 | netrwFileHandler_html("scp://user@host/some/path/mypgm.html") |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1205 | < |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1206 | See the <plugin/netrwFileHandlers.vim> for an example of how to handle an html |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1207 | file with mozilla. |
| 1208 | |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 1209 | One may write custom netrwFileHandlers; please look at the > |
| 1210 | |
| 1211 | plugin/netrwFileHandlers.vim |
| 1212 | |
| 1213 | script for examples. If its likely to be generally useful, please feel free |
| 1214 | to forward a copy to me for future inclusion in the distribution. |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 1215 | |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1216 | |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1217 | MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* *netrw-curdir* |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1218 | |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1219 | By default, g:netrw_keepdir is 1. This setting means that the current |
| 1220 | directory will not track the browsing directory. However, setting |
| 1221 | g:netrw_keepdir to 0 (say, in your <.vimrc>) will tell netrw to have the |
| 1222 | currently browsed directory be the current directory. |
| 1223 | |
| 1224 | With the default setting for g:netrw_keepdir, in order to make the two |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1225 | directories the same, use the "c" map (just type c). That map will set the |
| 1226 | current directory to the current browsing directory. |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1227 | |
| 1228 | |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1229 | BOOKMARKING A DIRECTORY *netrw-b* *netrw-bookmark* *netrw-bookmarks* |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 1230 | *netrw-Nb* |
Bram Moolenaar | 572cb56 | 2005-08-05 21:35:02 +0000 | [diff] [blame] | 1231 | One may easily "bookmark" a directory by using > |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1232 | |
| 1233 | {cnt}b |
Bram Moolenaar | 572cb56 | 2005-08-05 21:35:02 +0000 | [diff] [blame] | 1234 | < |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1235 | Any count may be used. One may use viminfo's "!" option to retain bookmarks |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 1236 | between vim sessions. See |netrw-B| for how to return to a bookmark and |
| 1237 | |netrw-q| for how to list them. |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1238 | |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 1239 | When wide listing is in use (see |netrw-i|), then the b map is not available; |
| 1240 | instead, use {cnt}Nb. |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1241 | |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 1242 | |
| 1243 | CHANGING TO A BOOKMARKED DIRECTORY *netrw-NB* *netrw-B* |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1244 | |
| 1245 | To change directory back to a bookmarked directory, use |
| 1246 | |
| 1247 | {cnt}B |
| 1248 | |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1249 | Any count may be used to reference any of the bookmarks. See |netrw-b| on |
| 1250 | how to bookmark a directory and |netrw-q| on how to list bookmarks. |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 1251 | |
| 1252 | When wide listing is in use (see |netrw-i|), then the B map is not available; |
| 1253 | instead, use {cnt}NB. |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1254 | |
| 1255 | |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1256 | LISTING BOOKMARKS AND HISTORY *netrw-q* *netrw-listbookmark* |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1257 | |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 1258 | Pressing "q" will list the bookmarked directories and directory traversal |
| 1259 | history (query). (see |netrw-b|, |netrw-B|, |netrw-u|, and |netrw-U|) |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1260 | |
| 1261 | |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 1262 | IMPROVING DIRECTORY BROWSING *netrw-listhack* |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 1263 | |
| 1264 | Especially with the remote directory browser, constantly entering the password |
| 1265 | is tedious. |
| 1266 | |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 1267 | For Linux/Unix systems, I suggest looking into |
| 1268 | |
| 1269 | http://hacks.oreilly.com/pub/h/66 |
| 1270 | |
| 1271 | It gives a tip for setting up password-less use of ssh and scp, and discusses |
| 1272 | the associated security issues. |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 1273 | |
| 1274 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 1275 | NETRW SETTINGS *netrw-settings* |
| 1276 | |
| 1277 | With the NetrwSettings.vim plugin, > |
| 1278 | :NetrwSettings |
| 1279 | 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] | 1280 | settings. You may change any of their values; when you save the file, the |
| 1281 | settings therein will be used. One may also press "?" on any of the lines for |
| 1282 | help on what each of the variables do. |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 1283 | |
| 1284 | |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 1285 | ============================================================================== |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 1286 | 9. Problems and Fixes *netrw-problems* |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1287 | |
| 1288 | (This section is likely to grow as I get feedback) |
| 1289 | (also see |netrw-debug|) |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 1290 | *netrw-p1* |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1291 | P1. I use windows 95, and my ftp dumps four blank lines at the |
| 1292 | end of every read. |
| 1293 | |
| 1294 | See |netrw-fixup|, and put the following into your |
| 1295 | <.vimrc> file: |
| 1296 | |
| 1297 | let g:netrw_win95ftp= 1 |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 1298 | |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 1299 | *netrw-p2* |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1300 | P2. I use windows, and my network browsing with ftp doesn't sort by |
| 1301 | time or size |
| 1302 | |
| 1303 | Windows' ftp has a minimal support for ls (ie. it doesn't |
| 1304 | accept sorting options). It doesn't support the -F which |
| 1305 | gives an explanatory character (ABC/ for "ABC is a directory"). |
| 1306 | Netrw uses dir to get its short and long listings. If you |
| 1307 | think your ftp does support a full-up ls, put the following |
| 1308 | into your <.vimrc>: |
| 1309 | |
| 1310 | let g:netrw_ftp_list_cmd= "ls -lF" |
| 1311 | |
| 1312 | Alternatively, if you have cygwin on your Windows box, put |
| 1313 | into your <.vimrc>: |
| 1314 | |
| 1315 | let g:netrw_cygwin= 1 |
| 1316 | |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 1317 | *netrw-p3* |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1318 | P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw |
| 1319 | used ssh! That wasn't what I asked for... |
| 1320 | |
| 1321 | Netrw has two methods for browsing remote directories: ssh |
| 1322 | and ftp. Unless you specify ftp specifically, ssh is used. |
| 1323 | When it comes time to do download a file (not just a directory |
| 1324 | listing), netrw will use the given protocol to do so. |
| 1325 | |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 1326 | *netrw-p4* |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1327 | P4. I would like long listings to be the default. |
| 1328 | |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1329 | let g:netrw_longlist=1 |
| 1330 | |
| 1331 | Check out |netrw-browse-var| for more customizations that |
| 1332 | you can set. |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1333 | |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 1334 | *netrw-p5* |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1335 | P5. My times come up oddly in local browsing |
| 1336 | |
| 1337 | Does your system's strftime() accept the "%c" to yield dates |
| 1338 | such as "Sun Apr 27 11:49:23 1997"? If not, do a "man strftime" |
| 1339 | and find out what option should be used. Then put it into |
| 1340 | your <.vimrc>: |
| 1341 | let g:netrw_timefmt= "%X" (where X is the option) |
| 1342 | |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 1343 | *netrw-p6* |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1344 | P6. I want my current directory to track my browsing. |
| 1345 | How do I do that? |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1346 | |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1347 | let g:netrw_keepdir= 0 |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 1348 | |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1349 | |
| 1350 | ============================================================================== |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 1351 | 10. Debugging *netrw-debug* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1352 | |
| 1353 | The <netrw.vim> script is typically available as: |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 1354 | > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1355 | /usr/local/share/vim/vim6x/plugin/netrw.vim |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 1356 | < -or- > |
| 1357 | /usr/local/share/vim/vim7x/plugin/netrw.vim |
| 1358 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1359 | which is loaded automatically at startup (assuming :set nocp). |
| 1360 | |
| 1361 | 1. Get the <Decho.vim> script, available as: |
| 1362 | |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 1363 | http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_scripts |
| 1364 | as "Decho, a vimL debugging aid" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1365 | or |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 1366 | http://vim.sourceforge.net/scripts/script.php?script_id=120 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1367 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1368 | and put it into your local plugin directory. |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 1369 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1370 | 2. <Decho.vim> itself needs the <cecutil.vim> script, so you'll need |
| 1371 | to put it into your .vim/plugin, too. You may obtain it from: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1372 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1373 | http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs |
| 1374 | as "DrC's Utilities" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1375 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1376 | 3. Edit the <netrw.vim> file by typing: |
| 1377 | |
| 1378 | vim netrw.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1379 | :DechoOn |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1380 | :wq |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1381 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1382 | To restore to normal non-debugging behavior, edit <netrw.vim> |
| 1383 | by typing |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1384 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 1385 | vim netrw.vim |
| 1386 | :DechoOff |
| 1387 | :wq |
| 1388 | |
| 1389 | This command, provided by <Decho.vim>, will comment out all |
| 1390 | Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()). |
| 1391 | |
| 1392 | 4. Then bring up vim and attempt a transfer. A set of messages |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1393 | should appear concerning the steps that <netrw.vim> took in |
| 1394 | attempting to read/write your file over the network. Please |
| 1395 | send that information to <netrw.vim>'s maintainer, |
| 1396 | |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 1397 | NdrOchip at ScampbellPfamily.AbizM - NOSPAM |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1398 | |
| 1399 | ============================================================================== |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 1400 | 11. History *netrw-history* {{{1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1401 | |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 1402 | v78: * progress has been made on allowing spaces inside directory |
| 1403 | names for remote work (reading, writing, browsing). (scp) |
| 1404 | v77: * Mikolaj Machowski fixed a bug in a substitute command |
| 1405 | * g:netrw_browsex_viewer implemented |
| 1406 | * Mikolaj Machowski pointed out that gnome-open is often |
| 1407 | executable under KDE systems, although it is effectively |
| 1408 | not functional. NetBrowseX now looks for "kicker" as |
| 1409 | a running process to determine if KDE is actually the |
| 1410 | really running. |
| 1411 | * Explorer's O functionality was inadvertently left out. |
| 1412 | Netrw now does the same thing, but with the "P" key. |
| 1413 | * added g:netrw_browse_split option |
| 1414 | * fixed a bug where the directory contained a "." but |
| 1415 | the file didn't (was treating the dirname from "." |
| 1416 | onwards as a suffix) |
Bram Moolenaar | 36c31f7 | 2005-11-28 23:01:53 +0000 | [diff] [blame] | 1417 | v76: * "directory is missing" error message now restores echo |
| 1418 | highlighting |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1419 | v75: * file://... now conforms to RFC2396 (thanks to S. Zacchiroli) |
| 1420 | * if the binary option is set, then NetWrite() will only write |
| 1421 | the whole file (line numbers don't make sense with this). |
| 1422 | Supports writing of tar and zip files. |
| 1423 | v74: * bugfix (vim, then :Explore) now works |
| 1424 | * ctrl-L keeps cursor at same screen location (both local and |
| 1425 | remote browsing) |
| 1426 | * netrw now can read remote zip and tar files |
| 1427 | * Obtain now uses WinXP ftp+.netrc successfully |
| 1428 | v73: * bugfix -- scp://host/path/file was getting named incorrectly |
| 1429 | * netrw detects use of earlier-than-7.0 version of vim and issues |
| 1430 | a pertinent error message. |
| 1431 | * netrwSettings.vim is now uses autoloading. Only |
| 1432 | <netrwPlugin.vim> is needed as a pure plugin |
| 1433 | (ie. always loaded). |
| 1434 | v72: * bugfix -- formerly, one could prevent the loading of netrw |
| 1435 | by "let g:loaded_netrw=1"; when autoloading became supported, |
| 1436 | this feature was lost. It is now restored. |
| 1437 | v71: * bugfix -- made some "set nomodifiable"s into setlocal variants |
| 1438 | (allows :e somenewfile to be modifiable as usual) |
| 1439 | * NetrwSettings calls a netrw function, thereby assuring that |
| 1440 | netrw has loaded. However, if netrw does not load for whatever |
| 1441 | reason, then NetrwSettings will now issue a warning message. |
| 1442 | * For what reason I don't recall, when wget and fetch are both |
| 1443 | not present, and an attempt to read a http://... url is made, |
| 1444 | netrw exited. It now only returns. |
| 1445 | * When ch=1, on the second and subsequent uses of browsing Netrw |
| 1446 | would issue a blank line to clear the echo'd messages. This |
| 1447 | caused an annoying "Hit-Enter" prompt; now a blank line message |
| 1448 | is echo'd only if &ch>1. |
| 1449 | v70: * when using |netrw-O|, the "Obtaining filename" message is now |
| 1450 | shown using |hl-User9|. If User9 has not been defined, netrw |
| 1451 | will define it. |
| 1452 | v69: * Bugfix: win95/98 machines were experiencing a |
| 1453 | "E121: Undefined variable: g:netrw_win95ftp" message |
| 1454 | v68: * double-click-leftmouse selects word under mouse |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 1455 | v67: * Passwords which contain blanks will now be surrounded by |
| 1456 | double-quotes automatically (Yongwei) |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 1457 | v66: * Netrw now seems to work with a few more Windows situations |
| 1458 | * O now obtains a file: remote browsing file -> local copy, |
| 1459 | locally browsing file -> current directory (see :pwd) |
| 1460 | * i now cycles between thin, long, and wide listing styles |
| 1461 | * NB and Nb are maps that are always available; corresponding |
| 1462 | B and b maps are only available when not using wide listing |
| 1463 | in order to allow them to be used for motions |
| 1464 | v65: * Browser functions now use NetOptionSave/Restore; in particular, |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1465 | netrw now works around the report setting |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 1466 | v64: * Bugfix - browsing a "/" directory (Unix) yielded buffers |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1467 | named "[Scratch]" instead of "/" |
| 1468 | * Bugfix - remote browsing with ftp was omitting the ./ and ../ |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 1469 | v63: * netrw now takes advantage of autoload (and requires 7.0) |
| 1470 | * Bugfix - using r (to reverse sort) working again |
| 1471 | v62: * Bugfix - spaces allowed again in directory names with |
| 1472 | g:netrw_keepdir=0. In fact, I've tested netrw (again) |
| 1473 | with most ANSI punctuation marks for directory names. |
| 1474 | * Bugfix - NetrwSettings gave errors when g:netrw_silent |
| 1475 | had not be set. |
Bram Moolenaar | 90cfdbe | 2005-08-12 19:59:19 +0000 | [diff] [blame] | 1476 | v61: * document upgrade -- netrw variable-based settings all should |
| 1477 | have tags. Supports NetrwSettings command. |
| 1478 | * several important variables are window-oriented. Netrw has |
| 1479 | to transfer these across a window split. See s:BufWinVars() |
| 1480 | and s:UseBufWinVars(). |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 1481 | v60: * when using the i map to switch between long and short listings, |
| 1482 | netrw will now keep cursor on same line |
| 1483 | * "Match # of #" now uses status line |
| 1484 | * :Explore **/*.c will now work from a non-netrw-browser window |
| 1485 | * :Explore **/patterns can now be run in separate browser windows |
| 1486 | * active banner (hit <cr> will cause various things to happen) |
Bram Moolenaar | f6cf987 | 2005-08-08 22:00:59 +0000 | [diff] [blame] | 1487 | v59: * bugfix -- another keepalt work-around installed (for vim6.3) |
| 1488 | * "Match # of #" for Explore **/pattern matches |
Bram Moolenaar | 572cb56 | 2005-08-05 21:35:02 +0000 | [diff] [blame] | 1489 | v58: * Explore and relatives can now handle **/somefilepattern (v7) |
| 1490 | * Nexplore and Pexplore introduced (v7). shift-down and shift-up |
| 1491 | cursor keys will invoke Nexplore and Pexplore, respectively. |
| 1492 | * bug fixed with o and v |
| 1493 | * autochdir only worked around for vim when it has been |
| 1494 | compiled with either |+netbeans_intg| or |+sun_workshop| |
| 1495 | * Under Windows, all directories and files were being preceded |
| 1496 | with a "/" when local browsing. Fixed. |
| 1497 | * When: syntax highlighting is off, laststatus=2, and remote |
| 1498 | browsing is used, sometimes the laststatus highlighting |
| 1499 | bleeds into the entire display. Work around - do an extra |
| 1500 | redraw in that case. |
| 1501 | * Bugfix: when g:netrw_keepdir=0, due to re-use of buffers, |
| 1502 | netrw didn't change the directory when it should've |
| 1503 | * Bugfix: D and R commands work again |
Bram Moolenaar | 1d94f9b | 2005-08-04 21:29:45 +0000 | [diff] [blame] | 1504 | v57: * Explore and relatives can now handle RO files |
| 1505 | * reverse sort restored with vim7's sort command |
| 1506 | * g:netrw_keepdir now being used to keep the current directory |
| 1507 | unchanged as intended (sense change) |
| 1508 | * vim 6.3 still supported |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1509 | v56: * LocalBrowse now saves autochdir setting, unsets it, and |
| 1510 | restores it before returning. |
| 1511 | * using vim's rename() instead of system + local_rename variable |
Bram Moolenaar | 1d94f9b | 2005-08-04 21:29:45 +0000 | [diff] [blame] | 1512 | * avoids changing directory when g:netrw_keepdir is false |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1513 | v55: * -bar used with :Explore :Sexplore etc to allow multiple |
| 1514 | commands to be separated by |s |
| 1515 | * browser listings now use the "nowrap" option |
| 1516 | * browser: some unuseful error messages now suppressed |
| 1517 | v54: * For backwards compatibility, Explore and Sexplore have been |
| 1518 | implemented. In addition, Hexplore and Vexplore commands |
| 1519 | are available, too. |
| 1520 | * <amatch> used instead of <afile> in the transparency |
| 1521 | support (BufReadCmd, FileReadCmd, FileWriteCmd) |
| 1522 | * ***netrw*** prepended to various error messages netrw may emit |
| 1523 | * g:netrw_port used instead of b:netrw_port for scp |
| 1524 | * any leading [:#] is removed from port numbers |
| 1525 | v53: * backslashes as well as slashes placed in various patterns |
| 1526 | (ex. g:netrw_sort_sequence) to better support Windows |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 1527 | v52: * nonumber'ing now set for browsing buffers |
| 1528 | * when the hiding list hid all files, error messages ensued. Fixed |
| 1529 | * when browsing, swf is set, but directory is not set, when netrw |
| 1530 | was attempting to restore options, vim wanted to save a swapfile |
| 1531 | to a local directory using an url-style path. Fixed |
| 1532 | v51: * cygwin detection now automated (using windows and &shell is bash) |
| 1533 | * customizable browser "file" rejection patterns |
| 1534 | * directory history |
| 1535 | * :[range]w url now supported (ie. netrw has a FileWriteCmd event) |
| 1536 | * error messages have a "Press <cr> to continue" to allow them |
| 1537 | to be seen |
| 1538 | * directory browser displays no longer bother the swapfile |
| 1539 | * u/U commands to go up and down the history stack |
| 1540 | * history stack may be saved with viminfo with its "!" option |
| 1541 | * bugfixes associated with unwanted [No Files] entries |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1542 | v50: * directories now displayed using buftype=nofile; should keep the |
| 1543 | directory names as-is |
| 1544 | * attempts to remove empty "[No File]" buffers leftover |
| 1545 | from :file ..name.. commands |
| 1546 | * bugfix: a "caps-lock" editing difficulty left in v49 was fixed |
| 1547 | * syntax highlighting for "Showing:" the hiding list included |
| 1548 | * bookmarks can now be retained if "!" is in the viminfo option |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 1549 | v49: * will use ftp for http://.../ browsing v48: |
| 1550 | * One may use ftp to do remote host file browsing |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1551 | * (windows and !cygwin) remote browsing with ftp can now use |
| 1552 | the "dir" command internally to provide listings |
| 1553 | * g:netrw_keepdir now allows one to keep the initial current |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1554 | directory as the current directory (normally the local file |
| 1555 | browser makes the currently viewed directory the current |
| 1556 | directory) |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1557 | * g:netrw_alto and g:netrw_altv now support alternate placement |
| 1558 | of windows started with o or v |
| 1559 | * Nread ? and Nwrite ? now uses echomsg (instead of echo) so |
| 1560 | :messages can repeat showing the help |
| 1561 | * bugfix: avoids problems with partial matches of directory names |
| 1562 | to prior buffers with longer names |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1563 | * one can suppress error messages with g:netrw_quiet ctrl-h used |
| 1564 | * instead of <Leader>h for editing hiding list one may edit the |
| 1565 | * sorting sequence with the S map now allows confirmation of |
| 1566 | * deletion with [y(es) n(o) a(ll) q(uit)] the "x" map now handles |
| 1567 | * special file viewing with: |
| 1568 | (windows) rundll32 url.dll (gnome) gnome-open (kde) |
| 1569 | kfmclient If none of these are on the executable path, then |
Bram Moolenaar | 1afcace | 2005-11-25 19:54:28 +0000 | [diff] [blame] | 1570 | netrwFileHandlers.vim is used. |
Bram Moolenaar | c0197e2 | 2004-09-13 20:26:32 +0000 | [diff] [blame] | 1571 | * directory bookmarking during both local and remote browsing |
| 1572 | implemented |
| 1573 | * one may view all, use the hiding list to suppress, or use the |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1574 | hiding list to show-only remote and local file/directory |
| 1575 | listings |
| 1576 | * improved unusual file and directory name handling preview |
| 1577 | * window support |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 1578 | v47: * now handles local directory browsing. |
| 1579 | v46: * now handles remote directory browsing |
| 1580 | * g:netrw_silent (if 1) will cause all transfers to be silent |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1581 | v45: * made the [user@]hostname:path form a bit more restrictive to |
| 1582 | better handle errors in using protocols (e.g. scp:usr@host:file |
| 1583 | was being recognized as an rcp request) v44: * changed from |
| 1584 | "rsync -a" to just "rsync" |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 1585 | * somehow an editing error messed up the test to recognize |
| 1586 | use of the fetch method for NetRead. |
| 1587 | * more debugging statements included |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1588 | v43: * moved "Explanation" comments to <pi_netrw.txt> help file as |
| 1589 | "Network Reference" (|netrw-ref|) |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 1590 | * <netrw.vim> now uses Dfunc() Decho() and Dret() for debugging |
| 1591 | * removed superfluous NetRestorePosn() calls |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1592 | v42: * now does BufReadPre and BufReadPost events on file:///* and |
| 1593 | file://localhost/* v41: * installed file:///* and |
| 1594 | file://localhost/* handling v40: * prevents redraw when a |
| 1595 | protocol error occurs so that the user may see it v39: * sftp |
| 1596 | support v38: * Now uses NetRestorePosn() calls with |
| 1597 | Nread/Nwrite commands |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 1598 | * Temporary files now removed via bwipe! instead of bwipe |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1599 | (thanks to Dave Roberts) v37: * Claar's modifications which |
| 1600 | test if ftp is successful, otherwise give an error message |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 1601 | * After a read, the alternate file was pointing to the temp file. |
| 1602 | The temp file buffer is now wiped out. |
| 1603 | * removed silent from transfer methods so user can see what's |
| 1604 | happening |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1605 | |
| 1606 | |
| 1607 | ============================================================================== |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame^] | 1608 | 11. Credits *netrw-credits* {{{1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1609 | |
| 1610 | Vim editor by Bram Moolenaar (Thanks, Bram!) |
| 1611 | dav support by C Campbell |
| 1612 | fetch support by Bram Moolenaar and C Campbell |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 1613 | ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1614 | http support by Bram Moolenaar <bram@moolenaar.net> |
| 1615 | rcp |
| 1616 | rsync support by C Campbell (suggested by Erik Warendorph) |
| 1617 | scp support by raf <raf@comdyn.com.au> |
| 1618 | sftp support by C Campbell |
| 1619 | |
| 1620 | inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell |
| 1621 | |
| 1622 | Jérôme Augé -- also using new buffer method with ftp+.netrc |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 1623 | Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use, |
| 1624 | fetch,... |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1625 | Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution |
| 1626 | Erik Warendorph -- for several suggestions (g:netrw_..._cmd |
| 1627 | variables, rsync etc) |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 1628 | Doug Claar -- modifications to test for success with ftp |
| 1629 | operation |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1630 | |
| 1631 | ============================================================================== |
Bram Moolenaar | 83bab71 | 2005-08-01 21:58:57 +0000 | [diff] [blame] | 1632 | vim:tw=78:ts=8:ft=help:norl:fdm=marker |