0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

Updated runtime files.

This commit is contained in:
Bram Moolenaar 2016-10-11 08:57:33 +02:00
parent dc0ccaee68
commit dc08328821
11 changed files with 161 additions and 88 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: 2015 Jul 13 " Last Change: 2016 Oct 10
" "
" OPTIONS: " OPTIONS:
" "
@ -195,6 +195,8 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
" }}} " }}}
elseif context =~? 'implements' elseif context =~? 'implements'
return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports) return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports)
elseif context =~? 'instanceof'
return phpcomplete#CompleteClassName(a:base, ['c', 'n'], current_namespace, imports)
elseif context =~? 'extends\s\+.\+$' && a:base == '' elseif context =~? 'extends\s\+.\+$' && a:base == ''
return ['implements'] return ['implements']
elseif context =~? 'extends' elseif context =~? 'extends'
@ -787,6 +789,8 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports)
if kinds == ['c', 'i'] if kinds == ['c', 'i']
let filterstr = 'v:val =~? "\\(class\\|interface\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"' let filterstr = 'v:val =~? "\\(class\\|interface\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
elseif kinds == ['c', 'n']
let filterstr = 'v:val =~? "\\(class\\|namespace\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
elseif kinds == ['c'] elseif kinds == ['c']
let filterstr = 'v:val =~? "class\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"' let filterstr = 'v:val =~? "class\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
elseif kinds == ['i'] elseif kinds == ['i']
@ -996,7 +1000,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) "
let required_modifiers += ['static'] let required_modifiers += ['static']
endif endif
let all_variable = filter(deepcopy(a:sccontent), let all_variable = filter(deepcopy(a:sccontent),
\ 'v:val =~ "^\\s*\\(var\\s\\+\\|public\\s\\+\\|protected\\s\\+\\|private\\s\\+\\|final\\s\\+\\|abstract\\s\\+\\|static\\s\\+\\)\\+\\$"') \ 'v:val =~ "\\(^\\s*\\(var\\s\\+\\|public\\s\\+\\|protected\\s\\+\\|private\\s\\+\\|final\\s\\+\\|abstract\\s\\+\\|static\\s\\+\\)\\+\\$\\|^\\s*\\(\\/\\|\\*\\)*\\s*@property\\s\\+\\S\\+\\s\\S\\{-}\\s*$\\)"')
let variables = [] let variables = []
for i in all_variable for i in all_variable
@ -1160,6 +1164,14 @@ function! phpcomplete#GetTaglist(pattern) " {{{
endif endif
let tags = taglist(a:pattern) let tags = taglist(a:pattern)
for tag in tags
for prop in keys(tag)
if prop == 'cmd' || prop == 'static' || prop == 'kind' || prop == 'builtin'
continue
endif
let tag[prop] = substitute(tag[prop], '\\\\', '\\', 'g')
endfor
endfor
let s:cache_tags[a:pattern] = tags let s:cache_tags[a:pattern] = tags
let has_key = has_key(s:cache_tags, a:pattern) let has_key = has_key(s:cache_tags, a:pattern)
let s:cache_tags_checksum = cache_checksum let s:cache_tags_checksum = cache_checksum
@ -1379,7 +1391,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 docblock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method let docblock_target_pattern = 'function\s\+&\?'.method.'\>\|\(public\|private\|protected\|var\).\+\$'.method.'\>\|@property.\+\$'.method.'\>'
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern) let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern)
if doc_str != '' if doc_str != ''
break break
@ -1387,8 +1399,17 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
endfor endfor
if doc_str != '' if doc_str != ''
let docblock = phpcomplete#ParseDocBlock(doc_str) let docblock = phpcomplete#ParseDocBlock(doc_str)
if has_key(docblock.return, 'type') || has_key(docblock.var, 'type') if has_key(docblock.return, 'type') || has_key(docblock.var, 'type') || len(docblock.properties) > 0
let type = has_key(docblock.return, 'type') ? docblock.return.type : docblock.var.type let type = has_key(docblock.return, 'type') ? docblock.return.type : has_key(docblock.var, 'type') ? docblock.var.type : ''
if type == ''
for property in docblock.properties
if property.description =~? method
let type = property.type
break
endif
endfor
endif
" there's a namespace in the type, threat the type as FQCN " there's a namespace in the type, threat the type as FQCN
if type =~ '\\' if type =~ '\\'
@ -1554,6 +1575,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
elseif get(methodstack, 0) =~# function_invocation_pattern elseif get(methodstack, 0) =~# function_invocation_pattern
let function_name = matchstr(methodstack[0], '^\s*\zs'.function_name_pattern) let function_name = matchstr(methodstack[0], '^\s*\zs'.function_name_pattern)
let function_file = phpcomplete#GetFunctionLocation(function_name, a:current_namespace) let function_file = phpcomplete#GetFunctionLocation(function_name, a:current_namespace)
if function_file == ''
let function_file = phpcomplete#GetFunctionLocation(function_name, '\')
endif
if function_file == 'VIMPHP_BUILTINFUNCTION' if function_file == 'VIMPHP_BUILTINFUNCTION'
" built in function, grab the return type from the info string " built in function, grab the return type from the info string
@ -1569,7 +1593,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines) let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
" try to expand the classname of the returned type with the context got from the function's source file " try to expand the classname of the returned type with the context got from the function's source file
let [classname_candidate, unused] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports) let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
endif endif
endif endif
if classname_candidate != '' if classname_candidate != ''
@ -1650,9 +1674,10 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
let sub_methodstack = phpcomplete#GetMethodStack(matchstr(line, '^\s*'.object.'\s*=&\?\s*\s\+\zs.*')) let sub_methodstack = phpcomplete#GetMethodStack(matchstr(line, '^\s*'.object.'\s*=&\?\s*\s\+\zs.*'))
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType( let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(
\ classname, \ classname,
\ a:current_namespace, \ namespace_for_class,
\ a:imports, \ a:imports,
\ sub_methodstack) \ sub_methodstack)
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
endif endif
@ -1783,6 +1808,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
let [function_name, function_namespace] = phpcomplete#ExpandClassName(function_name, a:current_namespace, a:imports) let [function_name, function_namespace] = phpcomplete#ExpandClassName(function_name, a:current_namespace, a:imports)
let function_file = phpcomplete#GetFunctionLocation(function_name, function_namespace) let function_file = phpcomplete#GetFunctionLocation(function_name, function_namespace)
if function_file == ''
let function_file = phpcomplete#GetFunctionLocation(function_name, '\')
endif
if function_file == 'VIMPHP_BUILTINFUNCTION' if function_file == 'VIMPHP_BUILTINFUNCTION'
" built in function, grab the return type from the info string " built in function, grab the return type from the info string
@ -1798,7 +1826,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
let classname_candidate = docblock.return.type let classname_candidate = docblock.return.type
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines) let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
" try to expand the classname of the returned type with the context got from the function's source file " try to expand the classname of the returned type with the context got from the function's source file
let [classname_candidate, unused] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports) let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
break break
endif endif
endif endif
@ -1861,6 +1889,8 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
for tag in tags for tag in tags
if tag.kind ==? 'v' && tag.cmd =~? '=\s*new\s\+\zs'.class_name_pattern.'\ze' if tag.kind ==? 'v' && tag.cmd =~? '=\s*new\s\+\zs'.class_name_pattern.'\ze'
let classname = matchstr(tag.cmd, '=\s*new\s\+\zs'.class_name_pattern.'\ze') let classname = matchstr(tag.cmd, '=\s*new\s\+\zs'.class_name_pattern.'\ze')
" unescape the classname, it would have "\" doubled since it is an ex command
let classname = substitute(classname, '\\\(\_.\)', '\1', 'g')
return classname return classname
endif endif
endfor endfor
@ -2077,6 +2107,19 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
endif endif
call searchpair('{', '', '}', 'W') call searchpair('{', '', '}', 'W')
let class_closing_bracket_line = line('.') let class_closing_bracket_line = line('.')
" Include class docblock
let doc_line = cfline - 1
if getline(doc_line) =~? '^\s*\*/'
while doc_line != 0
if getline(doc_line) =~? '^\s*/\*\*'
let cfline = doc_line
break
endif
let doc_line -= 1
endwhile
endif
let classcontent = join(getline(cfline, class_closing_bracket_line), "\n") let classcontent = join(getline(cfline, class_closing_bracket_line), "\n")
let used_traits = [] let used_traits = []
@ -2241,8 +2284,19 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
let line = a:sccontent[i] let line = a:sccontent[i]
" search for a function declaration " search for a function declaration
if line =~? a:search if line =~? a:search
let l = i - 1 if line =~? '@property'
" start backward serch for the comment block let doc_line = i
while doc_line != sccontent_len - 1
if a:sccontent[doc_line] =~? '^\s*\*/'
let l = doc_line
break
endif
let doc_line += 1
endwhile
else
let l = i - 1
endif
" start backward search for the comment block
while l != 0 while l != 0
let line = a:sccontent[l] let line = a:sccontent[l]
" if it's a one line docblock like comment and we can just return it right away " if it's a one line docblock like comment and we can just return it right away
@ -2263,7 +2317,7 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
return '' return ''
end end
while l != 0 while l >= 0
let line = a:sccontent[l] let line = a:sccontent[l]
if line =~? '^\s*/\*\*' if line =~? '^\s*/\*\*'
let comment_start = l let comment_start = l
@ -2297,9 +2351,10 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{
\ 'return': {}, \ 'return': {},
\ 'throws': [], \ 'throws': [],
\ 'var': {}, \ 'var': {},
\ 'properties': [],
\ } \ }
let res.description = substitute(matchstr(a:docblock, '\zs\_.\{-}\ze\(@var\|@param\|@return\|$\)'), '\(^\_s*\|\_s*$\)', '', 'g') let res.description = substitute(matchstr(a:docblock, '\zs\_.\{-}\ze\(@type\|@var\|@param\|@return\|$\)'), '\(^\_s*\|\_s*$\)', '', 'g')
let docblock_lines = split(a:docblock, "\n") let docblock_lines = split(a:docblock, "\n")
let param_lines = filter(copy(docblock_lines), 'v:val =~? "^@param"') let param_lines = filter(copy(docblock_lines), 'v:val =~? "^@param"')
@ -2334,15 +2389,26 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{
endif endif
endfor endfor
let var_line = filter(copy(docblock_lines), 'v:val =~? "^@var"') let var_line = filter(copy(docblock_lines), 'v:val =~? "^\\(@var\\|@type\\)"')
if len(var_line) > 0 if len(var_line) > 0
let var_parts = matchlist(var_line[0], '@var\s\+\(\S\+\)\s*\(.*\)') let var_parts = matchlist(var_line[0], '\(@var\|@type\)\s\+\(\S\+\)\s*\(.*\)')
let res['var'] = { let res['var'] = {
\ 'line': var_parts[0], \ 'line': var_parts[0],
\ 'type': phpcomplete#GetTypeFromDocBlockParam(get(var_parts, 1, '')), \ 'type': phpcomplete#GetTypeFromDocBlockParam(get(var_parts, 2, '')),
\ 'description': get(var_parts, 2, '')} \ 'description': get(var_parts, 3, '')}
endif endif
let property_lines = filter(copy(docblock_lines), 'v:val =~? "^@property"')
for property_line in property_lines
let parts = matchlist(property_line, '\(@property\)\s\+\(\S\+\)\s*\(.*\)')
if len(parts) > 0
call add(res.properties, {
\ 'line': parts[0],
\ 'type': phpcomplete#GetTypeFromDocBlockParam(get(parts, 2, '')),
\ 'description': get(parts, 3, '')})
endif
endfor
return res return res
endfunction endfunction
" }}} " }}}
@ -2498,6 +2564,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
let name = matchstr(name, '\\\zs[^\\]\+\ze$') let name = matchstr(name, '\\\zs[^\\]\+\ze$')
endif endif
endif endif
" leading slash is not required use imports are always absolute " leading slash is not required use imports are always absolute
let imports[name] = {'name': object, 'kind': ''} let imports[name] = {'name': object, 'kind': ''}
endfor endfor
@ -2533,6 +2600,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
elseif !exists('no_namespace_candidate') elseif !exists('no_namespace_candidate')
" save the first namespacless match to be used if no better " save the first namespacless match to be used if no better
" candidate found later on " candidate found later on
let tag.namespace = namespace_for_classes
let no_namespace_candidate = tag let no_namespace_candidate = tag
endif endif
endif endif

View File

@ -1,6 +1,6 @@
" Vim color file " Vim color file
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2006 Apr 14 " Last Change: 2016 Oct 10
" This color scheme uses a dark grey background. " This color scheme uses a dark grey background.
@ -46,8 +46,8 @@ hi CursorColumn term=reverse ctermbg=Black guibg=grey40
hi CursorLine term=underline cterm=underline guibg=grey40 hi CursorLine term=underline cterm=underline guibg=grey40
" Groups for syntax highlighting " Groups for syntax highlighting
hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0 guibg=grey5 hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0
hi Special term=bold ctermfg=LightRed guifg=Orange guibg=grey5 hi Special term=bold ctermfg=LightRed guifg=Orange
if &t_Co > 8 if &t_Co > 8
hi Statement term=bold cterm=bold ctermfg=Yellow guifg=#ffff60 gui=bold hi Statement term=bold cterm=bold ctermfg=Yellow guifg=#ffff60 gui=bold
endif endif

View File

@ -4327,8 +4327,8 @@ A jump table for the options with a short description can be found at |Q_op|.
original position when no match is found and when pressing <Esc>. You original position when no match is found and when pressing <Esc>. You
still need to finish the search command with <Enter> to move the still need to finish the search command with <Enter> to move the
cursor to the match. cursor to the match.
You can use the CTRL-N and CTRL-P keys to move to the next and You can use the CTRL-G and CTRL-T keys to move to the next and
previous match. |c_CTRL-N| |c_CTRL-P| previous match. |c_CTRL-G| |c_CTRL-T|
When compiled with the |+reltime| feature Vim only searches for about When compiled with the |+reltime| feature Vim only searches for about
half a second. With a complicated pattern and/or a lot of text the half a second. With a complicated pattern and/or a lot of text the
match may not be found. This is to avoid that Vim hangs while you match may not be found. This is to avoid that Vim hangs while you

View File

@ -2863,9 +2863,11 @@ vimrc file: >
(Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>) (Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>)
SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax* *ft-posix-synax* *ft-dash-syntax*
SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax*
This covers the "normal" Unix (Bourne) sh, bash and the Korn shell. This covers syntax highlighting for the older Unix (Bourne) sh, and newer
shells such as bash, dash, posix, and the Korn shells.
Vim attempts to determine which shell type is in use by specifying that Vim attempts to determine which shell type is in use by specifying that
various filenames are of specific types: > various filenames are of specific types: >
@ -2874,28 +2876,31 @@ various filenames are of specific types: >
bash: .bashrc* bashrc bash.bashrc .bash_profile* *.bash bash: .bashrc* bashrc bash.bashrc .bash_profile* *.bash
< <
If none of these cases pertain, then the first line of the file is examined If none of these cases pertain, then the first line of the file is examined
(ex. /bin/sh /bin/ksh /bin/bash). If the first line specifies a shelltype, (ex. looking for /bin/sh /bin/ksh /bin/bash). If the first line specifies a
then that shelltype is used. However some files (ex. .profile) are known to shelltype, then that shelltype is used. However some files (ex. .profile) are
be shell files but the type is not apparent. Furthermore, on many systems known to be shell files but the type is not apparent. Furthermore, on many
sh is symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" (Posix). systems sh is symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh"
(Posix).
One may specify a global default by instantiating one of the following three One may specify a global default by instantiating one of the following
variables in your <.vimrc>: variables in your <.vimrc>:
ksh: > ksh: >
let g:is_kornshell = 1 let g:is_kornshell = 1
< posix: (using this is the same as setting is_kornshell to 1) > < posix: (using this is the nearly the same as setting g:is_kornshell to 1) >
let g:is_posix = 1 let g:is_posix = 1
< bash: > < bash: >
let g:is_bash = 1 let g:is_bash = 1
< sh: (default) Bourne shell > < sh: (default) Bourne shell >
let g:is_sh = 1 let g:is_sh = 1
< (dash users should use posix)
If there's no "#! ..." line, and the user hasn't availed himself/herself of a If there's no "#! ..." line, and the user hasn't availed himself/herself of a
default sh.vim syntax setting as just shown, then syntax/sh.vim will assume default sh.vim syntax setting as just shown, then syntax/sh.vim will assume
the Bourne shell syntax. No need to quote RFCs or market penetration the Bourne shell syntax. No need to quote RFCs or market penetration
statistics in error reports, please -- just select the default version of the statistics in error reports, please -- just select the default version of the
sh your system uses in your <.vimrc>. sh your system uses and install the associated "let..." in your <.vimrc>.
The syntax/sh.vim file provides several levels of syntax-based folding: > The syntax/sh.vim file provides several levels of syntax-based folding: >
@ -2904,7 +2909,7 @@ The syntax/sh.vim file provides several levels of syntax-based folding: >
let g:sh_fold_enabled= 2 (enable heredoc folding) let g:sh_fold_enabled= 2 (enable heredoc folding)
let g:sh_fold_enabled= 4 (enable if/do/for folding) let g:sh_fold_enabled= 4 (enable if/do/for folding)
> >
then various syntax items (HereDocuments and function bodies) become then various syntax items (ie. HereDocuments and function bodies) become
syntax-foldable (see |:syn-fold|). You also may add these together syntax-foldable (see |:syn-fold|). You also may add these together
to get multiple types of folding: > to get multiple types of folding: >
@ -2928,14 +2933,7 @@ reduce this, the "sh_maxlines" internal variable can be set. Example: >
The default is to use the twice sh_minlines. Set it to a smaller number to The default is to use the twice sh_minlines. Set it to a smaller number to
speed up displaying. The disadvantage is that highlight errors may appear. speed up displaying. The disadvantage is that highlight errors may appear.
*g:sh_isk* *g:sh_noisk*
The shell languages appear to let "." be part of words, commands, etc;
consequently it should be in the isk for sh.vim. As of v116 of syntax/sh.vim,
syntax/sh.vim will append the "." to |'iskeyword'| by default; you may control
this behavior with: >
let g:sh_isk = '..whatever characters you want as part of iskeyword'
let g:sh_noisk= 1 " otherwise, if this exists, the isk will NOT chg
<
*sh-embed* *sh-awk* *sh-embed* *sh-awk*
Sh: EMBEDDING LANGUAGES~ Sh: EMBEDDING LANGUAGES~

View File

@ -6027,6 +6027,7 @@ ft-csh-syntax syntax.txt /*ft-csh-syntax*
ft-css-omni insert.txt /*ft-css-omni* ft-css-omni insert.txt /*ft-css-omni*
ft-cweb-syntax syntax.txt /*ft-cweb-syntax* ft-cweb-syntax syntax.txt /*ft-cweb-syntax*
ft-cynlib-syntax syntax.txt /*ft-cynlib-syntax* ft-cynlib-syntax syntax.txt /*ft-cynlib-syntax*
ft-dash-syntax syntax.txt /*ft-dash-syntax*
ft-desktop-syntax syntax.txt /*ft-desktop-syntax* ft-desktop-syntax syntax.txt /*ft-desktop-syntax*
ft-dircolors-syntax syntax.txt /*ft-dircolors-syntax* ft-dircolors-syntax syntax.txt /*ft-dircolors-syntax*
ft-docbk-syntax syntax.txt /*ft-docbk-syntax* ft-docbk-syntax syntax.txt /*ft-docbk-syntax*
@ -6087,6 +6088,7 @@ ft-php-syntax syntax.txt /*ft-php-syntax*
ft-php3-syntax syntax.txt /*ft-php3-syntax* ft-php3-syntax syntax.txt /*ft-php3-syntax*
ft-phtml-syntax syntax.txt /*ft-phtml-syntax* ft-phtml-syntax syntax.txt /*ft-phtml-syntax*
ft-plaintex-syntax syntax.txt /*ft-plaintex-syntax* ft-plaintex-syntax syntax.txt /*ft-plaintex-syntax*
ft-posix-synax syntax.txt /*ft-posix-synax*
ft-postscr-syntax syntax.txt /*ft-postscr-syntax* ft-postscr-syntax syntax.txt /*ft-postscr-syntax*
ft-ppwiz-syntax syntax.txt /*ft-ppwiz-syntax* ft-ppwiz-syntax syntax.txt /*ft-ppwiz-syntax*
ft-printcap-syntax syntax.txt /*ft-printcap-syntax* ft-printcap-syntax syntax.txt /*ft-printcap-syntax*
@ -6340,8 +6342,6 @@ g:netrw_win95ftp pi_netrw.txt /*g:netrw_win95ftp*
g:netrw_winsize pi_netrw.txt /*g:netrw_winsize* g:netrw_winsize pi_netrw.txt /*g:netrw_winsize*
g:netrw_wiw pi_netrw.txt /*g:netrw_wiw* g:netrw_wiw pi_netrw.txt /*g:netrw_wiw*
g:netrw_xstrlen pi_netrw.txt /*g:netrw_xstrlen* g:netrw_xstrlen pi_netrw.txt /*g:netrw_xstrlen*
g:sh_isk syntax.txt /*g:sh_isk*
g:sh_noisk syntax.txt /*g:sh_noisk*
g:syntax_on syntax.txt /*g:syntax_on* g:syntax_on syntax.txt /*g:syntax_on*
g:tar_browseoptions pi_tar.txt /*g:tar_browseoptions* g:tar_browseoptions pi_tar.txt /*g:tar_browseoptions*
g:tar_cmd pi_tar.txt /*g:tar_cmd* g:tar_cmd pi_tar.txt /*g:tar_cmd*

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.0. Last change: 2016 Oct 01 *todo.txt* For Vim version 8.0. Last change: 2016 Oct 09
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -62,9 +62,6 @@ Regexp problems:
(Manuel Ortega, 2016 Apr 24) (Manuel Ortega, 2016 Apr 24)
Test fails on Mac. Avoid using isalpha(), isalnum(), etc? Depends on Test fails on Mac. Avoid using isalpha(), isalnum(), etc? Depends on
LC_CTYPE LC_CTYPE
- The regexp engines are not reentrant, causing havoc when interrupted by a
remote expression or something else. Move global variables onto the stack
or into an allocated struct.
- The old engine does not find a match for "/\%#=1\(\)\{80}", the new engine - The old engine does not find a match for "/\%#=1\(\)\{80}", the new engine
matches everywhere. matches everywhere.
- Using win_linetabsize() can still be slow. Cache the result, store col and - Using win_linetabsize() can still be slow. Cache the result, store col and
@ -80,6 +77,7 @@ Regexp problems:
- NFA regexp doesn't handle \%<v correctly. (Ingo Karkat, 2014 May 12) - NFA regexp doesn't handle \%<v correctly. (Ingo Karkat, 2014 May 12)
- Does not work with NFA regexp engine: - Does not work with NFA regexp engine:
\%u, \%x, \%o, \%d followed by a composing character \%u, \%x, \%o, \%d followed by a composing character
- Search for \%d0\+ may fail with E363. (Christian Brabandt, 2016 Oct 4)
- \%'[ does not work. '%'] does work. (Masaaki Nakamura, 2016 Apr 4) - \%'[ does not work. '%'] does work. (Masaaki Nakamura, 2016 Apr 4)
- Bug relating to back references. (Ingo Karkat, 2014 Jul 24) - Bug relating to back references. (Ingo Karkat, 2014 Jul 24)
- New RE does not give an error for empty group: "\(\)\{2}" (Dominique Pelle, - New RE does not give an error for empty group: "\(\)\{2}" (Dominique Pelle,
@ -112,6 +110,8 @@ Error in test_startup_utf8 on Solaris. (Danek Duvall, 2016 Aug 17)
Patch to recognize tmux. (Michael Henry, 2016 Sep 29) Patch to recognize tmux. (Michael Henry, 2016 Sep 29)
Patch to fix escaping of job arguments. (Yasuhiro Matsumoto, 2016 Oct 5)
Once .exe with updated installer is available: Add remark to download page Once .exe with updated installer is available: Add remark to download page
about /S and /D options (Ken Takata, 2016 Apr 13) about /S and /D options (Ken Takata, 2016 Apr 13)
Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
@ -140,17 +140,24 @@ Patch to make it possible to extend a list with itself.
min() and max() spawn lots of error messages if sorted list/dictionary min() and max() spawn lots of error messages if sorted list/dictionary
contains invalid data (Nikolay Pavlov, 2016 Sep 4, #1039) contains invalid data (Nikolay Pavlov, 2016 Sep 4, #1039)
Should :vmap in matchit.vim be :xmap? (Tony Mechelynck)
Problem with whitespace in errorformat. (Gerd Wachsmuth, 2016 May 15, #807) Problem with whitespace in errorformat. (Gerd Wachsmuth, 2016 May 15, #807)
Undo problem: "g-" doesn't go back, gets stuck. (Björn Linse, 2016 Jul 18) Undo problem: "g-" doesn't go back, gets stuck. (Björn Linse, 2016 Jul 18)
Add "unicode true" to NSIS installer. Doesn't work with Windows 95, which we
no longer support.
sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep
4#1038) 4#1038)
Patch to add "cmdline" completion to getcompletion(). (Shougo, Oct 1, #1140) Patch to add "cmdline" completion to getcompletion(). (Shougo, Oct 1, #1140)
Patch for systemlist(), add empty item. (thinca, Sep 30, #1135) Patch for systemlist(), add empty item. (thinca, Sep 30, #1135)
Adjust the documentation instead? Do include the test. Add an argument to choose binary or non-binary (like readfile()), when omitted
use the current behavior.
Include the test.
Idea from Sven: record sequence of keys. Useful to show others what they are Idea from Sven: record sequence of keys. Useful to show others what they are
doing (look over the shoulder), and also to see what happened. doing (look over the shoulder), and also to see what happened.
@ -158,6 +165,9 @@ Probably list of keystrokes, with some annotations for mode changes.
Could store in logfile to be able to analyise it with an external command. Could store in logfile to be able to analyise it with an external command.
E.g. to see when's the last time a plugin command was used. E.g. to see when's the last time a plugin command was used.
execute() cannot be used with command completeion. (Daniel Hahler, 2016 Oct 1,
#1141)
cmap using execute() has side effects. (Killthemule, 2016 Aug 17, #983) cmap using execute() has side effects. (Killthemule, 2016 Aug 17, #983)
Patch to change order of compiler flags. (Yousong Zhou, 2016 Sep 19, #1100) Patch to change order of compiler flags. (Yousong Zhou, 2016 Sep 19, #1100)
@ -182,6 +192,9 @@ Cannot delete a file with square brackets with delete(). (#696)
Completion for input() does not expand environment variables. (chdiza, 2016 Completion for input() does not expand environment variables. (chdiza, 2016
Jul 25, #948) Jul 25, #948)
Patch to fix wrong encoding of error message on Cygwin/MSYS terminal.
(Ken Takata, 2016 Oct 4)
'hlsearch' interferes with a Conceal match. (Rom Grk, 2016 Aug 9) 'hlsearch' interferes with a Conceal match. (Rom Grk, 2016 Aug 9)
Patch to add context information to quickfix/location list. (Yegappan Patch to add context information to quickfix/location list. (Yegappan
@ -228,9 +241,6 @@ the last change in any buffer? Can we use ', (, is next to .)?
Ramel Eshed: system() is much slower than job_start(), why? (Aug 26) Ramel Eshed: system() is much slower than job_start(), why? (Aug 26)
Patch to make gd and gD work better for non-K&R code and with comments.
(Anton Lindqvist, 2016 Aug 29)
When generating the Unicode tables with runtime/tools/unicode.vim the When generating the Unicode tables with runtime/tools/unicode.vim the
emoji_width table has only one entry. emoji_width table has only one entry.

View File

@ -2,7 +2,7 @@
" Language: METAFONT " Language: METAFONT
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com> " Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
" Former Maintainers: Nikolai Weibull <now@bitwi.se> " Former Maintainers: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2016 Oct 1 " Latest Revision: 2016 Oct 2
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@ -25,7 +25,7 @@ let g:omni_syntax_group_exclude_mf = 'mfTodoComment'
let s:mp_regex = { let s:mp_regex = {
\ 'beginsection' : '^\s*\%(\%(\|var\|primary\|secondary\|tertiary\)def\|beginchar\|beginlogochar\)\>', \ 'beginsection' : '^\s*\%(\%(\|var\|primary\|secondary\|tertiary\)def\|beginchar\|beginlogochar\)\>',
\ 'endsection' : '^\s*\%(enddef\|endchar\|endlogochar\)\>', \ 'endsection' : '^\s*\%(enddef\|endchar\)\>',
\ 'beginblock' : '^\s*\%(begingroup\|if\|for\%(\|suffixes\|ever\)\)\>', \ 'beginblock' : '^\s*\%(begingroup\|if\|for\%(\|suffixes\|ever\)\)\>',
\ 'endblock' : '^\s*\%(endgroup\|fi\|endfor\)\>' \ 'endblock' : '^\s*\%(endgroup\|fi\|endfor\)\>'
\ } \ }
@ -35,9 +35,7 @@ function! s:move_around(count, what, flags, visual)
exe "normal! gv" exe "normal! gv"
endif endif
call search(s:mp_regex[a:what], a:flags.'s') " 's' sets previous context mark call search(s:mp_regex[a:what], a:flags.'s') " 's' sets previous context mark
for i in range(2, a:count) call map(range(2, a:count), 'search(s:mp_regex[a:what], a:flags)')
call search(s:mp_regex[a:what], a:flags)
endfor
endfunction endfunction
@ -62,8 +60,7 @@ if exists("loaded_matchit")
\ '\<for\%(\|suffixes\|ever\)\>:\<exit\%(if\|unless\)\>:\<endfor\>,' . \ '\<for\%(\|suffixes\|ever\)\>:\<exit\%(if\|unless\)\>:\<endfor\>,' .
\ '\<\%(\|var\|primary\|secondary\|tertiary\)def\>:\<enddef\>,' . \ '\<\%(\|var\|primary\|secondary\|tertiary\)def\>:\<enddef\>,' .
\ '\<begingroup\>:\<endgroup\>,' . \ '\<begingroup\>:\<endgroup\>,' .
\ '\<beginchar\>:\<endchar\>' . \ '\<begin\%(logo\)\?char\>:\<endchar\>'
\ '\<beginlogochar\>:\<endlogochar\>'
" Ignore comments and strings " Ignore comments and strings
let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name") let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name")
\ =~# "mf\\(Comment\\|String\\)$"' \ =~# "mf\\(Comment\\|String\\)$"'

View File

@ -2,7 +2,7 @@
" Language: MetaPost " Language: MetaPost
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com> " Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
" Former Maintainers: Nikolai Weibull <now@bitwi.se> " Former Maintainers: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2016 Oct 1 " Latest Revision: 2016 Oct 2
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@ -34,7 +34,7 @@ endif
let s:mp_regex = { let s:mp_regex = {
\ 'beginsection' : '^\s*\%(\%(\|var\|primary\|secondary\|tertiary\)def\|begin\%(fig\|char\|logochar\|glyph\|graph\)\)\>', \ 'beginsection' : '^\s*\%(\%(\|var\|primary\|secondary\|tertiary\)def\|begin\%(fig\|char\|logochar\|glyph\|graph\)\)\>',
\ 'endsection' : '^\s*\%(enddef\|end\%(fig\|char\|logochar\|glyph\|graph\)\)\>', \ 'endsection' : '^\s*\%(enddef\|end\%(fig\|char\|glyph\|graph\)\)\>',
\ 'beginblock' : '^\s*\%(begingroup\|if\|for\%(\|suffixes\|ever\)\)\>', \ 'beginblock' : '^\s*\%(begingroup\|if\|for\%(\|suffixes\|ever\)\)\>',
\ 'endblock' : '^\s*\%(endgroup\|fi\|endfor\)\>' \ 'endblock' : '^\s*\%(endgroup\|fi\|endfor\)\>'
\ } \ }
@ -44,9 +44,7 @@ function! s:move_around(count, what, flags, visual)
exe "normal! gv" exe "normal! gv"
endif endif
call search(s:mp_regex[a:what], a:flags.'s') " 's' sets previous context mark call search(s:mp_regex[a:what], a:flags.'s') " 's' sets previous context mark
for i in range(2, a:count) call map(range(2, a:count), 'search(s:mp_regex[a:what], a:flags)')
call search(s:mp_regex[a:what], a:flags)
endfor
endfunction endfunction
@ -72,9 +70,8 @@ if exists("loaded_matchit")
\ '\<\%(\|var\|primary\|secondary\|tertiary\)def\>:\<enddef\>,' . \ '\<\%(\|var\|primary\|secondary\|tertiary\)def\>:\<enddef\>,' .
\ '\<beginfig\>:\<endfig\>,' . \ '\<beginfig\>:\<endfig\>,' .
\ '\<begingroup\>:\<endgroup\>,' . \ '\<begingroup\>:\<endgroup\>,' .
\ '\<beginchar\>:\<endchar\>' . \ '\<begin\%(logo\)\?char\>:\<endchar\>,' .
\ '\<beginlogochar\>:\<endlogochar\>' . \ '\<beginglyph\>:\<endglyph\>,' .
\ '\<beginglyph\>:\<endglyph\>' .
\ '\<begingraph\>:\<endgraph\>' \ '\<begingraph\>:\<endgraph\>'
" Ignore comments and strings " Ignore comments and strings
let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name") let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name")

View File

@ -2,7 +2,7 @@
" Language: python " Language: python
" Maintainer: James Sully <sullyj3@gmail.com> " Maintainer: James Sully <sullyj3@gmail.com>
" Previous Maintainer: Johannes Zellner <johannes@zellner.org> " Previous Maintainer: Johannes Zellner <johannes@zellner.org>
" Last Change: Tue, 06 September 2016 " Last Change: Tue, 09 October 2016
" https://github.com/sullyj3/vim-ftplugin-python " https://github.com/sullyj3/vim-ftplugin-python
if exists("b:did_ftplugin") | finish | endif if exists("b:did_ftplugin") | finish | endif
@ -22,10 +22,10 @@ setlocal omnifunc=pythoncomplete#Complete
set wildignore+=*.pyc set wildignore+=*.pyc
let b:next_toplevel='\v%$\|^(class\|def)>' let b:next_toplevel='\v%$\|^(class\|def\|async def)>'
let b:prev_toplevel='\v^(class\|def)>' let b:prev_toplevel='\v^(class\|def\|async def)>'
let b:next='\v%$\|^\s*(class\|def)>' let b:next='\v%$\|^\s*(class\|def\|async def)>'
let b:prev='\v^\s*(class\|def)>' let b:prev='\v^\s*(class\|def\|async def)>'
execute "nnoremap <silent> <buffer> ]] :call <SID>Python_jump('n', '". b:next_toplevel."', 'W')<cr>" execute "nnoremap <silent> <buffer> ]] :call <SID>Python_jump('n', '". b:next_toplevel."', 'W')<cr>"
execute "nnoremap <silent> <buffer> [[ :call <SID>Python_jump('n', '". b:prev_toplevel."', 'Wb')<cr>" execute "nnoremap <silent> <buffer> [[ :call <SID>Python_jump('n', '". b:prev_toplevel."', 'Wb')<cr>"

View File

@ -2,7 +2,7 @@
" Language: MetaPost " Language: MetaPost
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com> " Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
" Former Maintainers: Eugene Minkovskii <emin@mccme.ru> " Former Maintainers: Eugene Minkovskii <emin@mccme.ru>
" Last Change: 2016 Oct 01 " Last Change: 2016 Oct 2, 4:13pm
" Version: 0.2 " Version: 0.2
if exists("b:did_indent") if exists("b:did_indent")
@ -57,7 +57,7 @@ let g:mp_open_tag = ''
let g:mp_close_tag = '' let g:mp_close_tag = ''
\ . '\<fi\>' \ . '\<fi\>'
\ . '\|\<else\%[if]\>' \ . '\|\<else\%[if]\>'
\ . '\|\<end\%(\|for\|group\|def\|fig\|char\|logochar\|glyph\|graph\)\>' \ . '\|\<end\%(\|for\|group\|def\|fig\|char\|glyph\|graph\)\>'
\ . '\|[)\]}]' \ . '\|[)\]}]'
" Statements that may span multiple lines and are ended by a semicolon. To " Statements that may span multiple lines and are ended by a semicolon. To
@ -118,12 +118,10 @@ function! s:CommentOrString(line, pos)
return in_string || (c >= 0 && c <= a:pos) return in_string || (c >= 0 && c <= a:pos)
endfunction endfunction
" Find the first non-comment non-blank line before the current line. Skip also " Find the first non-comment non-blank line before the current line.
" verbatimtex/btex... etex blocks.
function! s:PrevNonBlankNonComment(lnum) function! s:PrevNonBlankNonComment(lnum)
let l:lnum = prevnonblank(a:lnum - 1) let l:lnum = prevnonblank(a:lnum - 1)
while getline(l:lnum) =~# '^\s*%' || while getline(l:lnum) =~# '^\s*%'
\ synIDattr(synID(a:lnum, 1, 1), "name") =~# '^mpTeXinsert$\|^tex\|^Delimiter'
let l:lnum = prevnonblank(l:lnum - 1) let l:lnum = prevnonblank(l:lnum - 1)
endwhile endwhile
return l:lnum return l:lnum
@ -220,25 +218,32 @@ endfunction
" "
" Example: " Example:
" "
" shiftwidth=4
" def foo = " def foo =
" makepen(subpath(T-n,t) of r %> " makepen(
" shifted .5down %> " subpath(T-n,t) of r %>
" --subpath(t,T) of r shifted .5up -- cycle) %<< " shifted .5down %>
" --subpath(t,T) of r shifted .5up -- cycle %<<<
" )
" withcolor black " withcolor black
" enddef " enddef
" "
" The default indentation of the previous example would be: " The default indentation of the previous example would be:
" "
" def foo = " def foo =
" makepen(subpath(T-n,t) of r " makepen(
" shifted .5down " subpath(T-n,t) of r
" --subpath(t,T) of r shifted .5up -- cycle) " shifted .5down
" --subpath(t,T) of r shifted .5up -- cycle
" )
" withcolor black " withcolor black
" enddef " enddef
" "
" Personally, I prefer the latter, but anyway... " Personally, I prefer the latter, but anyway...
function! GetMetaPostIndentIntern() function! GetMetaPostIndentIntern()
" Do not touch indentation inside verbatimtex/btex.. etex blocks.
if synIDattr(synID(v:lnum, 1, 1), "name") =~# '^mpTeXinsert$\|^tex\|^Delimiter'
return -1
endif
" This is the reference line relative to which the current line is indented " This is the reference line relative to which the current line is indented
" (but see below). " (but see below).
@ -327,8 +332,8 @@ function! GetMetaPostIndentIntern()
" "
" for i = 1 upto 3: % <-- Current line: this gets the same indent as `draw ...` " for i = 1 upto 3: % <-- Current line: this gets the same indent as `draw ...`
" "
" NOTE: we get here if and only if L does not contain a statement (among " NOTE: we get here only if L does not contain a statement (among those
" those listed in g:mp_statement). " listed in g:mp_statement).
if s:ValidMatchEnd(prev_text, ';'.s:eol, 0) >= 0 " L ends with a semicolon if s:ValidMatchEnd(prev_text, ';'.s:eol, 0) >= 0 " L ends with a semicolon
let stm_lnum = s:PrevNonBlankNonComment(lnum) let stm_lnum = s:PrevNonBlankNonComment(lnum)
while stm_lnum > 0 while stm_lnum > 0

View File

@ -2,14 +2,12 @@
" Language: AVR Assembler (AVRA) " Language: AVR Assembler (AVRA)
" AVRA Home: http://avra.sourceforge.net/index.html " AVRA Home: http://avra.sourceforge.net/index.html
" AVRA Version: 1.3.0 " AVRA Version: 1.3.0
" Last Update: 2016 Oct 7
" Maintainer: Marius Ghita <mhitza@gmail.com> " Maintainer: Marius Ghita <mhitza@gmail.com>
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo&vim set cpo&vim
setlocal iskeyword=a-z,A-Z,48-57,.,_
" 'isident' is a global option, better not set it
" setlocal isident=a-z,A-Z,48-57,.,_
syn case ignore syn case ignore
syn keyword avraRegister r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 syn keyword avraRegister r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14