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
6262| ` g:python_highlight_builtins ` | Highlight builtin functions and objects | ` 0 ` |
6363| ` g:python_highlight_builtin_objs ` | Highlight builtin objects only | ` 0 ` |
6464| ` 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 ` |
6566| ` g:python_highlight_exceptions ` | Highlight standard exceptions | ` 0 ` |
6667| ` g:python_highlight_string_formatting ` | Highlight ` % ` string formatting | ` 0 ` |
6768| ` 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`: >
6565`g:python_highlight_builtin_funcs` (default `0`)
6666 Highlight builtin functions only
6767
68+ `g:python_highlight_builtin_funcs_kwarg` (default `1`)
69+ Highlight builtin functions when used as kwarg
70+
6871`g:python_highlight_exceptions` (default `0`)
6972 Highlight standard exceptions
7073
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ endfunction
3737"
3838
3939call s: EnableByDefault (' g:python_slow_sync' )
40+ call s: EnableByDefault (' g:python_highlight_builtin_funcs_kwarg' )
4041
4142if s: Enabled (' g:python_highlight_all' )
4243 call s: EnableByDefault (' g:python_highlight_builtins' )
@@ -352,7 +353,13 @@ if s:Enabled('g:python_highlight_builtin_funcs')
352353 let s: funcs_re .= ' |ascii|exec|print'
353354 endif
354355
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 . ' ' ' '
356363 unlet s: funcs_re
357364endif
358365
You can’t perform that action at this time.
0 commit comments