comparison runtime/autoload/getscript.vim @ 1668:0b796e045c42 v7.2b.000

updated for version 7.2b-000
author vimboss
date Sun, 13 Jul 2008 17:41:49 +0000
parents 73fe8baea242
children 7bc41231fbc7
comparison
equal deleted inserted replaced
1667:131dbd3d2a4b 1668:0b796e045c42
1 " --------------------------------------------------------------------- 1 " ---------------------------------------------------------------------
2 " getscript.vim 2 " getscript.vim
3 " Author: Charles E. Campbell, Jr. 3 " Author: Charles E. Campbell, Jr.
4 " Date: May 30, 2008 4 " Date: Jul 10, 2008
5 " Version: 30 5 " Version: 31
6 " Installing: :help glvs-install 6 " Installing: :help glvs-install
7 " Usage: :help glvs 7 " Usage: :help glvs
8 " 8 "
9 " GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim 9 " GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
10 "redraw!|call inputsave()|call input("Press <cr> to continue")|call inputrestore() 10 "redraw!|call inputsave()|call input("Press <cr> to continue")|call inputrestore()
21 "DechoTabOn 21 "DechoTabOn
22 22
23 if exists("g:loaded_getscript") 23 if exists("g:loaded_getscript")
24 finish 24 finish
25 endif 25 endif
26 let g:loaded_getscript= "v30" 26 let g:loaded_getscript= "v31"
27 27
28 " --------------------------- 28 " ---------------------------
29 " Global Variables: {{{1 29 " Global Variables: {{{1
30 " --------------------------- 30 " ---------------------------
31 " Cygwin Detection ------- {{{2 31 " Cygwin Detection ------- {{{2
138 echoerr "GetLatestVimScripts needs ".g:GetLatestVimScripts_wget." which apparently is not available on your system" 138 echoerr "GetLatestVimScripts needs ".g:GetLatestVimScripts_wget." which apparently is not available on your system"
139 " call Dret("GetLatestVimScripts : wget not executable/availble") 139 " call Dret("GetLatestVimScripts : wget not executable/availble")
140 return 140 return
141 endif 141 endif
142 142
143 " insure that fnameescape() is available
144 if !exists("*fnameescape")
145 echoerr "GetLatestVimScripts needs fnameescape() (provided by 7.1.299 or later)"
146 return
147 endif
148
143 " Find the .../GetLatest subdirectory under the runtimepath 149 " Find the .../GetLatest subdirectory under the runtimepath
144 for datadir in split(&rtp,',') + [''] 150 for datadir in split(&rtp,',') + ['']
145 if isdirectory(datadir."/GetLatest") 151 if isdirectory(datadir."/GetLatest")
146 " call Decho("found directory<".datadir.">") 152 " call Decho("found directory<".datadir.">")
147 let datadir= datadir . "/GetLatest" 153 let datadir= datadir . "/GetLatest"
179 " call Decho("datadir <".datadir.">") 185 " call Decho("datadir <".datadir.">")
180 " call Decho("datafile <".datafile.">") 186 " call Decho("datafile <".datafile.">")
181 187
182 " don't let any events interfere (like winmanager's, taglist's, etc) 188 " don't let any events interfere (like winmanager's, taglist's, etc)
183 let eikeep= &ei 189 let eikeep= &ei
184 set ei=all 190 let hlskeep= &hls
191 set ei=all hls&vim
185 192
186 " record current directory, change to datadir, open split window with 193 " record current directory, change to datadir, open split window with
187 " datafile 194 " datafile
188 let origdir= getcwd() 195 let origdir= getcwd()
189 " call Decho("exe cd ".fnameescape(substitute(datadir,'\','/','ge'))) 196 " call Decho("exe cd ".fnameescape(substitute(datadir,'\','/','ge')))
314 q 321 q
315 322
316 " restore events and current directory 323 " restore events and current directory
317 exe "cd ".fnameescape(substitute(origdir,'\','/','ge')) 324 exe "cd ".fnameescape(substitute(origdir,'\','/','ge'))
318 let &ei= eikeep 325 let &ei= eikeep
326 let &hls= hlskeep
319 setlocal nolz 327 setlocal nolz
320 " call Dredir("BUFFER TEST (GetLatestVimScripts 2)","ls!") 328 " call Dredir("BUFFER TEST (GetLatestVimScripts 2)","ls!")
321 " call Dret("GetLatestVimScripts : did ".s:downloads." downloads") 329 " call Dret("GetLatestVimScripts : did ".s:downloads." downloads")
322 endfun 330 endfun
323 331
504 if has("win32") || has("win16") || has("win95") 512 if has("win32") || has("win16") || has("win95")
505 " call Decho("new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid)."|q") 513 " call Decho("new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid)."|q")
506 new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid)|q 514 new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid)|q
507 else 515 else
508 " call Decho("exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id=')) 516 " call Decho("exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id='))
509 exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id=') 517 exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id=').latestsrcid
510 endif 518 endif
511 519
512 " AutoInstall: only if doautoinstall has been requested by the plugin itself 520 " AutoInstall: only if doautoinstall has been requested by the plugin itself
513 if doautoinstall 521 if doautoinstall
514 " call Decho("attempting to do autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname)) 522 " call Decho("attempting to do autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname))
515 if filereadable(sname) 523 if filereadable(sname)
516 call Decho("exe silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".s:Escape(s:autoinstall)) 524 " call Decho("exe silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".s:Escape(s:autoinstall))
517 exe "silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".s:Escape(s:autoinstall) 525 exe "silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".s:Escape(s:autoinstall)
518 let curdir = escape(substitute(getcwd(),'\','/','ge'),"|[]*'\" #") 526 let curdir = escape(substitute(getcwd(),'\','/','ge'),"|[]*'\" #")
519 let installdir= curdir."/Installed" 527 let installdir= curdir."/Installed"
520 if !isdirectory(installdir) 528 if !isdirectory(installdir)
521 call mkdir(installdir) 529 call mkdir(installdir)