@@ -44,6 +44,7 @@ if s:Enabled('g:python_highlight_all')
4444 if s: Enabled (' g:python_highlight_builtins' )
4545 call s: EnableByDefault (' g:python_highlight_builtin_objs' )
4646 call s: EnableByDefault (' g:python_highlight_builtin_funcs' )
47+ call s: EnableByDefault (' g:python_highlight_builtin_types' )
4748 endif
4849 call s: EnableByDefault (' g:python_highlight_exceptions' )
4950 call s: EnableByDefault (' g:python_highlight_string_formatting' )
9293 syn match pythonStatement ' \< async\s\+ def\> ' nextgroup =pythonFunction skipwhite
9394 syn match pythonStatement ' \< async\s\+ with\> '
9495 syn match pythonStatement ' \< async\s\+ for\> '
95- syn cluster pythonExpression contains =pythonStatement,pythonRepeat,pythonConditional,pythonOperator,pythonNumber,pythonHexNumber,pythonOctNumber,pythonBinNumber,pythonFloat,pythonString,pythonBytes,pythonBoolean,pythonNone,pythonBuiltinObj,pythonBuiltinFunc
96+ syn cluster pythonExpression contains =pythonStatement,pythonRepeat,pythonConditional,pythonOperator,pythonNumber,pythonHexNumber,pythonOctNumber,pythonBinNumber,pythonFloat,pythonString,pythonBytes,pythonBoolean,pythonNone,pythonSingleton, pythonBuiltinObj,pythonBuiltinFunc,pythonBuiltinType
9697endif
9798
9899
@@ -330,14 +331,13 @@ else
330331endif
331332
332333"
333- " Builtin objects and types
334+ " Builtin objects
334335"
335336
336337if s: Enabled (' g:python_highlight_builtin_objs' )
337338 syn keyword pythonNone None
338339 syn keyword pythonBoolean True False
339- syn keyword pythonBuiltinObj Ellipsis NotImplemented
340- syn match pythonBuiltinObj ' \v\. @<!<%(object|bool|int|float|tuple|str|list|dict|set|frozenset|bytearray|bytes)>'
340+ syn keyword pythonSingleton Ellipsis NotImplemented
341341 syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__
342342 syn keyword pythonBuiltinObj __loader__ __spec__ __path__ __cached__
343343endif
@@ -368,6 +368,15 @@ if s:Enabled('g:python_highlight_builtin_funcs')
368368 unlet s: funcs_re
369369endif
370370
371+ "
372+ " Builtin types
373+ "
374+
375+ if s: Enabled (' g:python_highlight_builtin_types' )
376+ syn match pythonBuiltinType ' \v\. @<!<%(object|bool|int|float|tuple|str|list|dict|set|frozenset|bytearray|bytes)>'
377+ endif
378+
379+
371380"
372381" Builtin exceptions and warnings
373382"
@@ -469,9 +478,11 @@ if v:version >= 508 || !exists('did_python_syn_inits')
469478
470479 HiLink pythonBoolean Boolean
471480 HiLink pythonNone Constant
481+ HiLink pythonSingleton Constant
472482
473- HiLink pythonBuiltinObj Structure
483+ HiLink pythonBuiltinObj Identifier
474484 HiLink pythonBuiltinFunc Function
485+ HiLink pythonBuiltinType Structure
475486
476487 HiLink pythonExClass Structure
477488 HiLink pythonClassVar Identifier
0 commit comments