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