vim-python / python-syntax

Python syntax highlighting for Vim
MIT License
438 stars 84 forks source link

Suggestion: Add separate syntax group for async etc. #78

Open MisanthropicBit opened 3 years ago

MisanthropicBit commented 3 years ago

First of all, thanks for this awesome project. Really spiced up my Python files!

I was wondering if there are any plans to have separate syntax groups for async and friends? Something like:

syn match   pythonAsyncStatement   '\<\zsasync\ze\s\+def\>' nextgroup=pythonFunction skipwhite
syn match   pythonAsyncStatement   '\<\zsasync\ze\s\+with\>'
syn match   pythonAsyncStatement   '\<\zsasync\ze\s\+for\>'

The benefit would be that colorschemes could bring extra attention to asynchronous statements if they wanted to. By default, pythonAsyncStatement could link to pythonStatement to achieve the current behaviour.

EDIT: I would be happy to submit a pull request.