mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 10:45:16 -07:00
vim-patch:4466ad6baa22
Update runtime files
4466ad6baa
Omit vim9 references in autocmd.txt.
Omit matchfuzzypos().
This commit is contained in:
parent
2ebd1f6286
commit
0c93005383
@ -1,13 +1,13 @@
|
||||
" Vim completion script
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 Apr 08
|
||||
" Last Change: 2020 Nov 14
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" This function is used for the 'omnifunc' option.
|
||||
function! ccomplete#Complete(findstart, base)
|
||||
func ccomplete#Complete(findstart, base)
|
||||
if a:findstart
|
||||
" Locate the start of the item, including ".", "->" and "[...]".
|
||||
let line = getline('.')
|
||||
@ -244,7 +244,7 @@ function! ccomplete#Complete(findstart, base)
|
||||
return map(res, 's:Tagline2item(v:val, brackets)')
|
||||
endfunc
|
||||
|
||||
function! s:GetAddition(line, match, memarg, bracket)
|
||||
func s:GetAddition(line, match, memarg, bracket)
|
||||
" Guess if the item is an array.
|
||||
if a:bracket && match(a:line, a:match . '\s*\[') > 0
|
||||
return '['
|
||||
@ -260,13 +260,13 @@ function! s:GetAddition(line, match, memarg, bracket)
|
||||
endif
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
endfunc
|
||||
|
||||
" Turn the tag info "val" into an item for completion.
|
||||
" "val" is is an item in the list returned by taglist().
|
||||
" If it is a variable we may add "." or "->". Don't do it for other types,
|
||||
" such as a typedef, by not including the info that s:GetAddition() uses.
|
||||
function! s:Tag2item(val)
|
||||
func s:Tag2item(val)
|
||||
let res = {'match': a:val['name']}
|
||||
|
||||
let res['extra'] = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename'])
|
||||
@ -289,10 +289,10 @@ function! s:Tag2item(val)
|
||||
endif
|
||||
|
||||
return res
|
||||
endfunction
|
||||
endfunc
|
||||
|
||||
" Use all the items in dictionary for the "info" entry.
|
||||
function! s:Dict2info(dict)
|
||||
func s:Dict2info(dict)
|
||||
let info = ''
|
||||
for k in sort(keys(a:dict))
|
||||
let info .= k . repeat(' ', 10 - len(k))
|
||||
@ -307,7 +307,7 @@ function! s:Dict2info(dict)
|
||||
endfunc
|
||||
|
||||
" Parse a tag line and return a dictionary with items like taglist()
|
||||
function! s:ParseTagline(line)
|
||||
func s:ParseTagline(line)
|
||||
let l = split(a:line, "\t")
|
||||
let d = {}
|
||||
if len(l) >= 3
|
||||
@ -334,12 +334,12 @@ function! s:ParseTagline(line)
|
||||
endif
|
||||
|
||||
return d
|
||||
endfunction
|
||||
endfunc
|
||||
|
||||
" Turn a match item "val" into an item for completion.
|
||||
" "val['match']" is the matching item.
|
||||
" "val['tagline']" is the tagline in which the last part was found.
|
||||
function! s:Tagline2item(val, brackets)
|
||||
func s:Tagline2item(val, brackets)
|
||||
let line = a:val['tagline']
|
||||
let add = s:GetAddition(line, a:val['match'], [a:val], a:brackets == '')
|
||||
let res = {'word': a:val['match'] . a:brackets . add }
|
||||
@ -377,10 +377,10 @@ function! s:Tagline2item(val, brackets)
|
||||
let res['menu'] = s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t'))
|
||||
endif
|
||||
return res
|
||||
endfunction
|
||||
endfunc
|
||||
|
||||
" Turn a command from a tag line to something that is useful in the menu
|
||||
function! s:Tagcmd2extra(cmd, name, fname)
|
||||
func s:Tagcmd2extra(cmd, name, fname)
|
||||
if a:cmd =~ '^/^'
|
||||
" The command is a search command, useful to see what it is.
|
||||
let x = matchstr(a:cmd, '^/^\s*\zs.*\ze$/')
|
||||
@ -395,13 +395,13 @@ function! s:Tagcmd2extra(cmd, name, fname)
|
||||
let x = a:cmd . ' - ' . a:fname
|
||||
endif
|
||||
return x
|
||||
endfunction
|
||||
endfunc
|
||||
|
||||
" Find composing type in "lead" and match items[0] with it.
|
||||
" Repeat this recursively for items[1], if it's there.
|
||||
" When resolving typedefs "depth" is used to avoid infinite recursion.
|
||||
" Return the list of matches.
|
||||
function! s:Nextitem(lead, items, depth, all)
|
||||
func s:Nextitem(lead, items, depth, all)
|
||||
|
||||
" Use the text up to the variable name and split it in tokens.
|
||||
let tokens = split(a:lead, '\s\+\|\<')
|
||||
@ -485,7 +485,7 @@ function! s:Nextitem(lead, items, depth, all)
|
||||
endfor
|
||||
|
||||
return res
|
||||
endfunction
|
||||
endfunc
|
||||
|
||||
|
||||
" Search for members of structure "typename" in tags files.
|
||||
@ -493,7 +493,7 @@ endfunction
|
||||
" Each match is a dictionary with "match" and "tagline" entries.
|
||||
" When "all" is non-zero find all, otherwise just return 1 if there is any
|
||||
" member.
|
||||
function! s:StructMembers(typename, items, all)
|
||||
func s:StructMembers(typename, items, all)
|
||||
" Todo: What about local structures?
|
||||
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
|
||||
if fnames == ''
|
||||
@ -586,12 +586,12 @@ function! s:StructMembers(typename, items, all)
|
||||
|
||||
" Failed to find anything.
|
||||
return []
|
||||
endfunction
|
||||
endfunc
|
||||
|
||||
" For matching members, find matches for following items.
|
||||
" When "all" is non-zero find all, otherwise just return 1 if there is any
|
||||
" member.
|
||||
function! s:SearchMembers(matches, items, all)
|
||||
func s:SearchMembers(matches, items, all)
|
||||
let res = []
|
||||
for i in range(len(a:matches))
|
||||
let typename = ''
|
||||
|
@ -1785,6 +1785,8 @@ found here: |sort()|, |uniq()|.
|
||||
When /{pattern}/ is specified and there is no [r] flag
|
||||
the text matched with {pattern} is skipped, so that
|
||||
you sort on what comes after the match.
|
||||
'ignorecase' applies to the pattern, but 'smartcase'
|
||||
is not used.
|
||||
Instead of the slash any non-letter can be used.
|
||||
For example, to sort on the second comma-separated
|
||||
field: >
|
||||
|
@ -2863,8 +2863,8 @@ byteidx({expr}, {nr}) *byteidx()*
|
||||
Return byte index of the {nr}'th character in the string
|
||||
{expr}. Use zero for the first character, it then returns
|
||||
zero.
|
||||
This function is only useful when there are multibyte
|
||||
characters, otherwise the returned value is equal to {nr}.
|
||||
If there are no multibyte characters the returned value is
|
||||
equal to {nr}.
|
||||
Composing characters are not counted separately, their byte
|
||||
length is added to the preceding base character. See
|
||||
|byteidxcomp()| below for counting composing characters
|
||||
@ -7189,11 +7189,16 @@ search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()*
|
||||
|
||||
'ignorecase', 'smartcase' and 'magic' are used.
|
||||
|
||||
When the 'z' flag is not given, searching always starts in
|
||||
column zero and then matches before the cursor are skipped.
|
||||
When the 'c' flag is present in 'cpo' the next search starts
|
||||
after the match. Without the 'c' flag the next search starts
|
||||
one column further.
|
||||
When the 'z' flag is not given, forward searching always
|
||||
starts in column zero and then matches before the cursor are
|
||||
skipped. When the 'c' flag is present in 'cpo' the next
|
||||
search starts after the match. Without the 'c' flag the next
|
||||
search starts one column further. This matters for
|
||||
overlapping matches.
|
||||
When searching backwards and the 'z' flag is given then the
|
||||
search starts in column zero, thus no match in the current
|
||||
line will be found (unless wrapping around the end of the
|
||||
file).
|
||||
|
||||
When the {stopline} argument is given then the search stops
|
||||
after searching this line. This is useful to restrict the
|
||||
|
@ -306,14 +306,17 @@ preserved, so tricks with |gv| are not needed. Commands can be invoked
|
||||
directly in cmdline-mode (which would otherwise require timer hacks).
|
||||
|
||||
Unlike <expr> mappings, there are no special restrictions on the <Cmd>
|
||||
command: it is executed as if an (unrestricted) |autocmd| was invoked or an
|
||||
async event event was processed.
|
||||
command: it is executed as if an (unrestricted) |autocommand| was invoked
|
||||
or an async event event was processed.
|
||||
|
||||
Note:
|
||||
- Because <Cmd> avoids mode-changes (unlike ":") it does not trigger
|
||||
|CmdlineEnter| and |CmdlineLeave| events. This helps performance.
|
||||
- For the same reason, |keycodes| like <C-R><C-W> are interpreted as plain,
|
||||
unmapped keys.
|
||||
- The command is not echo'ed, no need for <silent>.
|
||||
- In Visual mode you can use `line('v')` and `col('v')` to get one end of the
|
||||
Visual area, the cursor is at the other end.
|
||||
- In select-mode, |:map| and |:vmap| command mappings are executed in
|
||||
visual-mode. Use |:smap| to handle select-mode.
|
||||
|
||||
@ -1122,9 +1125,9 @@ Otherwise, using "<SID>" outside of a script context is an error.
|
||||
|
||||
If you need to get the script number to use in a complicated script, you can
|
||||
use this function: >
|
||||
function s:SID()
|
||||
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
|
||||
endfun
|
||||
func s:ScriptNumber()
|
||||
return matchstr(expand('<SID>'), '<SNR>\zs\d\+\ze_')
|
||||
endfunc
|
||||
|
||||
The "<SNR>" will be shown when listing functions and mappings. This is useful
|
||||
to find out what they are defined to.
|
||||
|
@ -2974,7 +2974,7 @@ vimrc file: >
|
||||
(Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>)
|
||||
|
||||
|
||||
*ft-posix-synax* *ft-dash-syntax*
|
||||
*ft-posix-syntax* *ft-dash-syntax*
|
||||
SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax*
|
||||
|
||||
This covers syntax highlighting for the older Unix (Bourne) sh, and newer
|
||||
|
@ -134,15 +134,17 @@ g8 Print the hex values of the bytes used in the
|
||||
quit
|
||||
<
|
||||
*:z* *E144*
|
||||
:{range}z[+-^.=]{count} Display several lines of text surrounding the line
|
||||
specified with {range}, or around the current line
|
||||
if there is no {range}. If there is a {count}, that's
|
||||
how many lines you'll see; if there is no {count} and
|
||||
only one window then twice the value of the 'scroll'
|
||||
option is used, otherwise the current window height
|
||||
minus 3 is used.
|
||||
:[range]z[+-^.=][count] Display several lines of text surrounding the line
|
||||
specified with [range], or around the current line
|
||||
if there is no [range].
|
||||
|
||||
If there is a {count} the 'window' option is set to
|
||||
If there is a [count], that's how many lines you'll
|
||||
see; if there is no [count] and only one window then
|
||||
twice the value of the 'scroll' option is used,
|
||||
otherwise the current window height minus 3 is used.
|
||||
This is the value of "scr" in the table below.
|
||||
|
||||
If there is a [count] the 'window' option is set to
|
||||
its value.
|
||||
|
||||
:z can be used either alone or followed by any of
|
||||
@ -160,7 +162,7 @@ g8 Print the hex values of the bytes used in the
|
||||
If the mark is "=", a line of dashes is printed
|
||||
around the current line.
|
||||
|
||||
:{range}z#[+-^.=]{count} *:z#*
|
||||
:[range]z#[+-^.=][count] *:z#*
|
||||
Like ":z", but number the lines.
|
||||
{not in all versions of Vi, not with these arguments}
|
||||
|
||||
|
21
runtime/ftplugin/pbtxt.vim
Normal file
21
runtime/ftplugin/pbtxt.vim
Normal file
@ -0,0 +1,21 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Protobuf Text Format
|
||||
" Maintainer: Lakshay Garg <lakshayg@outlook.in>
|
||||
" Last Change: 2020 Nov 17
|
||||
" Homepage: https://github.com/lakshayg/vim-pbtxt
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet
|
@ -404,6 +404,7 @@ an 50.90.120 &Syntax.PQ.Pam\ config :cal SetSyn("pamconf")<CR>
|
||||
an 50.90.130 &Syntax.PQ.PApp :cal SetSyn("papp")<CR>
|
||||
an 50.90.140 &Syntax.PQ.Pascal :cal SetSyn("pascal")<CR>
|
||||
an 50.90.150 &Syntax.PQ.Password\ file :cal SetSyn("passwd")<CR>
|
||||
an 50.90.490 &Syntax.PQ.Pbtxt :cal SetSyn("pbtxt")<CR>
|
||||
an 50.90.160 &Syntax.PQ.PCCTS :cal SetSyn("pccts")<CR>
|
||||
an 50.90.170 &Syntax.PQ.PDF :cal SetSyn("pdf")<CR>
|
||||
an 50.90.180 &Syntax.PQ.Perl.Perl :cal SetSyn("perl")<CR>
|
||||
|
44
runtime/syntax/pbtxt.vim
Normal file
44
runtime/syntax/pbtxt.vim
Normal file
@ -0,0 +1,44 @@
|
||||
" Vim syntax file
|
||||
" Language: Protobuf Text Format
|
||||
" Maintainer: Lakshay Garg <lakshayg@outlook.in>
|
||||
" Last Change: 2020 Nov 17
|
||||
" Homepage: https://github.com/lakshayg/vim-pbtxt
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn case ignore
|
||||
|
||||
syn keyword pbtxtTodo TODO FIXME contained
|
||||
syn keyword pbtxtBool true false contained
|
||||
|
||||
syn match pbtxtInt display "\<\(0\|[1-9]\d*\)\>"
|
||||
syn match pbtxtHex display "\<0[xX]\x\+\>"
|
||||
syn match pbtxtFloat display "\(0\|[1-9]\d*\)\=\.\d*"
|
||||
syn match pbtxtMessage display "^\s*\w\+\s*{"me=e-1
|
||||
syn match pbtxtField display "^\s*\w\+:"me=e-1
|
||||
syn match pbtxtEnum display ":\s*\a\w\+"ms=s+1 contains=pbtxtBool
|
||||
syn region pbtxtString start=+"+ skip=+\\"+ end=+"+ contains=@Spell
|
||||
syn region pbtxtComment start="#" end="$" keepend contains=pbtxtTodo,@Spell
|
||||
|
||||
hi def link pbtxtTodo Todo
|
||||
hi def link pbtxtBool Boolean
|
||||
hi def link pbtxtInt Number
|
||||
hi def link pbtxtHex Number
|
||||
hi def link pbtxtFloat Float
|
||||
hi def link pbtxtMessage Structure
|
||||
hi def link pbtxtField Identifier
|
||||
hi def link pbtxtEnum Define
|
||||
hi def link pbtxtString String
|
||||
hi def link pbtxtComment Comment
|
||||
|
||||
let b:current_syntax = "pbtxt"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet
|
Loading…
Reference in New Issue
Block a user