突出显示python docstrings作为注释(vim语法高亮)
发布时间:2020-09-25 11:07:31 所属栏目:Python 来源:互联网
导读:可以修改 python.vim(和相应的colorscheme文件),以便在class和def语句(a.k.a. docstrings)下面的三重引用的字符串将在vim下的python语法高亮显示时被突出显示为注释? class URLopener: Class to open URLs. This is a class rather than just a subroutine b
|
可以修改 python.vim(和相应的colorscheme文件),以便在class和def语句(a.k.a. docstrings)下面的三重引用的字符串将在vim下的python语法高亮显示时被突出显示为注释? class URLopener:
"""Class to open URLs.
This is a class rather than just a subroutine because we may need
more than one set of global protocol-specific options.
Note -- this is a base class for those who don't want the
automatic handling of errors type 302 (relocated) and 401
(authorization needed)."""
def addheader(self,*args):
"""Add a header to be used by the HTTP interface only
e.g. u.addheader('Accept','sound/basic')"""
# sample comment
解决方法您可以添加以下行:syn region Comment start=/"""/ end=/"""/ 到你的/ .vim / after / syntax / python.vim.如果文件不存在,您可以创建此文件. (编辑:长春站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
- flask:wsgi-middleware vs before_和after_requ
- 示例python twisted事件驱动的Web应用程序递增请
- python – Pandas:根据来自另一列的匹配替换列值
- python – Pandas读取sql整数变为浮点数
- python – 如何为Xerox打印机创建动态作业单?
- 在Python中存储三角形/六边形网格的最佳方法
- python函数——根据经纬度计算距离公式的错误及修
- django – 必须使用对象pk或slug调用通用详细信息
- 使用远程存储配置django-compressor(django-stor
- python – 如何修补`__call__`方法?
热点阅读
