Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated for version 7.1a

  • Loading branch information...
commit 0496d46ee2342cbc314d65027b05d5e79713c671 1 parent 7a30f23
vimboss authored
Showing with 19,668 additions and 6,859 deletions.
  1. +1 −1  README.txt
  2. +1 −1  README_amibin.txt
  3. +1 −1  README_dos.txt
  4. +1 −1  README_extra.txt
  5. +1 −1  README_mac.txt
  6. +1 −1  README_ole.txt
  7. +109 −0 runtime/autoload/adacomplete.vim
  8. +370 −370 runtime/autoload/csscomplete.vim
  9. +75 −0 runtime/autoload/decada.vim
  10. +501 −0 runtime/autoload/getscript.vim
  11. +3,965 −3,008 runtime/autoload/netrw.vim
  12. +63 −31 runtime/autoload/pythoncomplete.vim
  13. +604 −292 runtime/autoload/rubycomplete.vim
  14. +93 −24 runtime/autoload/syntaxcomplete.vim
  15. +18 −6 runtime/autoload/xmlcomplete.vim
  16. +99 −39 runtime/autoload/zip.vim
  17. +34 −56 runtime/colors/blue.vim
  18. +3 −3 runtime/colors/torte.vim
  19. +13 −7 runtime/doc/change.txt
  20. +5 −1 runtime/doc/cmdline.txt
  21. +1 −1  runtime/doc/debug.txt
  22. +1 −1  runtime/doc/debugger.txt
  23. +2 −2 runtime/doc/develop.txt
  24. +10 −7 runtime/doc/diff.txt
  25. +7 −8 runtime/doc/digraph.txt
  26. +8 −6 runtime/doc/editing.txt
  27. +1 −1  runtime/doc/fold.txt
  28. +1 −1  runtime/doc/gui_w16.txt
  29. +5 −2 runtime/doc/gui_w32.txt
  30. +5 −10 runtime/doc/gui_x11.txt
  31. +1 −1  runtime/doc/hangulin.txt
  32. +9 −6 runtime/doc/help.txt
  33. +1 −1  runtime/doc/if_cscop.txt
  34. +6 −3 runtime/doc/if_mzsch.txt
  35. +1 −1  runtime/doc/if_ole.txt
  36. +1 −1  runtime/doc/if_perl.txt
  37. +1 −1  runtime/doc/if_pyth.txt
  38. +1 −1  runtime/doc/if_ruby.txt
  39. +1 −1  runtime/doc/if_sniff.txt
  40. +38 −20 runtime/doc/insert.txt
  41. +3 −2 runtime/doc/mbyte.txt
  42. +2 −2 runtime/doc/mlang.txt
  43. +10 −10 runtime/doc/motion.txt
  44. +1 −1  runtime/doc/os_390.txt
  45. +1 −1  runtime/doc/os_beos.txt
  46. +1 −1  runtime/doc/os_mac.txt
  47. +1 −1  runtime/doc/os_msdos.txt
  48. +1 −1  runtime/doc/os_risc.txt
  49. +1 −1  runtime/doc/os_unix.txt
  50. +406 −0 runtime/doc/pi_getscript.txt
  51. +1 −1  runtime/doc/pi_gzip.txt
  52. +667 −292 runtime/doc/pi_netrw.txt
  53. +2 −2 runtime/doc/pi_paren.txt
  54. +18 −16 runtime/doc/pi_tar.txt
  55. +58 −13 runtime/doc/pi_vimball.txt
  56. +17 −7 runtime/doc/pi_zip.txt
  57. +2 −2 runtime/doc/print.txt
  58. +3 −2 runtime/doc/quickref.txt
  59. +1 −1  runtime/doc/recover.txt
  60. +1 −1  runtime/doc/rileft.txt
  61. +1 −1  runtime/doc/russian.txt
  62. +1 −1  runtime/doc/sign.txt
  63. +2 −2 runtime/doc/sponsor.txt
  64. +208 −28 runtime/doc/tags
  65. +2 −2 runtime/doc/term.txt
  66. +3 −3 runtime/doc/tips.txt
  67. +9 −17 runtime/doc/uganda.txt
  68. +1 −1  runtime/doc/undo.txt
  69. +62 −2 runtime/doc/usr_02.txt
  70. +3 −3 runtime/doc/usr_03.txt
  71. +4 −4 runtime/doc/usr_08.txt
  72. +1 −1  runtime/doc/usr_09.txt
  73. +4 −3 runtime/doc/usr_10.txt
  74. +2 −2 runtime/doc/usr_25.txt
  75. +1 −1  runtime/doc/usr_26.txt
  76. +1 −1  runtime/doc/usr_29.txt
  77. +1 −1  runtime/doc/usr_32.txt
  78. +1 −1  runtime/doc/usr_42.txt
  79. +1 −1  runtime/doc/usr_44.txt
  80. +1 −1  runtime/doc/usr_90.txt
  81. +1 −1  runtime/doc/usr_toc.txt
  82. +4 −4 runtime/doc/version5.txt
  83. +3 −3 runtime/doc/version6.txt
  84. +0 −1  runtime/doc/vim2html.pl
  85. +2 −2 runtime/doc/visual.txt
  86. +1 −1  runtime/doc/xxd-it.1
  87. +1 −1  runtime/doc/xxd-pl.UTF-8.1
  88. +1 −1  runtime/doc/xxd-ru.UTF-8.1
  89. +162 −195 runtime/ftplugin/ada.vim
  90. +15 −0 runtime/ftplugin/bst.vim
  91. +266 −0 runtime/ftplugin/cobol.vim
  92. +15 −12 runtime/ftplugin/debchangelog.vim
  93. +61 −0 runtime/ftplugin/hamster.vim
  94. +1 −1  runtime/ftplugin/haskell.vim
  95. +3 −2 runtime/ftplugin/mail.vim
  96. +2 −2 runtime/ftplugin/make.vim
  97. +5 −3 runtime/ftplugin/ocaml.vim
  98. +55 −23 runtime/indent/ada.vim
  99. +47 −4 runtime/indent/eruby.vim
  100. +11 −2 runtime/indent/html.vim
  101. +12 −0 runtime/indent/htmldjango.vim
  102. +17 −0 runtime/indent/jsp.vim
  103. +1 −1  runtime/indent/ocaml.vim
  104. +2 −2 runtime/indent/python.vim
  105. +12 −2 runtime/indent/ruby.vim
  106. +52 −59 runtime/indent/vhdl.vim
  107. +127 −0 runtime/keymap/bulgarian-bds.vim
  108. +108 −0 runtime/keymap/bulgarian-phonetic.vim
  109. +3 −0  runtime/keymap/thaana.vim
  110. +160 −0 runtime/keymap/vietnamese-viqr_utf-8.vim
  111. +294 −0 runtime/lang/menu_sl_si.cp1250.vim
  112. +294 −0 runtime/lang/menu_sl_si.latin2.vim
  113. +1 −1  runtime/lang/menu_slovak_slovak_republic.1250.vim
  114. +12 −8 runtime/plugin/README.txt
  115. +17 −13 runtime/plugin/vimballPlugin.vim
  116. +15 −9 runtime/plugin/zipPlugin.vim
  117. +1 −1  runtime/spell/da/main.aap
  118. +10 −30 runtime/spell/pl/main.aap
  119. +29 −21 runtime/spell/pt/pt_PT.diff
  120. +154 −142 runtime/synmenu.vim
  121. +3 −3 runtime/syntax/amiga.vim
  122. +5 −3 runtime/syntax/aspvbs.vim
  123. +1,111 −0 runtime/syntax/autoit.vim
  124. +14 −13 runtime/syntax/automake.vim
  125. +1 −1  runtime/syntax/b.vim
  126. +51 −0 runtime/syntax/bzr.vim
  127. +10 −7 runtime/syntax/c.vim
  128. +309 −0 runtime/syntax/cmusrc.vim
  129. +8 −8 runtime/syntax/csh.vim
  130. +3 −3 runtime/syntax/dcl.vim
  131. +2 −2 runtime/syntax/desc.vim
  132. +4 −4 runtime/syntax/elmfilt.vim
  133. +4 −4 runtime/syntax/eruby.vim
  134. +40 −5 runtime/syntax/foxpro.vim
  135. +587 −319 runtime/syntax/fvwm.vim
  136. +382 −0 runtime/syntax/hamster.vim
  137. +1 −2  runtime/syntax/ia64.vim
  138. +176 −0 runtime/syntax/ibasic.vim
  139. +91 −0 runtime/syntax/initng.vim
  140. +3 −3 runtime/syntax/javascript.vim
  141. +17 −12 runtime/syntax/lua.vim
  142. +62 −66 runtime/syntax/lynx.vim
  143. +5 −5 runtime/syntax/make.vim
  144. +5 −5 runtime/syntax/maple.vim
  145. +280 −86 runtime/syntax/masm.vim
  146. +107 −56 runtime/syntax/muttrc.vim
  147. +28 −16 runtime/syntax/named.vim
  148. +10 −3 runtime/syntax/netrw.vim
  149. +2 −2 runtime/syntax/objc.vim
  150. +12 −8 runtime/syntax/ocaml.vim
  151. +430 −304 runtime/syntax/php.vim
  152. +71 −0 runtime/syntax/privoxy.vim
  153. +11 −6 runtime/syntax/remind.vim
  154. +93 −56 runtime/syntax/ruby.vim
  155. +75 −0 runtime/syntax/sd.vim
  156. +42 −31 runtime/syntax/sh.vim
  157. +10 −9 runtime/syntax/tcsh.vim
  158. +19 −19 runtime/syntax/tex.vim
  159. +34 −25 runtime/syntax/vim.vim
  160. +3 −3 runtime/syntax/xdefaults.vim
  161. +812 −0 runtime/tutor/tutor.cs
  162. +812 −0 runtime/tutor/tutor.cs.cp1250
  163. +812 −0 runtime/tutor/tutor.cs.utf-8
  164. +823 −0 runtime/tutor/tutor.hu
  165. +823 −0 runtime/tutor/tutor.hu.utf-8
  166. +457 −295 runtime/tutor/tutor.it
  167. +813 −0 runtime/tutor/tutor.tr.utf-8
  168. +2 −2 src/GvimExt/GvimExt.reg
  169. +2 −2 src/if_xcmdsrv.c
  170. +1 −1  src/keymap.h
  171. +4 −4 src/move.c
  172. +5 −3 src/os_vms.c
  173. +21 −7 src/po/README_mvc.txt
  174. +6 −4 src/po/de.po
  175. +36 −7 src/po/pl.UTF-8.po
  176. +36 −7 src/po/pl.cp1250.po
  177. +54 −54 src/proto/charset.pro
  178. +24 −24 src/proto/diff.pro
  179. +30 −30 src/proto/ex_eval.pro
  180. +54 −54 src/proto/ex_getln.pro
  181. +39 −39 src/proto/fold.pro
  182. +63 −63 src/proto/gui.pro
  183. +71 −71 src/proto/gui_gtk_x11.pro
  184. +1 −1  src/proto/gui_xmdlg.pro
  185. +12 −12 src/proto/hashtab.pro
  186. +8 −8 src/proto/if_tcl.pro
  187. +24 −24 src/proto/main.pro
  188. +28 −28 src/proto/mark.pro
  189. +16 −16 src/proto/memfile.pro
  190. +69 −69 src/proto/message.pro
  191. +23 −23 src/proto/netbeans.pro
  192. +24 −24 src/proto/normal.pro
Sorry, we could not display the entire diff because it was too big.
View
2  README.txt
@@ -1,4 +1,4 @@
-README.txt for version 7.0 of Vim: Vi IMproved.
+README.txt for version 7.1a of Vim: Vi IMproved.
WHAT IS VIM
View
2  README_amibin.txt
@@ -1,4 +1,4 @@
-README_amibin.txt for version 7.0 of Vim: Vi IMproved.
+README_amibin.txt for version 7.1a of Vim: Vi IMproved.
See "README.txt" for general information about Vim.
See "README_ami.txt" for installation instructions for the Amiga.
View
2  README_dos.txt
@@ -1,4 +1,4 @@
-README_dos.txt for version 7.0 of Vim: Vi IMproved.
+README_dos.txt for version 7.1a of Vim: Vi IMproved.
This file explains the installation of Vim on MS-DOS and MS-Windows systems.
See "README.txt" for general information about Vim.
View
2  README_extra.txt
@@ -1,4 +1,4 @@
-README_extra.txt for version 7.0 of Vim: Vi IMproved.
+README_extra.txt for version 7.1a of Vim: Vi IMproved.
The extra archive of Vim is to be used in combination with the source archive
(vim-7.0-src.tar.gz). The extra archive is useless without it.
View
2  README_mac.txt
@@ -1,4 +1,4 @@
-README_mac.txt for version 7.0 of Vim: Vi IMproved.
+README_mac.txt for version 7.1a of Vim: Vi IMproved.
This file explains the installation of Vim on Macintosh systems.
See "README.txt" for general information about Vim.
View
2  README_ole.txt
@@ -1,4 +1,4 @@
-README_ole.txt for version 7.0 of Vim: Vi IMproved.
+README_ole.txt for version 7.1a of Vim: Vi IMproved.
This archive contains gvim.exe with OLE interface and VisVim.
This version of gvim.exe can also load a number of interface dynamically (you
View
109 runtime/autoload/adacomplete.vim
@@ -0,0 +1,109 @@
+"------------------------------------------------------------------------------
+" Description: Vim Ada omnicompletion file
+" Language: Ada (2005)
+" $Id$
+" Maintainer: Martin Krischik
+" $Author$
+" $Date$
+" Version: 4.2
+" $Revision$
+" $HeadURL: https://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.
+" 16.07.2006 MK Ada-Mode as vim-ball
+" 15.10.2006 MK Bram's suggestion for runtime integration
+" 05.11.2006 MK Bram suggested not to use include protection for
+" autoload
+" 05.11.2006 MK Bram suggested agaist using setlocal omnifunc
+" 05.11.2006 MK Bram suggested to save on spaces
+" Help Page: ft-ada-omni
+"------------------------------------------------------------------------------
+
+if version < 700
+ finish
+endif
+
+" Section: adacomplete#Complete () {{{1
+"
+" This function is used for the 'omnifunc' option.
+"
+function! adacomplete#Complete (findstart, base)
+ if a:findstart == 1
+ return ada#User_Complete (a:findstart, a:base)
+ else
+ "
+ " look up matches
+ "
+ if exists ("g:ada_omni_with_keywords")
+ call ada#User_Complete (a:findstart, a:base)
+ endif
+ "
+ " search tag file for matches
+ "
+ let l:Pattern = '^' . a:base . '.*$'
+ let l:Tag_List = taglist (l:Pattern)
+ "
+ " add symbols
+ "
+ for Tag_Item in l:Tag_List
+ if l:Tag_Item['kind'] == ''
+ "
+ " Tag created by gnat xref
+ "
+ let l:Match_Item = {
+ \ 'word': l:Tag_Item['name'],
+ \ 'menu': l:Tag_Item['filename'],
+ \ 'info': "Symbol from file " . l:Tag_Item['filename'] . " line " . l:Tag_Item['cmd'],
+ \ 'kind': 's',
+ \ 'icase': 1}
+ else
+ "
+ " Tag created by ctags
+ "
+ let l:Info = 'Symbol : ' . l:Tag_Item['name'] . "\n"
+ let l:Info .= 'Of type : ' . g:ada#Ctags_Kinds[l:Tag_Item['kind']][1] . "\n"
+ let l:Info .= 'Defined in File : ' . l:Tag_Item['filename'] . "\n"
+
+ if has_key( l:Tag_Item, 'package')
+ let l:Info .= 'Package : ' . l:Tag_Item['package'] . "\n"
+ let l:Menu = l:Tag_Item['package']
+ elseif has_key( l:Tag_Item, 'separate')
+ let l:Info .= 'Separate from Package : ' . l:Tag_Item['separate'] . "\n"
+ let l:Menu = l:Tag_Item['separate']
+ elseif has_key( l:Tag_Item, 'packspec')
+ let l:Info .= 'Package Specification : ' . l:Tag_Item['packspec'] . "\n"
+ let l:Menu = l:Tag_Item['packspec']
+ elseif has_key( l:Tag_Item, 'type')
+ let l:Info .= 'Datetype : ' . l:Tag_Item['type'] . "\n"
+ let l:Menu = l:Tag_Item['type']
+ else
+ let l:Menu = l:Tag_Item['filename']
+ endif
+
+ let l:Match_Item = {
+ \ 'word': l:Tag_Item['name'],
+ \ 'menu': l:Menu,
+ \ 'info': l:Info,
+ \ 'kind': l:Tag_Item['kind'],
+ \ 'icase': 1}
+ endif
+ if complete_add (l:Match_Item) == 0
+ return []
+ endif
+ if complete_check ()
+ return []
+ endif
+ endfor
+ return []
+ endif
+endfunction adacomplete#Complete
+
+finish " 1}}}
+
+"------------------------------------------------------------------------------
+" Copyright (C) 2006 Martin Krischik
+"
+" Vim is Charityware - see ":help license" or uganda.txt for licence details.
+"------------------------------------------------------------------------------
+" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
+" vim: foldmethod=marker
View
740 runtime/autoload/csscomplete.vim
@@ -1,422 +1,407 @@
" Vim completion script
" Language: CSS 2.1
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
-" Last Change: 2006 Apr 30
+" Last Change: 2007 Mar 11
function! csscomplete#CompleteCSS(findstart, base)
+
if a:findstart
" We need whole line to proper checking
- let line = getline('.')
- let start = col('.') - 1
+ let line = getline('.')
+ let start = col('.') - 1
let compl_begin = col('.') - 2
- while start >= 0 && line[start - 1] =~ '\(\k\|-\)'
+ while start >= 0 && line[start - 1] =~ '\%(\k\|-\)'
let start -= 1
endwhile
let b:compl_context = getline('.')[0:compl_begin]
return start
+endif
+
+" There are few chars important for context:
+" ^ ; : { } /* */
+" Where ^ is start of line and /* */ are comment borders
+" Depending on their relative position to cursor we will know what should
+" be completed.
+" 1. if nearest are ^ or { or ; current word is property
+" 2. if : it is value (with exception of pseudo things)
+" 3. if } we are outside of css definitions
+" 4. for comments ignoring is be the easiest but assume they are the same
+" as 1.
+" 5. if @ complete at-rule
+" 6. if ! complete important
+if exists("b:compl_context")
+ let line = b:compl_context
+ unlet! b:compl_context
else
- " There are few chars important for context:
- " ^ ; : { } /* */
- " Where ^ is start of line and /* */ are comment borders
- " Depending on their relative position to cursor we will now what should
- " be completed.
- " 1. if nearest are ^ or { or ; current word is property
- " 2. if : it is value (with exception of pseudo things)
- " 3. if } we are outside of css definitions
- " 4. for comments ignoring is be the easiest but assume they are the same
- " as 1.
- " 5. if @ complete at-rule
- " 6. if ! complete important
- if exists("b:compl_context")
- let line = b:compl_context
- unlet! b:compl_context
- else
- let line = a:base
- endif
-
- let res = []
- let res2 = []
- let borders = {}
-
- " We need the last occurrence of char so reverse line
- let revline = join(reverse(split(line, '.\zs')), '')
-
- let openbrace = stridx(revline, '{')
- let closebrace = stridx(revline, '}')
- let colon = stridx(revline, ':')
- let semicolon = stridx(revline, ';')
- let opencomm = stridx(revline, '*/') " Line was reversed
- let closecomm = stridx(revline, '/*') " Line was reversed
- let style = stridx(revline, '=\s*elyts') " Line was reversed
- let atrule = stridx(revline, '@')
- let exclam = stridx(revline, '!')
-
- if openbrace > -1
- let borders[openbrace] = "openbrace"
- endif
- if closebrace > -1
- let borders[closebrace] = "closebrace"
- endif
- if colon > -1
- let borders[colon] = "colon"
- endif
- if semicolon > -1
- let borders[semicolon] = "semicolon"
- endif
- if opencomm > -1
- let borders[opencomm] = "opencomm"
- endif
- if closecomm > -1
- let borders[closecomm] = "closecomm"
- endif
- if style > -1
- let borders[style] = "style"
- endif
- if atrule > -1
- let borders[atrule] = "atrule"
- endif
- if exclam > -1
- let borders[exclam] = "exclam"
- endif
-
-
- if len(borders) == 0 || borders[min(keys(borders))] =~ '^\(openbrace\|semicolon\|opencomm\|closecomm\|style\)$'
- " Complete properties
-
- let values = split("azimuth background background-attachment background-color background-image background-position background-repeat border bottom border-collapse border-color border-spacing border-style border-top border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width border-bottom-width border-left-width border-width caption-side clear clip color content counter-increment counter-reset cue cue-after cue-before cursor display direction elevation empty-cells float font font-family font-size font-style font-variant font-weight height left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-right margin-left margin-top margin-bottom max-height max-width min-height min-width orphans outline outline-color outline-style outline-width overflow padding padding-top padding-right padding-bottom padding-left page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position quotes right richness speak speak-header speak-numeral speak-punctuation speech-rate stress table-layout text-align text-decoration text-indent text-transform top unicode-bidi vertical-align visibility voice-family volume white-space width widows word-spacing z-index")
-
- let entered_property = matchstr(line, '.\{-}\zs[a-zA-Z-]*$')
-
- for m in values
- if m =~? '^'.entered_property
- call add(res, m . ':')
- elseif m =~? entered_property
- call add(res2, m . ':')
- endif
- endfor
-
- return res + res2
-
- elseif borders[min(keys(borders))] == 'colon'
- " Get name of property
- let prop = tolower(matchstr(line, '\zs[a-zA-Z-]*\ze\s*:[^:]\{-}$'))
-
- if prop == 'azimuth'
- let values = ["left-side", "far-left", "left", "center-left", "center", "center-right", "right", "far-right", "right-side", "behind", "leftwards", "rightwards"]
- elseif prop == 'background-attachment'
- let values = ["scroll", "fixed"]
- elseif prop == 'background-color'
- let values = ["transparent", "rgb(", "#"]
- elseif prop == 'background-image'
- let values = ["url(", "none"]
- elseif prop == 'background-position'
- let vals = matchstr(line, '.*:\s*\zs.*')
- if vals =~ '^\([a-zA-Z]\+\)\?$'
- let values = ["top", "center", "bottom"]
- elseif vals =~ '^[a-zA-Z]\+\s\+\([a-zA-Z]\+\)\?$'
- let values = ["left", "center", "right"]
- else
- return []
- endif
- elseif prop == 'background-repeat'
- let values = ["repeat", "repeat-x", "repeat-y", "no-repeat"]
- elseif prop == 'background'
- let values = ["url(", "scroll", "fixed", "transparent", "rgb(", "#", "none", "top", "center", "bottom" , "left", "right", "repeat", "repeat-x", "repeat-y", "no-repeat"]
- elseif prop == 'border-collapse'
- let values = ["collapse", "separate"]
- elseif prop == 'border-color'
- let values = ["rgb(", "#", "transparent"]
- elseif prop == 'border-spacing'
+ let line = a:base
+endif
+
+let res = []
+let res2 = []
+let borders = {}
+
+" Check last occurrence of sequence
+
+let openbrace = strridx(line, '{')
+let closebrace = strridx(line, '}')
+let colon = strridx(line, ':')
+let semicolon = strridx(line, ';')
+let opencomm = strridx(line, '/*')
+let closecomm = strridx(line, '*/')
+let style = strridx(line, 'style\s*=')
+let atrule = strridx(line, '@')
+let exclam = strridx(line, '!')
+
+if openbrace > -1
+ let borders[openbrace] = "openbrace"
+endif
+if closebrace > -1
+ let borders[closebrace] = "closebrace"
+endif
+if colon > -1
+ let borders[colon] = "colon"
+endif
+if semicolon > -1
+ let borders[semicolon] = "semicolon"
+endif
+if opencomm > -1
+ let borders[opencomm] = "opencomm"
+endif
+if closecomm > -1
+ let borders[closecomm] = "closecomm"
+endif
+if style > -1
+ let borders[style] = "style"
+endif
+if atrule > -1
+ let borders[atrule] = "atrule"
+endif
+if exclam > -1
+ let borders[exclam] = "exclam"
+endif
+
+
+if len(borders) == 0 || borders[max(keys(borders))] =~ '^\%(openbrace\|semicolon\|opencomm\|closecomm\|style\)$'
+ " Complete properties
+
+ let values = split("azimuth background background-attachment background-color background-image background-position background-repeat border bottom border-collapse border-color border-spacing border-style border-top border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width border-bottom-width border-left-width border-width caption-side clear clip color content counter-increment counter-reset cue cue-after cue-before cursor display direction elevation empty-cells float font font-family font-size font-style font-variant font-weight height left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-right margin-left margin-top margin-bottom max-height max-width min-height min-width orphans outline outline-color outline-style outline-width overflow padding padding-top padding-right padding-bottom padding-left page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position quotes right richness speak speak-header speak-numeral speak-punctuation speech-rate stress table-layout text-align text-decoration text-indent text-transform top unicode-bidi vertical-align visibility voice-family volume white-space width widows word-spacing z-index")
+
+ let entered_property = matchstr(line, '.\{-}\zs[a-zA-Z-]*$')
+
+ for m in values
+ if m =~? '^'.entered_property
+ call add(res, m . ':')
+ elseif m =~? entered_property
+ call add(res2, m . ':')
+ endif
+ endfor
+
+ return res + res2
+
+elseif borders[max(keys(borders))] == 'colon'
+ " Get name of property
+ let prop = tolower(matchstr(line, '\zs[a-zA-Z-]*\ze\s*:[^:]\{-}$'))
+
+ if prop == 'azimuth'
+ let values = ["left-side", "far-left", "left", "center-left", "center", "center-right", "right", "far-right", "right-side", "behind", "leftwards", "rightwards"]
+ elseif prop == 'background-attachment'
+ let values = ["scroll", "fixed"]
+ elseif prop == 'background-color'
+ let values = ["transparent", "rgb(", "#"]
+ elseif prop == 'background-image'
+ let values = ["url(", "none"]
+ elseif prop == 'background-position'
+ let vals = matchstr(line, '.*:\s*\zs.*')
+ if vals =~ '^\%([a-zA-Z]\+\)\?$'
+ let values = ["top", "center", "bottom"]
+ elseif vals =~ '^[a-zA-Z]\+\s\+\%([a-zA-Z]\+\)\?$'
+ let values = ["left", "center", "right"]
+ else
return []
- elseif prop == 'border-style'
+ endif
+ elseif prop == 'background-repeat'
+ let values = ["repeat", "repeat-x", "repeat-y", "no-repeat"]
+ elseif prop == 'background'
+ let values = ["url(", "scroll", "fixed", "transparent", "rgb(", "#", "none", "top", "center", "bottom" , "left", "right", "repeat", "repeat-x", "repeat-y", "no-repeat"]
+ elseif prop == 'border-collapse'
+ let values = ["collapse", "separate"]
+ elseif prop == 'border-color'
+ let values = ["rgb(", "#", "transparent"]
+ elseif prop == 'border-spacing'
+ return []
+ elseif prop == 'border-style'
+ let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
+ elseif prop =~ 'border-\%(top\|right\|bottom\|left\)$'
+ let vals = matchstr(line, '.*:\s*\zs.*')
+ if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$'
+ let values = ["thin", "thick", "medium"]
+ elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$'
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
- elseif prop =~ 'border-\(top\|right\|bottom\|left\)$'
- let vals = matchstr(line, '.*:\s*\zs.*')
- if vals =~ '^\([a-zA-Z0-9.]\+\)\?$'
- let values = ["thin", "thick", "medium"]
- elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\([a-zA-Z]\+\)\?$'
- let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
- elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\([a-zA-Z(]\+\)\?$'
- let values = ["rgb(", "#", "transparent"]
- else
- return []
- endif
- elseif prop =~ 'border-\(top\|right\|bottom\|left\)-color'
+ elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$'
let values = ["rgb(", "#", "transparent"]
- elseif prop =~ 'border-\(top\|right\|bottom\|left\)-style'
- let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
- elseif prop =~ 'border-\(top\|right\|bottom\|left\)-width'
- let values = ["thin", "thick", "medium"]
- elseif prop == 'border-width'
- let values = ["thin", "thick", "medium"]
- elseif prop == 'border'
- let vals = matchstr(line, '.*:\s*\zs.*')
- if vals =~ '^\([a-zA-Z0-9.]\+\)\?$'
- let values = ["thin", "thick", "medium"]
- elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\([a-zA-Z]\+\)\?$'
- let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
- elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\([a-zA-Z(]\+\)\?$'
- let values = ["rgb(", "#", "transparent"]
- else
- return []
- endif
- elseif prop == 'bottom'
- let values = ["auto"]
- elseif prop == 'caption-side'
- let values = ["top", "bottom"]
- elseif prop == 'clear'
- let values = ["none", "left", "right", "both"]
- elseif prop == 'clip'
- let values = ["auto", "rect("]
- elseif prop == 'color'
- let values = ["rgb(", "#"]
- elseif prop == 'content'
- let values = ["normal", "attr(", "open-quote", "close-quote", "no-open-quote", "no-close-quote"]
- elseif prop =~ 'counter-\(increment\|reset\)$'
- let values = ["none"]
- elseif prop =~ '^\(cue-after\|cue-before\|cue\)$'
- let values = ["url(", "none"]
- elseif prop == 'cursor'
- let values = ["url(", "auto", "crosshair", "default", "pointer", "move", "e-resize", "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "text", "wait", "help", "progress"]
- elseif prop == 'direction'
- let values = ["ltr", "rtl"]
- elseif prop == 'display'
- let values = ["inline", "block", "list-item", "run-in", "inline-block", "table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption", "none"]
- elseif prop == 'elevation'
- let values = ["below", "level", "above", "higher", "lower"]
- elseif prop == 'empty-cells'
- let values = ["show", "hide"]
- elseif prop == 'float'
- let values = ["left", "right", "none"]
- elseif prop == 'font-family'
- let values = ["sans-serif", "serif", "monospace", "cursive", "fantasy"]
- elseif prop == 'font-size'
- let values = ["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller"]
- elseif prop == 'font-style'
- let values = ["normal", "italic", "oblique"]
- elseif prop == 'font-variant'
- let values = ["normal", "small-caps"]
- elseif prop == 'font-weight'
- let values = ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"]
- elseif prop == 'font'
- let values = ["normal", "italic", "oblique", "small-caps", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller", "sans-serif", "serif", "monospace", "cursive", "fantasy", "caption", "icon", "menu", "message-box", "small-caption", "status-bar"]
- elseif prop =~ '^\(height\|width\)$'
- let values = ["auto"]
- elseif prop =~ '^\(left\|rigth\)$'
- let values = ["auto"]
- elseif prop == 'letter-spacing'
- let values = ["normal"]
- elseif prop == 'line-height'
- let values = ["normal"]
- elseif prop == 'list-style-image'
- let values = ["url(", "none"]
- elseif prop == 'list-style-position'
- let values = ["inside", "outside"]
- elseif prop == 'list-style-type'
- let values = ["disc", "circle", "square", "decimal", "decimal-leading-zero", "lower-roman", "upper-roman", "lower-latin", "upper-latin", "none"]
- elseif prop == 'list-style'
+ else
return []
- elseif prop == 'margin'
- let values = ["auto"]
- elseif prop =~ 'margin-\(right\|left\|top\|bottom\)$'
- let values = ["auto"]
- elseif prop == 'max-height'
- let values = ["auto"]
- elseif prop == 'max-width'
- let values = ["none"]
- elseif prop == 'min-height'
- let values = ["none"]
- elseif prop == 'min-width'
- let values = ["none"]
- elseif prop == 'orphans'
+ endif
+ elseif prop =~ 'border-\%(top\|right\|bottom\|left\)-color'
+ let values = ["rgb(", "#", "transparent"]
+ elseif prop =~ 'border-\%(top\|right\|bottom\|left\)-style'
+ let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
+ elseif prop =~ 'border-\%(top\|right\|bottom\|left\)-width'
+ let values = ["thin", "thick", "medium"]
+ elseif prop == 'border-width'
+ let values = ["thin", "thick", "medium"]
+ elseif prop == 'border'
+ let vals = matchstr(line, '.*:\s*\zs.*')
+ if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$'
+ let values = ["thin", "thick", "medium"]
+ elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$'
+ let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
+ elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$'
+ let values = ["rgb(", "#", "transparent"]
+ else
return []
- elseif prop == 'outline-color'
+ endif
+ elseif prop == 'bottom'
+ let values = ["auto"]
+ elseif prop == 'caption-side'
+ let values = ["top", "bottom"]
+ elseif prop == 'clear'
+ let values = ["none", "left", "right", "both"]
+ elseif prop == 'clip'
+ let values = ["auto", "rect("]
+ elseif prop == 'color'
+ let values = ["rgb(", "#"]
+ elseif prop == 'content'
+ let values = ["normal", "attr(", "open-quote", "close-quote", "no-open-quote", "no-close-quote"]
+ elseif prop =~ 'counter-\%(increment\|reset\)$'
+ let values = ["none"]
+ elseif prop =~ '^\%(cue-after\|cue-before\|cue\)$'
+ let values = ["url(", "none"]
+ elseif prop == 'cursor'
+ let values = ["url(", "auto", "crosshair", "default", "pointer", "move", "e-resize", "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "text", "wait", "help", "progress"]
+ elseif prop == 'direction'
+ let values = ["ltr", "rtl"]
+ elseif prop == 'display'
+ let values = ["inline", "block", "list-item", "run-in", "inline-block", "table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption", "none"]
+ elseif prop == 'elevation'
+ let values = ["below", "level", "above", "higher", "lower"]
+ elseif prop == 'empty-cells'
+ let values = ["show", "hide"]
+ elseif prop == 'float'
+ let values = ["left", "right", "none"]
+ elseif prop == 'font-family'
+ let values = ["sans-serif", "serif", "monospace", "cursive", "fantasy"]
+ elseif prop == 'font-size'
+ let values = ["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller"]
+ elseif prop == 'font-style'
+ let values = ["normal", "italic", "oblique"]
+ elseif prop == 'font-variant'
+ let values = ["normal", "small-caps"]
+ elseif prop == 'font-weight'
+ let values = ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"]
+ elseif prop == 'font'
+ let values = ["normal", "italic", "oblique", "small-caps", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller", "sans-serif", "serif", "monospace", "cursive", "fantasy", "caption", "icon", "menu", "message-box", "small-caption", "status-bar"]
+ elseif prop =~ '^\%(height\|width\)$'
+ let values = ["auto"]
+ elseif prop =~ '^\%(left\|rigth\)$'
+ let values = ["auto"]
+ elseif prop == 'letter-spacing'
+ let values = ["normal"]
+ elseif prop == 'line-height'
+ let values = ["normal"]
+ elseif prop == 'list-style-image'
+ let values = ["url(", "none"]
+ elseif prop == 'list-style-position'
+ let values = ["inside", "outside"]
+ elseif prop == 'list-style-type'
+ let values = ["disc", "circle", "square", "decimal", "decimal-leading-zero", "lower-roman", "upper-roman", "lower-latin", "upper-latin", "none"]
+ elseif prop == 'list-style'
+ return []
+ elseif prop == 'margin'
+ let values = ["auto"]
+ elseif prop =~ 'margin-\%(right\|left\|top\|bottom\)$'
+ let values = ["auto"]
+ elseif prop == 'max-height'
+ let values = ["auto"]
+ elseif prop == 'max-width'
+ let values = ["none"]
+ elseif prop == 'min-height'
+ let values = ["none"]
+ elseif prop == 'min-width'
+ let values = ["none"]
+ elseif prop == 'orphans'
+ return []
+ elseif prop == 'outline-color'
+ let values = ["rgb(", "#"]
+ elseif prop == 'outline-style'
+ let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
+ elseif prop == 'outline-width'
+ let values = ["thin", "thick", "medium"]
+ elseif prop == 'outline'
+ let vals = matchstr(line, '.*:\s*\zs.*')
+ if vals =~ '^\%([a-zA-Z0-9,()#]\+\)\?$'
let values = ["rgb(", "#"]
- elseif prop == 'outline-style'
+ elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+\%([a-zA-Z]\+\)\?$'
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
- elseif prop == 'outline-width'
+ elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$'
let values = ["thin", "thick", "medium"]
- elseif prop == 'outline'
- let vals = matchstr(line, '.*:\s*\zs.*')
- if vals =~ '^\([a-zA-Z0-9,()#]\+\)\?$'
- let values = ["rgb(", "#"]
- elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+\([a-zA-Z]\+\)\?$'
- let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
- elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+[a-zA-Z]\+\s\+\([a-zA-Z(]\+\)\?$'
- let values = ["thin", "thick", "medium"]
- else
- return []
- endif
- elseif prop == 'overflow'
- let values = ["visible", "hidden", "scroll", "auto"]
- elseif prop == 'padding'
- return []
- elseif prop =~ 'padding-\(top\|right\|bottom\|left\)$'
- return []
- elseif prop =~ 'page-break-\(after\|before\)$'
- let values = ["auto", "always", "avoid", "left", "right"]
- elseif prop == 'page-break-inside'
- let values = ["auto", "avoid"]
- elseif prop =~ 'pause-\(after\|before\)$'
- return []
- elseif prop == 'pause'
- return []
- elseif prop == 'pitch-range'
- return []
- elseif prop == 'pitch'
- let values = ["x-low", "low", "medium", "high", "x-high"]
- elseif prop == 'play-during'
- let values = ["url(", "mix", "repeat", "auto", "none"]
- elseif prop == 'position'
- let values = ["static", "relative", "absolute", "fixed"]
- elseif prop == 'quotes'
- let values = ["none"]
- elseif prop == 'richness'
- return []
- elseif prop == 'speak-header'
- let values = ["once", "always"]
- elseif prop == 'speak-numeral'
- let values = ["digits", "continuous"]
- elseif prop == 'speak-punctuation'
- let values = ["code", "none"]
- elseif prop == 'speak'
- let values = ["normal", "none", "spell-out"]
- elseif prop == 'speech-rate'
- let values = ["x-slow", "slow", "medium", "fast", "x-fast", "faster", "slower"]
- elseif prop == 'stress'
- return []
- elseif prop == 'table-layout'
- let values = ["auto", "fixed"]
- elseif prop == 'text-align'
- let values = ["left", "right", "center", "justify"]
- elseif prop == 'text-decoration'
- let values = ["none", "underline", "overline", "line-through", "blink"]
- elseif prop == 'text-indent'
- return []
- elseif prop == 'text-transform'
- let values = ["capitalize", "uppercase", "lowercase", "none"]
- elseif prop == 'top'
- let values = ["auto"]
- elseif prop == 'unicode-bidi'
- let values = ["normal", "embed", "bidi-override"]
- elseif prop == 'vertical-align'
- let values = ["baseline", "sub", "super", "top", "text-top", "middle", "bottom", "text-bottom"]
- elseif prop == 'visibility'
- let values = ["visible", "hidden", "collapse"]
- elseif prop == 'voice-family'
- return []
- elseif prop == 'volume'
- let values = ["silent", "x-soft", "soft", "medium", "loud", "x-loud"]
- elseif prop == 'white-space'
- let values = ["normal", "pre", "nowrap", "pre-wrap", "pre-line"]
- elseif prop == 'widows'
+ else
return []
- elseif prop == 'word-spacing'
- let values = ["normal"]
- elseif prop == 'z-index'
- let values = ["auto"]
+ endif
+ elseif prop == 'overflow'
+ let values = ["visible", "hidden", "scroll", "auto"]
+ elseif prop == 'padding'
+ return []
+ elseif prop =~ 'padding-\%(top\|right\|bottom\|left\)$'
+ return []
+ elseif prop =~ 'page-break-\%(after\|before\)$'
+ let values = ["auto", "always", "avoid", "left", "right"]
+ elseif prop == 'page-break-inside'
+ let values = ["auto", "avoid"]
+ elseif prop =~ 'pause-\%(after\|before\)$'
+ return []
+ elseif prop == 'pause'
+ return []
+ elseif prop == 'pitch-range'
+ return []
+ elseif prop == 'pitch'
+ let values = ["x-low", "low", "medium", "high", "x-high"]
+ elseif prop == 'play-during'
+ let values = ["url(", "mix", "repeat", "auto", "none"]
+ elseif prop == 'position'
+ let values = ["static", "relative", "absolute", "fixed"]
+ elseif prop == 'quotes'
+ let values = ["none"]
+ elseif prop == 'richness'
+ return []
+ elseif prop == 'speak-header'
+ let values = ["once", "always"]
+ elseif prop == 'speak-numeral'
+ let values = ["digits", "continuous"]
+ elseif prop == 'speak-punctuation'
+ let values = ["code", "none"]
+ elseif prop == 'speak'
+ let values = ["normal", "none", "spell-out"]
+ elseif prop == 'speech-rate'
+ let values = ["x-slow", "slow", "medium", "fast", "x-fast", "faster", "slower"]
+ elseif prop == 'stress'
+ return []
+ elseif prop == 'table-layout'
+ let values = ["auto", "fixed"]
+ elseif prop == 'text-align'
+ let values = ["left", "right", "center", "justify"]
+ elseif prop == 'text-decoration'
+ let values = ["none", "underline", "overline", "line-through", "blink"]
+ elseif prop == 'text-indent'
+ return []
+ elseif prop == 'text-transform'
+ let values = ["capitalize", "uppercase", "lowercase", "none"]
+ elseif prop == 'top'
+ let values = ["auto"]
+ elseif prop == 'unicode-bidi'
+ let values = ["normal", "embed", "bidi-override"]
+ elseif prop == 'vertical-align'
+ let values = ["baseline", "sub", "super", "top", "text-top", "middle", "bottom", "text-bottom"]
+ elseif prop == 'visibility'
+ let values = ["visible", "hidden", "collapse"]
+ elseif prop == 'voice-family'
+ return []
+ elseif prop == 'volume'
+ let values = ["silent", "x-soft", "soft", "medium", "loud", "x-loud"]
+ elseif prop == 'white-space'
+ let values = ["normal", "pre", "nowrap", "pre-wrap", "pre-line"]
+ elseif prop == 'widows'
+ return []
+ elseif prop == 'word-spacing'
+ let values = ["normal"]
+ elseif prop == 'z-index'
+ let values = ["auto"]
+ else
+ " If no property match it is possible we are outside of {} and
+ " trying to complete pseudo-(class|element)
+ let element = tolower(matchstr(line, '\zs[a-zA-Z1-6]*\ze:[^:[:space:]]\{-}$'))
+ if stridx(',a,abbr,acronym,address,area,b,base,bdo,big,blockquote,body,br,button,caption,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,fieldset,form,head,h1,h2,h3,h4,h5,h6,hr,html,i,img,input,ins,kbd,label,legend,li,link,map,meta,noscript,object,ol,optgroup,option,p,param,pre,q,samp,script,select,small,span,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,title,tr,tt,ul,var,', ','.element.',') > -1
+ let values = ["first-child", "link", "visited", "hover", "active", "focus", "lang", "first-line", "first-letter", "before", "after"]
else
- " If no property match it is possible we are outside of {} and
- " trying to complete pseudo-(class|element)
- let element = tolower(matchstr(line, '\zs[a-zA-Z1-6]*\ze:[^:[:space:]]\{-}$'))
- if ",a,abbr,acronym,address,area,b,base,bdo,big,blockquote,body,br,button,caption,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,fieldset,form,head,h1,h2,h3,h4,h5,h6,hr,html,i,img,input,ins,kbd,label,legend,li,link,map,meta,noscript,object,ol,optgroup,option,p,param,pre,q,samp,script,select,small,span,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,title,tr,tt,ul,var," =~ ','.element.','
- let values = ["first-child", "link", "visited", "hover", "active", "focus", "lang", "first-line", "first-letter", "before", "after"]
- else
- return []
- endif
+ return []
endif
+ endif
- " Complete values
- let entered_value = matchstr(line, '.\{-}\zs[a-zA-Z0-9#,.(_-]*$')
-
- for m in values
- if m =~? '^'.entered_value
- call add(res, m)
- elseif m =~? entered_value
- call add(res2, m)
- endif
- endfor
-
- return res + res2
-
- elseif borders[min(keys(borders))] == 'closebrace'
+ " Complete values
+ let entered_value = matchstr(line, '.\{-}\zs[a-zA-Z0-9#,.(_-]*$')
- return []
+ for m in values
+ if m =~? '^'.entered_value
+ call add(res, m)
+ elseif m =~? entered_value
+ call add(res2, m)
+ endif
+ endfor
- elseif borders[min(keys(borders))] == 'exclam'
+ return res + res2
- " Complete values
- let entered_imp = matchstr(line, '.\{-}!\s*\zs[a-zA-Z ]*$')
+elseif borders[max(keys(borders))] == 'closebrace'
- let values = ["important"]
+ return []
- for m in values
- if m =~? '^'.entered_imp
- call add(res, m)
- endif
- endfor
+elseif borders[max(keys(borders))] == 'exclam'
- return res
+ " Complete values
+ let entered_imp = matchstr(line, '.\{-}!\s*\zs[a-zA-Z ]*$')
- elseif borders[min(keys(borders))] == 'atrule'
+ let values = ["important"]
- let afterat = matchstr(line, '.*@\zs.*')
+ for m in values
+ if m =~? '^'.entered_imp
+ call add(res, m)
+ endif
+ endfor
- if afterat =~ '\s'
+ return res
- let atrulename = matchstr(line, '.*@\zs[a-zA-Z-]\+\ze')
+elseif borders[max(keys(borders))] == 'atrule'
- if atrulename == 'media'
- let values = ["screen", "tty", "tv", "projection", "handheld", "print", "braille", "aural", "all"]
+ let afterat = matchstr(line, '.*@\zs.*')
- let atruleafterbase = matchstr(line, '.*@media\s\+\ze.*$')
- let entered_atruleafter = matchstr(line, '.*@media\s\+\zs.*$')
+ if afterat =~ '\s'
- elseif atrulename == 'import'
- let atruleafterbase = matchstr(line, '.*@import\s\+\ze.*$')
- let entered_atruleafter = matchstr(line, '.*@import\s\+\zs.*$')
+ let atrulename = matchstr(line, '.*@\zs[a-zA-Z-]\+\ze')
- if entered_atruleafter =~ "^[\"']"
- let filestart = matchstr(entered_atruleafter, '^.\zs.*')
- let files = split(glob(filestart.'*'), '\n')
- let values = map(copy(files), '"\"".v:val')
+ if atrulename == 'media'
+ let values = ["screen", "tty", "tv", "projection", "handheld", "print", "braille", "aural", "all"]
- elseif entered_atruleafter =~ "^url("
- let filestart = matchstr(entered_atruleafter, "^url([\"']\\?\\zs.*")
- let files = split(glob(filestart.'*'), '\n')
- let values = map(copy(files), '"url(".v:val')
+ let atruleafterbase = matchstr(line, '.*@media\s\+\ze.*$')
+ let entered_atruleafter = matchstr(line, '.*@media\s\+\zs.*$')
- else
- let values = ['"', 'url(']
+ elseif atrulename == 'import'
+ let atruleafterbase = matchstr(line, '.*@import\s\+\ze.*$')
+ let entered_atruleafter = matchstr(line, '.*@import\s\+\zs.*$')
- endif
+ if entered_atruleafter =~ "^[\"']"
+ let filestart = matchstr(entered_atruleafter, '^.\zs.*')
+ let files = split(glob(filestart.'*'), '\n')
+ let values = map(copy(files), '"\"".v:val')
+ elseif entered_atruleafter =~ "^url("
+ let filestart = matchstr(entered_atruleafter, "^url([\"']\\?\\zs.*")
+ let files = split(glob(filestart.'*'), '\n')
+ let values = map(copy(files), '"url(".v:val')
+
else
- return []
+ let values = ['"', 'url(']
endif
- for m in values
- if m =~? '^'.entered_atruleafter
- call add(res, m)
- elseif m =~? entered_atruleafter
- call add(res2, m)
- endif
- endfor
-
- return res + res2
+ else
+ return []
endif
- let values = ["charset", "page", "media", "import", "font-face"]
-
- let entered_atrule = matchstr(line, '.*@\zs[a-zA-Z-]*$')
-
for m in values
- if m =~? '^'.entered_atrule
- call add(res, m .' ')
- elseif m =~? entered_atrule
- call add(res2, m .' ')
+ if m =~? '^'.entered_atruleafter
+ call add(res, m)
+ elseif m =~? entered_atruleafter
+ call add(res2, m)
endif
endfor
@@ -424,7 +409,22 @@ else
endif
- return []
+ let values = ["charset", "page", "media", "import", "font-face"]
+
+ let entered_atrule = matchstr(line, '.*@\zs[a-zA-Z-]*$')
+
+ for m in values
+ if m =~? '^'.entered_atrule
+ call add(res, m .' ')
+ elseif m =~? entered_atrule
+ call add(res2, m .' ')
+ endif
+ endfor
+
+ return res + res2
+
+endif
+
+return []
- endif
endfunction
View
75 runtime/autoload/decada.vim
@@ -0,0 +1,75 @@
+"------------------------------------------------------------------------------
+" Description: Vim Ada/Dec Ada compiler file
+" Language: Ada (Dec Ada)
+" $Id$
+" Copyright: Copyright (C) 2006 Martin Krischik
+" Maintainer: Martin Krischik
+" $Author$
+" $Date$
+" Version: 4.2
+" $Revision$
+" $HeadURL: https://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
+" 05.11.2006 MK Bram suggested not to use include protection for
+" autoload
+" 05.11.2006 MK Bram suggested to save on spaces
+" Help Page: compiler-decada
+"------------------------------------------------------------------------------
+
+if version < 700
+ finish
+endif
+
+function decada#Unit_Name () dict " {{{1
+ " Convert filename into acs unit:
+ " 1: remove the file extenstion.
+ " 2: replace all double '_' or '-' with an dot (which denotes a separate)
+ " 3: remove a trailing '_' (wich denotes a specification)
+ return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '')
+endfunction decada#Unit_Name " }}}1
+
+function decada#Make () dict " {{{1
+ let l:make_prg = substitute (g:self.Make_Command, '%<', self.Unit_Name(), '')
+ let &errorformat = g:self.Error_Format
+ let &makeprg = l:make_prg
+ wall
+ make
+ copen
+ set wrap
+ wincmd W
+endfunction decada#Build " }}}1
+
+function decada#Set_Session (...) dict " {{{1
+ if a:0 > 0
+ call ada#Switch_Session (a:1)
+ elseif argc() == 0 && strlen (v:servername) > 0
+ call ada#Switch_Session (
+ \ expand('~')[0:-2] . ".vimfiles.session]" .
+ \ v:servername . ".vim")
+ endif
+ return
+endfunction decada#Set_Session " }}}1
+
+function decada#New () " }}}1
+ let Retval = {
+ \ 'Make' : function ('decada#Make'),
+ \ 'Unit_Name' : function ('decada#Unit_Name'),
+ \ 'Set_Session' : function ('decada#Set_Session'),
+ \ 'Project_Dir' : '',
+ \ 'Make_Command' : 'ACS COMPILE /Wait /Log /NoPreLoad /Optimize=Development /Debug %<',
+ \ 'Error_Format' : '%+A%%ADAC-%t-%m,%C %#%m,%Zat line number %l in file %f,' .
+ \ '%+I%%ada-I-%m,%C %#%m,%Zat line number %l in file %f'}
+
+ return Retval
+endfunction decada#New " }}}1
+
+finish " 1}}}
+
+"------------------------------------------------------------------------------
+" Copyright (C) 2006 Martin Krischik
+"
+" Vim is Charityware - see ":help license" or uganda.txt for licence details.
+"------------------------------------------------------------------------------
+" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
+" vim: foldmethod=marker
View
501 runtime/autoload/getscript.vim
@@ -0,0 +1,501 @@
+" ---------------------------------------------------------------------
+" getscript.vim
+" Author: Charles E. Campbell, Jr.
+" Date: Nov 27, 2006
+" Version: 23
+" Installing: :help glvs-install
+" Usage: :help glvs
+"
+" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
+" ---------------------------------------------------------------------
+" Initialization: {{{1
+" if you're sourcing this file, surely you can't be
+" expecting vim to be in its vi-compatible mode
+if &cp
+ echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
+ finish
+endif
+let s:keepfo = &fo
+let s:keepcpo = &cpo
+set cpo&vim
+
+if exists("g:loaded_getscript")
+ finish
+endif
+let g:loaded_getscript= "v23"
+
+" ---------------------------------------------------------------------
+" Global Variables: {{{1
+" allow user to change the command for obtaining scripts (does fetch work?)
+if !exists("g:GetLatestVimScripts_wget")
+ if executable("wget")
+ let g:GetLatestVimScripts_wget= "wget"
+ elseif executable("curl")
+ let g:GetLatestVimScripts_wget= "curl"
+ else
+ let g:GetLatestVimScripts_wget = 'echo "GetLatestVimScripts needs wget or curl"'
+ let g:GetLatestVimScripts_options = ""
+ endif
+endif
+
+" options that wget and curl require:
+if !exists("g:GetLatestVimScripts_options")
+ if g:GetLatestVimScripts_wget == "wget"
+ let g:GetLatestVimScripts_options= "-q -O"
+ elseif g:GetLatestVimScripts_wget == "curl"
+ let g:GetLatestVimScripts_options= "-s -O"
+ else
+ let g:GetLatestVimScripts_options= ""
+ endif
+endif
+
+" by default, allow autoinstall lines to work
+if !exists("g:GetLatestVimScripts_allowautoinstall")
+ let g:GetLatestVimScripts_allowautoinstall= 1
+endif
+
+"" For debugging:
+"let g:GetLatestVimScripts_wget = "echo"
+"let g:GetLatestVimScripts_options = "options"
+
+" ---------------------------------------------------------------------
+" Check If AutoInstall Capable: {{{1
+let s:autoinstall= ""
+if g:GetLatestVimScripts_allowautoinstall
+
+ if (has("win32") || has("gui_win32") || has("gui_win32s") || has("win16") || has("win64") || has("win32unix") || has("win95")) && &shell != "bash"
+ " windows (but not cygwin/bash)
+ let s:dotvim= "vimfiles"
+ if !exists("g:GetLatestVimScripts_mv")
+ let g:GetLatestVimScripts_mv= "ren"
+ endif
+
+ else
+ " unix
+ let s:dotvim= ".vim"
+ if !exists("g:GetLatestVimScripts_mv")
+ let g:GetLatestVimScripts_mv= "mv"
+ endif
+ endif
+
+ if exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim)
+ let s:autoinstall= $HOME."/".s:dotvim
+ endif
+" call Decho("s:autoinstall<".s:autoinstall.">")
+"else "Decho
+" call Decho("g:GetLatestVimScripts_allowautoinstall=".g:GetLatestVimScripts_allowautoinstall.": :AutoInstall: disabled")
+endif
+
+" ---------------------------------------------------------------------
+" Public Interface: {{{1
+com! -nargs=0 GetLatestVimScripts call getscript#GetLatestVimScripts()
+com! -nargs=0 GetScript call getscript#GetLatestVimScripts()
+silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts()
+
+" ---------------------------------------------------------------------
+" 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.
+fun! s:GetOneScript(...)
+" call Dfunc("GetOneScript()")
+
+ " set options to allow progress to be shown on screen
+ let t_ti= &t_ti
+ let t_te= &t_te
+ let rs = &rs
+ set t_ti= t_te= nors
+
+ " put current line on top-of-screen and interpret it into
+ " a script identifer : used to obtain webpage
+ " source identifier : used to identify current version
+ " and an associated comment: used to report on what's being considered
+ if a:0 >= 3
+ let scriptid = a:1
+ let srcid = a:2
+ let fname = a:3
+ let cmmnt = ""
+" call Decho("scriptid<".scriptid.">")
+" call Decho("srcid <".srcid.">")
+" call Decho("fname <".fname.">")
+ else
+ let curline = getline(".")
+ if curline =~ '^\s*#'
+" call Dret("GetOneScript : skipping a pure comment line")
+ return
+ endif
+ let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(.\{-}\)\(\s*#.*\)\=$'
+ try
+ let scriptid = substitute(curline,parsepat,'\1','e')
+ catch /^Vim\%((\a\+)\)\=:E486/
+ let scriptid= 0
+ endtry
+ try
+ let srcid = substitute(curline,parsepat,'\2','e')
+ catch /^Vim\%((\a\+)\)\=:E486/
+ let srcid= 0
+ endtry
+ try
+ let fname= substitute(curline,parsepat,'\3','e')
+ catch /^Vim\%((\a\+)\)\=:E486/
+ let fname= ""
+ endtry
+ try
+ let cmmnt= substitute(curline,parsepat,'\4','e')
+ catch /^Vim\%((\a\+)\)\=:E486/
+ let cmmnt= ""
+ endtry
+" call Decho("curline <".curline.">")
+" call Decho("parsepat<".parsepat.">")
+" call Decho("scriptid<".scriptid.">")
+" call Decho("srcid <".srcid.">")
+" call Decho("fname <".fname.">")
+ endif
+
+ if scriptid == 0 || srcid == 0
+ " When looking for :AutoInstall: lines, skip scripts that
+ " have 0 0 scriptname
+" call Dret("GetOneScript : skipping a scriptid==srcid==0 line")
+ return
+ endif
+
+ let doautoinstall= 0
+ if fname =~ ":AutoInstall:"
+" call Decho("fname<".fname."> has :AutoInstall:...")
+ let aicmmnt= substitute(fname,'\s\+:AutoInstall:\s\+',' ','')
+" call Decho("aicmmnt<".aicmmnt."> s:autoinstall=".s:autoinstall)
+ if s:autoinstall != ""
+ let doautoinstall = g:GetLatestVimScripts_allowautoinstall
+ endif
+ else
+ let aicmmnt= fname
+ endif
+" call Decho("aicmmnt<".aicmmnt.">: doautoinstall=".doautoinstall)
+
+ exe "norm z\<CR>"
+ redraw!
+" call Decho('considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid)
+ echomsg '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
+ let tmpfile = tempname()
+ let v:errmsg = ""
+
+ " make three tries at downloading the description
+ let itry= 1
+ while itry <= 3
+" call Decho("try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr)
+ if has("win32") || has("win16") || has("win95")
+" call Decho("silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile.' "'.scriptaddr.'"')
+ exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile.' "'.scriptaddr.'"'
+ else
+" call Decho("silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile." '".scriptaddr."'")
+ exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile." '".scriptaddr."'"
+ endif
+ if itry == 1
+ exe "silent vsplit ".tmpfile
+ else
+ silent! e %
+ endif
+
+ " find the latest source-id in the plugin's webpage
+ silent! 1
+ let findpkg= search('Click on the package to download','W')
+ if findpkg > 0
+ break
+ endif
+ let itry= itry + 1
+ endwhile
+" call Decho(" --- end downloading tries while loop --- itry=".itry)
+
+ " testing: did finding /Click on the package.../ fail?
+ if findpkg == 0 || itry >= 4
+ silent q!
+ call delete(tmpfile)
+ " restore options
+ let &t_ti = t_ti
+ let &t_te = t_te
+ let &rs = rs
+ let s:downerrors = s:downerrors + 1
+" call Decho("***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">")
+ echomsg "***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">"
+" call Dret("GetOneScript : srch for /Click on the package/ failed")
+ return
+ endif
+" call Decho('found "Click on the package to download"')
+
+ let findsrcid= search('src_id=','W')
+ if findsrcid == 0
+ silent q!
+ call delete(tmpfile)
+ " restore options
+ let &t_ti = t_ti
+ let &t_te = t_te
+ let &rs = rs
+ let s:downerrors = s:downerrors + 1
+" call Decho("***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">")
+ echomsg "***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">"
+" call Dret("GetOneScript : srch for /src_id/ failed")
+ return
+ endif
+" call Decho('found "src_id=" in description page')
+
+ let srcidpat = '^\s*<td class.*src_id=\(\d\+\)">\([^<]\+\)<.*$'
+ let latestsrcid= substitute(getline("."),srcidpat,'\1','')
+ let fname = substitute(getline("."),srcidpat,'\2','')
+" call Decho("srcidpat<".srcidpat."> latestsrcid<".latestsrcid."> fname<".fname.">")
+ silent q!
+ call delete(tmpfile)
+
+ " convert the strings-of-numbers into numbers
+ let srcid = srcid + 0
+ let latestsrcid = latestsrcid + 0
+" call Decho("srcid=".srcid." latestsrcid=".latestsrcid." fname<".fname.">")
+
+ " has the plugin's most-recent srcid increased, which indicates
+ " that it has been updated
+ if latestsrcid > srcid
+ let s:downloads= s:downloads + 1
+ if fname == bufname("%")
+ " GetLatestVimScript has to be careful about downloading itself
+ let fname= "NEW_".fname
+ endif
+
+ " the plugin has been updated since we last obtained it, so download a new copy
+" call Decho("...downloading new <".fname.">")
+ echomsg "...downloading new <".fname.">"
+ if has("win32") || has("gui_win32") || has("gui_win32s") || has("win16") || has("win64") || has("win32unix") || has("win95")
+" call Decho("windows: silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".fname.' "'.'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid.'"')
+ exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".fname.' "'.'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid.'"'
+ else
+" call Decho("unix: silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".fname." '".'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid."'")
+ exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".fname." '".'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid."'"
+ endif
+
+ " AutoInstall: only if doautoinstall is so indicating
+ if doautoinstall
+" call Decho("attempting to do autoinstall: getcwd<".getcwd()."> filereadable(".fname.")=".filereadable(fname))
+ if filereadable(fname)
+" call Decho("move <".fname."> to ".s:autoinstall)
+" call Decho("DISABLED for testing")
+ exe "silent !".g:GetLatestVimScripts_mv." ".fname." ".s:autoinstall
+ let curdir= escape(substitute(getcwd(),'\','/','ge'),"|[]*'\" #")
+ exe "cd ".s:autoinstall
+ if fname =~ '\.bz2$'
+" call Decho("attempt to bunzip2 ".fname)
+ exe "silent !bunzip2 ".fname
+ let fname= substitute(fname,'\.bz2$','','')
+ elseif fname =~ '\.gz$'
+" call Decho("attempt to gunzip ".fname)
+ exe "silent !gunzip ".fname
+ let fname= substitute(fname,'\.gz$','','')
+ endif
+ if fname =~ '\.zip$'
+" call Decho("attempt to unzip ".fname)
+ exe "silent !unzip -o".fname
+ elseif fname =~ '\.tar$'
+" call Decho("attempt to untar ".fname)
+ exe "silent !tar -xvf ".fname
+ elseif fname =~ '\.vba$'
+" call Decho("attempt to handle a vimball: ".fname)
+ 1split
+ exe "e ".fname
+ so %
+ q
+ endif
+ if fname =~ '.vim$'
+" call Decho("attempt to simply move ".fname." to plugin")
+ exe "silent !".g:GetLatestVimScripts_mv." ".fname." plugin"
+ endif
+ let docdir= substitute(&rtp,',.*','','e')."/doc"
+" call Decho("helptags docdir<".docdir.">")
+ exe "helptags ".docdir
+ exe "cd ".curdir
+ endif
+ endif
+
+ " update the data in the <GetLatestVimScripts.dat> file
+ let modline=scriptid." ".latestsrcid." ".fname.cmmnt
+ call setline(line("."),modline)
+" call Decho("modline<".modline."> (updated GetLatestVimScripts.dat file)")
+ endif
+
+ " restore options
+ let &t_ti= t_ti
+ let &t_te= t_te
+ let &rs = rs
+
+" call Dret("GetOneScript")
+endfun
+
+" ---------------------------------------------------------------------
+" GetLatestVimScripts: this function gets the latest versions of {{{1
+" scripts based on the list in
+" (first dir in runtimepath)/GetLatest/GetLatestVimScripts.dat
+fun! getscript#GetLatestVimScripts()
+" call Dfunc("GetLatestVimScripts() autoinstall<".s:autoinstall.">")
+
+" insure that wget is executable
+ if executable(g:GetLatestVimScripts_wget) != 1
+ echoerr "GetLatestVimScripts needs ".g:GetLatestVimScripts_wget." which apparently is not available on your system"
+" call Dret("GetLatestVimScripts : wget not executable/availble")
+ return
+ endif
+
+ " Find the .../GetLatest subdirectory under the runtimepath
+ for datadir in split(&rtp,',') + ['']
+ if isdirectory(datadir."/GetLatest")
+" call Decho("found directory<".datadir.">")
+ let datadir= datadir . "/GetLatest"
+ break
+ endif
+ if filereadable(datadir."GetLatestVimScripts.dat")
+" call Decho("found ".datadir."/GetLatestVimScripts.dat")
+ break
+ endif
+ endfor
+ " Sanity checks: readability and writability
+ if datadir == ""
+ echoerr 'Missing "GetLatest/" on your runtimepath - see :help glvs-dist-install'
+" 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.">")
+ return
+ endif
+ let datafile= datadir."/GetLatestVimScripts.dat"
+ if !filereadable(datafile)
+ echoerr "Your data file<".datafile."> isn't readable"
+" call Dret("GetLatestVimScripts : non-readable datafile<".datafile.">")
+ return
+ endif
+ if !filewritable(datafile)
+ echoerr "Your data file<".datafile."> isn't writable"
+" call Dret("GetLatestVimScripts : non-writable datafile<".datafile.">")
+ return
+ endif
+" call Decho("datadir <".datadir.">")
+" call Decho("datafile <".datafile.">")
+
+ " don't let any events interfere (like winmanager's, taglist's, etc)
+ let eikeep= &ei
+ set ei=all
+
+ " record current directory, change to datadir, open split window with
+ " datafile
+ let origdir= getcwd()
+ exe "cd ".escape(substitute(datadir,'\','/','ge'),"|[]*'\" #")
+ split
+ exe "e ".escape(substitute(datafile,'\','/','ge'),"|[]*'\" #")
+ res 1000
+ let s:downloads = 0
+ let s:downerrors= 0
+
+ " Check on dependencies mentioned in plugins
+" call Decho(" ")
+" call Decho("searching plugins for GetLatestVimScripts dependencies")
+ let lastline = line("$")
+ let plugins = globpath(&rtp,"plugin/*.vim")
+ let foundscript = 0
+
+" call Decho("plugins<".plugins."> lastline#".lastline)
+ while plugins != ""
+ let plugin = substitute(plugins,'\n.*$','','e')
+ let plugins= (plugins =~ '\n')? substitute(plugins,'^.\{-}\n\(.*\)$','\1','e') : ""
+ $
+" call Decho(".dependency checking<".plugin."> line$=".line("$"))
+ exe "silent r ".plugin
+ 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
+
+ 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("..newscript<".newscript."> noai_script<".noai_script."> srch=".srchline." 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
+ endif
+
+ endwhile
+ let llp1= lastline + 1
+" call Decho(".deleting lines: ".llp1.",$d")
+ exe "silent! ".llp1.",$d"
+ endwhile
+
+ if foundscript == 0
+ set nomod
+ endif
+
+ " Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat
+ set lz
+" call Decho(" --- end of dependency checking loop --- ")
+" call Decho("call GetOneScript on lines at end of datafile<".datafile.">")
+ 1
+ /^-----/,$g/^\s*\d/call <SID>GetOneScript()
+
+ " Final report (an echomsg)
+ try
+ silent! ?^-------?
+ catch /^Vim\%((\a\+)\)\=:E114/
+" call Dret("GetLatestVimScripts : nothing done!")
+ return
+ endtry
+ exe "norm! kz\<CR>"
+ redraw!
+ let s:msg = ""
+ if s:downloads == 1
+ let s:msg = "Downloaded one updated script to <".datadir.">"
+ elseif s:downloads == 2
+ let s:msg= "Downloaded two updated scripts to <".datadir.">"
+ elseif s:downloads > 1
+ let s:msg= "Downloaded ".s:downloads." updated scripts to <".datadir.">"
+ else
+ let s:msg= "Everything was already current"
+ endif
+ if s:downerrors > 0
+ let s:msg= s:msg." (".s:downerrors." downloading errors)"
+ endif
+ echomsg s:msg
+ " save the file
+ if &mod
+ silent! w!
+ endif
+ q
+
+ " restore events and current directory
+ exe "cd ".escape(substitute(origdir,'\','/','ge'),"|[]*'\" #")
+ let &ei= eikeep
+ set nolz
+" call Dret("GetLatestVimScripts : did ".s:downloads." downloads")
+endfun
+" ---------------------------------------------------------------------
+
+" Restore Options: {{{1
+let &fo = s:keepfo
+let &cpo= s:keepcpo
+
+" vim: ts=8 sts=2 fdm=marker nowrap
View
6,973 runtime/autoload/netrw.vim
3,965 additions, 3,008 deletions not shown
View
94 runtime/autoload/pythoncomplete.vim
@@ -1,16 +1,34 @@
"pythoncomplete.vim - Omni Completion for python
" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
-" Version: 0.5
-" Last Updated: 19 April 2006
-"
-" Yeah, I skipped a version number - 0.4 was never public.
-" It was a bugfix version on top of 0.3. This is a complete
-" rewrite.
+" Version: 0.7
+" Last Updated: 19 Oct 2006
"
+" Changes
" TODO:
" User defined docstrings aren't handled right...
" 'info' item output can use some formatting work
" Add an "unsafe eval" mode, to allow for return type evaluation
+" Complete basic syntax along with import statements
+" i.e. "import url<c-x,c-o>"
+" Continue parsing on invalid line??
+"
+" v 0.7
+" * Fixed function list sorting (_ and __ at the bottom)
+" * Removed newline removal from docs. It appears vim handles these better in
+" recent patches
+"
+" v 0.6:
+" * Fixed argument completion
+" * Removed the 'kind' completions, as they are better indicated
+" with real syntax
+" * Added tuple assignment parsing (whoops, that was forgotten)
+" * Fixed import handling when flattening scope
+"
+" v 0.5:
+" Yeah, I skipped a version number - 0.4 was never public.
+" It was a bugfix version on top of 0.3. This is a complete
+" rewrite.
+"
if !has('python')
echo "Error: Required vim compiled with +python"
@@ -28,7 +46,7 @@ function! pythoncomplete#Complete(findstart, base)
if c =~ '\w'
continue
elseif ! c =~ '\.'
- idx = -1
+ let idx = -1
break
else
break
@@ -45,7 +63,7 @@ function! pythoncomplete#Complete(findstart, base)
while idx > 0
let idx -= 1
let c = line[idx]
- if c =~ '\w' || c =~ '\.'
+ if c =~ '\w' || c =~ '\.' || c == '('
let cword = c . cword
continue
elseif strlen(cword) > 0 || idx == 0
@@ -73,7 +91,24 @@ def vimcomplete(context,match):
try:
import vim
def complsort(x,y):
- return x['abbr'] > y['abbr']
+ try:
+ xa = x['abbr']
+ ya = y['abbr']
+ if xa[0] == '_':
+ if xa[1] == '_' and ya[0:2] == '__':
+ return xa > ya
+ elif ya[0:2] == '__':
+ return -1
+ elif y[0] == '_':
+ return xa > ya
+ else:
+ return 1
+ elif ya[0] == '_':
+ return -1
+ else:
+ return xa > ya
+ except:
+ return 0
cmpl = Completer()
cmpl.evalsource('\n'.join(vim.current.buffer),vim.eval("line('.')"))
all = cmpl.get_completions(context,match)
@@ -86,7 +121,7 @@ def vimcomplete(context,match):
dictstr += '"icase":0},'
if dictstr[-1] == ',': dictstr = dictstr[:-1]
dictstr += ']'
- dbg("dict: %s" % dictstr)
+ #dbg("dict: %s" % dictstr)
vim.command("silent let g:pythoncomplete_completions = %s" % dictstr)
#dbg("Completion dict:\n%s" % all)
except vim.error:
@@ -108,11 +143,7 @@ class Completer(object):
except: dbg("locals: %s, %s [%s]" % (sys.exc_info()[0],sys.exc_info()[1],l))
def _cleanstr(self,doc):
- return doc.replace('"',' ')\
- .replace("'",' ')\
- .replace('\n',' ')\
- .replace('\r',' ')\
- .replace('
+ return doc.replace('"',' ').replace("'",' ')
def get_arguments(self,func_obj):
def _ctor(obj):
@@ -128,23 +159,23 @@ class Completer(object):
elif type(func_obj) == types.MethodType: func_obj = func_obj.im_func
else: arg_offset = 0
-
+ arg_text=''
if type(func_obj) in [types.FunctionType, types.LambdaType]:
try:
cd = func_obj.func_code
real_args = cd.co_varnames[arg_offset:cd.co_argcount]
- real_args = cd.co_varnames[arg_offset:cd.co_argcount]
- defaults = func_obj.func_defaults or []
+ defaults = func_obj.func_defaults or ''
+ defaults = map(lambda name: "=%s" % name, defaults)
defaults = [""] * (len(real_args)-len(defaults)) + defaults
items = map(lambda a,d: a+d, real_args, defaults)
if func_obj.func_code.co_flags & 0x4:
items.append("...")
if func_obj.func_code.co_flags & 0x8:
items.append("***")
- items.append("***")
+ arg_text = (','.join(items)) + ')'
except:
- except:
+ dbg("arg completion: %s: %s" % (sys.exc_info()[0],sys.exc_info()[1]))
pass
if len(arg_text) == 0:
# The doc string sometimes contains the function signature
@@ -160,6 +191,7 @@ class Completer(object):
ridx = sigline.find(')')
if lidx > 0 and ridx > 0:
arg_text = sigline[lidx+1:ridx] + ')'
+ if len(arg_text) == 0: arg_text = ')'
return arg_text
def get_completions(self,context,match):
@@ -172,12 +204,11 @@ class Completer(object):
all = {}
ridx = stmt.rfind('.')
if len(stmt) > 0 and stmt[-1] == '(':
- if len(stmt) > 0 and stmt[-1] == '(':
result = eval(_sanitize(stmt[:-1]), self.compldict)
doc = result.__doc__
if doc == None: doc = ''
- if doc == None: doc = ''
- args = self.get_arguments(res)
+ args = self.get_arguments(result)
+ return [{'word':self._cleanstr(args),'info':self._cleanstr(doc)}]
elif ridx == -1:
match = stmt
all = self.compldict
@@ -206,22 +237,18 @@ class Completer(object):
if doc == None or doc == '': doc = maindoc
wrd = m[len(match):]
- wrd = m[len(match):]
+ c = {'word':wrd, 'abbr':m, 'info':self._cleanstr(doc)}
if "function" in typestr:
c['word'] += '('
c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst))
- c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst))
elif "method" in typestr:
c['word'] += '('
c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst))
- c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst))
elif "module" in typestr:
c['word'] += '.'
- c['word'] += '.'
elif "class" in typestr:
c['word'] += '('
c['abbr'] += '('
- c['abbr'] += '('
completions.append(c)
except:
i = sys.exc_info()
@@ -277,10 +304,13 @@ class Scope(object):
# we need to start with this, to fix up broken completions
# hopefully this name is unique enough...
str = '"""'+self.docstr+'"""\n'
+ for l in self.locals:
+ if l.startswith('import'): str += l+'\n'
str += 'class _PyCmplNoType:\n def __getattr__(self,name):\n return None\n'
for sub in self.subscopes:
str += sub.get_code()
- str += sub.get_code()
+ for l in self.locals:
+ if not l.startswith('import'): str += l+'\n'
return str
@@ -420,6 +450,8 @@ class PyParser:
tokentype, token, indent = self.next()
if tokentype == tokenize.STRING or token == 'str':
return '""'
+ elif token == '(' or token == 'tuple':
+ return '()'
elif token == '[' or token == 'list':
return '[]'
elif token == '{' or token == 'dict':
@@ -494,9 +526,9 @@ class PyParser:
freshscope=True
while True:
tokentype, token, indent = self.next()
- tokentype, token, indent = self.next()
+ #dbg( 'main: token=[%s] indent=[%s]' % (token,indent))
-
+ if tokentype == DEDENT or token == "pass":
self.scope = self.scope.pop(indent)
elif token == 'def':
func = self._parsefunction(indent)
View
896 runtime/autoload/rubycomplete.vim
@@ -5,6 +5,7 @@
" URL: http://vim-ruby.rubyforge.org
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
+" Maintainer Version: 0.8
" ----------------------------------------------------------------------------
"
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
@@ -12,20 +13,20 @@
" {{{ requirement checks
if !has('ruby')
- echohl ErrorMsg
- echo "Error: Required vim compiled with +ruby"
- echohl None
+ s:ErrMsg( "Error: Rubycomplete requires vim compiled with +ruby" )
+ s:ErrMsg( "Error: falling back to syntax completion" )
+ " lets fall back to syntax completion
+ setlocal omnifunc=syntaxcomplete#Complete
finish
endif
if version < 700
- echohl ErrorMsg
- echo "Error: Required vim >= 7.0"
- echohl None
+ s:ErrMsg( "Error: Required vim >= 7.0" )
finish
endif
" }}} requirement checks
+" {{{ configuration failsafe initialization
if !exists("g:rubycomplete_rails")
let g:rubycomplete_rails = 0
endif
@@ -34,76 +35,131 @@ if !exists("g:rubycomplete_classes_in_global")
let g:rubycomplete_classes_in_global = 0
endif
+if !exists("g:rubycomplete_buffer_loading")
+ let g:rubycomplete_classes_in_global = 0
+endif
+
+if !exists("g:rubycomplete_include_object")
+ let g:rubycomplete_include_object = 0
+endif
+
+if !exists("g:rubycomplete_include_objectspace")
+ let g:rubycomplete_include_objectspace = 0
+endif
+" }}} configuration failsafe initialization
+
" {{{ vim-side support functions
-function! GetBufferRubyModule(name)
- let [snum,enum] = GetBufferRubyEntity(a:name, "module")
+let s:rubycomplete_debug = 0
+
+function! s:ErrMsg(msg)
+ echohl ErrorMsg
+ echo a:msg
+ echohl None
+endfunction
+
+function! s:dprint(msg)
+ if s:rubycomplete_debug == 1
+ echom a:msg
+ endif
+endfunction
+
+function! s:GetBufferRubyModule(name, ...)
+ if a:0 == 1
+ let [snum,enum] = s:GetBufferRubyEntity(a:name, "module", a:1)
+ else
+ let [snum,enum] = s:GetBufferRubyEntity(a:name, "module")
+ endif
return snum . '..' . enum
endfunction
-function! GetBufferRubyClass(name)
- let [snum,enum] = GetBufferRubyEntity(a:name, "class")
+function! s:GetBufferRubyClass(name, ...)
+ if a:0 >= 1
+ let [snum,enum] = s:GetBufferRubyEntity(a:name, "class", a:1)
+ else
+ let [snum,enum] = s:GetBufferRubyEntity(a:name, "class")
+ endif
return snum . '..' . enum
endfunction
-function! GetBufferRubySingletonMethods(name)
+function! s:GetBufferRubySingletonMethods(name)
endfunction
-function! GetBufferRubyEntity( name, type )
+function! s:GetBufferRubyEntity( name, type, ... )
+ let lastpos = getpos(".")
+ let lastline = lastpos
+ if (a:0 >= 1)
+ let lastline = [ 0, a:1, 0, 0 ]
+ call cursor( a:1, 0 )
+ endif
+
let stopline = 1
- let crex = '^\s*' . a:type . '\s*' . a:name . '\s*\(<\s*.*\s*\)\?\n*\(\(\s\|#\).*\n*\)*\n*\s*end$'
- let [lnum,lcol] = searchpos( crex, 'nbw')
+
+ let crex = '^\s*\<' . a:type . '\>\s*\<' . a:name . '\>\s*\(<\s*.*\s*\)\?'
+ let [lnum,lcol] = searchpos( crex, 'w' )
+ "let [lnum,lcol] = searchpairpos( crex . '\zs', '', '\(end\|}\)', 'w' )
+
if lnum == 0 && lcol == 0
+ call cursor(lastpos[1], lastpos[2])
return [0,0]
endif
- let [enum,ecol] = searchpos( crex, 'nebw')
+ let curpos = getpos(".")
+ let [enum,ecol] = searchpairpos( crex, '', '\(end\|}\)', 'wr' )
+ call cursor(lastpos[1], lastpos[2])
+
if lnum > enum
- let realdef = getline( lnum )
- let crexb = '^' . realdef . '\n*\(\(\s\|#\).*\n*\)*\n*\s*end$'
- let [enum,ecol] = searchpos( crexb, 'necw' )
+ return [0,0]
endif
" we found a the class def
return [lnum,enum]
endfunction
-function! IsInClassDef()
- let [snum,enum] = GetBufferRubyEntity( '.*', "class" )
+function! s:IsInClassDef()
+ return s:IsPosInClassDef( line('.') )
+endfunction
+
+function! s:IsPosInClassDef(pos)
+ let [snum,enum] = s:GetBufferRubyEntity( '.*', "class" )
let ret = 'nil'
- let pos = line('.')
- if snum < pos && pos < enum
+ if snum < a:pos && a:pos < enum
let ret = snum . '..' . enum
endif
return ret
endfunction
-function! GetRubyVarType(v)
+function! s:GetRubyVarType(v)