File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ let g:python_highlight_all = 1
62
62
| ` g:python_highlight_builtins ` | Highlight builtin functions and objects | ` 0 ` |
63
63
| ` g:python_highlight_builtin_objs ` | Highlight builtin objects only | ` 0 ` |
64
64
| ` g:python_highlight_builtin_funcs ` | Highlight builtin functions only | ` 0 ` |
65
+ | ` g:python_highlight_builtin_funcs_kwarg ` | Highlight builtin functions when used as kwarg | ` 1 ` |
65
66
| ` g:python_highlight_exceptions ` | Highlight standard exceptions | ` 0 ` |
66
67
| ` g:python_highlight_string_formatting ` | Highlight ` % ` string formatting | ` 0 ` |
67
68
| ` g:python_highlight_string_format ` | Highlight syntax of ` str.format ` syntax | ` 0 ` |
Original file line number Diff line number Diff line change @@ -65,6 +65,9 @@ following command to your `~/.config/nvim/init.vim` or `~/.vimrc`: >
65
65
`g:python_highlight_builtin_funcs` (default `0`)
66
66
Highlight builtin functions only
67
67
68
+ `g:python_highlight_builtin_funcs_kwarg` (default `1`)
69
+ Highlight builtin functions when used as kwarg
70
+
68
71
`g:python_highlight_exceptions` (default `0`)
69
72
Highlight standard exceptions
70
73
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ endfunction
37
37
"
38
38
39
39
call s: EnableByDefault (' g:python_slow_sync' )
40
+ call s: EnableByDefault (' g:python_highlight_builtin_funcs_kwarg' )
40
41
41
42
if s: Enabled (' g:python_highlight_all' )
42
43
call s: EnableByDefault (' g:python_highlight_builtins' )
@@ -352,7 +353,13 @@ if s:Enabled('g:python_highlight_builtin_funcs')
352
353
let s: funcs_re .= ' |ascii|exec|print'
353
354
endif
354
355
355
- execute ' syn match pythonBuiltinFunc '' \v\.@<!\zs<%(' . s: funcs_re . ' )>'' '
356
+ let s: funcs_re = ' syn match pythonBuiltinFunc '' \v\.@<!\zs<%(' . s: funcs_re . ' )>'
357
+
358
+ if ! s: Enabled (' g:python_highlight_builtin_funcs_kwarg' )
359
+ let s: funcs_re .= ' \=@!'
360
+ endif
361
+
362
+ execute s: funcs_re . ' ' ' '
356
363
unlet s: funcs_re
357
364
endif
358
365
You can’t perform that action at this time.
0 commit comments