From 01a6ac0aef38c40b8a22426279b5337e97b233a1 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Mon, 10 Feb 2020 14:37:12 +0200 Subject: [PATCH] [nvim] add proper highlighting for keyword operators in Python --- nvim/{ftplugin => after/syntax}/json.vim | 0 nvim/after/syntax/python.vim | 4 ++++ nvim/colors/dotfiles.vim | 7 ++++--- 3 files changed, 8 insertions(+), 3 deletions(-) rename nvim/{ftplugin => after/syntax}/json.vim (100%) create mode 100644 nvim/after/syntax/python.vim diff --git a/nvim/ftplugin/json.vim b/nvim/after/syntax/json.vim similarity index 100% rename from nvim/ftplugin/json.vim rename to nvim/after/syntax/json.vim diff --git a/nvim/after/syntax/python.vim b/nvim/after/syntax/python.vim new file mode 100644 index 0000000..5fa9647 --- /dev/null +++ b/nvim/after/syntax/python.vim @@ -0,0 +1,4 @@ +syn clear pythonOperator +syn match pythonOperator '\V=\|-\|+\|*\|@\|/\|%\|&\||\|^\|~\|<\|>\|!=' +syn keyword pythonOperatorKeyword and in is not or +syn cluster pythonExpression add=pythonOperatorKeyword diff --git a/nvim/colors/dotfiles.vim b/nvim/colors/dotfiles.vim index 995384f..7601232 100644 --- a/nvim/colors/dotfiles.vim +++ b/nvim/colors/dotfiles.vim @@ -341,9 +341,10 @@ " }}} " Python {{{ - hi! link pythonBuiltinType Type - hi! link pythonBuiltinObj pythonFunction - hi! link pythonClassVar Variable + hi! link pythonBuiltinType Type + hi! link pythonBuiltinObj pythonFunction + hi! link pythonClassVar Variable + hi! link pythonOperatorKeyword Keyword " }}} " Ruby {{{