Mercurial > vim
comparison runtime/autoload/netrw.vim @ 819:23f82b5d2814 v7.0c10
updated for version 7.0c10
author | vimboss |
---|---|
date | Wed, 05 Apr 2006 20:41:53 +0000 |
parents | 6beb2c667935 |
children | 57c7403f6599 |
comparison
equal
deleted
inserted
replaced
818:1f929f3ca806 | 819:23f82b5d2814 |
---|---|
1 " netrw.vim: Handles file transfer and remote directory listing across a network | 1 " netrw.vim: Handles file transfer and remote directory listing across a network |
2 " AUTOLOAD PORTION | 2 " AUTOLOAD PORTION |
3 " Date: Mar 22, 2006 | 3 " Date: Mar 31, 2006 |
4 " Version: 83 | 4 " Version: 84 |
5 " Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz> | 5 " Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz> |
6 " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim | 6 " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim |
7 " Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1 | 7 " Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1 |
8 " Permission is hereby granted to use and distribute this code, | 8 " Permission is hereby granted to use and distribute this code, |
9 " with or without modifications, provided that this copyright | 9 " with or without modifications, provided that this copyright |
21 | 21 |
22 " Exception for &cp: {{{1 | 22 " Exception for &cp: {{{1 |
23 if &cp || exists("g:loaded_netrw") | 23 if &cp || exists("g:loaded_netrw") |
24 finish | 24 finish |
25 endif | 25 endif |
26 let g:loaded_netrw = "v83" | 26 let g:loaded_netrw = "v84" |
27 if v:version < 700 | 27 if v:version < 700 |
28 echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None | 28 echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None |
29 finish | 29 finish |
30 endif | 30 endif |
31 let s:keepcpo= &cpo | 31 let s:keepcpo= &cpo |
402 | 402 |
403 " Determine method of read (ftp, rcp, etc) {{{3 | 403 " Determine method of read (ftp, rcp, etc) {{{3 |
404 call s:NetMethod(choice) | 404 call s:NetMethod(choice) |
405 | 405 |
406 " Check if NetBrowse() should be handling this request | 406 " Check if NetBrowse() should be handling this request |
407 " call Decho("checking if netlist: choice<".choice."> netrw_list_cmd<".g:netrw_list_cmd.">") | 407 " call Decho("checking if NetBrowse() should handle choice<".choice."> with netrw_list_cmd<".g:netrw_list_cmd.">") |
408 if choice =~ "^.*[\/]$" | 408 if choice =~ "^.*[\/]$" |
409 " call Decho("yes, choice matches '^.*[\/]$'") | |
409 keepjumps call s:NetBrowse(choice) | 410 keepjumps call s:NetBrowse(choice) |
410 " call Dret("NetRead") | 411 " call Dret("NetRead") |
411 return | 412 return |
412 endif | 413 endif |
413 | 414 |
455 "......................................... | 456 "......................................... |
456 " ftp + <.netrc>: NetRead Method #2 {{{3 | 457 " ftp + <.netrc>: NetRead Method #2 {{{3 |
457 elseif b:netrw_method == 2 " read with ftp + <.netrc> | 458 elseif b:netrw_method == 2 " read with ftp + <.netrc> |
458 " call Decho("read via ftp+.netrc (method #2)") | 459 " call Decho("read via ftp+.netrc (method #2)") |
459 let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) | 460 let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) |
461 " call Decho("netrw_fname<".netrw_fname.">") | |
460 new | 462 new |
461 setlocal ff=unix | 463 setlocal ff=unix |
462 exe "put ='".g:netrw_ftpmode."'" | 464 exe "put ='".g:netrw_ftpmode."'" |
463 " call Decho("filter input: ".getline(".")) | 465 " call Decho("filter input: ".getline(".")) |
464 exe "put ='".'get \"'.netrw_fname.'\" '.tmpfile."'" | 466 exe "put ='".'get \"'.netrw_fname.'\" '.tmpfile."'" |
778 " User-provided (ie. optional) fix-it-up command | 780 " User-provided (ie. optional) fix-it-up command |
779 if exists("*NetReadFixup") | 781 if exists("*NetReadFixup") |
780 " call Decho("calling NetReadFixup(method<".a:method."> line1=".line1." line2=".line2.")") | 782 " call Decho("calling NetReadFixup(method<".a:method."> line1=".line1." line2=".line2.")") |
781 call NetReadFixup(a:method, line1, line2) | 783 call NetReadFixup(a:method, line1, line2) |
782 " else " Decho | 784 " else " Decho |
783 " call Decho("NetReadFixup() not called, doesn't exist") | 785 " call Decho("NetReadFixup() not called, doesn't exist (line1=".line1." line2=".line2.")") |
784 endif | 786 endif |
785 | 787 |
786 " update the Buffers menu | 788 " update the Buffers menu |
787 if has("gui") && has("gui_running") | 789 if has("gui") && has("gui_running") |
788 silent! emenu Buffers.Refresh\ menu | 790 silent! emenu Buffers.Refresh\ menu |
1237 " call Decho("exe file ".method."://".user.machine."/".escape(path,s:netrw_cd_escape)) | 1239 " call Decho("exe file ".method."://".user.machine."/".escape(path,s:netrw_cd_escape)) |
1238 exe "file ".method."://".user.machine."/".escape(path,s:netrw_cd_escape) | 1240 exe "file ".method."://".user.machine."/".escape(path,s:netrw_cd_escape) |
1239 exe "silent doau BufReadPre ".fname | 1241 exe "silent doau BufReadPre ".fname |
1240 silent call netrw#NetRead(2,method."://".user.machine."/".path) | 1242 silent call netrw#NetRead(2,method."://".user.machine."/".path) |
1241 exe "silent doau BufReadPost ".fname | 1243 exe "silent doau BufReadPost ".fname |
1242 keepjumps 1d | |
1243 | 1244 |
1244 " save certain window-oriented variables into buffer-oriented variables | 1245 " save certain window-oriented variables into buffer-oriented variables |
1245 call s:SetBufWinVars() | 1246 call s:SetBufWinVars() |
1246 call s:NetOptionRestore() | 1247 call s:NetOptionRestore() |
1247 setlocal nomod nowrap | 1248 setlocal nomod nowrap |
1350 else | 1351 else |
1351 keepjumps put ='\" Showing: '.g:netrw_list_hide | 1352 keepjumps put ='\" Showing: '.g:netrw_list_hide |
1352 endif | 1353 endif |
1353 let w:netrw_bannercnt= w:netrw_bannercnt + 1 | 1354 let w:netrw_bannercnt= w:netrw_bannercnt + 1 |
1354 endif | 1355 endif |
1355 keepjumps put ='\" Quick Help: ?:help -:go up dir D:delete R:rename s:sort-by x:exec' | 1356 keepjumps put ='\" Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:exec' |
1356 keepjumps put ='\" ===========================================================================' | 1357 keepjumps put ='\" ===========================================================================' |
1357 | 1358 |
1358 " remote read the requested directory listing | 1359 " remote read the requested directory listing |
1359 " Use ftp if that was the file-transfer method selected, otherwise use ssh | 1360 " Use ftp if that was the file-transfer method selected, otherwise use ssh |
1360 " Note that not all ftp servers honor the options for ls | 1361 " Note that not all ftp servers honor the options for ls |
2941 else | 2942 else |
2942 keepjumps put ='\" Showing: '.g:netrw_list_hide | 2943 keepjumps put ='\" Showing: '.g:netrw_list_hide |
2943 endif | 2944 endif |
2944 let w:netrw_bannercnt= w:netrw_bannercnt + 1 | 2945 let w:netrw_bannercnt= w:netrw_bannercnt + 1 |
2945 endif | 2946 endif |
2946 keepjumps put ='\" Quick Help: ?:help -:go up dir D:delete R:rename s:sort-by x:exec' | 2947 keepjumps put ='\" Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:exec' |
2947 keepjumps put ='\" ============================================================================' | 2948 keepjumps put ='\" ============================================================================' |
2948 let w:netrw_bannercnt= w:netrw_bannercnt + 2 | 2949 let w:netrw_bannercnt= w:netrw_bannercnt + 2 |
2949 | 2950 |
2950 " bannercnt should index the line just after the banner | 2951 " bannercnt should index the line just after the banner |
2951 let w:netrw_bannercnt= w:netrw_bannercnt + 1 | 2952 let w:netrw_bannercnt= w:netrw_bannercnt + 1 |