Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame^] | 1 | " NetrwFileHandlers: contains various extension-based file handlers for |
| 2 | " netrw's browser |
| 3 | " Author: Charles E. Campbell, Jr. |
| 4 | " Date: Jun 25, 2004 |
| 5 | " Version: 1 |
| 6 | " --------------------------------------------------------------------- |
| 7 | |
| 8 | " NetrwFileHandler_html: handles html |
| 9 | fun! NetrwFileHandler_html(webpage) |
| 10 | " call Dfunc("NetrwFileHandler_html(".a:webpage.")") |
| 11 | |
| 12 | let host= substitute(a:webpage,'^\w\+://\%(\w*@\)\=\(\w\+\)/.*$','\1','e') |
| 13 | " call Decho("host<".host.">") |
| 14 | |
| 15 | if host == hostname() || host == substitute(hostname(),'\..*$','','e') |
| 16 | let page= substitute(a:webpage,'^\w\+://\%(\w*@\)\=\(\w\+\)/','file://\1/'.expand("$HOME").'/','e') |
| 17 | else |
| 18 | let page= substitute(a:webpage,'^\w\+://\%(\w*@\)\=\(\w\+\)/','http://\1/','e') |
| 19 | endif |
| 20 | " call Decho("executing !mozilla ".page) |
| 21 | exe "!mozilla ".page |
| 22 | |
| 23 | " call Dret("NetrwFileHandler_html") |
| 24 | endfun |
| 25 | |
| 26 | " --------------------------------------------------------------------- |