Skip to content

Commit 17c6144

Browse files
committed
Embellish .vim/after/syntax/python.vim
See vim-python/python-syntax#65
1 parent 13cb3e5 commit 17c6144

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

vim/after/syntax/python.vim

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
" https://vi.stackexchange.com/a/9917/1851
2-
32
hi PythonFuncCall ctermfg=218 cterm=none guifg=#0000dd gui=none
43
hi PythonClassVar ctermfg=194 cterm=none guifg=#770077 gui=none
54

@@ -10,11 +9,17 @@ syntax match pythonKeywordArgument contained /\<\K\k*\ze\s*=/ nextgroup=pyt
109
syntax match pythonFuncArgCommas contained ','
1110
hi pythonKeywordArgument ctermfg=154 cterm=italic guifg=#228822 gui=italic
1211

12+
" match breakpoints
1313
syntax match pythonBreakpoint /breakpoint()/
1414
hi link pythonBreakpoint Error
1515

16-
syn match pythonStrFormatNotFString "{\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)\=\%(\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\[\%(\d\+\|[^!:\}]\+\)\]\)*\%(![rsa]\)\=\%(:\%({\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)}\|\%([^}]\=[<>=^]\)\=[ +-]\=#\=0\=\d*,\=\%(\.\d\+\)\=[bcdeEfFgGnosxX%]\=\)\=\)\=}" contained containedin=pythonString,pythonRawString
17-
hi pythonStrFormatNotFString ctermbg=94 ctermfg=229 guibg=#875f00 guifg=#ffffaf
16+
" https://github.com/vim-python/python-syntax/issues/65
17+
syn match pythonStrFormatNotFString "{\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)\=\%(\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\[\%(\d\+\|[^!:\}]\+\)\]\)*\%(![rsa]\)\=\%(:\%({\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)}\|\%([^}]\=[<>=^]\)\=[ +-]\=#\=0\=\d*,\=\%(\.\d\+\)\=[bcdeEfFgGnosxX%]\=\)\=\)\=}" contained containedin=pythonString
18+
hi pythonStrFormatNotFString ctermbg=88 ctermfg=225 guibg=#870000 guifg=#ffd7ff
19+
20+
syn match pythonStrFormatRawString "{\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)\=\%(\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\[\%(\d\+\|[^!:\}]\+\)\]\)*\%(![rsa]\)\=\%(:\%({\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)}\|\%([^}]\=[<>=^]\)\=[ +-]\=#\=0\=\d*,\=\%(\.\d\+\)\=[bcdeEfFgGnosxX%]\=\)\=\)\=}" contained containedin=pythonRawString
21+
hi pythonStrFormatRawString ctermbg=94 ctermfg=229 guibg=#875f00 guifg=#ffffaf
1822

23+
" misc settings
1924
set foldmethod=indent
2025
set foldlevelstart=1

0 commit comments

Comments
 (0)