Merge pull request #35296 from zeertzjq/vim-7270a5a

vim-patch: runtime file updates
This commit is contained in:
zeertzjq
2025-08-11 07:23:43 +08:00
committed by GitHub
4 changed files with 51 additions and 28 deletions

View File

@@ -3,7 +3,7 @@
" Maintainer: D. Ben Knoble <ben.knoble+github@gmail.com> " Maintainer: D. Ben Knoble <ben.knoble+github@gmail.com>
" Previous Maintainer: Will Langstroth <will@langstroth.com> " Previous Maintainer: Will Langstroth <will@langstroth.com>
" URL: https://github.com/benknoble/vim-racket " URL: https://github.com/benknoble/vim-racket
" Last Change: 2024 Jun 01 " Last Change: 2025 Aug 09
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@@ -39,7 +39,7 @@ if !exists("no_plugin_maps") && !exists("no_racket_maps")
" "press ENTER or type a command to continue" " "press ENTER or type a command to continue"
" We avoid the annoyance of having to hit enter by remapping K directly. " We avoid the annoyance of having to hit enter by remapping K directly.
function s:RacketDoc(word) abort function s:RacketDoc(word) abort
execute 'silent !raco docs --' shellescape(a:word) execute 'silent !raco docs --' shellescape(a:word, v:true)
redraw! redraw!
endfunction endfunction
nnoremap <buffer> <Plug>RacketDoc :call <SID>RacketDoc(expand('<cword>'))<CR> nnoremap <buffer> <Plug>RacketDoc :call <SID>RacketDoc(expand('<cword>'))<CR>

View File

@@ -3,7 +3,7 @@
" Maintainer: D. Ben Knoble <ben.knoble+github@gmail.com> " Maintainer: D. Ben Knoble <ben.knoble+github@gmail.com>
" Previous Maintainer: Will Langstroth <will@langstroth.com> " Previous Maintainer: Will Langstroth <will@langstroth.com>
" URL: https://github.com/benknoble/vim-racket " URL: https://github.com/benknoble/vim-racket
" Last Change: 2024 Nov 12 " Last Change: 2025 Aug 09
if exists("b:did_indent") if exists("b:did_indent")
finish finish
@@ -16,6 +16,7 @@ if has('vim9script')
endif endif
setlocal lispwords+=module,module*,module+,parameterize,parameterize*,let-values,let*-values,letrec-values,local setlocal lispwords+=module,module*,module+,parameterize,parameterize*,let-values,let*-values,letrec-values,local
setlocal lispwords+=splicing-let,splicing-letrec,splicing-let-values,splicing-letrec-values,splicing-local,splicing-parameterize
setlocal lispwords+=define/contract setlocal lispwords+=define/contract
setlocal lispwords+=λ setlocal lispwords+=λ
setlocal lispwords+=with-handlers setlocal lispwords+=with-handlers
@@ -50,7 +51,7 @@ setlocal lispwords+=fresh,run,run*,project,conde,condu
" loops " loops
setlocal lispwords+=for,for/list,for/fold,for*,for*/list,for*/fold,for/or,for/and,for*/or,for*/and setlocal lispwords+=for,for/list,for/fold,for*,for*/list,for*/fold,for/or,for/and,for*/or,for*/and
setlocal lispwords+=for/hash,for/hasheq,for/hasheqv,for/sum,for/flvector,for*/flvector,for/vector,for*/vector,for*/sum,for*/hash,for*/hasheq,for*/hasheqv setlocal lispwords+=for/hash,for/hasheq,for/hasheqv,for/sum,for/flvector,for*/flvector,for/vector,for*/vector,for/fxvector,for*/fxvector,for*/sum,for*/hash,for*/hasheq,for*/hasheqv
setlocal lispwords+=for/async setlocal lispwords+=for/async
setlocal lispwords+=for/set,for*/set setlocal lispwords+=for/set,for*/set
setlocal lispwords+=for/first,for*/first setlocal lispwords+=for/first,for*/first

View File

@@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: Python " Language: Python
" Maintainer: Zvezdan Petkovic <zpetkovic@acm.org> " Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
" Last Change: 2025 Jul 17 " Last Change: 2025 Aug 10
" Credits: Neil Schemenauer <nas@python.ca> " Credits: Neil Schemenauer <nas@python.ca>
" Dmitry Vasiliev " Dmitry Vasiliev
" Rob B " Rob B
@@ -97,7 +97,8 @@ endif
syn keyword pythonStatement False None True syn keyword pythonStatement False None True
syn keyword pythonStatement as assert break continue del global syn keyword pythonStatement as assert break continue del global
syn keyword pythonStatement lambda nonlocal pass return with yield syn keyword pythonStatement lambda nonlocal pass return with yield
syn keyword pythonStatement class def nextgroup=pythonFunction skipwhite syn keyword pythonStatement class nextgroup=pythonClass skipwhite
syn keyword pythonStatement def nextgroup=pythonFunction skipwhite
syn keyword pythonConditional elif else if syn keyword pythonConditional elif else if
syn keyword pythonRepeat for while syn keyword pythonRepeat for while
syn keyword pythonOperator and in is not or syn keyword pythonOperator and in is not or
@@ -123,20 +124,21 @@ syn match pythonDecoratorName "@\s*\h\%(\w\|\.\)*" display contains=pythonDeco
" Single line multiplication. " Single line multiplication.
syn match pythonMatrixMultiply syn match pythonMatrixMultiply
\ "\%(\w\|[])]\)\s*@" \ "\%(\w\|[])]\)\s*@"
\ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonFunction,pythonDoctestValue \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonClass,pythonFunction,pythonDoctestValue
\ transparent \ transparent
" Multiplication continued on the next line after backslash. " Multiplication continued on the next line after backslash.
syn match pythonMatrixMultiply syn match pythonMatrixMultiply
\ "[^\\]\\\s*\n\%(\s*\.\.\.\s\)\=\s\+@" \ "[^\\]\\\s*\n\%(\s*\.\.\.\s\)\=\s\+@"
\ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonFunction,pythonDoctestValue \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonClass,pythonFunction,pythonDoctestValue
\ transparent \ transparent
" Multiplication in a parenthesized expression over multiple lines with @ at " Multiplication in a parenthesized expression over multiple lines with @ at
" the start of each continued line; very similar to decorators and complex. " the start of each continued line; very similar to decorators and complex.
syn match pythonMatrixMultiply syn match pythonMatrixMultiply
\ "^\s*\%(\%(>>>\|\.\.\.\)\s\+\)\=\zs\%(\h\|\%(\h\|[[(]\).\{-}\%(\w\|[])]\)\)\s*\n\%(\s*\.\.\.\s\)\=\s\+@\%(.\{-}\n\%(\s*\.\.\.\s\)\=\s\+@\)*" \ "^\s*\%(\%(>>>\|\.\.\.\)\s\+\)\=\zs\%(\h\|\%(\h\|[[(]\).\{-}\%(\w\|[])]\)\)\s*\n\%(\s*\.\.\.\s\)\=\s\+@\%(.\{-}\n\%(\s*\.\.\.\s\)\=\s\+@\)*"
\ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonFunction,pythonDoctestValue \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonClass,pythonFunction,pythonDoctestValue
\ transparent \ transparent
syn match pythonClass "\h\w*" display contained
syn match pythonFunction "\h\w*" display contained syn match pythonFunction "\h\w*" display contained
syn match pythonComment "#.*$" contains=pythonTodo,@Spell syn match pythonComment "#.*$" contains=pythonTodo,@Spell
@@ -163,25 +165,25 @@ syn region pythonFString
\ start=+\cF\z(['"]\)+ \ start=+\cF\z(['"]\)+
\ end="\z1" \ end="\z1"
\ skip="\\\\\|\\\z1" \ skip="\\\\\|\\\z1"
\ contains=pythonEscape,pythonUnicodeEscape,@Spell \ contains=pythonFStringField,pythonFStringSkip,pythonEscape,pythonUnicodeEscape,@Spell
syn region pythonFString syn region pythonFString
\ matchgroup=pythonTripleQuotes \ matchgroup=pythonTripleQuotes
\ start=+\cF\z('''\|"""\)+ \ start=+\cF\z('''\|"""\)+
\ end="\z1" \ end="\z1"
\ keepend \ keepend
\ contains=pythonEscape,pythonUnicodeEscape,pythonSpaceError,pythonDoctest,@Spell \ contains=pythonFStringField,pythonFStringSkip,pythonEscape,pythonUnicodeEscape,pythonSpaceError,pythonDoctest,@Spell
syn region pythonRawFString syn region pythonRawFString
\ matchgroup=pythonQuotes \ matchgroup=pythonQuotes
\ start=+\c\%(FR\|RF\)\z(['"]\)+ \ start=+\c\%(FR\|RF\)\z(['"]\)+
\ end="\z1" \ end="\z1"
\ skip="\\\\\|\\\z1" \ skip="\\\\\|\\\z1"
\ contains=@Spell \ contains=pythonFStringField,pythonFStringSkip,@Spell
syn region pythonRawFString syn region pythonRawFString
\ matchgroup=pythonTripleQuotes \ matchgroup=pythonTripleQuotes
\ start=+\c\%(FR\|RF\)\z('''\|"""\)+ \ start=+\c\%(FR\|RF\)\z('''\|"""\)+
\ end="\z1" \ end="\z1"
\ keepend \ keepend
\ contains=pythonSpaceError,pythonDoctest,@Spell \ contains=pythonFStringField,pythonFStringSkip,pythonSpaceError,pythonDoctest,@Spell
" Bytes " Bytes
syn region pythonBytes syn region pythonBytes
@@ -207,6 +209,24 @@ syn region pythonRawBytes
\ end="\z1" \ end="\z1"
\ keepend \ keepend
" F-string replacement fields
"
" - Matched parentheses, brackets and braces are ignored
" - A bare # is ignored to end of line
" - A bare = (surrounded by optional whitespace) enables debugging
" - A bare ! prefixes a conversion field
" - A bare : begins a format specification
" - Matched braces inside a format specification are ignored
"
syn region pythonFStringField
\ matchgroup=pythonFStringDelimiter
\ start=/{/
\ skip=/([^)]*)\|\[[^]]*]\|{[^}]*}\|#.*$/
\ end=/\%(\s*=\s*\)\=\%(!\a\)\=\%(:\%({[^}]*}\|[^}]*\)\+\)\=}/
\ contained
" Doubled braces and Unicode escapes are not replacement fields
syn match pythonFStringSkip /{{\|\\N{/ transparent contained contains=NONE
syn match pythonEscape +\\[abfnrtv'"\\]+ contained syn match pythonEscape +\\[abfnrtv'"\\]+ contained
syn match pythonEscape "\\\o\{1,3}" contained syn match pythonEscape "\\\o\{1,3}" contained
syn match pythonEscape "\\x\x\{2}" contained syn match pythonEscape "\\x\x\{2}" contained
@@ -279,7 +299,7 @@ if !exists("python_no_builtin_highlight")
syn keyword pythonBuiltin tuple type vars zip __import__ syn keyword pythonBuiltin tuple type vars zip __import__
" avoid highlighting attributes as builtins " avoid highlighting attributes as builtins
syn match pythonAttribute /\.\h\w*/hs=s+1 syn match pythonAttribute /\.\h\w*/hs=s+1
\ contains=ALLBUT,pythonBuiltin,pythonFunction,pythonAsync \ contains=ALLBUT,pythonBuiltin,pythonClass,pythonFunction,pythonAsync
\ transparent \ transparent
endif endif
@@ -336,7 +356,7 @@ if !exists("python_no_doctest_highlight")
if !exists("python_no_doctest_code_highlight") if !exists("python_no_doctest_code_highlight")
syn region pythonDoctest syn region pythonDoctest
\ start="^\s*>>>\s" end="^\s*$" \ start="^\s*>>>\s" end="^\s*$"
\ contained contains=ALLBUT,pythonDoctest,pythonFunction,@Spell \ contained contains=ALLBUT,pythonDoctest,pythonClass,pythonFunction,@Spell
syn region pythonDoctestValue syn region pythonDoctestValue
\ start=+^\s*\%(>>>\s\|\.\.\.\s\|"""\|'''\)\@!\S\++ end="$" \ start=+^\s*\%(>>>\s\|\.\.\.\s\|"""\|'''\)\@!\S\++ end="$"
\ contained \ contained
@@ -360,6 +380,7 @@ hi def link pythonInclude Include
hi def link pythonAsync Statement hi def link pythonAsync Statement
hi def link pythonDecorator Define hi def link pythonDecorator Define
hi def link pythonDecoratorName Function hi def link pythonDecoratorName Function
hi def link pythonClass Structure
hi def link pythonFunction Function hi def link pythonFunction Function
hi def link pythonComment Comment hi def link pythonComment Comment
hi def link pythonTodo Todo hi def link pythonTodo Todo
@@ -373,6 +394,7 @@ hi def link pythonQuotes String
hi def link pythonTripleQuotes pythonQuotes hi def link pythonTripleQuotes pythonQuotes
hi def link pythonEscape Special hi def link pythonEscape Special
hi def link pythonUnicodeEscape pythonEscape hi def link pythonUnicodeEscape pythonEscape
hi def link pythonFStringDelimiter Special
if !exists("python_no_number_highlight") if !exists("python_no_number_highlight")
hi def link pythonNumber Number hi def link pythonNumber Number
endif endif

View File

@@ -4,7 +4,7 @@
" Previous Maintainer: Will Langstroth <will@langstroth.com> " Previous Maintainer: Will Langstroth <will@langstroth.com>
" URL: https://github.com/benknoble/vim-racket " URL: https://github.com/benknoble/vim-racket
" Description: Contains all of the keywords in #lang racket " Description: Contains all of the keywords in #lang racket
" Last Change: 2024 Apr 14 " Last Change: 2025 Aug 09
" Initializing: " Initializing:
if exists("b:current_syntax") if exists("b:current_syntax")
@@ -534,21 +534,21 @@ syntax match racketContainedNumberError "\<#[ei]#[ei]"
syntax match racketContainedNumberError "\<#[xdob]#[xdob]" syntax match racketContainedNumberError "\<#[xdob]#[xdob]"
" start with the simpler sorts " start with the simpler sorts
syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\?\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdlef][-+]\?\d\+#*\)\?\>" contains=racketContainedNumberError syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\?\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdleft][-+]\?\d\+#*\)\?\>" contains=racketContainedNumberError
syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\?\d\+/\d\+\>" contains=racketContainedNumberError syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\?\d\+/\d\+\>" contains=racketContainedNumberError
syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\?\d\+/\d\+[-+]\d\+\(/\d\+\)\?i\>" contains=racketContainedNumberError syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\?\d\+/\d\+[-+]\d\+\(/\d\+\)\?i\>" contains=racketContainedNumberError
" different possible ways of expressing complex values " different possible ways of expressing complex values
syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdlef][-+]\?\d\+#*\)\?i\>" contains=racketContainedNumberError syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdleft][-+]\?\d\+#*\)\?i\>" contains=racketContainedNumberError
syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\?\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdlef][-+]\?\d\+#*\)\?[-+]\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdlef][-+]\?\d\+#*\)\?i\>" contains=racketContainedNumberError syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\?\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdleft][-+]\?\d\+#*\)\?[-+]\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdlef][-+]\?\d\+#*\)\?i\>" contains=racketContainedNumberError
syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\(inf\|nan\)\.[0f][-+]\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdlef][-+]\?\d\+#*\)\?i\>" contains=racketContainedNumberError syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\(inf\|nan\)\.[0f][-+]\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdleft][-+]\?\d\+#*\)\?i\>" contains=racketContainedNumberError
syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\?\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdlef][-+]\?\d\+#*\)\?[-+]\(inf\|nan\)\.[0f]i\>" contains=racketContainedNumberError syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\?\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdleft][-+]\?\d\+#*\)\?[-+]\(inf\|nan\)\.[0f]i\>" contains=racketContainedNumberError
syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\?\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdlef][-+]\?\d\+#*\)\?@[-+]\?\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdlef][-+]\?\d\+#*\)\?\>" contains=racketContainedNumberError syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\?\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdleft][-+]\?\d\+#*\)\?@[-+]\?\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdlef][-+]\?\d\+#*\)\?\>" contains=racketContainedNumberError
syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\(inf\|nan\)\.[0f]@[-+]\?\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdlef][-+]\?\d\+#*\)\?\>" contains=racketContainedNumberError syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\(inf\|nan\)\.[0f]@[-+]\?\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdleft][-+]\?\d\+#*\)\?\>" contains=racketContainedNumberError
syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\?\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdlef][-+]\?\d\+#*\)\?@[-+]\(inf\|nan\)\.[0f]\>" contains=racketContainedNumberError syntax match racketNumber "\<\(#[dobie]\)\{0,2}[-+]\?\(\d\+\|\d\+#*\.\|\d*\.\d\+\)#*\(/\d\+#*\)\?\([sdleft][-+]\?\d\+#*\)\?@[-+]\(inf\|nan\)\.[0f]\>" contains=racketContainedNumberError
" hex versions of the above (separate because of the different possible exponent markers) " hex versions of the above (separate because of the different possible exponent markers)
syntax match racketNumber "\<\(#x\|#[ei]#x\|#x#[ei]\)[-+]\?\(\x\+\|\x\+#*\.\|\x*\.\x\+\)#*\(/\x\+#*\)\?\([sl][-+]\?\x\+#*\)\?\>" syntax match racketNumber "\<\(#x\|#[ei]#x\|#x#[ei]\)[-+]\?\(\x\+\|\x\+#*\.\|\x*\.\x\+\)#*\(/\x\+#*\)\?\([slt][-+]\?\x\+#*\)\?\>"
syntax match racketNumber "\<\(#x\|#[ei]#x\|#x#[ei]\)[-+]\?\x\+/\x\+\>" syntax match racketNumber "\<\(#x\|#[ei]#x\|#x#[ei]\)[-+]\?\x\+/\x\+\>"
syntax match racketNumber "\<\(#x\|#[ei]#x\|#x#[ei]\)[-+]\?\x\+/\x\+[-+]\x\+\(/\x\+\)\?i\>" syntax match racketNumber "\<\(#x\|#[ei]#x\|#x#[ei]\)[-+]\?\x\+/\x\+[-+]\x\+\(/\x\+\)\?i\>"
@@ -561,9 +561,9 @@ syntax match racketNumber "\<\(#x\|#[ei]#x\|#x#[ei]\)[-+]\(inf\|nan\)\.[0f]@[
syntax match racketNumber "\<\(#x\|#[ei]#x\|#x#[ei]\)[-+]\?\(\x\+\|\x\+#*\.\|\x*\.\x\+\)#*\(/\x\+#*\)\?\([sl][-+]\?\x\+#*\)\?@[-+]\(inf\|nan\)\.[0f]\>" syntax match racketNumber "\<\(#x\|#[ei]#x\|#x#[ei]\)[-+]\?\(\x\+\|\x\+#*\.\|\x*\.\x\+\)#*\(/\x\+#*\)\?\([sl][-+]\?\x\+#*\)\?@[-+]\(inf\|nan\)\.[0f]\>"
" these work for any radix " these work for any radix
syntax match racketNumber "\<\(#[xdobie]\)\{0,2}[-+]\(inf\|nan\)\.[0f]i\?\>" contains=racketContainedNumberError syntax match racketNumber "\<\(#[xdobie]\)\{0,2}[-+]\(inf\|nan\)\.[0ft]i\?\>" contains=racketContainedNumberError
syntax match racketNumber "\<\(#[xdobie]\)\{0,2}[-+]\(inf\|nan\)\.[0f][-+]\(inf\|nan\)\.[0f]i\>" contains=racketContainedNumberError syntax match racketNumber "\<\(#[xdobie]\)\{0,2}[-+]\(inf\|nan\)\.[0ft][-+]\(inf\|nan\)\.[0f]i\>" contains=racketContainedNumberError
syntax match racketNumber "\<\(#[xdobie]\)\{0,2}[-+]\(inf\|nan\)\.[0f]@[-+]\(inf\|nan\)\.[0f]\>" contains=racketContainedNumberError syntax match racketNumber "\<\(#[xdobie]\)\{0,2}[-+]\(inf\|nan\)\.[0ft]@[-+]\(inf\|nan\)\.[0f]\>" contains=racketContainedNumberError
syntax keyword racketBoolean #t #f #true #false #T #F syntax keyword racketBoolean #t #f #true #false #T #F