if there is 'type' in a variable name, e.g., 'typeids', 'type' would be improperly highlighted.
2026-05-07.11.45.59.png (view on web)replacing line 325, runtime/syntax/python.vim
syn match pythonBuiltin "\<type\>\ze\(\s\+\h\w*\)\@!"
with:
syn match pythonBuiltin "\<type\>\ze[^a-zA-Z0-9_]"
should solve this problem
currently I'm using ~/.vim/after/syntax/python.vim to override.
syntax clear pythonBuiltin if !exists("python_no_builtin_highlight") " built-in constants " 'False', 'True', and 'None' are also reserved words in Python 3 syn keyword pythonBuiltin False True None syn keyword pythonBuiltin NotImplemented Ellipsis __debug__ " constants added by the `site` module syn keyword pythonBuiltin quit exit copyright credits license " built-in functions syn keyword pythonBuiltin abs all any ascii bin bool breakpoint bytearray syn keyword pythonBuiltin bytes callable chr classmethod compile complex syn keyword pythonBuiltin delattr dict dir divmod enumerate eval exec syn keyword pythonBuiltin filter float format frozenset getattr globals syn keyword pythonBuiltin hasattr hash help hex id input int isinstance syn keyword pythonBuiltin issubclass iter len list locals map max syn keyword pythonBuiltin memoryview min next object oct open ord pow syn keyword pythonBuiltin print property range repr reversed round set syn keyword pythonBuiltin setattr slice sorted staticmethod str sum super syn keyword pythonBuiltin tuple vars zip __import__ " only match `type` as a builtin when it's not followed by an identifier syn match pythonBuiltin "\<type\>\ze[^a-zA-Z0-9_]" " avoid highlighting attributes as builtins syn match pythonAttribute /\.\h\w*/hs=s+1 \ contains=ALLBUT,pythonBuiltin,pythonClass,pythonFunction,pythonType,pythonAsync \ transparent " the ellipsis literal `...` can be used in multiple syntactic contexts syn match pythonEllipsis "\.\@1<!.\.\.\ze\.\@!" display endif
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
The \> atom can only match at a word boundary (as defined by 'iskeyword') which you're attempting to recreate with [^a-zA-Z0-9_]. You must have a butchered 'iskeyword' setting.
What happens when you edit the file with vim --clean?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
I got this when I edit the file with vim --clean
2026-05-08.12.36.11.png (view on web)—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
Does the following return anything unusual?
:verbose set iskeyword? | syn iskeyword
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
clean mode:
2026-05-08.1.03.41.png (view on web)normal :
2026-05-08.1.03.59.png (view on web)—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
Are you running with the latest version of the syntax file? You didn't give any version info.
This issue appears to have been fixed in commit 900c747
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
I tried the latest version and it was fixed!
I was using macOS's default VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Feb 21 2026 19:49:52) rather than HomeBrew version or compile from source code, that's why I didn't upgrade in time. This should be an issue with Apple.
Anyway thanks for your help!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
please report as bug to Apple then.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()