From 49fd76c107eb0e6b49828c90ee89a7827ad15d78 Mon Sep 17 00:00:00 2001 From: Dario Giovannetti Date: Fri, 1 Jan 2016 18:52:02 +0800 Subject: [PATCH] Highlight punctuation that does not fall into any syntax group --- README.rst | 2 ++ syntax.txt | 4 +++- syntax/python.vim | 13 +++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index f9cd20d..c8ed599 100644 --- a/README.rst +++ b/README.rst @@ -95,6 +95,8 @@ highlighting modes: Options used by the script ~~~~~~~~~~~~~~~~~~~~~~~~~~ +``python_highlight_default_punctuation`` + Highlight punctuation that does not fall into any syntax group ``python_highlight_builtins`` Highlight builtin functions and objects ``python_highlight_builtin_objs`` diff --git a/syntax.txt b/syntax.txt index 294b11a..239c353 100644 --- a/syntax.txt +++ b/syntax.txt @@ -32,7 +32,9 @@ highlighting modes: < Options used by the script - Highlight builtin functions and objects > + Highlight punctuation that does not fall into any syntax group > + :let python_highlight_default_punctuation +< Highlight builtin functions and objects > :let python_highlight_builtins = 1 < Highlight builtin objects only > :let python_highlight_builtin_objs = 1 diff --git a/syntax/python.vim b/syntax/python.vim index e963628..f8013b6 100644 --- a/syntax/python.vim +++ b/syntax/python.vim @@ -66,6 +66,8 @@ " Option names used by the script " ------------------------------- " +" python_highlight_default_punctuation Highlight punctuation that does not +" fall into any syntax group " python_highlight_builtins Highlight builtin functions and " objects " python_highlight_builtin_objs Highlight builtin objects only @@ -131,6 +133,7 @@ endfunction call s:EnableByDefault("g:python_slow_sync") if s:Enabled("g:python_highlight_all") + call s:EnableByDefault("g:python_highlight_default_punctuation") call s:EnableByDefault("g:python_highlight_builtins") if s:Enabled("g:python_highlight_builtins") call s:EnableByDefault("g:python_highlight_builtin_objs") @@ -146,6 +149,14 @@ if s:Enabled("g:python_highlight_all") call s:EnableByDefault("g:python_print_as_function") endif +" +" Default punctuation +" + +if s:Enabled("g:python_highlight_default_punctuation") + syn match pythonPunctuation "[^A-Za-z0-9_]" +endif + " " Keywords " @@ -495,6 +506,8 @@ if version >= 508 || !exists("did_python_syn_inits") command -nargs=+ HiLink hi def link endif + HiLink pythonPunctuation Special + HiLink pythonStatement Statement HiLink pythonImport Include HiLink pythonFunction Function