Skip to content

Commit 5881fdc

Browse files
author
Michael Doronin
committed
vim bultin objects and functions aren't highlighted if they come after
dot
1 parent cf3c359 commit 5881fdc

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

syntax/python.vim

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,7 @@ if s:Enabled("g:python_highlight_builtin_objs")
416416
syn keyword pythonBuiltinObj None
417417
syn keyword pythonBoolean True False
418418
syn keyword pythonBuiltinObj Ellipsis NotImplemented
419-
syn keyword pythonBuiltinObj int float tuple str list dict set frozenset
420-
syn keyword pythonBuiltinObj defaultdict
419+
syn match pythonBuiltinObj '\v[^.]*<(int|float|tuple|str|list|dict|set|frozenset)>'
421420
syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__
422421
endif
423422

@@ -427,28 +426,28 @@ endif
427426

428427
if s:Enabled("g:python_highlight_builtin_funcs")
429428
if s:Python2Syntax()
430-
syn keyword pythonBuiltinFunc apply basestring buffer callable coerce
431-
syn keyword pythonBuiltinFunc execfile file help intern long raw_input
432-
syn keyword pythonBuiltinFunc reduce reload unichr unicode xrange
429+
syn match pythonBuiltinFunc 'v[^.]*<(apply|basestring|buffer|callable|coerce)>'
430+
syn match pythonBuiltinFunc 'v[^.]*<(execfile|file|help|intern|long|raw_input)>'
431+
syn match pythonBuiltinFunc 'v[^.]*<(reduce|reload|unichr|unicode|xrange)>'
433432
if s:Enabled("g:python_print_as_function")
434-
syn keyword pythonBuiltinFunc print
433+
syn match pythonBuiltinFunc 'v[^.]*<(print)>'
435434
endif
436435
else
437-
syn keyword pythonBuiltinFunc ascii exec memoryview print
436+
syn match pythonBuiltinFunc 'v[^.]*<(ascii|exec|memoryview|print)>'
438437
endif
439-
syn keyword pythonBuiltinFunc __import__ abs all any
440-
syn keyword pythonBuiltinFunc bin bool bytearray bytes
441-
syn keyword pythonBuiltinFunc chr classmethod cmp compile complex
442-
syn keyword pythonBuiltinFunc delattr dir divmod enumerate eval
443-
syn keyword pythonBuiltinFunc filter format getattr
444-
syn keyword pythonBuiltinFunc globals hasattr hash hex id
445-
syn keyword pythonBuiltinFunc input isinstance
446-
syn keyword pythonBuiltinFunc issubclass iter len locals map max
447-
syn keyword pythonBuiltinFunc min next object oct open ord
448-
syn keyword pythonBuiltinFunc pow property range
449-
syn keyword pythonBuiltinFunc repr reversed round setattr
450-
syn keyword pythonBuiltinFunc slice sorted staticmethod sum super
451-
syn keyword pythonBuiltinFunc type vars zip
438+
syn match pythonBuiltinFunc 'v[^.]*<(__import__|abs|all|any)>'
439+
syn match pythonBuiltinFunc 'v[^.]*<(bin|bool|bytearray|bytes)>'
440+
syn match pythonBuiltinFunc 'v[^.]*<(chr|classmethod|cmp|compile|complex)>'
441+
syn match pythonBuiltinFunc 'v[^.]*<(delattr|dir|divmod|enumerate|eval)>'
442+
syn match pythonBuiltinFunc 'v[^.]*<(filter|format|getattr)>'
443+
syn match pythonBuiltinFunc 'v[^.]*<(globals|hasattr|hash|hex|id)>'
444+
syn match pythonBuiltinFunc 'v[^.]*<(input|isinstance)>'
445+
syn match pythonBuiltinFunc 'v[^.]*<(issubclass|iter|len|locals|map|max)>'
446+
syn match pythonBuiltinFunc 'v[^.]*<(min|next|object|oct|open|ord)>'
447+
syn match pythonBuiltinFunc 'v[^.]*<(pow|property|range)>'
448+
syn match pythonBuiltinFunc 'v[^.]*<(repr|reversed|round|setattr)>'
449+
syn match pythonBuiltinFunc 'v[^.]*<(slice|sorted|staticmethod|sum|super)>'
450+
syn match pythonBuiltinFunc 'v[^.]*<(type|vars|zip)>'
452451
endif
453452

454453
"

0 commit comments

Comments
 (0)