用于 Python 的 Vim 语法高亮显示“else:" [英] Vim syntax highlighting 'else:' for Python

查看:46
本文介绍了用于 Python 的 Vim 语法高亮显示“else:"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Vim 中默认的 Python 语法高亮感到恼火.

I'm getting annoyed with the default python syntax highlighting in Vim.

它没有正确突出显示 else: 语句.如果 else 和冒号 : 之间有一些空白,Vim 只会突出显示 else 语句,所以 else : 可以工作,但是 否则: 没有.

It does not highlight the else: statement correctly. Vim only highlights the else statement if I have some white space between the else and the colon :, so else : works, but else: does not.

它必须很容易修复.

我使用的是 Vim 7.2

I'm using Vim 7.2

推荐答案

我的 vimrc 文件中有以下语句.这使得 else:被标记为一个词.删除它之后:语法突出显示效果很好.

I had below statement in my vimrc file. This made else: be tokenized as one word. After removing that else: syntax highlighting works just fine.

设置 iskeyword+=:

这篇关于用于 Python 的 Vim 语法高亮显示“else:"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆