Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use :upper:
  • Loading branch information
koka831 committed Jul 31, 2017
commit 28776a52be718444025c7a9af8f85fcd3e0ef1c9
7 changes: 3 additions & 4 deletions syntax/python.vim
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ syn keyword pythonStatement break continue del return pass yield global asse
syn keyword pythonStatement raise nextgroup=pythonExClass skipwhite
syn keyword pythonStatement def nextgroup=pythonFunction skipwhite
syn keyword pythonStatement class nextgroup=pythonClassName skipwhite
" for all developers, commented out CamelCase regex for className
"syn match pythonClassName '[A-Z][a-zA-Z0-9_]*' display contained
syn match pythonClassName '[:upper:]*' display contained

if s:Enabled('g:python_highlight_class_vars')
syn keyword pythonClassVar self cls
endif
Expand All @@ -88,13 +88,12 @@ if s:Python2Syntax()
syn keyword pythonStatement exec
syn keyword pythonImport as
syn match pythonFunction '[a-zA-Z_][a-zA-Z0-9_]*' display contained
syn match pythonClassName '[A-Z][a-zA-Z0-9_]*' display contained
else
syn keyword pythonStatement as nonlocal
syn match pythonStatement '\v\.@<!<await>'
syn match pythonFunction '\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*' display contained
syn match pythonClassName '\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*' display contained
syn match pythonStatement '\<async\s\+def\>' nextgroup=pythonFunction skipwhite
syn match pythonStatement '\<async\s\+class\>' nextgroup=pythonClassName skipwhite
syn match pythonStatement '\<async\s\+with\>'
syn match pythonStatement '\<async\s\+for\>'
syn cluster pythonExpression contains=pythonStatement,pythonRepeat,pythonConditional,pythonOperator,pythonNumber,pythonHexNumber,pythonOctNumber,pythonBinNumber,pythonFloat,pythonString,pythonBytes,pythonBoolean,pythonBuiltinObj,pythonBuiltinFunc
Expand Down
3 changes: 2 additions & 1 deletion tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class Classname
class classname
def функция
class Класс
class функция
class класс


# Keywords: Python 2

Expand Down