Update runtime files.

This commit is contained in:
Bram Moolenaar
2014-06-12 21:46:14 +02:00
parent 2d54ec92d4
commit 822ff866bd
17 changed files with 231 additions and 146 deletions

View File

@ -3,7 +3,7 @@
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com ) " Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" URL: https://github.com/shawncplus/phpcomplete.vim " URL: https://github.com/shawncplus/phpcomplete.vim
" Last Change: 2014 May 08 " Last Change: 2014 May 30
" "
" OPTIONS: " OPTIONS:
" "
@ -109,13 +109,12 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
" locate the start of the word " locate the start of the word
let line = getline('.') let line = getline('.')
let start = col('.') - 1 let start = col('.') - 1
let curline = line('.')
let compl_begin = col('.') - 2 let compl_begin = col('.') - 2
while start >= 0 && line[start - 1] =~ '[\\a-zA-Z_0-9\x7f-\xff$]' while start >= 0 && line[start - 1] =~ '[\\a-zA-Z_0-9\x7f-\xff$]'
let start -= 1 let start -= 1
endwhile endwhile
let b:phpbegin = phpbegin let b:phpbegin = phpbegin
let b:compl_context = phpcomplete#GetCurrentInstruction(line('.'), col('.') - 2, phpbegin) let b:compl_context = phpcomplete#GetCurrentInstruction(line('.'), max([0, col('.') - 2]), phpbegin)
return start return start
" We can be also inside of phpString with HTML tags. Deal with " We can be also inside of phpString with HTML tags. Deal with
@ -265,11 +264,11 @@ function! phpcomplete#CompleteUse(base) " {{{
if base !~ '\' if base !~ '\'
let builtin_classnames = filter(keys(copy(g:php_builtin_classnames)), 'v:val =~? "^'.classname_match_pattern.'"') let builtin_classnames = filter(keys(copy(g:php_builtin_classnames)), 'v:val =~? "^'.classname_match_pattern.'"')
for classname in builtin_classnames for classname in builtin_classnames
call add(res, {'word': classname, 'kind': 'c'}) call add(res, {'word': g:php_builtin_classes[tolower(classname)].name, 'kind': 'c'})
endfor endfor
let builtin_interfacenames = filter(keys(copy(g:php_builtin_interfacenames)), 'v:val =~? "^'.classname_match_pattern.'"') let builtin_interfacenames = filter(keys(copy(g:php_builtin_interfacenames)), 'v:val =~? "^'.classname_match_pattern.'"')
for interfacename in builtin_interfacenames for interfacename in builtin_interfacenames
call add(res, {'word': interfacename, 'kind': 'i'}) call add(res, {'word': g:php_builtin_interfaces[tolower(interfacename)].name, 'kind': 'i'})
endfor endfor
endif endif
@ -459,7 +458,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
" Add builtin class names " Add builtin class names
for [classname, info] in items(g:php_builtin_classnames) for [classname, info] in items(g:php_builtin_classnames)
if classname =~? '^'.base if classname =~? '^'.base
let builtin_classnames[leading_slash.classname] = info let builtin_classnames[leading_slash.g:php_builtin_classes[tolower(classname)].name] = info
endif endif
endfor endfor
for [interfacename, info] in items(g:php_builtin_interfacenames) for [interfacename, info] in items(g:php_builtin_interfacenames)
@ -832,7 +831,7 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports)
if has_key(g:php_builtin_classes[tolower(classname)].methods, '__construct') if has_key(g:php_builtin_classes[tolower(classname)].methods, '__construct')
let menu = g:php_builtin_classes[tolower(classname)]['methods']['__construct']['signature'] let menu = g:php_builtin_classes[tolower(classname)]['methods']['__construct']['signature']
endif endif
call add(res, {'word': leading_slash.classname, 'kind': 'c', 'menu': menu}) call add(res, {'word': leading_slash.g:php_builtin_classes[tolower(classname)].name, 'kind': 'c', 'menu': menu})
endfor endfor
endif endif
@ -926,10 +925,10 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) "
\ 'function\s*&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze') \ 'function\s*&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
let f_args = matchstr(i, let f_args = matchstr(i,
\ 'function\s*&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|\_$\)') \ 'function\s*&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|\_$\)')
if f_name != '' if f_name != '' && stridx(f_name, '__') != 0
let c_functions[f_name.'('] = f_args let c_functions[f_name.'('] = f_args
if g:phpcomplete_parse_docblock_comments if g:phpcomplete_parse_docblock_comments
let c_doc[f_name.'('] = phpcomplete#GetDocBlock(a:sccontent, 'function\s*\<'.f_name.'\>') let c_doc[f_name.'('] = phpcomplete#GetDocBlock(a:sccontent, 'function\s*&\?\<'.f_name.'\>')
endif endif
endif endif
endfor endfor
@ -1049,7 +1048,7 @@ function! phpcomplete#CompleteBuiltInClass(context, classname, base) " {{{
if a:context =~ '->$' " complete for everything instance related if a:context =~ '->$' " complete for everything instance related
" methods " methods
for [method_name, method_info] in items(class_info.methods) for [method_name, method_info] in items(class_info.methods)
if a:base == '' || method_name =~? '^'.a:base if stridx(method_name, '__') != 0 && (a:base == '' || method_name =~? '^'.a:base)
call add(res, {'word':method_name.'(', 'kind': 'f', 'menu': method_info.signature, 'info': method_info.signature }) call add(res, {'word':method_name.'(', 'kind': 'f', 'menu': method_info.signature, 'info': method_info.signature })
endif endif
endfor endfor
@ -1317,7 +1316,7 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
return unknown_result return unknown_result
elseif filereadable(classlocation) elseif classlocation != '' && filereadable(classlocation)
" Read the next method from the stack and extract only the name " Read the next method from the stack and extract only the name
let classcontents = phpcomplete#GetCachedClassContents(classlocation, classname_candidate) let classcontents = phpcomplete#GetCachedClassContents(classlocation, classname_candidate)
@ -1325,7 +1324,7 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
" Get Structured information of all classes and subclasses including namespace and includes " Get Structured information of all classes and subclasses including namespace and includes
" try to find the method's return type in docblock comment " try to find the method's return type in docblock comment
for classstructure in classcontents for classstructure in classcontents
let doclock_target_pattern = 'function\s\+'.method.'\|\(public\|private\|protected\|var\).\+\$'.method let doclock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), doclock_target_pattern) let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), doclock_target_pattern)
if doc_str != '' if doc_str != ''
break break
@ -1357,7 +1356,14 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
else else
let fullnamespace = class_candidate_namespace let fullnamespace = class_candidate_namespace
endif endif
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(returnclass, fullnamespace, a:imports) " make @return self, static, $this the same way
" (not exactly what php means by these)
if returnclass == 'self' || returnclass == 'static' || returnclass == '$this'
let classname_candidate = a:classname_candidate
let class_candidate_namespace = a:class_candidate_namespace
else
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(returnclass, fullnamespace, a:imports)
endif
endif endif
return phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, a:imports, methodstack) return phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, a:imports, methodstack)
@ -1496,9 +1502,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
let return_type = matchstr(g:php_builtin_functions[function_name.'('], '\v\|\s+\zs.+$') let return_type = matchstr(g:php_builtin_functions[function_name.'('], '\v\|\s+\zs.+$')
let classname_candidate = return_type let classname_candidate = return_type
let class_candidate_namespace = '\' let class_candidate_namespace = '\'
else elseif function_file != '' && filereadable(function_file)
let file_lines = readfile(function_file) let file_lines = readfile(function_file)
let docblock_str = phpcomplete#GetDocBlock(file_lines, 'function\s*\<'.function_name.'\>') let docblock_str = phpcomplete#GetDocBlock(file_lines, 'function\s*&\?\<'.function_name.'\>')
let docblock = phpcomplete#ParseDocBlock(docblock_str) let docblock = phpcomplete#ParseDocBlock(docblock_str)
if has_key(docblock.return, 'type') if has_key(docblock.return, 'type')
let classname_candidate = docblock.return.type let classname_candidate = docblock.return.type
@ -1514,32 +1520,35 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
endif endif
else else
" extract the variable name from the context
let object = methodstack[0]
let object_is_array = (object =~ '\v^[^[]+\[' ? 1 : 0)
let object = matchstr(object, variable_name_pattern)
" check Constant lookup " check Constant lookup
let constant_object = matchstr(a:context, '\zs'.class_name_pattern.'\ze::') let constant_object = matchstr(a:context, '\zs'.class_name_pattern.'\ze::')
if constant_object != '' if constant_object != ''
let classname_candidate = constant_object let classname_candidate = constant_object
endif endif
" extract the variable name from the context if classname_candidate == ''
let object = methodstack[0] " scan the file backwards from current line for explicit type declaration (@var $variable Classname)
let object_is_array = (object =~ '\v^[^[]+\[' ? 1 : 0) let i = 1 " start from the current line - 1
let object = matchstr(object, variable_name_pattern) while i < a:start_line
let line = getline(a:start_line - i)
" scan the file backwards from current line for explicit type declaration (@var $variable Classname) " in file lookup for /* @var $foo Class */
let i = 1 " start from the current line - 1 if line =~# '@var\s\+'.object.'\s\+'.class_name_pattern
while i < a:start_line let classname_candidate = matchstr(line, '@var\s\+'.object.'\s\+\zs'.class_name_pattern.'\(\[\]\)\?')
let line = getline(a:start_line - i) let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
" in file lookup for /* @var $foo Class */ break
if line =~# '@var\s\+'.object.'\s\+'.class_name_pattern elseif line !~ '^\s*$'
let classname_candidate = matchstr(line, '@var\s\+'.object.'\s\+\zs'.class_name_pattern.'\(\[\]\)\?') " type indicator comments should be next to the variable
break " non empty lines break the search
elseif line !~ '^\s*$' break
" type indicator comments should be next to the variable endif
" non empty lines break the search let i += 1
break endwhile
endif endif
let i += 1
endwhile
if classname_candidate != '' if classname_candidate != ''
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack) let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack)
@ -1549,7 +1558,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
" scan the file backwards from the current line " scan the file backwards from the current line
let i = 1 let i = 1
while i < a:start_line while i < a:start_line " {{{
let line = getline(a:start_line - i) let line = getline(a:start_line - i)
" do in-file lookup of $var = new Class " do in-file lookup of $var = new Class
@ -1661,9 +1670,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
let classname_candidate = return_type let classname_candidate = return_type
let class_candidate_namespace = '\' let class_candidate_namespace = '\'
break break
else elseif function_file != '' && filereadable(function_file)
let file_lines = readfile(function_file) let file_lines = readfile(function_file)
let docblock_str = phpcomplete#GetDocBlock(file_lines, 'function\s*\<'.function_name.'\>') let docblock_str = phpcomplete#GetDocBlock(file_lines, 'function\s*&\?\<'.function_name.'\>')
let docblock = phpcomplete#ParseDocBlock(docblock_str) let docblock = phpcomplete#ParseDocBlock(docblock_str)
if has_key(docblock.return, 'type') if has_key(docblock.return, 'type')
let classname_candidate = docblock.return.type let classname_candidate = docblock.return.type
@ -1713,7 +1722,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
endif endif
let i += 1 let i += 1
endwhile endwhile " }}}
if classname_candidate != '' if classname_candidate != ''
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack) let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack)
@ -1784,6 +1793,7 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{
return no_namespace_candidate return no_namespace_candidate
endif endif
return ''
endfunction endfunction
" }}} " }}}
@ -1794,11 +1804,12 @@ function! phpcomplete#GetFunctionLocation(function_name, namespace) " {{{
return 'VIMPHP_BUILTINFUNCTION' return 'VIMPHP_BUILTINFUNCTION'
endif endif
" do in-file lookup for function definition " do in-file lookup for function definition
let i = 1 let i = 1
let buffer_lines = getline(1, line('$')) let buffer_lines = getline(1, line('$'))
for line in buffer_lines for line in buffer_lines
if line =~? '^\s*function\s\+'.a:function_name.'\s*(' if line =~? '^\s*function\s\+&\?'.a:function_name.'\s*('
return expand('%:p') return expand('%:p')
endif endif
endfor endfor
@ -1826,6 +1837,8 @@ function! phpcomplete#GetFunctionLocation(function_name, namespace) " {{{
if no_namespace_candidate != '' if no_namespace_candidate != ''
return no_namespace_candidate return no_namespace_candidate
endif endif
return ''
endfunction endfunction
" }}} " }}}
@ -1916,7 +1929,7 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
silent! below 1new silent! below 1new
silent! 0put =cfile silent! 0put =cfile
call search('\(class\|interface\)\s\+'.a:class_name.'\(\>\|$\)') call search('\(class\|interface\)\_s\+'.a:class_name.'\(\>\|$\)')
let cfline = line('.') let cfline = line('.')
call search('{') call search('{')
let endline = line('.') let endline = line('.')
@ -1949,7 +1962,7 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
let namespace = '\' let namespace = '\'
endif endif
let classlocation = phpcomplete#GetClassLocation(extends_class, namespace) let classlocation = phpcomplete#GetClassLocation(extends_class, namespace)
if filereadable(classlocation) if classlocation != '' && filereadable(classlocation)
let full_file_path = fnamemodify(classlocation, ':p') let full_file_path = fnamemodify(classlocation, ':p')
let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), extends_class) let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), extends_class)
elseif tolower(current_namespace) == tolower(namespace) elseif tolower(current_namespace) == tolower(namespace)
@ -2266,7 +2279,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
if has_key(g:php_builtin_classnames, tolower(import.name)) if has_key(g:php_builtin_classnames, tolower(import.name))
let import['kind'] = 'c' let import['kind'] = 'c'
let import['builtin'] = 1 let import['builtin'] = 1
elseif has_key(g:php_builtin_interfaces, import.name) elseif has_key(g:php_builtin_interfacenames, tolower(import.name))
let import['kind'] = 'i' let import['kind'] = 'i'
let import['builtin'] = 1 let import['builtin'] = 1
else else
@ -2494,7 +2507,7 @@ for [classname, class_info] in items(g:php_builtin_classes)
endif endif
endfor endfor
let g:php_builtin_classnames[class_info.name] = '' let g:php_builtin_classnames[classname] = ''
for [method_name, method_info] in items(class_info.methods) for [method_name, method_info] in items(class_info.methods)
let g:php_builtin_object_functions[classname.'::'.method_name.'('] = method_info.signature let g:php_builtin_object_functions[classname.'::'.method_name.'('] = method_info.signature
endfor endfor
@ -2513,10 +2526,10 @@ for [interfacename, info] in items(g:php_builtin_interfaces)
let g:php_builtin_interfacenames[interfacename] = '' let g:php_builtin_interfacenames[interfacename] = ''
for [method_name, method_info] in items(class_info.methods) for [method_name, method_info] in items(class_info.methods)
let g:php_builtin_object_functions[classname.'::'.method_name.'('] = method_info.signature let g:php_builtin_object_functions[interfacename.'::'.method_name.'('] = method_info.signature
endfor endfor
for [method_name, method_info] in items(class_info.static_methods) for [method_name, method_info] in items(class_info.static_methods)
let g:php_builtin_object_functions[classname.'::'.method_name.'('] = method_info.signature let g:php_builtin_object_functions[interfacename.'::'.method_name.'('] = method_info.signature
endfor endfor
endfor endfor

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.4. Last change: 2014 May 07 *eval.txt* For Vim version 7.4. Last change: 2014 Jun 12
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -3260,6 +3260,10 @@ getchar([expr]) *getchar()*
String when a modifier (shift, control, alt) was used that is String when a modifier (shift, control, alt) was used that is
not included in the character. not included in the character.
When [expr] is 0 and Esc is typed, there will be a short delay
while Vim waits to see if this is the start of an escape
sequence.
When [expr] is 1 only the first byte is returned. For a When [expr] is 1 only the first byte is returned. For a
one-byte character it is the character itself as a number. one-byte character it is the character itself as a number.
Use nr2char() to convert it to a String. Use nr2char() to convert it to a String.
@ -3475,6 +3479,34 @@ getmatches() *getmatches()*
'pattern': 'FIXME', 'priority': 10, 'id': 2}] > 'pattern': 'FIXME', 'priority': 10, 'id': 2}] >
:unlet m :unlet m
< <
*getpid()*
getpid() Return a Number which is the process ID of the Vim process.
On Unix and MS-Windows this is a unique number, until Vim
exits. On MS-DOS it's always zero.
*getpos()*
getpos({expr}) Get the position for {expr}. For possible values of {expr}
see |line()|. For getting the cursor position see
|getcurpos()|.
The result is a |List| with four numbers:
[bufnum, lnum, col, off]
"bufnum" is zero, unless a mark like '0 or 'A is used, then it
is the buffer number of the mark.
"lnum" and "col" are the position in the buffer. The first
column is 1.
The "off" number is zero, unless 'virtualedit' is used. Then
it is the offset in screen columns from the start of the
character. E.g., a position within a <Tab> or after the last
character.
Note that for '< and '> Visual mode matters: when it is "V"
(visual line mode) the column of '< is zero and the column of
'> is a large number.
This can be used to save and restore the position of a mark: >
let save_a_mark = getpos("'a")
...
call setpos(''a', save_a_mark
< Also see |getcurpos()| and |setpos()|.
getqflist() *getqflist()* getqflist() *getqflist()*
Returns a list with all the current quickfix errors. Each Returns a list with all the current quickfix errors. Each
@ -4506,34 +4538,6 @@ nr2char({expr}[, {utf8}]) *nr2char()*
characters. nr2char(0) is a real NUL and terminates the characters. nr2char(0) is a real NUL and terminates the
string, thus results in an empty string. string, thus results in an empty string.
*getpid()*
getpid() Return a Number which is the process ID of the Vim process.
On Unix and MS-Windows this is a unique number, until Vim
exits. On MS-DOS it's always zero.
*getpos()*
getpos({expr}) Get the position for {expr}. For possible values of {expr}
see |line()|. For getting the cursor position see
|getcurpos()|.
The result is a |List| with four numbers:
[bufnum, lnum, col, off]
"bufnum" is zero, unless a mark like '0 or 'A is used, then it
is the buffer number of the mark.
"lnum" and "col" are the position in the buffer. The first
column is 1.
The "off" number is zero, unless 'virtualedit' is used. Then
it is the offset in screen columns from the start of the
character. E.g., a position within a <Tab> or after the last
character.
Note that for '< and '> Visual mode matters: when it is "V"
(visual line mode) the column of '< is zero and the column of
'> is a large number.
This can be used to save and restore the position of a mark: >
let save_a_mark = getpos("'a")
...
call setpos(''a', save_a_mark
< Also see |getcurpos()| and |setpos()|.
or({expr}, {expr}) *or()* or({expr}, {expr}) *or()*
Bitwise OR on the two arguments. The arguments are converted Bitwise OR on the two arguments. The arguments are converted
to a number. A List, Dict or Float argument causes an error. to a number. A List, Dict or Float argument causes an error.
@ -5587,6 +5591,7 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702*
If you want a list to remain unmodified make a copy first: > If you want a list to remain unmodified make a copy first: >
:let sortedlist = sort(copy(mylist)) :let sortedlist = sort(copy(mylist))
< Uses the string representation of each item to sort on. < Uses the string representation of each item to sort on.
Numbers sort after Strings, |Lists| after Numbers. Numbers sort after Strings, |Lists| after Numbers.
For sorting text in the current buffer use |:sort|. For sorting text in the current buffer use |:sort|.

View File

@ -1,4 +1,4 @@
*intro.txt* For Vim version 7.4. Last change: 2013 Jun 17 *intro.txt* For Vim version 7.4. Last change: 2014 May 24
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -136,9 +136,10 @@ http://www.vim.org/maillist.php
Bug reports: *bugs* *bug-reports* *bugreport.vim* Bug reports: *bugs* *bug-reports* *bugreport.vim*
Send bug reports to: Vim Developers <vim_dev@vim.org> Send bug reports to: Vim Developers <vim_dev@vim.org>
This is a maillist, many people will see the message. If you don't want that, This is a maillist, you need to become a member first and many people will see
e.g. because it is a security issue, send it to <bugs@vim.org>, this only goes the message. If you don't want that, e.g. because it is a security issue,
to the Vim maintainer (that's Bram). send it to <bugs@vim.org>, this only goes to the Vim maintainer (that's Bram).
Please be brief; all the time that is spent on answering mail is subtracted Please be brief; all the time that is spent on answering mail is subtracted
from the time that is spent on improving Vim! Always give a reproducible from the time that is spent on improving Vim! Always give a reproducible
example and try to find out which settings or other things influence the example and try to find out which settings or other things influence the

View File

@ -1,4 +1,4 @@
*map.txt* For Vim version 7.4. Last change: 2014 May 10 *map.txt* For Vim version 7.4. Last change: 2014 Jun 02
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -60,17 +60,17 @@ modes.
{rhs}, is then further scanned for mappings. This {rhs}, is then further scanned for mappings. This
allows for nested and recursive use of mappings. allows for nested and recursive use of mappings.
*:nore* *:norem*
:no[remap] {lhs} {rhs} |mapmode-nvo| *:no* *:noremap* :no[remap] {lhs} {rhs} |mapmode-nvo| *:no* *:noremap* *:nor*
:nn[oremap] {lhs} {rhs} |mapmode-n| *:nn* *:nnoremap* :nn[oremap] {lhs} {rhs} |mapmode-n| *:nn* *:nnoremap*
:vn[oremap] {lhs} {rhs} |mapmode-v| *:vn* *:vnoremap* :vn[oremap] {lhs} {rhs} |mapmode-v| *:vn* *:vnoremap*
:xn[oremap] {lhs} {rhs} |mapmode-x| *:xn* *:xnoremap* :xn[oremap] {lhs} {rhs} |mapmode-x| *:xn* *:xnoremap*
:snor[emap] {lhs} {rhs} |mapmode-s| *:snor* *:snoremap* :snor[emap] {lhs} {rhs} |mapmode-s| *:snor* *:snoremap*
:ono[remap] {lhs} {rhs} |mapmode-o| *:ono* *:onoremap* :ono[remap] {lhs} {rhs} |mapmode-o| *:ono* *:onoremap*
:no[remap]! {lhs} {rhs} |mapmode-ic| *:no!* *:noremap!* :no[remap]! {lhs} {rhs} |mapmode-ic| *:no!* *:noremap!*
:ino[remap] {lhs} {rhs} |mapmode-i| *:ino* *:inoremap* :ino[remap] {lhs} {rhs} |mapmode-i| *:ino* *:inoremap*
:ln[oremap] {lhs} {rhs} |mapmode-l| *:ln* *:lnoremap* :ln[oremap] {lhs} {rhs} |mapmode-l| *:ln* *:lnoremap*
:cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnoremap* :cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnoremap*
Map the key sequence {lhs} to {rhs} for the modes Map the key sequence {lhs} to {rhs} for the modes
where the map command applies. Disallow mapping of where the map command applies. Disallow mapping of
{rhs}, to avoid nested and recursive mappings. Often {rhs}, to avoid nested and recursive mappings. Often
@ -828,12 +828,10 @@ Here is an example that counts the number of spaces with <F4>: >
let &selection = "inclusive" let &selection = "inclusive"
let reg_save = @@ let reg_save = @@
if a:0 " Invoked from Visual mode, use '< and '> marks. if a:0 " Invoked from Visual mode, use gv command.
silent exe "normal! `<" . a:type . "`>y" silent exe "normal! gvy"
elseif a:type == 'line' elseif a:type == 'line'
silent exe "normal! '[V']y" silent exe "normal! '[V']y"
elseif a:type == 'block'
silent exe "normal! `[\<C-V>`]y"
else else
silent exe "normal! `[v`]y" silent exe "normal! `[v`]y"
endif endif

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 7.4. Last change: 2014 May 13 *options.txt* For Vim version 7.4. Last change: 2014 May 28
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar

View File

@ -1,4 +1,4 @@
*pattern.txt* For Vim version 7.4. Last change: 2014 May 13 *pattern.txt* For Vim version 7.4. Last change: 2014 May 28
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -1332,7 +1332,7 @@ Finally, these constructs are unique to Perl:
patterns defined by both |matchadd()| and |:match|. patterns defined by both |matchadd()| and |:match|.
Highlighting matches using |:match| are limited to three Highlighting matches using |:match| are limited to three
matches (aside from |:match|, |:2match| and |:3match|are matches (aside from |:match|, |:2match| and |:3match| are
available). |matchadd()| does not have this limitation and in available). |matchadd()| does not have this limitation and in
addition makes it possible to prioritize matches. addition makes it possible to prioritize matches.

View File

@ -1,4 +1,4 @@
*syntax.txt* For Vim version 7.4. Last change: 2014 Apr 05 *syntax.txt* For Vim version 7.4. Last change: 2014 Jun 03
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -2279,7 +2279,7 @@ files, you may set the 'perl_include_pod' option to 0: >
:let perl_include_pod = 0 :let perl_include_pod = 0
The reduce the complexity of parsing (and increase performance) you can switch To reduce the complexity of parsing (and increase performance) you can switch
off two elements in the parsing of variable names and contents. > off two elements in the parsing of variable names and contents. >
To handle package references in variable and function names not differently To handle package references in variable and function names not differently

View File

@ -2523,6 +2523,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:noautocmd autocmd.txt /*:noautocmd* :noautocmd autocmd.txt /*:noautocmd*
:noh pattern.txt /*:noh* :noh pattern.txt /*:noh*
:nohlsearch pattern.txt /*:nohlsearch* :nohlsearch pattern.txt /*:nohlsearch*
:nor map.txt /*:nor*
:norea map.txt /*:norea* :norea map.txt /*:norea*
:noreabbrev map.txt /*:noreabbrev* :noreabbrev map.txt /*:noreabbrev*
:noremap map.txt /*:noremap* :noremap map.txt /*:noremap*
@ -4795,6 +4796,7 @@ argidx() eval.txt /*argidx()*
arglist editing.txt /*arglist* arglist editing.txt /*arglist*
arglist-position editing.txt /*arglist-position* arglist-position editing.txt /*arglist-position*
arglist-quit usr_07.txt /*arglist-quit* arglist-quit usr_07.txt /*arglist-quit*
arglistid() eval.txt /*arglistid()*
argument-list editing.txt /*argument-list* argument-list editing.txt /*argument-list*
argv() eval.txt /*argv()* argv() eval.txt /*argv()*
as motion.txt /*as* as motion.txt /*as*
@ -6128,6 +6130,7 @@ getcharmod() eval.txt /*getcharmod()*
getcmdline() eval.txt /*getcmdline()* getcmdline() eval.txt /*getcmdline()*
getcmdpos() eval.txt /*getcmdpos()* getcmdpos() eval.txt /*getcmdpos()*
getcmdtype() eval.txt /*getcmdtype()* getcmdtype() eval.txt /*getcmdtype()*
getcurpos() eval.txt /*getcurpos()*
getcwd() eval.txt /*getcwd()* getcwd() eval.txt /*getcwd()*
getfontname() eval.txt /*getfontname()* getfontname() eval.txt /*getfontname()*
getfperm() eval.txt /*getfperm()* getfperm() eval.txt /*getfperm()*

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.4. Last change: 2014 May 22 *todo.txt* For Vim version 7.4. Last change: 2014 Jun 12
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -50,6 +50,8 @@ Regexp problems:
Problem that a previous silent ":throw" causes a following try/catch not to Problem that a previous silent ":throw" causes a following try/catch not to
work. (ZyX, 2013 Sep 28) work. (ZyX, 2013 Sep 28)
Completion for :buf does not use 'wildignorecase'. (Akshay H, 2014 May 31)
":cd C:\Windows\System32\drivers\etc*" does not work, even though the ":cd C:\Windows\System32\drivers\etc*" does not work, even though the
directory exists. (Sergio Gallelli, 2013 Dec 29) directory exists. (Sergio Gallelli, 2013 Dec 29)
@ -60,13 +62,28 @@ Setting 'ttymouse' empty causes Dec mouse to be detected. (Elijah Griffin,
Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
Value returned by virtcol() changes depending on how lines wrap. This is
inconsistant with the documentation.
Serbian translation of the vimtutor. (Ivan Nejgebauer, 2014 Jun 2)
Patch to add matchaddpos(), match using a position instead of a pattern.
To be used for matchparen. (Alexey Radkov, 2014 Jun 1)
Waiting for tests. Some on Jun 2.
MS-Windows: Crash opening very long file name starting with "\\". MS-Windows: Crash opening very long file name starting with "\\".
(Christian Brock, 2012 Jun 29) (Christian Brock, 2012 Jun 29)
Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21) Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21)
Patch to translate 0xce in K_NUL 3. (Yasuhiro Matsumoto, 2014 June 6)
Doesn't work yet.
Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19) Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19)
"hi link" does not respect groups with GUI settings only. (Mark Lodato, 2014
Jun 8)
Syntax file for gnuplot. Existing one is very old. (Andrew Rasmussen, 2014 Syntax file for gnuplot. Existing one is very old. (Andrew Rasmussen, 2014
Feb 24) Feb 24)
@ -90,7 +107,7 @@ Also fixes wrong result from executable().
Update from Ken Takata, 2014 Jan 10. Newer 2014 Apr 3. Update from Ken Takata, 2014 Jan 10. Newer 2014 Apr 3.
Win32: use 64 bit stat() if possible. (Ken Takata, 2014 May 12) Win32: use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
More tests May 14. More tests May 14. Update May 29.
Idea: For a window in the middle (has window above and below it), use Idea: For a window in the middle (has window above and below it), use
right-mouse-drag on the status line to move a window up/down without changing right-mouse-drag on the status line to move a window up/down without changing
@ -99,22 +116,23 @@ it's height? It's like dragging the status bar above it at the same time.
Can we make ":unlet $VAR" use unsetenv() to delete the env var? Can we make ":unlet $VAR" use unsetenv() to delete the env var?
What for systems that don't have unsetenv()? What for systems that don't have unsetenv()?
Patch to make getchar() work for typing Esc. (Yasuhiro Matsumoto, 2014 May 13)
Patch for problem that v:register is set to '_' after deleting into the black
hole register.
This does not give an error: (Andre Sihera, 2014 Mar 21) This does not give an error: (Andre Sihera, 2014 Mar 21)
vim -u NONE 1 2 3 -c 'bufdo if 1 | echo 1' vim -u NONE 1 2 3 -c 'bufdo if 1 | echo 1'
This neither: (ZyX) This neither: (ZyX)
vim -u NONE 1 2 3 -c 'bufdo while 1 | echo 1' vim -u NONE 1 2 3 -c 'bufdo while 1 | echo 1'
Patch for signs in GTK. (Christian Brabandt, 2014 Jun 10)
Asked about it.
'viewdir' default on MS-Windows is not a good choice, it's a system directory. 'viewdir' default on MS-Windows is not a good choice, it's a system directory.
Change 'viewdir' to "$HOME/vimfiles/view" and use 'viewdiralt' to also read Change 'viewdir' to "$HOME/vimfiles/view" and use 'viewdiralt' to also read
from? from?
Patch to add arglistid(), get the ID of the currently used argument list. Problem with upwards search on Windows (works OK on Linux). (Brett Stahlman,
(Marcin Szamotulski, 2014 Apr 27) 2014 Jun 8)
When 'clipboard' is "unnamed", :g/pat/d is very slow. Only set the clipboard
after the last delete? (Praful, 2014 May 28)
Include a plugin manager with Vim? Neobundle seems to be the best currently. Include a plugin manager with Vim? Neobundle seems to be the best currently.
Long message about this from ZyX, 2014 Mar 23. And following replies. Long message about this from ZyX, 2014 Mar 23. And following replies.
@ -153,16 +171,6 @@ Out of scope:
Setting the spell file in a session only reads the local additions, not the Setting the spell file in a session only reads the local additions, not the
normal spell file. (Enno Nagel, 2014 Mar 29) normal spell file. (Enno Nagel, 2014 Mar 29)
- Patch for 'breakindent' option: repeat indent for wrapped line. (Vaclav
Smilauer, 2004 Sep 13, fix Oct 31, update 2007 May 30)
Version for latest MacVim: Tobia Conforto, 2009 Nov 23
More recent version: https://retracile.net/wiki/VimBreakIndent
Posted to vim-dev by Taylor Hedberg, 2011 Nov 25
Update by Taylor Hedberg, 2013 May 30.
Updated for Vim 7.4 by Ken Takata, 2013 Oct 5.
Update by Christian Brabandt, 2014 May 9. Remarks by Ken Takata.
Update by Christian 2014 May 12, github link on May 15
When typing the first character of a command, e.g. "f", then using a menu, the When typing the first character of a command, e.g. "f", then using a menu, the
menu item doesn't work. Clear typeahead when using a menu? menu item doesn't work. Clear typeahead when using a menu?
@ -176,9 +184,10 @@ VMS: Select() doesn't work properly, typing ESC may hang Vim. Use sys$qiow
instead. (Samuel Ferencik, 2013 Sep 28) instead. (Samuel Ferencik, 2013 Sep 28)
Patch for XDG base directory support. (Jean François Bignolles, 2014 Mar 4) Patch for XDG base directory support. (Jean François Bignolles, 2014 Mar 4)
Remark on the docs. Should not be a compile time feature. But then what?
Patch to add flag to shortmess to avoid giving completion messages. Completion of ":e" is ":earlier", whould be ":edit". Complete to the matching
(Shougo Matsu, 2014 Jan 6, update Jan 11) command instead of doing this alphabetically. (Mikel Jorgensen)
Patch to add v:completed_item. (Shougo Matsu, 2013 Nov 29). Patch to add v:completed_item. (Shougo Matsu, 2013 Nov 29).
@ -314,6 +323,17 @@ Issue 28.
Patch to fix that 'cedit' is recognized after :normal. (Christian Brabandt, Patch to fix that 'cedit' is recognized after :normal. (Christian Brabandt,
2013 Mar 19, later message) 2013 Mar 19, later message)
- Patch for 'breakindent' option: repeat indent for wrapped line. (Vaclav
Smilauer, 2004 Sep 13, fix Oct 31, update 2007 May 30)
Version for latest MacVim: Tobia Conforto, 2009 Nov 23
More recent version: https://retracile.net/wiki/VimBreakIndent
Posted to vim-dev by Taylor Hedberg, 2011 Nov 25
Update by Taylor Hedberg, 2013 May 30.
Updated for Vim 7.4 by Ken Takata, 2013 Oct 5.
Update by Christian Brabandt, 2014 May 9. Remarks by Ken Takata.
Update by Christian 2014 May 12, github link on May 15
2014 May 28: remarks from Bram
Patch to view coverage of the tests. (Nazri Ramliy, 2013 Feb 15) Patch to view coverage of the tests. (Nazri Ramliy, 2013 Feb 15)
Patch to invert characters differently in GTK. (Yukihiro Nakadaira, 2013 May Patch to invert characters differently in GTK. (Yukihiro Nakadaira, 2013 May
@ -358,9 +378,6 @@ Patch by Christian Brabandt, 2013 Apr 20, unfinished.
Bug: findfile("any", "file:///tmp;") does not work. Bug: findfile("any", "file:///tmp;") does not work.
v:register is not directly reset to " after a delete command that specifies a
register. It is reset after the next command. (Steve Vermeulen, 2013 Mar 16)
'ff' is wrong for one-line file without EOL. (Issue 77) 'ff' is wrong for one-line file without EOL. (Issue 77)
Patch to set antialiasing style on Windows. (Ondrej Balaz, 2013 Mar 14) Patch to set antialiasing style on Windows. (Ondrej Balaz, 2013 Mar 14)
@ -791,10 +808,6 @@ setpos() does not restore cursor position after :normal. (Tyru, 2010 Aug 11)
file names unique, also support this for 'backupdir'. (Mikolaj Machowski) file names unique, also support this for 'backupdir'. (Mikolaj Machowski)
Patch by Christian Brabandt, 2010 Oct 21. Patch by Christian Brabandt, 2010 Oct 21.
getpos()/setpos() don't include curswant. getpos() could return a fifth
element. setpos() could accept an optional fifth element.
Patch by Christian Brabandt, 2010 Sep 6. Again 2013 Aug 22.
With "tw=55 fo+=a" typing space before ) doesn't work well. (Scott Mcdermott, With "tw=55 fo+=a" typing space before ) doesn't work well. (Scott Mcdermott,
2010 Oct 24) 2010 Oct 24)

View File

@ -1,4 +1,4 @@
*undo.txt* For Vim version 7.4. Last change: 2013 Sep 08 *undo.txt* For Vim version 7.4. Last change: 2014 May 24
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -97,9 +97,9 @@ change but joins in with the previous change use this command:
or redo. or redo.
{not in Vi} {not in Vi}
This is most useful when you need to prompt the user halfway a change. For This is most useful when you need to prompt the user halfway through a change.
example in a function that calls |getchar()|. Do make sure that there was a For example in a function that calls |getchar()|. Do make sure that there was
related change before this that you must join with. a related change before this that you must join with.
This doesn't work by itself, because the next key press will start a new This doesn't work by itself, because the next key press will start a new
change again. But you can do something like this: > change again. But you can do something like this: >

View File

@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 7.4. Last change: 2014 Apr 05 *usr_41.txt* For Vim version 7.4. Last change: 2014 May 28
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@ -708,6 +708,7 @@ Cursor and mark position: *cursor-functions* *mark-functions*
cursor() position the cursor at a line/column cursor() position the cursor at a line/column
screencol() get screen column of the cursor screencol() get screen column of the cursor
screenrow() get screen row of the cursor screenrow() get screen row of the cursor
getcurpos() get position of the cursor
getpos() get position of cursor, mark, etc. getpos() get position of cursor, mark, etc.
setpos() set position of cursor, mark, etc. setpos() set position of cursor, mark, etc.
byte2line() get line number at a specific byte count byte2line() get line number at a specific byte count

View File

@ -1,7 +1,7 @@
" Vim support file to detect file types " Vim support file to detect file types
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2014 Feb 26 " Last Change: 2014 Jun 12
" Listen very carefully, I will say this only once " Listen very carefully, I will say this only once
if exists("did_load_filetypes") if exists("did_load_filetypes")
@ -1013,6 +1013,9 @@ au BufNewFile,BufRead *.kix setf kix
" Kimwitu[++] " Kimwitu[++]
au BufNewFile,BufRead *.k setf kwt au BufNewFile,BufRead *.k setf kwt
" Kivy
au BufNewFile,BufRead *.kv setf kivy
" KDE script " KDE script
au BufNewFile,BufRead *.ks setf kscript au BufNewFile,BufRead *.ks setf kscript

View File

@ -2,7 +2,7 @@
" You can also use this as a start for your own set of menus. " You can also use this as a start for your own set of menus.
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2013 May 17 " Last Change: 2014 May 22
" Note that ":an" (short for ":anoremenu") is often used to make a menu work " Note that ":an" (short for ":anoremenu") is often used to make a menu work
" in all modes and avoid side effects from mappings defined by the user. " in all modes and avoid side effects from mappings defined by the user.
@ -477,6 +477,7 @@ if has("folding")
an 40.340.110 &Tools.&Folding.&Enable/Disable\ folds<Tab>zi zi an 40.340.110 &Tools.&Folding.&Enable/Disable\ folds<Tab>zi zi
an 40.340.120 &Tools.&Folding.&View\ Cursor\ Line<Tab>zv zv an 40.340.120 &Tools.&Folding.&View\ Cursor\ Line<Tab>zv zv
an 40.340.120 &Tools.&Folding.Vie&w\ Cursor\ Line\ only<Tab>zMzx zMzx an 40.340.120 &Tools.&Folding.Vie&w\ Cursor\ Line\ only<Tab>zMzx zMzx
inoremenu 40.340.120 &Tools.&Folding.Vie&w\ Cursor\ Line\ only<Tab>zMzx <C-O>zM<C-O>zx
an 40.340.130 &Tools.&Folding.C&lose\ more\ folds<Tab>zm zm an 40.340.130 &Tools.&Folding.C&lose\ more\ folds<Tab>zm zm
an 40.340.140 &Tools.&Folding.&Close\ all\ folds<Tab>zM zM an 40.340.140 &Tools.&Folding.&Close\ all\ folds<Tab>zM zM
an 40.340.150 &Tools.&Folding.O&pen\ more\ folds<Tab>zr zr an 40.340.150 &Tools.&Folding.O&pen\ more\ folds<Tab>zr zr

View File

@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: C " Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2013 Jul 05 " Last Change: 2014 May 26
" Quit when a (custom) syntax file was already loaded " Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax") if exists("b:current_syntax")
@ -322,6 +322,9 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
syn keyword cConstant TMP_MAX stderr stdin stdout syn keyword cConstant TMP_MAX stderr stdin stdout
syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
" POSIX 2001
syn keyword cConstant SIGBUS SIGPOLL SIGPROF SIGSYS SIGURG
syn keyword cConstant SIGVTALRM SIGXCPU SIGXFSZ
" Add POSIX errors as well " Add POSIX errors as well
syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY
syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT

View File

@ -2,7 +2,7 @@
" Language: J " Language: J
" Maintainer: David Bürgin <676c7473@gmail.com> " Maintainer: David Bürgin <676c7473@gmail.com>
" URL: https://github.com/glts/vim-j " URL: https://github.com/glts/vim-j
" Last Change: 2014-04-05 " Last Change: 2014-05-25
if exists('b:current_syntax') if exists('b:current_syntax')
finish finish
@ -46,7 +46,7 @@ syntax match jStdlibVerb /\<\%(assert\|break\|do\)\>\.\@!/
" All in all, a compromise between correctness and practicality had to be " All in all, a compromise between correctness and practicality had to be
" made. See http://www.jsoftware.com/help/dictionary/dcons.htm for reference. " made. See http://www.jsoftware.com/help/dictionary/dcons.htm for reference.
syntax match jNumber /\<_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(r_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(r_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\=\)\|\%(\%(j\|a[dr]\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(j\|a[dr]\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\=\)\|\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(j\|a[dr]\|r\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\)\=/ syntax match jNumber /\<_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(r_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(r_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\=\)\|\%(\%(j\|a[dr]\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(j\|a[dr]\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\=\)\|\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(j\|a[dr]\|r\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\)\=/
syntax match jNumber /\<_\=\d\+\%([eE]\d\+\)\=b_\=[0-9a-z]\+/ syntax match jNumber /\<_\=\d\+\%([eE]\d\+\)\=b_\=[0-9a-z]\+\%(\.[0-9a-z]\+\)\=/
syntax match jNumber /\<__\=\>/ syntax match jNumber /\<__\=\>/
syntax match jNumber /\<_\./ syntax match jNumber /\<_\./
syntax match jNumber /\<_\=\d\+x\>/ syntax match jNumber /\<_\=\d\+x\>/
@ -64,15 +64,20 @@ syntax match jVerb /[=!\]]\|[\^?]\.\=\|[;[]:\=\|{\.\|[_/\\]:\|[<>+*\-%$|,#][.:]\
syntax match jCopula /=[.:]/ syntax match jCopula /=[.:]/
syntax match jConjunction /;\.\|\^:\|![.:]/ syntax match jConjunction /;\.\|\^:\|![.:]/
" Explicit noun definition. The difficulty is that the define expression " Explicit noun definition. The difficulty is that the define expression can
" "0 : 0" can occur in the middle of a line but the jNounDefine region must " occur in the middle of a line but the jNounDefine region must only start on
" only start on the next line. The trick is to split the problem into two " the next line. The trick is to split the problem into two regions and link
" regions and link them with "nextgroup=". " them with "nextgroup=". The fold wrapper provides syntax folding.
syntax region jNounDefineFold
\ matchgroup=NONE start=/\<\%(\%(0\|noun\)\s\+\%(\:\s*0\|def\s\+0\|define\)\>\)\@=/
\ keepend matchgroup=NONE end=/^\s*)\s*$/
\ contains=jNounDefineStart
\ fold
syntax region jNounDefineStart syntax region jNounDefineStart
\ matchgroup=jDefineExpression start=/\<\%(0\|noun\)\s\+\%(\:\s*0\|def\s\+0\|define\)\>/ \ matchgroup=jDefineExpression start=/\<\%(0\|noun\)\s\+\%(\:\s*0\|def\s\+0\|define\)\>/
\ keepend matchgroup=NONE end=/$/ \ keepend matchgroup=NONE end=/$/
\ contains=@jStdlibItems,@jPrimitiveItems,jNumber,jString,jParenGroup,jParen,jComment \ contains=@jStdlibItems,@jPrimitiveItems,jNumber,jString,jParenGroup,jParen,jComment
\ oneline skipempty nextgroup=jDefineEnd,jNounDefine \ contained oneline skipempty nextgroup=jDefineEnd,jNounDefine
" These two items must have "contained", which allows them to match only after " These two items must have "contained", which allows them to match only after
" jNounDefineStart thanks to the "nextgroup=" above. " jNounDefineStart thanks to the "nextgroup=" above.
syntax region jNounDefine syntax region jNounDefine
@ -87,6 +92,7 @@ syntax region jDefine
\ matchgroup=jDefineExpression start=/\<\%([1-4]\|13\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\>/ \ matchgroup=jDefineExpression start=/\<\%([1-4]\|13\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\>/
\ matchgroup=jDefineEnd end=/^\s*)\s*$/ \ matchgroup=jDefineEnd end=/^\s*)\s*$/
\ contains=jControl,@jStdlibItems,@jPrimitiveItems,jNumber,jString,jArgument,jParenGroup,jParen,jComment,jDefineMonadDyad \ contains=jControl,@jStdlibItems,@jPrimitiveItems,jNumber,jString,jArgument,jParenGroup,jParen,jComment,jDefineMonadDyad
\ fold
syntax match jDefineMonadDyad contained /^\s*:\s*$/ syntax match jDefineMonadDyad contained /^\s*:\s*$/
" Paired parentheses. When a jDefineExpression such as "3 : 0" is " Paired parentheses. When a jDefineExpression such as "3 : 0" is

36
runtime/syntax/kivy.vim Normal file
View File

@ -0,0 +1,36 @@
" Vim syntax file
" Language: Kivy
" Maintainer: Corey Prophitt <prophitt.corey@gmail.com>
" Last Change: May 29th, 2014
" Version: 1
" URL: http://kivy.org/
if exists("b:current_syntax")
finish
endif
" Load Python syntax first (Python can be used within Kivy)
syn include @pyth $VIMRUNTIME/syntax/python.vim
" Kivy language rules can be found here
" http://kivy.org/docs/guide/lang.html
" Define Kivy syntax
syn match kivyPreProc /#:.*/
syn match kivyComment /#.*/
syn match kivyRule /<\I\i*\(,\s*\I\i*\)*>:/
syn match kivyAttribute /\<\I\i*\>/ nextgroup=kivyValue
syn region kivyValue start=":" end=/$/ contains=@pyth skipwhite
syn region kivyAttribute matchgroup=kivyIdent start=/[\a_][\a\d_]*:/ end=/$/ contains=@pyth skipwhite
hi def link kivyPreproc PreProc
hi def link kivyComment Comment
hi def link kivyRule Function
hi def link kivyIdent Statement
hi def link kivyAttribute Label
let b:current_syntax = "kivy"
" vim: ts=8

View File

@ -1,10 +1,10 @@
" ninja build file syntax. " ninja build file syntax.
" Language: ninja build file as described at " Language: ninja build file as described at
" http://martine.github.com/ninja/manual.html " http://martine.github.com/ninja/manual.html
" Version: 1.3 " Version: 1.4
" Last Change: 2013/04/16 " Last Change: 2014/05/13
" Maintainer: Nicolas Weber <nicolasweber@gmx.de> " Maintainer: Nicolas Weber <nicolasweber@gmx.de>
" Version 1.3 of this script is in the upstream vim repository and will be " Version 1.4 of this script is in the upstream vim repository and will be
" included in the next vim release. If you change this, please send your change " included in the next vim release. If you change this, please send your change
" upstream. " upstream.
@ -55,6 +55,7 @@ syn keyword ninjaPoolCommand contained depth
" $simple_varname -> variable " $simple_varname -> variable
" ${varname} -> variable " ${varname} -> variable
syn match ninjaDollar "\$\$"
syn match ninjaWrapLineOperator "\$$" syn match ninjaWrapLineOperator "\$$"
syn match ninjaSimpleVar "\$[a-zA-Z0-9_-]\+" syn match ninjaSimpleVar "\$[a-zA-Z0-9_-]\+"
syn match ninjaVar "\${[a-zA-Z0-9_.-]\+}" syn match ninjaVar "\${[a-zA-Z0-9_.-]\+}"
@ -70,6 +71,7 @@ hi def link ninjaComment Comment
hi def link ninjaKeyword Keyword hi def link ninjaKeyword Keyword
hi def link ninjaRuleCommand Statement hi def link ninjaRuleCommand Statement
hi def link ninjaPoolCommand Statement hi def link ninjaPoolCommand Statement
hi def link ninjaDollar ninjaOperator
hi def link ninjaWrapLineOperator ninjaOperator hi def link ninjaWrapLineOperator ninjaOperator
hi def link ninjaOperator Operator hi def link ninjaOperator Operator
hi def link ninjaSimpleVar ninjaVar hi def link ninjaSimpleVar ninjaVar