updated for version 7.0d02

This commit is contained in:
Bram Moolenaar
2006-04-12 21:52:12 +00:00
parent 4c3f536f47
commit 18144c8423
57 changed files with 5356 additions and 963 deletions

View File

@ -16,6 +16,6 @@ csscomplete.vim HTML / CSS
htmlcomplete.vim HTML
javascriptcomplete.vim Javascript
phpcomplete.vim PHP
pycomplete.vim Python
pythoncomplete.vim Python
syntaxcomplete.vim from syntax highlighting
xmlcomplete.vim XML (uses files in the xml directory)

View File

@ -1,4 +1,4 @@
"pycomplete.vim - Omni Completion for python
"pythoncomplete.vim - Omni Completion for python
" Maintainer: Aaron Griffin
" Version: 0.3
" Last Updated: 23 January 2006
@ -21,7 +21,7 @@ if !has('python')
finish
endif
function! pycomplete#Complete(findstart, base)
function! pythoncomplete#Complete(findstart, base)
"findstart = 1 when we need to get the text length
if a:findstart
let line = getline('.')
@ -43,7 +43,7 @@ function! pycomplete#Complete(findstart, base)
"findstart = 0 when we need to return the list of completions
else
execute "python get_completions('" . a:base . "')"
return g:pycomplete_completions
return g:pythoncomplete_completions
endif
endfunction
@ -64,7 +64,7 @@ LOCALDEFS = \
def dbg(level,msg):
debug_level = 1
try:
debug_level = vim.eval("g:pycomplete_debug_level")
debug_level = vim.eval("g:pythoncomplete_debug_level")
except:
pass
if level <= debug_level: print(msg)
@ -119,9 +119,9 @@ def get_completions(base):
else:
completions.append(all)
#dbg(10,"all completions: %s" % completions)
vim.command("let g:pycomplete_completions = %s" % completions)
vim.command("let g:pythoncomplete_completions = %s" % completions)
except:
vim.command("let g:pycomplete_completions = []")
vim.command("let g:pythoncomplete_completions = []")
#dbg(1,"exception: %s" % sys.exc_info()[1])
clean_up()
@ -346,6 +346,6 @@ sys.path.extend(['.','..'])
PYTHONEOF
endfunction
let g:pycomplete_debug_level = 0
let g:pythoncomplete_debug_level = 0
call s:DefPython()
" vim: set et ts=4:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
let g:xmldata_xsl = {
\ 'apply-imports' : [[], {}],
\ 'apply-templates' : [['sort', 'with-param'], {'select' : [], 'mode' : []}],
\ 'attribute' : [[], {'name' : [], 'namespace' : []}],
\ 'attribute-set' : [['attribute'], {'name' : [], 'use-attribute-sets' : []}],
\ 'call-template' : [['with-param'], {'name' : []}],
\ 'choose' : [['when', 'otherwise'], {}],
\ 'comment' : [[], {}],
\ 'copy' : [[], {'use-attribute-sets' : []}],
\ 'copy-of' : [[], {'select' : []}],
\ 'decimal-format' : [[], {'name' : [], 'decimal-separator' : [], 'grouping-separator' : [], 'infinity' : [], 'minus-sign' : [], 'NaN' : [], 'percent' : [], 'per-mille' : [], 'zero-digit' : [], 'digit' : [], 'pattern-separator' : []}],
\ 'element' : [[], {'name' : [], 'namespace' : [], 'use-attribute-sets' : []}],
\ 'fallback' : [[], {}],
\ 'for-each' : [['sort'], {'select' : []}],
\ 'if' : [[], {'test' : []}],
\ 'import' : [[], {'href' : []}],
\ 'include' : [[], {'href' : []}],
\ 'key' : [[], {'name' : [], 'match' : [], 'use' : []}],
\ 'message' : [[], {'terminate' : ['yes', 'no']}],
\ 'namespace-alias' : [[], {'stylesheet-prefix' : ['#default'], 'result-prefix' : ['#default']}],
\ 'number' : [[], {'level' : ['single', 'multiple', 'any'], 'count' : [], 'from' : [], 'value' : [], 'format' : [], 'lang' : [], 'letter-value' : ['alphabetic', 'traditional'], 'grouping-separator' : [], 'grouping-size' : []}],
\ 'otherwise' : [[], {}],
\ 'output' : [[], {'method' : ['xml', 'html', 'text'], 'version' : [], 'encoding' : [], 'omit-xml-declaration' : ['yes', 'no'], 'standalone' : ['yes', 'no'], 'doctype-public' : [], 'doctype-system' : [], 'cdata-section-elements' : [], 'indent' : ['yes', 'no'], 'media-type' : []}],
\ 'param' : [[], {'name' : [], 'select' : []}],
\ 'preserve-space' : [[], {'elements' : []}],
\ 'processing-instruction' : [[], {'name' : []}],
\ 'sort' : [[], {'select' : [], 'lang' : [], 'data-type' : ['text', 'number'], 'order' : ['ascending', 'descending'], 'case-order' : ['upper-first', 'lower-first']}],
\ 'strip-space' : [[], {'elements' : []}],
\ 'stylesheet' : [['import', 'attribute-set', 'decimal-format', 'include', 'key', 'namespace-alias', 'output', 'param', 'preserve-space', 'strip-space', 'template'], {'id' : [], 'extension-element-prefixes' : [], 'version' : []}],
\ 'template' : [['param'], {'match' : [], 'name' : [], 'priority' : [], 'mode' : []}],
\ 'text' : [[], {'disable-output-escaping' : ['yes', 'no']}],
\ 'transform' : [['import', 'attribute-set', 'decimal-format', 'include', 'key', 'namespace-alias', 'output', 'param', 'preserve-space', 'strip-space', 'template'], {'id' : [], 'extension-element-prefixes' : [], 'exclude-result-prefixes' : [], 'version' : []}],
\ 'value-of' : [[], {'select' : [], 'disable-output-escaping' : ['yes', 'no']}],
\ 'variable' : [[], {'name' : [], 'select' : []}],
\ 'when' : [[], {'test' : []}],
\ 'with-param' : [[], {'name' : [], 'select' : []}]}

View File

@ -1,7 +1,7 @@
" Vim completion script
" Language: XML
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2006 Mar 31
" Last Change: 2006 Apr 12
" This function will create Dictionary with users namespace strings and values
" canonical (system) names of data files. Names should be lowercase,
@ -11,7 +11,7 @@
" Currently supported canonicals are:
" xhtml10s - XHTML 1.0 Strict
" xsl - XSL
function! xmlcomplete#CreateConnection(canonical, ...)
function! xmlcomplete#CreateConnection(canonical, ...) " {{{
" When only one argument provided treat name as default namespace (without
" 'prefix:').
@ -42,14 +42,16 @@ function! xmlcomplete#CreateConnection(canonical, ...)
let g:xmldata_connection[users] = a:canonical
endfunction
" }}}
function! xmlcomplete#CreateEntConnection(...)
function! xmlcomplete#CreateEntConnection(...) " {{{
if a:0 > 0
let g:xmldata_entconnect = a:1
else
let g:xmldata_entconnect = 'DEFAULT'
endif
endfunction
" }}}
function! xmlcomplete#CompleteTags(findstart, base)
if a:findstart
@ -104,7 +106,7 @@ function! xmlcomplete#CompleteTags(findstart, base)
return start
else
" There is no connction of namespace and data file. Abandon action
" There is no connection of namespace and data file. Abandon action
if !exists("g:xmldata_connection") || g:xmldata_connection == {}
return []
endif
@ -305,7 +307,6 @@ function! xmlcomplete#CompleteTags(findstart, base)
endif
" Complete text declaration
let g:co = context
if context =~ '^?'
let tags = ['?xml']
@ -329,7 +330,7 @@ function! xmlcomplete#CompleteTags(findstart, base)
let tags = keys(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]})
call filter(tags, 'v:val !~ "^vimxml"')
else
if !has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}, tag)
if !has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}, opentag)
" Abandon when data file isn't complete
return []
endif
@ -346,6 +347,11 @@ function! xmlcomplete#CompleteTags(findstart, base)
endif
endfor
let menu = res + res2
if b:xml_namespace == 'DEFAULT'
let xml_namespace = ''
else
let xml_namespace = b:xml_namespace.':'
endif
if has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}, 'vimxmltaginfo')
let final_menu = []
for i in range(len(menu))
@ -357,22 +363,18 @@ function! xmlcomplete#CompleteTags(findstart, base)
let m_menu = ''
let m_info = ''
endif
if b:xml_namespace == 'DEFAULT'
let xml_namespace = ''
else
let xml_namespace = b:xml_namespace.':'
endif
let final_menu += [{'word':xml_namespace.item, 'menu':m_menu, 'info':m_info}]
endfor
else
let final_menu = menu
let final_menu = map(menu, 'xml_namespace.v:val')
endif
return final_menu
endif
endfunction
" MM: This is greatly reduced closetag.vim used with kind permission of Steven
" MM: This is severely reduced closetag.vim used with kind permission of Steven
" Mueller
" Changes: strip all comments; delete error messages; add checking for
" namespace
@ -510,3 +512,4 @@ endfunction
function! s:Clearstack(sname)
exe 'let '.a:sname."=''"
endfunction
" vim:set foldmethod=marker: