Skip to content
Browse files

Update runtime files.

  • Loading branch information...
1 parent dee4bec commit 4895774ca7e0e2b9a1bf99142ea89c1bb7cb04d0 Bram Moolenaar committed Jan 6, 2010
Showing with 10,948 additions and 3,595 deletions.
  1. +4 −4 runtime/autoload/ada.vim
  2. +4 −4 runtime/autoload/adacomplete.vim
  3. +4 −4 runtime/autoload/decada.vim
  4. +147 −126 runtime/autoload/getscript.vim
  5. +4 −4 runtime/autoload/gnat.vim
  6. +1,130 −663 runtime/autoload/netrw.vim
  7. +36 −30 runtime/autoload/netrwFileHandlers.vim
  8. +11 −3 runtime/autoload/netrwSettings.vim
  9. +1 −1 runtime/autoload/rubycomplete.vim
  10. +40 −11 runtime/autoload/spellfile.vim
  11. +38 −11 runtime/autoload/sqlcomplete.vim
  12. +169 −84 runtime/autoload/tar.vim
  13. +58 −83 runtime/autoload/vimball.vim
  14. +3 −3 runtime/colors/desert.vim
  15. +4 −4 runtime/compiler/decada.vim
  16. +1 −1 runtime/compiler/eruby.vim
  17. +2 −2 runtime/compiler/fortran_g77.vim
  18. +4 −1 runtime/compiler/gcc.vim
  19. +4 −4 runtime/compiler/gnat.vim
  20. +2 −2 runtime/compiler/jikes.vim
  21. +1 −1 runtime/compiler/rspec.vim
  22. +1 −1 runtime/compiler/ruby.vim
  23. +1 −1 runtime/compiler/rubyunit.vim
  24. +1 −1 runtime/compiler/splint.vim
  25. +57 −22 runtime/filetype.vim
  26. +31 −21 runtime/ftplugin/abaqus.vim
  27. +4 −4 runtime/ftplugin/ada.vim
  28. +3 −3 runtime/ftplugin/ant.vim
  29. +3 −3 runtime/ftplugin/aspvbs.vim
  30. +1 −1 runtime/ftplugin/bst.vim
  31. +110 −68 runtime/ftplugin/changelog.vim
  32. +1 −1 runtime/ftplugin/cobol.vim
  33. +3 −3 runtime/ftplugin/config.vim
  34. +3 −3 runtime/ftplugin/csc.vim
  35. +3 −3 runtime/ftplugin/csh.vim
  36. +3 −3 runtime/ftplugin/dosbatch.vim
  37. +3 −3 runtime/ftplugin/dtd.vim
  38. +1 −1 runtime/ftplugin/eruby.vim
  39. +5 −2 runtime/ftplugin/git.vim
  40. +3 −3 runtime/ftplugin/gitcommit.vim
  41. +2 −2 runtime/ftplugin/gitconfig.vim
  42. +4 −3 runtime/ftplugin/gitrebase.vim
  43. +2 −2 runtime/ftplugin/gitsendemail.vim
  44. +3 −3 runtime/ftplugin/html.vim
  45. +3 −3 runtime/ftplugin/java.vim
  46. +3 −3 runtime/ftplugin/jsp.vim
  47. +2 −2 runtime/ftplugin/mail.vim
  48. +2 −2 runtime/ftplugin/man.vim
  49. +3 −3 runtime/ftplugin/pascal.vim
  50. +3 −3 runtime/ftplugin/perl.vim
  51. +3 −3 runtime/ftplugin/php.vim
  52. +1 −1 runtime/ftplugin/ruby.vim
  53. +3 −3 runtime/ftplugin/sgml.vim
  54. +3 −3 runtime/ftplugin/sh.vim
  55. +68 −20 runtime/ftplugin/sql.vim
  56. +3 −3 runtime/ftplugin/svg.vim
  57. +36 −0 runtime/ftplugin/tcl.vim
  58. +3 −3 runtime/ftplugin/tcsh.vim
  59. +9 −3 runtime/ftplugin/verilog.vim
  60. +10 −6 runtime/ftplugin/vim.vim
  61. +3 −3 runtime/ftplugin/xhtml.vim
  62. +3 −3 runtime/ftplugin/xml.vim
  63. +3 −3 runtime/ftplugin/xsd.vim
  64. +3 −3 runtime/ftplugin/xslt.vim
  65. +4 −4 runtime/indent/ada.vim
  66. +1 −1 runtime/indent/bst.vim
  67. +5 −5 runtime/indent/cmake.vim
  68. +1 −1 runtime/indent/cobol.vim
  69. +3 −1 runtime/indent/cpp.vim
  70. +15 −0 runtime/indent/cuda.vim
  71. +2 −2 runtime/indent/eiffel.vim
  72. +1 −1 runtime/indent/eruby.vim
  73. +2 −2 runtime/indent/gitconfig.vim
  74. +13 −0 runtime/indent/mail.vim
  75. +25 −60 runtime/indent/php.vim
  76. +1 −1 runtime/indent/ruby.vim
  77. +122 −16 runtime/indent/sh.vim
  78. +11 −3 runtime/indent/xml.vim
  79. +82 −0 runtime/keymap/dvorak.vim
  80. +2 −2 runtime/lang/menu_cs_cz.iso_8859-2.vim
  81. +2 −2 runtime/lang/menu_czech_czech_republic.1250.vim
  82. +2 −2 runtime/lang/menu_czech_czech_republic.ascii.vim
  83. +45 −24 runtime/lang/menu_es_es.latin1.vim
  84. +2 −2 runtime/lang/menu_ko_kr.euckr.vim
  85. +2 −2 runtime/lang/menu_ko_kr.utf-8.vim
  86. +2 −2 runtime/lang/menu_ko_kr.vim
  87. +1 −1 runtime/lang/menu_ru_ru.koi8-r.vim
  88. +1 −1 runtime/lang/menu_ru_ru.vim
  89. +1 −1 runtime/macros/matchit.vim
  90. +3 −3 runtime/menu.vim
  91. +1 −1 runtime/plugin/getscriptPlugin.vim
  92. +6 −2 runtime/plugin/gzip.vim
  93. +4 −3 runtime/plugin/matchparen.vim
  94. +7 −28 runtime/plugin/netrwPlugin.vim
  95. +9 −7 runtime/plugin/tarPlugin.vim
  96. +7 −7 runtime/plugin/vimballPlugin.vim
  97. +11 −10 runtime/scripts.vim
  98. +1 −1 runtime/spell/README.txt
  99. +27 −0 runtime/spell/fixdup.vim
  100. +384 −40 runtime/syntax/2html.vim
  101. +4 −4 runtime/syntax/ada.vim
  102. +1 −1 runtime/syntax/ant.vim
  103. +1 −1 runtime/syntax/aspvbs.vim
  104. +1 −1 runtime/syntax/bindzone.vim
  105. +1 −1 runtime/syntax/bst.vim
  106. +16 −4 runtime/syntax/bzr.vim
  107. +10 −4 runtime/syntax/c.vim
  108. +1 −1 runtime/syntax/catalog.vim
  109. +1 −1 runtime/syntax/cl.vim
  110. +5 −5 runtime/syntax/cmake.vim
  111. +1 −1 runtime/syntax/cobol.vim
  112. +2 −2 runtime/syntax/config.vim
  113. +5 −5 runtime/syntax/cs.vim
  114. +3 −3 runtime/syntax/debchangelog.vim
  115. +12 −12 runtime/syntax/debcontrol.vim
  116. +3 −3 runtime/syntax/debsources.vim
  117. +2 −2 runtime/syntax/def.vim
  118. +7 −6 runtime/syntax/django.vim
  119. +2 −2 runtime/syntax/docbk.vim
  120. +12 −10 runtime/syntax/dosbatch.vim
  121. +3 −3 runtime/syntax/doxygen.vim
  122. +1 −1 runtime/syntax/dsl.vim
  123. +1 −1 runtime/syntax/elf.vim
  124. +2 −2 runtime/syntax/erlang.vim
  125. +1 −1 runtime/syntax/eruby.vim
  126. +2 −2 runtime/syntax/focexec.vim
  127. +72 −15 runtime/syntax/form.vim
  128. +1 −1 runtime/syntax/forth.vim
  129. +2 −2 runtime/syntax/fortran.vim
  130. +22 −4 runtime/syntax/fstab.vim
  131. +2 −2 runtime/syntax/gdb.vim
  132. +20 −9 runtime/syntax/git.vim
  133. +24 −6 runtime/syntax/gitcommit.vim
  134. +2 −2 runtime/syntax/gitconfig.vim
  135. +5 −3 runtime/syntax/gitrebase.vim
  136. +1 −0 runtime/syntax/groovy.vim
  137. +3 −2 runtime/syntax/haskell.vim
  138. +2 −2 runtime/syntax/help.vim
  139. +1 −1 runtime/syntax/hog.vim
  140. +1 −1 runtime/syntax/initng.vim
  141. +10 −9 runtime/syntax/java.vim
  142. +3 −3 runtime/syntax/kconfig.vim
  143. +1 −1 runtime/syntax/kscript.vim
  144. +48 −19 runtime/syntax/lex.vim
  145. +13 −8 runtime/syntax/lhaskell.vim
  146. +4 −6 runtime/syntax/lilo.vim
  147. +4 −3 runtime/syntax/lisp.vim
  148. +4 −4 runtime/syntax/logtalk.vim
  149. +1 −1 runtime/syntax/lout.vim
  150. +25 −17 runtime/syntax/mail.vim
  151. +2 −2 runtime/syntax/man.vim
  152. +2 −2 runtime/syntax/masm.vim
  153. +2 −2 runtime/syntax/master.vim
  154. +25 −8 runtime/syntax/matlab.vim
  155. +1 −1 runtime/syntax/maxima.vim
  156. +1 −1 runtime/syntax/mgl.vim
  157. +1 −1 runtime/syntax/mma.vim
  158. +3 −3 runtime/syntax/mysql.vim
  159. +1 −1 runtime/syntax/ncf.vim
  160. +11 −10 runtime/syntax/netrc.vim
  161. +67 −61 runtime/syntax/netrw.vim
  162. +1 −1 runtime/syntax/opl.vim
  163. +2 −1 runtime/syntax/papp.vim
  164. +2 −2 runtime/syntax/po.vim
  165. +1 −1 runtime/syntax/progress.vim
  166. +3 −3 runtime/syntax/prolog.vim
  167. +6 −6 runtime/syntax/pyrex.vim
  168. +228 −114 runtime/syntax/python.vim
  169. +1 −1 runtime/syntax/rcs.vim
  170. +2 −1 runtime/syntax/readline.vim
  171. +18 −8 runtime/syntax/remind.vim
  172. +5 −4 runtime/syntax/rhelp.vim
  173. +4 −3 runtime/syntax/rnoweb.vim
  174. +5 −8 runtime/syntax/rst.vim
  175. +1 −1 runtime/syntax/ruby.vim
  176. +5 −3 runtime/syntax/samba.vim
  177. +51 −36 runtime/syntax/scheme.vim
  178. +41 −0 runtime/syntax/sdc.vim
  179. +1 −1 runtime/syntax/sgml.vim
  180. +2 −2 runtime/syntax/sgmllnx.vim
  181. +37 −33 runtime/syntax/sh.vim
  182. +4 −2 runtime/syntax/sisu.vim
  183. +1 −2 runtime/syntax/spec.vim
  184. +2 −2 runtime/syntax/splint.vim
  185. +2 −1 runtime/syntax/spyce.vim
  186. +130 −155 runtime/syntax/sqlanywhere.vim
  187. +61 −50 runtime/syntax/sshconfig.vim
  188. +61 −54 runtime/syntax/sshdconfig.vim
  189. +1 −1 runtime/syntax/svn.vim
  190. +2 −2 runtime/syntax/tads.vim
  191. +43 −0 runtime/syntax/taskdata.vim
  192. +35 −0 runtime/syntax/taskedit.vim
  193. +69 −30 runtime/syntax/tcl.vim
  194. +8 −4 runtime/syntax/tcsh.vim
  195. +22 −11 runtime/syntax/tex.vim
  196. +1 −1 runtime/syntax/tilde.vim
  197. +3 −2 runtime/syntax/uil.vim
  198. +6 −2 runtime/syntax/updatedb.vim
  199. +1 −1 runtime/syntax/vhdl.vim
  200. +337 −299 runtime/syntax/vim.vim
  201. +1 −1 runtime/syntax/xdefaults.vim
  202. +6 −4 runtime/syntax/xml.vim
  203. +1 −1 runtime/syntax/xquery.vim
  204. +1 −1 runtime/syntax/xsd.vim
  205. +1 −1 runtime/syntax/xslt.vim
  206. +59 −63 runtime/syntax/yacc.vim
  207. +17 −0 runtime/tutor/Makefile
  208. +987 −0 runtime/tutor/tutor.bj
  209. +987 −0 runtime/tutor/tutor.bj.utf-8
  210. +989 −0 runtime/tutor/tutor.eo
  211. +56 −34 runtime/tutor/tutor.eo.utf-8
  212. +1 −1 runtime/tutor/tutor.es
  213. +1 −1 runtime/tutor/tutor.es.utf-8
  214. +580 −351 runtime/tutor/tutor.fr
  215. +580 −351 runtime/tutor/tutor.fr.utf-8
  216. +48 −41 runtime/tutor/tutor.hu
  217. +48 −41 runtime/tutor/tutor.hu.cp1250
  218. +48 −41 runtime/tutor/tutor.hu.utf-8
  219. +3 −3 runtime/tutor/tutor.ja.euc
  220. +3 −3 runtime/tutor/tutor.ja.sjis
  221. +3 −3 runtime/tutor/tutor.ja.utf-8
  222. +973 −0 runtime/tutor/tutor.nb
  223. +973 −0 runtime/tutor/tutor.nb.utf-8
Sorry, we could not display the entire diff because it was too big.
View
8 runtime/autoload/ada.vim
@@ -1,15 +1,15 @@
"------------------------------------------------------------------------------
" Description: Perform Ada specific completion & tagging.
" Language: Ada (2005)
-" $Id$
+" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
" Taylor Venable <taylor@metasyntax.net>
" Neil Bird <neil@fnxweb.com>
" Ned Okie <nokie@radford.edu>
-" $Author$
-" $Date$
+" $Author: krischik $
+" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
" Version: 4.6
-" $Revision$
+" $Revision: 887 $
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $
" History: 24.05.2006 MK Unified Headers
" 26.05.2006 MK ' should not be in iskeyword.
View
8 runtime/autoload/adacomplete.vim
@@ -1,12 +1,12 @@
"------------------------------------------------------------------------------
" Description: Vim Ada omnicompletion file
" Language: Ada (2005)
-" $Id$
+" $Id: adacomplete.vim 887 2008-07-08 14:29:01Z krischik $
" Maintainer: Martin Krischik
-" $Author$
-" $Date$
+" $Author: krischik $
+" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
" Version: 4.6
-" $Revision$
+" $Revision: 887 $
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/adacomplete.vim $
" History: 24.05.2006 MK Unified Headers
" 26.05.2006 MK improved search for begin of word.
View
8 runtime/autoload/decada.vim
@@ -1,13 +1,13 @@
"------------------------------------------------------------------------------
" Description: Vim Ada/Dec Ada compiler file
" Language: Ada (Dec Ada)
-" $Id$
+" $Id: decada.vim 887 2008-07-08 14:29:01Z krischik $
" Copyright: Copyright (C) 2006 Martin Krischik
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
-" $Author$
-" $Date$
+" $Author: krischik $
+" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
" Version: 4.6
-" $Revision$
+" $Revision: 887 $
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/decada.vim $
" History: 21.07.2006 MK New Dec Ada
" 15.10.2006 MK Bram's suggestion for runtime integration
View
273 runtime/autoload/getscript.vim
@@ -1,8 +1,8 @@
" ---------------------------------------------------------------------
" getscript.vim
" Author: Charles E. Campbell, Jr.
-" Date: Jul 10, 2008
-" Version: 31
+" Date: Dec 28, 2009
+" Version: 32
" Installing: :help glvs-install
" Usage: :help glvs
"
@@ -12,19 +12,24 @@
" Initialization: {{{1
" if you're sourcing this file, surely you can't be
" expecting vim to be in its vi-compatible mode!
+if exists("g:loaded_getscript")
+ finish
+endif
+let g:loaded_getscript= "v32"
if &cp
echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
finish
endif
+if v:version < 702
+ echohl WarningMsg
+ echo "***warning*** this version of getscript needs vim 7.2"
+ echohl Normal
+ finish
+endif
let s:keepcpo = &cpo
set cpo&vim
"DechoTabOn
-if exists("g:loaded_getscript")
- finish
-endif
-let g:loaded_getscript= "v31"
-
" ---------------------------
" Global Variables: {{{1
" ---------------------------
@@ -40,25 +45,6 @@ if !exists("g:getscript_cygwin")
let g:getscript_cygwin= 0
endif
endif
-" shell quoting character {{{2
-if exists("g:netrw_shq") && !exists("g:getscript_shq")
- let g:getscript_shq= g:netrw_shq
-elseif !exists("g:getscript_shq")
- if exists("&shq") && &shq != ""
- let g:getscript_shq= &shq
- elseif exists("&sxq") && &sxq != ""
- let g:getscript_shq= &sxq
- elseif has("win32") || has("win95") || has("win64") || has("win16")
- if g:getscript_cygwin
- let g:getscript_shq= "'"
- else
- let g:getscript_shq= '"'
- endif
- else
- let g:getscript_shq= "'"
- endif
-" call Decho("g:getscript_shq<".g:getscript_shq.">")
-endif
" wget vs curl {{{2
if !exists("g:GetLatestVimScripts_wget")
@@ -112,7 +98,9 @@ if g:GetLatestVimScripts_allowautoinstall
endif
endif
- if exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim)
+ if exists("g:GetLatestVimScripts_autoinstalldir") && isdirectory(g:GetLatestVimScripts_autoinstalldir)
+ let s:autoinstall= g:GetLatestVimScripts_autoinstalldir"
+ elseif exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim)
let s:autoinstall= $HOME."/".s:dotvim
endif
" call Decho("s:autoinstall<".s:autoinstall.">")
@@ -165,7 +153,6 @@ fun! getscript#GetLatestVimScripts()
" call Dret("GetLatestVimScripts : unable to find a GetLatest subdirectory")
return
endif
-
if filewritable(datadir) != 2
echoerr "(getLatestVimScripts) Your ".datadir." isn't writable"
" call Dret("GetLatestVimScripts : non-writable directory<".datadir.">")
@@ -182,21 +169,29 @@ fun! getscript#GetLatestVimScripts()
" call Dret("GetLatestVimScripts : non-writable datafile<".datafile.">")
return
endif
+ " --------------------
+ " Passed sanity checks
+ " --------------------
+
" call Decho("datadir <".datadir.">")
" call Decho("datafile <".datafile.">")
- " don't let any events interfere (like winmanager's, taglist's, etc)
- let eikeep= &ei
- let hlskeep= &hls
- set ei=all hls&vim
-
- " record current directory, change to datadir, open split window with
- " datafile
+ " don't let any event handlers interfere (like winmanager's, taglist's, etc)
+ let eikeep = &ei
+ let hlskeep = &hls
+ let acdkeep = &acd
+ set ei=all hls&vim noacd
+
+ " Edit the datafile (ie. GetLatestVimScripts.dat):
+ " 1. record current directory (origdir),
+ " 2. change directory to datadir,
+ " 3. split window
+ " 4. edit datafile
let origdir= getcwd()
" call Decho("exe cd ".fnameescape(substitute(datadir,'\','/','ge')))
exe "cd ".fnameescape(substitute(datadir,'\','/','ge'))
split
-" call Decho("exe e ".fnameescape(substitute(datafile,'\','/','ge')))
+" call Decho("exe e ".fnameescape(substitute(datafile,'\','/','ge')))
exe "e ".fnameescape(substitute(datafile,'\','/','ge'))
res 1000
let s:downloads = 0
@@ -207,69 +202,68 @@ fun! getscript#GetLatestVimScripts()
" call Decho("searching plugins for GetLatestVimScripts dependencies")
let lastline = line("$")
" call Decho("lastline#".lastline)
- let plugins = split(globpath(&rtp,"plugin/*.vim"),'\n')
+ let firstdir = substitute(&rtp,',.*$','','')
+ let plugins = split(globpath(firstdir,"plugin/*.vim"),'\n')
+ let plugins = plugins + split(globpath(firstdir,"AsNeeded/*.vim"),'\n')
let foundscript = 0
- let firstdir= ""
+ " this loop updates the GetLatestVimScripts.dat file
+ " with dependencies explicitly mentioned in the plugins
+ " via GetLatestVimScripts: ... lines
+ " It reads the plugin script at the end of the GetLatestVimScripts.dat
+ " file, examines it, and then removes it.
for plugin in plugins
+" call Decho(" ")
" call Decho("plugin<".plugin.">")
- " don't process plugins in system directories
- if firstdir == ""
- let firstdir= substitute(plugin,'[/\\][^/\\]\+$','','')
-" call Decho("setting firstdir<".firstdir.">")
- else
- let curdir= substitute(plugin,'[/\\][^/\\]\+$','','')
-" call Decho("curdir<".curdir.">")
- if curdir != firstdir
-" call Decho("skipping subsequent plugins: curdir<".curdir."> != firstdir<".firstdir.">")
- break
- endif
- endif
-
" read plugin in
" evidently a :r creates a new buffer (the "#" buffer) that is subsequently unused -- bwiping it
$
-" call Decho(" ")
" call Decho(".dependency checking<".plugin."> line$=".line("$"))
-" call Decho("exe silent r ".fnameescape(plugin))
+" call Decho("..exe silent r ".fnameescape(plugin))
exe "silent r ".fnameescape(plugin)
exe "silent bwipe ".bufnr("#")
while search('^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+','W') != 0
- let newscript= substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e')
- let llp1 = lastline+1
-" call Decho("..newscript<".newscript.">")
-
- " don't process ""GetLatestVimScripts lines -- those that have been doubly-commented out
- if newscript !~ '^"'
- " found a "GetLatestVimScripts: # #" line in the script; check if its already in the datafile
- let curline = line(".")
- let noai_script = substitute(newscript,'\s*:AutoInstall:\s*','','e')
- exe llp1
- let srchline = search('\<'.noai_script.'\>','bW')
-" call Decho("..noai_script<".noai_script."> srch=".srchline."curline#".line(".")." lastline#".lastline)
-
- if srchline == 0
- " found a new script to permanently include in the datafile
- let keep_rega = @a
- let @a = substitute(getline(curline),'^"\s\+GetLatestVimScripts:\s\+','','')
- exe lastline."put a"
- echomsg "Appending <".@a."> to ".datafile." for ".newscript
-" call Decho("..APPEND (".noai_script.")<".@a."> to GetLatestVimScripts.dat")
- let @a = keep_rega
- let lastline = llp1
- let curline = curline + 1
- let foundscript = foundscript + 1
-" else " Decho
-" call Decho("..found <".noai_script."> (already in datafile at line#".srchline.")")
- endif
-
- let curline = curline + 1
- exe curline
+ let depscript = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e')
+ let depscriptid = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\(\d\+\)\s\+.*$','\1','')
+ let llp1 = lastline+1
+" call Decho("..depscript<".depscript.">")
+
+ " found a "GetLatestVimScripts: # #" line in the script;
+ " check if its already in the datafile by searching backwards from llp1,
+ " the (prior to reading in the plugin script) last line plus one of the GetLatestVimScripts.dat file,
+ " for the script-id with no wrapping allowed.
+ let curline = line(".")
+ let noai_script = substitute(depscript,'\s*:AutoInstall:\s*','','e')
+ exe llp1
+ let srchline = search('^\s*'.depscriptid.'\s\+\d\+\s\+.*$','bW')
+ if srchline == 0
+ " this second search is taken when, for example, a 0 0 scriptname is to be skipped over
+ let srchline= search('\<'.noai_script.'\>','bW')
+ endif
+" call Decho("..noai_script<".noai_script."> depscriptid#".depscriptid." srchline#".srchline." curline#".line(".")." lastline#".lastline)
+
+ if srchline == 0
+ " found a new script to permanently include in the datafile
+ let keep_rega = @a
+ let @a = substitute(getline(curline),'^"\s\+GetLatestVimScripts:\s\+','','')
+ echomsg "Appending <".@a."> to ".datafile." for ".depscript
+" call Decho("..Appending <".@a."> to ".datafile." for ".depscript)
+ exe lastline."put a"
+ let @a = keep_rega
+ let lastline = llp1
+ let curline = curline + 1
+ let foundscript = foundscript + 1
+" else " Decho
+" call Decho("..found <".noai_script."> (already in datafile at line#".srchline.")")
endif
+
+ let curline = curline + 1
+ exe curline
endwhile
+ " llp1: last line plus one
let llp1= lastline + 1
" call Decho(".deleting lines: ".llp1.",$d")
exe "silent! ".llp1.",$d"
@@ -282,7 +276,9 @@ fun! getscript#GetLatestVimScripts()
setlocal nomod
endif
+ " --------------------------------------------------------------------
" Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat
+ " --------------------------------------------------------------------
" call Decho("begin: checking out-of-date scripts using datafile<".datafile.">")
setlocal lz
1
@@ -322,8 +318,9 @@ fun! getscript#GetLatestVimScripts()
" restore events and current directory
exe "cd ".fnameescape(substitute(origdir,'\','/','ge'))
- let &ei= eikeep
- let &hls= hlskeep
+ let &ei = eikeep
+ let &hls = hlskeep
+ let &acd = acdkeep
setlocal nolz
" call Dredir("BUFFER TEST (GetLatestVimScripts 2)","ls!")
" call Dret("GetLatestVimScripts : did ".s:downloads." downloads")
@@ -333,7 +330,7 @@ endfun
" GetOneScript: (Get Latest Vim Script) this function operates {{{1
" on the current line, interpreting two numbers and text as
" ScriptID, SourceID, and Filename.
-" It downloads any scripts that have newer versions from vim.sf.net.
+" It downloads any scripts that have newer versions from vim.sourceforge.net.
fun! s:GetOneScript(...)
" call Dfunc("GetOneScript()")
@@ -391,6 +388,7 @@ fun! s:GetOneScript(...)
" call Decho("fname <".fname.">")
endif
+ " plugin author protection from downloading his/her own scripts atop their latest work
if scriptid == 0 || srcid == 0
" When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname
let @a= rega
@@ -416,21 +414,21 @@ fun! s:GetOneScript(...)
" call Decho('considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid)
echo 'considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid
- " grab a copy of the plugin's vim.sf.net webpage
- let scriptaddr = 'http://vim.sf.net/script.php?script_id='.scriptid
+ " grab a copy of the plugin's vim.sourceforge.net webpage
+ let scriptaddr = 'http://vim.sourceforge.net/script.php?script_id='.scriptid
let tmpfile = tempname()
let v:errmsg = ""
" make up to three tries at downloading the description
let itry= 1
while itry <= 3
-" call Decho("try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr)
+" call Decho(".try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr)
if has("win32") || has("win16") || has("win95")
-" call Decho("new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(tmpfile).' '.s:Escape(scriptaddr)."|bw!")
- new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(tmpfile).' '.s:Escape(scriptaddr)|bw!
+" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)."|bw!")
+ new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)|bw!
else
-" call Decho("exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(tmpfile)." ".s:Escape(scriptaddr))
- exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(tmpfile)." ".s:Escape(scriptaddr)
+" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr))
+ exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr)
endif
if itry == 1
exe "silent vsplit ".fnameescape(tmpfile)
@@ -495,8 +493,7 @@ fun! s:GetOneScript(...)
let latestsrcid = latestsrcid + 0
" call Decho("srcid=".srcid." latestsrcid=".latestsrcid." sname<".sname.">")
- " has the plugin's most-recent srcid increased, which indicates
- " that it has been updated
+ " has the plugin's most-recent srcid increased, which indicates that it has been updated
if latestsrcid > srcid
" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."]: need to update <".sname.">")
@@ -506,65 +503,103 @@ fun! s:GetOneScript(...)
let sname= "NEW_".sname
endif
+ " -----------------------------------------------------------------------------
" the plugin has been updated since we last obtained it, so download a new copy
-" call Decho("...downloading new <".sname.">")
- echomsg "...downloading new <".sname.">"
+ " -----------------------------------------------------------------------------
+" call Decho(".downloading new <".sname.">")
+ echomsg ".downloading new <".sname.">"
if has("win32") || has("win16") || has("win95")
-" 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")
- 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
+" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='.latestsrcid)."|q")
+ new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='.latestsrcid)|q
else
-" 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='))
- exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id=').latestsrcid
+" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='))
+ exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id=').latestsrcid
endif
+ " --------------------------------------------------------------------------
" AutoInstall: only if doautoinstall has been requested by the plugin itself
+ " --------------------------------------------------------------------------
if doautoinstall
-" call Decho("attempting to do autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname))
+" call Decho(" ")
+" call Decho("Autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname))
if filereadable(sname)
-" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".s:Escape(s:autoinstall))
- exe "silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".s:Escape(s:autoinstall)
+" call Decho("<".sname."> is readable")
+" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall))
+ exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall)
let curdir = escape(substitute(getcwd(),'\','/','ge'),"|[]*'\" #")
let installdir= curdir."/Installed"
if !isdirectory(installdir)
call mkdir(installdir)
endif
-" call Decho("exe cd ".fnameescape(s:autoinstall))
+" call Decho("curdir<".curdir."> installdir<".installdir.">")
+" call Decho("exe cd ".fnameescape(s:autoinstall))
exe "cd ".fnameescape(s:autoinstall)
+
+ " determine target directory for moves
+ let firstdir= substitute(&rtp,',.*$','','')
+ let pname = substitute(sname,'\..*','.vim','')
+" call Decho("determine tgtdir: is <".firstdir.'/AsNeeded/'.pname." readable?")
+ if filereadable(firstdir.'/AsNeeded/'.pname)
+ let tgtdir= "AsNeeded"
+ else
+ let tgtdir= "plugin"
+ endif
+" call Decho("tgtdir<".tgtdir."> pname<".pname.">")
" decompress
if sname =~ '\.bz2$'
" call Decho("decompress: attempt to bunzip2 ".sname)
- exe "silent !bunzip2 ".s:Escape(sname)
+ exe "silent !bunzip2 ".shellescape(sname)
let sname= substitute(sname,'\.bz2$','','')
" call Decho("decompress: new sname<".sname."> after bunzip2")
elseif sname =~ '\.gz$'
" call Decho("decompress: attempt to gunzip ".sname)
- exe "silent !gunzip ".s:Escape(sname)
+ exe "silent !gunzip ".shellescape(sname)
let sname= substitute(sname,'\.gz$','','')
" call Decho("decompress: new sname<".sname."> after gunzip")
+ else
+" call Decho("no decompression needed")
endif
" distribute archive(.zip, .tar, .vba) contents
if sname =~ '\.zip$'
" call Decho("dearchive: attempt to unzip ".sname)
- exe "silent !unzip -o ".s:Escape(sname)
+ exe "silent !unzip -o ".shellescape(sname)
elseif sname =~ '\.tar$'
" call Decho("dearchive: attempt to untar ".sname)
- exe "silent !tar -xvf ".s:Escape(sname)
+ exe "silent !tar -xvf ".shellescape(sname)
elseif sname =~ '\.vba$'
" call Decho("dearchive: attempt to handle a vimball: ".sname)
silent 1split
+ if exists("g:vimball_home")
+ let oldvimballhome= g:vimball_home
+ endif
+ let g:vimball_home= s:autoinstall
exe "silent e ".fnameescape(sname)
silent so %
silent q
+ if exists("oldvimballhome")
+ let g:vimball_home= oldvimballhome
+ else
+ unlet g:vimball_home
+ endif
+ else
+" call Decho("no dearchiving needed")
endif
+ " ---------------------------------------------
+ " move plugin to plugin/ or AsNeeded/ directory
+ " ---------------------------------------------
if sname =~ '.vim$'
-" call Decho("dearchive: attempt to simply move ".sname." to plugin")
- exe "silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." plugin"
+" call Decho("dearchive: attempt to simply move ".sname." to ".tgtdir)
+ exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".tgtdir
else
" call Decho("dearchive: move <".sname."> to installdir<".installdir.">")
- exe "silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".installdir
+ exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".installdir
+ endif
+ if tgtdir != "plugin"
+" call Decho("exe silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir)
+ exe "silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir
endif
" helptags step
@@ -600,20 +635,6 @@ fun! s:GetOneScript(...)
endfun
" ---------------------------------------------------------------------
-" s:Escape: makes a string safe&suitable for the shell {{{2
-fun! s:Escape(name)
-" call Dfunc("s:Escape(name<".a:name.">)")
- if exists("*shellescape")
- " shellescape() was added by patch 7.0.111
- let name= shellescape(a:name)
- else
- let name= g:getscript_shq . a:name . g:getscript_shq
- endif
-" call Dret("s:Escape ".name)
- return name
-endfun
-
-" ---------------------------------------------------------------------
" Restore Options: {{{1
let &cpo= s:keepcpo
unlet s:keepcpo
View
8 runtime/autoload/gnat.vim
@@ -1,14 +1,14 @@
"------------------------------------------------------------------------------
" Description: Vim Ada/GNAT compiler file
" Language: Ada (GNAT)
-" $Id$
+" $Id: gnat.vim 887 2008-07-08 14:29:01Z krischik $
" Copyright: Copyright (C) 2006 Martin Krischik
" Maintainer: Martin Krischi <krischik@users.sourceforge.net>k
" Ned Okie <nokie@radford.edu>
-" $Author$
-" $Date$
+" $Author: krischik $
+" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
" Version: 4.6
-" $Revision$
+" $Revision: 887 $
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/gnat.vim $
" History: 24.05.2006 MK Unified Headers
" 16.07.2006 MK Ada-Mode as vim-ball
View
1,793 runtime/autoload/netrw.vim
1,130 additions, 663 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
66 runtime/autoload/netrwFileHandlers.vim
@@ -1,9 +1,9 @@
" netrwFileHandlers: contains various extension-based file handlers for
" netrw's browsers' x command ("eXecute launcher")
" Author: Charles E. Campbell, Jr.
-" Date: May 30, 2006
-" Version: 9
-" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
+" Date: Sep 30, 2008
+" Version: 10
+" Copyright: Copyright (C) 1999-2008 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
" notice is copied with it. Like anything else that's free,
@@ -20,9 +20,15 @@
if exists("g:loaded_netrwFileHandlers") || &cp
finish
endif
+let g:loaded_netrwFileHandlers= "v10"
+if v:version < 702
+ echohl WarningMsg
+ echo "***warning*** this version of netrwFileHandlers needs vim 7.2"
+ echohl Normal
+ finish
+endif
let s:keepcpo= &cpo
set cpo&vim
-let g:loaded_netrwFileHandlers= "v9"
" ---------------------------------------------------------------------
" netrwFileHandlers#Invoke: {{{1
@@ -73,10 +79,10 @@ fun! s:NFH_html(pagefile)
if executable("mozilla")
" call Decho("executing !mozilla ".page)
- exe "!mozilla ".g:netrw_shq.page.g:netrw_shq
+ exe "!mozilla ".shellescape(page,1)
elseif executable("netscape")
" call Decho("executing !netscape ".page)
- exe "!netscape ".g:netrw_shq..page.g:netrw_shq
+ exe "!netscape ".shellescape(page,1)
else
" call Dret("s:NFH_html 0")
return 0
@@ -96,10 +102,10 @@ fun! s:NFH_htm(pagefile)
if executable("mozilla")
" call Decho("executing !mozilla ".page)
- exe "!mozilla ".g:netrw_shq.page.g:netrw_shq
+ exe "!mozilla ".shellescape(page,1)
elseif executable("netscape")
" call Decho("executing !netscape ".page)
- exe "!netscape ".g:netrw_shq.page.g:netrw_shq
+ exe "!netscape ".shellescape(page,1)
else
" call Dret("s:NFH_htm 0")
return 0
@@ -115,10 +121,10 @@ fun! s:NFH_jpg(jpgfile)
" call Dfunc("s:NFH_jpg(jpgfile<".a:jpgfile.">)")
if executable("gimp")
- exe "silent! !gimp -s ".g:netrw_shq.a:jpgfile.g:netrw_shq
+ exe "silent! !gimp -s ".shellescape(a:jpgfile,1)
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
" call Decho("silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".escape(a:jpgfile," []|'"))
- exe "!".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:jpgfile.g:netrw_shq
+ exe "!".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:jpgfile,1)
else
" call Dret("s:NFH_jpg 0")
return 0
@@ -134,9 +140,9 @@ fun! s:NFH_gif(giffile)
" call Dfunc("s:NFH_gif(giffile<".a:giffile.">)")
if executable("gimp")
- exe "silent! !gimp -s ".g:netrw_shq.a:giffile.g:netrw_shq
+ exe "silent! !gimp -s ".shellescape(a:giffile,1)
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
- exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:giffile.g:netrw_shq
+ exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:giffile,1)
else
" call Dret("s:NFH_gif 0")
return 0
@@ -152,9 +158,9 @@ fun! s:NFH_png(pngfile)
" call Dfunc("s:NFH_png(pngfile<".a:pngfile.">)")
if executable("gimp")
- exe "silent! !gimp -s ".g:netrw_shq.a:pngfile.g:netrw_shq
+ exe "silent! !gimp -s ".shellescape(a:pngfile,1)
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
- exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:pngfile.g:netrw_shq
+ exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:pngfile,1)
else
" call Dret("s:NFH_png 0")
return 0
@@ -170,9 +176,9 @@ fun! s:NFH_pnm(pnmfile)
" call Dfunc("s:NFH_pnm(pnmfile<".a:pnmfile.">)")
if executable("gimp")
- exe "silent! !gimp -s ".g:netrw_shq.a:pnmfile.g:netrw_shq
+ exe "silent! !gimp -s ".shellescape(a:pnmfile,1)
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
- exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:pnmfile.g:netrw_shq
+ exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:pnmfile,1)
else
" call Dret("s:NFH_pnm 0")
return 0
@@ -190,7 +196,7 @@ fun! s:NFH_bmp(bmpfile)
if executable("gimp")
exe "silent! !gimp -s ".a:bmpfile
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
- exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:bmpfile.g:netrw_shq
+ exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:bmpfile,1)
else
" call Dret("s:NFH_bmp 0")
return 0
@@ -205,9 +211,9 @@ endfun
fun! s:NFH_pdf(pdf)
" call Dfunc("s:NFH_pdf(pdf<".a:pdf.">)")
if executable("gs")
- exe 'silent! !gs '.g:netrw_shq.a:pdf.g:netrw_shq
+ exe 'silent! !gs '.shellescape(a:pdf,1)
elseif executable("pdftotext")
- exe 'silent! pdftotext -nopgbrk '.g:netrw_shq.a:pdf.g:netrw_shq
+ exe 'silent! pdftotext -nopgbrk '.shellescape(a:pdf,1)
else
" call Dret("s:NFH_pdf 0")
return 0
@@ -223,7 +229,7 @@ fun! s:NFH_doc(doc)
" call Dfunc("s:NFH_doc(doc<".a:doc.">)")
if executable("oowriter")
- exe 'silent! !oowriter '.g:netrw_shq.a:doc.g:netrw_shq
+ exe 'silent! !oowriter '.shellescape(a:doc,1)
redraw!
else
" call Dret("s:NFH_doc 0")
@@ -240,7 +246,7 @@ fun! s:NFH_sxw(sxw)
" call Dfunc("s:NFH_sxw(sxw<".a:sxw.">)")
if executable("oowriter")
- exe 'silent! !oowriter '.g:netrw_shq.a:sxw.g:netrw_shq
+ exe 'silent! !oowriter '.shellescape(a:sxw,1)
redraw!
else
" call Dret("s:NFH_sxw 0")
@@ -257,7 +263,7 @@ fun! s:NFH_xls(xls)
" call Dfunc("s:NFH_xls(xls<".a:xls.">)")
if executable("oocalc")
- exe 'silent! !oocalc '.g:netrw_shq.a:xls.g:netrw_shq
+ exe 'silent! !oocalc '.shellescape(a:xls,1)
redraw!
else
" call Dret("s:NFH_xls 0")
@@ -274,15 +280,15 @@ fun! s:NFH_ps(ps)
" call Dfunc("s:NFH_ps(ps<".a:ps.">)")
if executable("gs")
" call Decho("exe silent! !gs ".a:ps)
- exe "silent! !gs ".g:netrw_shq.a:ps.g:netrw_shq
+ exe "silent! !gs ".shellescape(a:ps,1)
redraw!
elseif executable("ghostscript")
" call Decho("exe silent! !ghostscript ".a:ps)
- exe "silent! !ghostscript ".g:netrw_shq.a:ps.g:netrw_shq
+ exe "silent! !ghostscript ".shellescape(a:ps,1)
redraw!
elseif executable("gswin32")
-" call Decho("exe silent! !gswin32 ".g:netrw_shq.a:ps.g:netrw_shq)
- exe "silent! !gswin32 ".g:netrw_shq.a:ps.g:netrw_shq
+" call Decho("exe silent! !gswin32 ".shellescape(a:ps,1))
+ exe "silent! !gswin32 ".shellescape(a:ps,1)
redraw!
else
" call Dret("s:NFH_ps 0")
@@ -298,16 +304,16 @@ endfun
fun! s:NFH_eps(eps)
" call Dfunc("s:NFH_eps()")
if executable("gs")
- exe "silent! !gs ".g:netrw_shq.a:eps.g:netrw_shq
+ exe "silent! !gs ".shellescape(a:eps,1)
redraw!
elseif executable("ghostscript")
- exe "silent! !ghostscript ".g:netrw_shq.a:eps.g:netrw_shq
+ exe "silent! !ghostscript ".shellescape(a:eps,1)
redraw!
elseif executable("ghostscript")
- exe "silent! !ghostscript ".g:netrw_shq.a:eps.g:netrw_shq
+ exe "silent! !ghostscript ".shellescape(a:eps,1)
redraw!
elseif executable("gswin32")
- exe "silent! !gswin32 ".g:netrw_shq.a:eps.g:netrw_shq
+ exe "silent! !gswin32 ".shellescape(a:eps,1)
redraw!
else
" call Dret("s:NFH_eps 0")
View
14 runtime/autoload/netrwSettings.vim
@@ -1,7 +1,7 @@
" netrwSettings.vim: makes netrw settings simpler
-" Date: Jul 02, 2008
+" Date: Sep 03, 2008
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
-" Version: 12
+" Version: 13
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
@@ -19,7 +19,13 @@
if exists("g:loaded_netrwSettings") || &cp
finish
endif
-let g:loaded_netrwSettings = "v12"
+let g:loaded_netrwSettings = "v13"
+if v:version < 700
+ echohl WarningMsg
+ echo "***warning*** this version of netrwSettings needs vim 7.0"
+ echohl Normal
+ finish
+endif
" ---------------------------------------------------------------------
" NetrwSettings: {{{1
@@ -100,6 +106,7 @@ fun! netrwSettings#NetrwSettings()
put = 'let g:netrw_browsex_viewer = (not defined)'
endif
put = 'let g:netrw_compress = '.g:netrw_compress
+ put = 'let g:netrw_cursorline = '.g:netrw_cursorline
let decompressline= line("$")
put ='let g:netrw_decompress...'
put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax
@@ -138,6 +145,7 @@ fun! netrwSettings#NetrwSettings()
put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax
put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject
put = 'let g:netrw_scpport = '.g:netrw_scpport
+ put = 'let g:netrw_sepchr = '.g:netrw_sepchr
put = 'let g:netrw_sshport = '.g:netrw_sshport
put = 'let g:netrw_timefmt = '.g:netrw_timefmt
let tmpfileescline= line("$")
View
2 runtime/autoload/rubycomplete.vim
@@ -1,7 +1,7 @@
" Vim completion script
" Language: Ruby
" Maintainer: Mark Guzman <segfault@hasno.info>
-" Info: $Id$
+" Info: $Id: rubycomplete.vim,v 1.41 2008/06/30 06:50:45 segy Exp $
" URL: http://vim-ruby.rubyforge.org
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
View
51 runtime/autoload/spellfile.vim
@@ -1,6 +1,6 @@
" Vim script to download a missing spell file
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2008 Jun 27
+" Last Change: 2008 Nov 29
if !exists('g:spellfile_URL')
" Prefer using http:// when netrw should be able to use it, since
@@ -39,19 +39,22 @@ function! spellfile#LoadFile(lang)
let s:donedict[a:lang . &enc] = 1
" Find spell directories we can write in.
- let dirlist = []
- let dirchoices = '&Cancel'
- for dir in split(globpath(&rtp, 'spell'), "\n")
- if filewritable(dir) == 2
- call add(dirlist, dir)
- let dirchoices .= "\n&" . len(dirlist)
- endif
- endfor
+ let [dirlist, dirchoices] = spellfile#GetDirChoices()
if len(dirlist) == 0
- if &verbose
+ let dir_to_create = spellfile#WritableSpellDir()
+ if &verbose || dir_to_create != ''
echomsg 'spellfile#LoadFile(): There is no writable spell directory.'
endif
- return
+ if dir_to_create != ''
+ if confirm("Shall I create " . dir_to_create, "&Yes\n&No", 2) == 1
+ " After creating the directory it should show up in the list.
+ call mkdir(dir_to_create, "p")
+ let [dirlist, dirchoices] = spellfile#GetDirChoices()
+ endif
+ endif
+ if len(dirlist) == 0
+ return
+ endif
endif
let msg = 'Cannot find spell file for "' . a:lang . '" in ' . &enc
@@ -177,3 +180,29 @@ function! spellfile#Nread(fname)
unlet g:netrw_use_errorwindow
endif
endfunc
+
+" Get a list of writable spell directories and choices for confirm().
+function! spellfile#GetDirChoices()
+ let dirlist = []
+ let dirchoices = '&Cancel'
+ for dir in split(globpath(&rtp, 'spell'), "\n")
+ if filewritable(dir) == 2
+ call add(dirlist, dir)
+ let dirchoices .= "\n&" . len(dirlist)
+ endif
+ endfor
+ return [dirlist, dirchoices]
+endfunc
+
+function! spellfile#WritableSpellDir()
+ if has("unix")
+ " For Unix always use the $HOME/.vim directory
+ return $HOME . "/.vim/spell"
+ endif
+ for dir in split(&rtp, ',')
+ if filewritable(dir) == 2
+ return dir . "/spell"
+ endif
+ endfor
+ return ''
+endfunction
View
49 runtime/autoload/sqlcomplete.vim
@@ -1,13 +1,19 @@
" Vim OMNI completion script for SQL
" Language: SQL
-" Maintainer: David Fishburn <fishburn@ianywhere.com>
-" Version: 6.0
-" Last Change: Thu 03 Apr 2008 10:37:54 PM Eastern Daylight Time
+" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
+" Version: 7.0
+" Last Change: 2009 Jan 04
" Usage: For detailed help
" ":help sql.txt"
" or ":help ft-sql-omni"
" or read $VIMRUNTIME/doc/sql.txt
+" History
+" Version 7.0
+" Better handling of object names
+" Version 6.0
+" Supports object names with spaces "my table name"
+"
" Set completion with CTRL-X CTRL-O to autoloaded function.
" This check is in place in case this script is
" sourced directly instead of using the autoload feature.
@@ -22,7 +28,7 @@ endif
if exists('g:loaded_sql_completion')
finish
endif
-let g:loaded_sql_completion = 50
+let g:loaded_sql_completion = 70
" Maintains filename of dictionary
let s:sql_file_table = ""
@@ -106,10 +112,23 @@ function! sqlcomplete#Complete(findstart, base)
let begindot = 1
endif
while start > 0
- if line[start - 1] =~ '\(\w\|\s\+\)'
+ " Additional code was required to handle objects which
+ " can contain spaces like "my table name".
+ if line[start - 1] !~ '\(\w\|\.\)'
+ " If the previous character is not a period or word character
+ break
+ " elseif line[start - 1] =~ '\(\w\|\s\+\)'
+ " let start -= 1
+ elseif line[start - 1] =~ '\w'
+ " If the previous character is word character continue back
let start -= 1
elseif line[start - 1] =~ '\.' &&
\ compl_type =~ 'column\|table\|view\|procedure'
+ " If the previous character is a period and we are completing
+ " an object which can be specified with a period like this:
+ " table_name.column_name
+ " owner_name.table_name
+
" If lastword has already been set for column completion
" break from the loop, since we do not also want to pickup
" a table name if it was also supplied.
@@ -184,9 +203,10 @@ function! sqlcomplete#Complete(findstart, base)
endif
let compl_type_uc = substitute(compl_type, '\w\+', '\u&', '')
- if s:sql_file_{compl_type} == ""
- let s:sql_file_{compl_type} = DB_getDictionaryName(compl_type_uc)
- endif
+ " Same call below, no need to do it twice
+ " if s:sql_file_{compl_type} == ""
+ " let s:sql_file_{compl_type} = DB_getDictionaryName(compl_type_uc)
+ " endif
let s:sql_file_{compl_type} = DB_getDictionaryName(compl_type_uc)
if s:sql_file_{compl_type} != ""
if filereadable(s:sql_file_{compl_type})
@@ -312,9 +332,16 @@ function! sqlcomplete#Complete(findstart, base)
endif
if base != ''
- " Filter the list based on the first few characters the user
- " entered
- let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\|\\([^.]*\\)\\?'.base.'\\)"'
+ " Filter the list based on the first few characters the user entered.
+ " Check if the text matches at the beginning
+ " or
+ " Match to a owner.table or alias.column type match
+ " or
+ " Handle names with spaces "my table name"
+ let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\|^\\(\\w\\+\\.\\)\\?'.base.'\\)"'
+ " let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\)"'
+ " let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\|\\(\\.\\)\\?'.base.'\\)"'
+ " let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\|\\([^.]*\\)\\?'.base.'\\)"'
let compl_list = filter(deepcopy(compl_list), expr)
endif
View
253 runtime/autoload/tar.vim
@@ -1,13 +1,13 @@
" tar.vim: Handles browsing tarfiles
" AUTOLOAD PORTION
-" Date: Aug 08, 2008
-" Version: 23 + modifications by Bram
+" Date: Dec 28, 2009
+" Version: 24
" Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" License: Vim License (see vim's :help license)
"
" Contains many ideas from Michael Toren's <tar.vim>
"
-" Copyright: Copyright (C) 2005-2008 Charles E. Campbell, Jr. {{{1
+" Copyright: Copyright (C) 2005-2009 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
" notice is copied with it. Like anything else that's free,
@@ -16,19 +16,22 @@
" By using this plugin, you agree that in no event will the
" copyright holder be liable for any damages resulting from
" the use of this software.
-
+" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" ---------------------------------------------------------------------
" Load Once: {{{1
-let s:keepcpo= &cpo
-set cpo&vim
-if &cp || exists("g:loaded_tar") || v:version < 700
+if &cp || exists("g:loaded_tar")
finish
endif
-let g:loaded_tar= "v23b"
-"call Decho("loading autoload/tar.vim")
-if v:version < 701 || (v:version == 701 && !has("patch299"))
- echoerr "(autoload/tar.vim) need vim v7.1 with patchlevel 299"
+let g:loaded_tar= "v24"
+if v:version < 702
+ echohl WarningMsg
+ echo "***warning*** this version of tar needs vim 7.2"
+ echohl Normal
+ finish
endif
+let s:keepcpo= &cpo
+set cpo&vim
+"call Decho("loading autoload/tar.vim")
" ---------------------------------------------------------------------
" Default Settings: {{{1
@@ -44,7 +47,22 @@ endif
if !exists("g:tar_writeoptions")
let g:tar_writeoptions= "uf"
endif
-
+if !exists("g:tar_copycmd")
+ if !exists("g:netrw_localcopycmd")
+ if has("win32") || has("win95") || has("win64") || has("win16")
+ if g:netrw_cygwin
+ let g:netrw_localcopycmd= "cp"
+ else
+ let g:netrw_localcopycmd= "copy"
+ endif
+ elseif has("unix") || has("macunix")
+ let g:netrw_localcopycmd= "cp"
+ else
+ let g:netrw_localcopycmd= ""
+ endif
+ endif
+ let g:tar_copycmd= g:netrw_localcopycmd
+endif
if !exists("g:netrw_cygwin")
if has("win32") || has("win95") || has("win64") || has("win16")
if &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$'
@@ -56,6 +74,9 @@ if !exists("g:netrw_cygwin")
let g:netrw_cygwin= 0
endif
endif
+if !exists("g:tar_extractcmd")
+ let g:tar_extractcmd= "tar -xf"
+endif
" set up shell quoting character
if !exists("g:tar_shq")
@@ -88,7 +109,6 @@ fun! tar#Browse(tarfile)
if !executable(g:tar_cmd)
redraw!
echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system'
-" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep
" call Dret("tar#Browse")
return
@@ -99,7 +119,6 @@ fun! tar#Browse(tarfile)
" if its an url, don't complain, let url-handlers such as vim do its thing
redraw!
echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None
-" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif
let &report= repkeep
" call Dret("tar#Browse : file<".a:tarfile."> not readable")
@@ -130,37 +149,38 @@ fun! tar#Browse(tarfile)
let tarfile= a:tarfile
if has("win32") && executable("cygpath")
" assuming cygwin
- let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile,0)),'\n$','','e')
+ let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e')
endif
let curlast= line("$")
if tarfile =~# '\.\(gz\|tgz\)$'
-" call Decho("1: exe silent r! gzip -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
- exe "silent r! gzip -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
+" call Decho("1: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
+ exe "silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif tarfile =~# '\.lrp'
-" call Decho("2: exe silent r! cat -- ".s:Escape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ")
- exe "silent r! cat -- ".s:Escape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - "
+" call Decho("2: exe silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ")
+ exe "silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - "
elseif tarfile =~# '\.bz2$'
-" call Decho("3: exe silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
- exe "silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
+" call Decho("3: exe silent r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
+ exe "silent r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
+ elseif tarfile =~# '\.lzma$'
+" call Decho("3: exe silent r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
+ exe "silent r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
else
if tarfile =~ '^\s*-'
- " A file name starting with a dash may be taken as an option. Prepend ./ to avoid that.
+ " A file name starting with a dash is taken as an option. Prepend ./ to avoid that.
let tarfile = substitute(tarfile, '-', './-', '')
endif
-" call Decho("4: exe silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".s:Escape(tarfile,1))
- exe "silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".s:Escape(tarfile,1)
+" call Decho("4: exe silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".shellescape(tarfile,0))
+ exe "silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".shellescape(tarfile,1)
endif
if v:shell_error != 0
redraw!
echohl WarningMsg | echo "***warning*** (tar#Browse) please check your g:tar_browseoptions<".g:tar_browseoptions.">"
-" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" call Dret("tar#Browse : a:tarfile<".a:tarfile.">")
return
endif
if line("$") == curlast || ( line("$") == (curlast + 1) && getline("$") =~ '\c\%(warning\|error\|inappropriate\|unrecognized\)')
redraw!
echohl WarningMsg | echo "***warning*** (tar#Browse) ".a:tarfile." doesn't appear to be a tar file" | echohl None
-" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
silent %d
let eikeep= &ei
set ei=BufReadCmd,FileReadCmd
@@ -189,7 +209,7 @@ fun! s:TarBrowseSelect()
if !exists("g:tar_secure") && fname =~ '^\s*-\|\s\+-'
redraw!
- echohl WarningMsg | echo '***error*** (tar#BrowseSelect) rejecting tarfile member<'.fname.'> because of embedded "-"; See :help tar-options'
+ echohl WarningMsg | echo '***warning*** (tar#BrowseSelect) rejecting tarfile member<'.fname.'> because of embedded "-"'
" call Dret('tar#BrowseSelect : rejecting tarfile member<'.fname.'> because of embedded "-"')
return
endif
@@ -206,7 +226,7 @@ fun! s:TarBrowseSelect()
let curfile= expand("%")
if has("win32") && executable("cygpath")
" assuming cygwin
- let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile,0)),'\n$','','e')
+ let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e')
endif
new
@@ -231,21 +251,24 @@ fun! tar#Read(fname,mode)
let fname = substitute(a:fname,'tarfile:.\{-}::\(.*\)$','\1','')
if has("win32") && executable("cygpath")
" assuming cygwin
- let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile,0)),'\n$','','e')
+ let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e')
endif
" call Decho("tarfile<".tarfile.">")
" call Decho("fname<".fname.">")
- if fname =~ '\.gz$' && executable("zcat")
+ if fname =~ '\.bz2$' && executable("bzcat")
+ let decmp= "|bzcat"
+ let doro = 1
+ elseif fname =~ '\.gz$' && executable("zcat")
let decmp= "|zcat"
let doro = 1
- elseif fname =~ '\.bz2$' && executable("bzcat")
- let decmp= "|bzcat"
+ elseif fname =~ '\.lzma$' && executable("lzcat")
+ let decmp= "|lzcat"
let doro = 1
else
let decmp=""
let doro = 0
- if fname =~ '\.gz$\|\.bz2$\|\.Z$\|\.zip$'
+ if fname =~ '\.bz2$\|\.gz$\|\.lzma$\|\.zip$\|\.Z$'
setlocal bin
endif
endif
@@ -255,22 +278,25 @@ fun! tar#Read(fname,mode)
else
let tar_secure= " "
endif
- if tarfile =~# '\.\(gz\|tgz\)$'
-" call Decho("5: exe silent r! gzip -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.tar_secure.s:Escape(fname,1))
- exe "silent r! gzip -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp
+ if tarfile =~# '\.bz2$'
+" call Decho("7: exe silent r! bzip2 -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp)
+ exe "silent r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
+ elseif tarfile =~# '\.\(gz\|tgz\)$'
+" call Decho("5: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.tar_secure.shellescape(fname,1))
+ exe "silent r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
elseif tarfile =~# '\.lrp$'
-" call Decho("6: exe silent r! cat ".s:Escape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp)
- exe "silent r! cat -- ".s:Escape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp
- elseif tarfile =~# '\.bz2$'
-" call Decho("7: exe silent r! bzip2 -d -c ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp)
- exe "silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp
+" call Decho("6: exe silent r! cat ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp)
+ exe "silent r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
+ elseif tarfile =~# '\.lzma$'
+" call Decho("7: exe silent r! lzma -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp)
+ exe "silent r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
else
if tarfile =~ '^\s*-'
- " A file name starting with a dash may be taken as an option. Prepend ./ to avoid that.
+ " A file name starting with a dash is taken as an option. Prepend ./ to avoid that.
let tarfile = substitute(tarfile, '-', './-', '')
endif
-" call Decho("8: exe silent r! ".g:tar_cmd." -".g:tar_readoptions." "s:Escape(tarfile,1).tar_secure..s:Escape(fname,1).decmp)
- exe "silent r! ".g:tar_cmd." -".g:tar_readoptions." ".s:Escape(tarfile,1).tar_secure.s:Escape(fname,1).decmp
+" call Decho("8: exe silent r! ".g:tar_cmd." -".g:tar_readoptions.tar_secure.shellescape(tarfile,1)." ".shellescape(fname,1).decmp)
+ exe "silent r! ".g:tar_cmd." -".g:tar_readoptions.shellescape(tarfile,1)." ".tar_secure.shellescape(fname,1).decmp
endif
if doro
@@ -298,7 +324,7 @@ fun! tar#Write(fname)
if !exists("g:tar_secure") && a:fname =~ '^\s*-\|\s\+-'
redraw!
- echohl WarningMsg | echo '***error*** (tar#Write) rejecting tarfile member<'.a:fname.'> because of embedded "-"; See :help tar-options'
+ echohl WarningMsg | echo '***warning*** (tar#Write) rejecting tarfile member<'.a:fname.'> because of embedded "-"'
" call Dret('tar#Write : rejecting tarfile member<'.fname.'> because of embedded "-"')
return
endif
@@ -307,15 +333,13 @@ fun! tar#Write(fname)
if !executable(g:tar_cmd)
redraw!
echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system'
-" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep
" call Dret("tar#Write")
return
endif
if !exists("*mkdir")
redraw!
echohl Error | echo "***error*** (tar#Write) sorry, mkdir() doesn't work on your system" | echohl None
-" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep
" call Dret("tar#Write")
return
@@ -336,7 +360,6 @@ fun! tar#Write(fname)
catch /^Vim\%((\a\+)\)\=:E344/
redraw!
echohl Error | echo "***error*** (tar#Write) cannot cd to temporary directory" | Echohl None
-" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep
" call Dret("tar#Write")
return
@@ -355,37 +378,41 @@ fun! tar#Write(fname)
let fname = substitute(w:tarfile,'tarfile:.\{-}::\(.*\)$','\1','')
" handle compressed archives
- if tarfile =~# '\.gz'
- call system("gzip -d -- ".s:Escape(tarfile,0))
+ if tarfile =~# '\.bz2'
+ call system("bzip2 -d -- ".shellescape(tarfile,0))
+ let tarfile = substitute(tarfile,'\.bz2','','e')
+ let compress= "bzip2 -- ".shellescape(tarfile,0)
+" call Decho("compress<".compress.">")
+ elseif tarfile =~# '\.gz'
+ call system("gzip -d -- ".shellescape(tarfile,0))
let tarfile = substitute(tarfile,'\.gz','','e')
- let compress= "gzip -- ".s:Escape(tarfile,0)
+ let compress= "gzip -- ".shellescape(tarfile,0)
+" call Decho("compress<".compress.">")
+ elseif tarfile =~# '\.lzma'
+ call system("lzma -d -- ".shellescape(tarfile,0))
+ let tarfile = substitute(tarfile,'\.lzma','','e')
+ let compress= "lzma -- ".shellescape(tarfile,0)
" call Decho("compress<".compress.">")
elseif tarfile =~# '\.tgz'
- call system("gzip -d -- ".s:Escape(tarfile,0))
+ call system("gzip -d -- ".shellescape(tarfile,0))
let tarfile = substitute(tarfile,'\.tgz','.tar','e')
- let compress= "gzip -- ".s:Escape(tarfile,0)
+ let compress= "gzip -- ".shellescape(tarfile,0)
let tgz = 1
" call Decho("compress<".compress.">")
- elseif tarfile =~# '\.bz2'
- call system("bzip2 -d -- ".s:Escape(tarfile,0))
- let tarfile = substitute(tarfile,'\.bz2','','e')
- let compress= "bzip2 -- ".s:Escape(tarfile,0)
-" call Decho("compress<".compress.">")
endif
" call Decho("tarfile<".tarfile.">")
if v:shell_error != 0
redraw!
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname | echohl None
-" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
else
" call Decho("tarfile<".tarfile."> fname<".fname.">")
if fname =~ '/'
let dirpath = substitute(fname,'/[^/]\+$','','e')
if executable("cygpath")
- let dirpath = substitute(system("cygpath ".s:Escape(dirpath, 0)),'\n','','e')
+ let dirpath = substitute(system("cygpath ".shellescape(dirpath, 0)),'\n','','e')
endif
call mkdir(dirpath,"p")
endif
@@ -405,25 +432,23 @@ fun! tar#Write(fname)
endif
exe "w! ".fnameescape(fname)
if executable("cygpath")
- let tarfile = substitute(system("cygpath ".s:Escape(tarfile,0)),'\n','','e')
+ let tarfile = substitute(system("cygpath ".shellescape(tarfile,0)),'\n','','e')
endif
" delete old file from tarfile
-" call Decho("system(".g:tar_cmd." --delete -f ".s:Escape(tarfile,0)." -- ".s:Escape(fname,0).")")
- call system(g:tar_cmd." --delete -f ".s:Escape(tarfile,0).tar_secure.s:Escape(fname,0))
+" call Decho("system(".g:tar_cmd." --delete -f ".shellescape(tarfile,0)." -- ".shellescape(fname,0).")")
+ call system(g:tar_cmd." --delete -f ".shellescape(tarfile,0).tar_secure.shellescape(fname,0))
if v:shell_error != 0
redraw!
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None
-" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
else
" update tarfile with new file
-" call Decho(g:tar_cmd." -".g:tar_writeoptions." ".s:Escape(tarfile,0).tar_secure.s:Escape(fname,0))
- call system(g:tar_cmd." -".g:tar_writeoptions." ".s:Escape(tarfile,0).tar_secure.s:Escape(fname,0))
+" call Decho(g:tar_cmd." -".g:tar_writeoptions." ".shellescape(tarfile,0).tar_secure.shellescape(fname,0))
+ call system(g:tar_cmd." -".g:tar_writeoptions." ".shellescape(tarfile,0).tar_secure.shellescape(fname,0))
if v:shell_error != 0
redraw!
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None
-" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
elseif exists("compress")
" call Decho("call system(".compress.")")
call system(compress)
@@ -439,13 +464,13 @@ fun! tar#Write(fname)
" call Decho("handle writing <".tarfile."> across network to <".s:tblfile_{winnr()}.">")
let tblfile= s:tblfile_{winnr()}
1split|enew
- let binkeep= &binary
+ let binkeep= &l:binary
let eikeep = &ei
set binary ei=all
exe "e! ".fnameescape(tarfile)
call netrw#NetWrite(tblfile)
- let &ei = eikeep
- let &binary = binkeep
+ let &ei = eikeep
+ let &l:binary = binkeep
q!
unlet s:tblfile_{winnr()}
endif
@@ -462,38 +487,98 @@ fun! tar#Write(fname)
endfun
" ---------------------------------------------------------------------
-" Rmdir: {{{2
+" s:Rmdir: {{{2
fun! s:Rmdir(fname)
" call Dfunc("Rmdir(fname<".a:fname.">)")
if has("unix")
- call system("/bin/rm -rf -- ".s:Escape(a:fname,0))
+ call system("/bin/rm -rf -- ".shellescape(a:fname,0))
elseif has("win32") || has("win95") || has("win64") || has("win16")
if &shell =~? "sh$"
- call system("/bin/rm -rf -- ".s:Escape(a:fname,0))
+ call system("/bin/rm -rf -- ".shellescape(a:fname,0))
else
- call system("del /S ".s:Escape(a:fname,0))
+ call system("del /S ".shellescape(a:fname,0))
endif
endif
" call Dret("Rmdir")
endfun
" ---------------------------------------------------------------------
-" s:Escape: {{{2
-fun s:Escape(name,isfilt)
- " shellescape() was added by patch 7.0.111
- if exists("*shellescape")
- if a:isfilt
- let qnameq= shellescape(a:name,1)
+" tar#Vimuntar: installs a tarball in the user's .vim / vimfiles directory {{{2
+fun! tar#Vimuntar(...)
+" call Dfunc("tar#Vimuntar() a:0=".a:0." a:1<".(exists("a:1")? a:1 : "-n/a-").">")
+ let tarball = expand("%")
+" call Decho("tarball<".tarball.">")
+ let tarbase = substitute(tarball,'\..*$','','')
+" call Decho("tarbase<".tarbase.">")
+ let tarhome = expand("%:p")
+ if has("win32") || has("win95") || has("win64") || has("win16")
+ let tarhome= substitute(tarhome,'\\','/','g')
+ endif
+ let tarhome= substitute(tarhome,'/[^/]*$','','')
+" call Decho("tarhome<".tarhome.">")
+ let tartail = expand("%:t")
+" call Decho("tartail<".tartail.">")
+ let curdir = getcwd()
+" call Decho("curdir <".curdir.">")
+ " set up vimhome
+ if a:0 > 0 && a:1 != ""
+ let vimhome= a:1
+ else
+ let vimhome= vimball#VimballHome()
+ endif
+" call Decho("vimhome<".vimhome.">")
+
+" call Decho("curdir<".curdir."> vimhome<".vimhome.">")
+ if simplify(curdir) != simplify(vimhome)
+ " copy (possibly compressed) tarball to .vim/vimfiles
+" call Decho(netrw#WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome))
+ call system(netrw#WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome))
+" call Decho("exe cd ".fnameescape(vimhome))
+ exe "cd ".fnameescape(vimhome)
+ endif
+" call Decho("getcwd<".getcwd().">")
+
+ " if necessary, decompress the tarball; then, extract it
+ if tartail =~ '\.tgz'
+ if executable("gunzip")
+ silent exe "!gunzip ".shellescape(tartail)
+ elseif executable("gzip")
+ silent exe "!gzip -d ".shellescape(tartail)
else
- let qnameq= shellescape(a:name)
+ echoerr "unable to decompress<".tartail."> on this sytem"
+ if simplify(curdir) != simplify(tarhome)
+ " remove decompressed tarball, restore directory
+" call Decho("delete(".tartail.".tar)")
+ call delete(tartail.".tar")
+" call Decho("exe cd ".fnameescape(curdir))
+ exe "cd ".fnameescape(curdir)
+ endif
+" call Dret("tar#Vimuntar")
+ return
endif
else
- let qnameq= g:tar_shq . a:name . g:tar_shq
+ call vimball#Decompress(tartail,0)
endif
- return qnameq
+ let extractcmd= netrw#WinPath(g:tar_extractcmd)
+" call Decho("system(".extractcmd." ".shellescape(tarbase.".tar").")")
+ call system(extractcmd." ".shellescape(tarbase.".tar"))
+
+ " set up help
+ if filereadable("doc/".tarbase.".txt")
+" call Decho("exe helptags ".getcwd()."/doc")
+ exe "helptags ".getcwd()."/doc"
+ endif
+
+ if simplify(tarhome) != simplify(vimhome)
+ " remove decompressed tarball, restore directory
+ call delete(vimhome."/".tarbase.".tar")
+ exe "cd ".fnameescape(curdir)
+ endif
+
+" call Dret("tar#Vimuntar")
endfun
-" ---------------------------------------------------------------------
+" =====================================================================
" Modelines And Restoration: {{{1
let &cpo= s:keepcpo
unlet s:keepcpo
View
141 runtime/autoload/vimball.vim
@@ -1,21 +1,27 @@
" vimball.vim : construct a file containing both paths and files
" Author: Charles E. Campbell, Jr.
-" Date: Jul 30, 2008
-" Version: 29
+" Date: Dec 28, 2009
+" Version: 30
" GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim
-" Copyright: (c) 2004-2008 by Charles E. Campbell, Jr.
+" Copyright: (c) 2004-2009 by Charles E. Campbell, Jr.
" The VIM LICENSE applies to Vimball.vim, and Vimball.txt
" (see |copyright|) except use "Vimball" instead of "Vim".
" No warranty, express or implied.
" *** *** Use At-Your-Own-Risk! *** ***
" ---------------------------------------------------------------------
" Load Once: {{{1
-if &cp || exists("g:loaded_vimball") || v:version < 700
+if &cp || exists("g:loaded_vimball")
finish
endif
-let s:keepcpo = &cpo
-let g:loaded_vimball = "v29"
+let g:loaded_vimball = "v30"
+if v:version < 702
+ echohl WarningMsg
+ echo "***warning*** this version of vimball needs vim 7.2"
+ echohl Normal
+ finish
+endif
+let s:keepcpo= &cpo
set cpo&vim
"DechoTabOn
@@ -52,30 +58,6 @@ if !exists("s:USAGE")
call vimball#ShowMesg(s:WARNING,"(vimball) g:vimball_mkdir undefined")
endif
endif
-
- " set up shell quoting character
- if exists("g:vimball_shq") && !exists("g:netrw_shq")
- let g:netrw_shq= g:vimball_shq
- endif
- if !exists("g:netrw_shq")
- if exists("&shq") && &shq != ""
- let g:netrw_shq= &shq
- elseif has("win32") || has("win95") || has("win64") || has("win16")
- if g:netrw_cygwin
- let g:netrw_shq= "'"
- else
- let g:netrw_shq= '"'
- endif
- else
- let g:netrw_shq= "'"
- endif
-" call Decho("g:netrw_shq<".g:netrw_shq.">")
- endif
-
- " set up escape string (used to protect paths)
- if !exists("g:vimball_path_escape")
- let g:vimball_path_escape= ' ;#%'
- endif
endif
" =====================================================================
@@ -106,8 +88,8 @@ fun! vimball#MkVimball(line1,line2,writelevel,...) range
let vbname= vbname.'.vba'
endif
" call Decho("vbname<".vbname.">")
- if a:1 =~ '[\/]'
- call vimball#ShowMesg(s:ERROR,"(MkVimball) vimball name<".a:1."> should not include slashes")
+ if !a:writelevel && a:1 =~ '[\/]'
+ call vimball#ShowMesg(s:ERROR,"(MkVimball) vimball name<".a:1."> should not include slashes; use ! to insist")
" call Dret("MkVimball : vimball name<".a:1."> should not include slashes")
return
endif
@@ -125,7 +107,7 @@ fun! vimball#MkVimball(line1,line2,writelevel,...) range
let home= expand(a:2)
else
" use first existing directory from rtp
- let home= s:VimballHome()
+ let home= vimball#VimballHome()
endif
" save current directory
@@ -218,7 +200,7 @@ fun! vimball#Vimball(really,...)
return
endif
- if getline(1) !~ '^" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.$'
+ if getline(1) !~ '^" Vimball Archiver'
echoerr "(Vimball) The current file does not appear to be a Vimball!"
" call Dret("vimball#Vimball")
return
@@ -240,7 +222,7 @@ fun! vimball#Vimball(really,...)