突出显示python docstrings作为注释(vim语法高亮)
发布时间:2020-12-16 23:38:55 所属栏目: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 subrouti
可以修改
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.如果文件不存在,您可以创建此文件. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- python – DataFrame.stack()之后的新索引级别名称
- 关于python的元组操作
- python – Matplotlib:从头开始制作彩色标记图例
- 如何使用Python来确保字符串只是数字,然后将其转换为整数
- 详谈python http长连接客户端
- python+pandas生成指定日期和重采样的方法
- pip报错解决:EnvironmentError: mysql_config not found
- 我可以在Python 3上提供lxml.etree.parse的URL吗?
- 使用Python库绘制共享相同y轴的两个水平条形图
- Python爬虫常用库介绍(requests、BeautifulSoup、lxml、js