I deleted python.vim in ~./Vim/vim82/syntax directory, and define colorscheme.vim in ~./Vim/vim82/colors directory.

The colorscheme.vim contain this code

call <sid>hi('pythonNumber', s:cdLightGreen, {}, 'none', {})
call <sid>hi('pythonFloat', s:cdLightGreen, {}, 'none', {})
call <sid>hi('pythonString', s:cdOrange, {}, 'none', {})
call <sid>hi('pythonClass', s:cdBlueGreen, {}, 'none', {})
call <sid>hi('pythonComment', s:cdGreen, {}, 'none', {})
call <sid>hi('pythonFunction', s:cdYellow, {}, 'none', {})
call <sid>hi('pythonDecorator', s:cdYellow, {}, 'none', {})
call <sid>hi('pythonStatement', s:cdBlue, {}, 'none', {})
call <sid>hi('pythonStructure', s:cdRed, {}, 'none', {})
call <sid>hi('pythonImport', s:cdPink, {}, 'none', {})
call <sid>hi('pythonRepeat', s:cdPink, {}, 'none', {})
call <sid>hi('pythonConditional', s:cdPink, {}, 'none', {})
call <sid>hi('pythonOperator', s:cdBlue, {}, 'none', {})

The code successfully applied in vim editor as filetype=python. I wonder how bring the syntax highlight such as 'pythonOperator', 'pythonConditional' ... even though there is no python.vim in syntax directory. These keywords are not brought from python.vim in syntax directory?

  • 1
    You can run :verbose hi pythonOperator to see where it was last set. In my case for example it shows Last set from /usr/local/share/vim/vim82/syntax/python.vim line 283. Jun 17 '21 at 18:10
  • That was because Plugin what I was installed before and contain syntax file...haha. Thank you for taking your time! Jun 17 '21 at 20:15
  • 1
    @hibernation Does that mean your question is now answered?
    – filbranden
    Jun 17 '21 at 20:46
  • If the question has an answer, please post it. The code shown in the post is also not minimal, because it doesn't work without at least a definition for the s:hi function, which you might want to edit and add. Lastly, you might want to know that :filter ,syntax/py, scriptnames can show the syntax files starting py that have been loaded
    – D. Ben Knoble
    Jun 19 '21 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.