突出显示python docstrings作为注释(vim语法高亮)

突出显示python docstrings作为注释(vim语法高亮),第1张

概述可以修改 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
@H_301_5@解决方法 您可以添加以下行:
syn region Comment start=/"""/ end=/"""/

到你的〜/ .vim / after / Syntax / python.vim.如果文件不存在,您可以创建此文件.

总结

以上是内存溢出为你收集整理的突出显示python docstrings作为注释(vim语法高亮)全部内容,希望文章能够帮你解决突出显示python docstrings作为注释(vim语法高亮)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/langs/1207440.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-04
下一篇 2022-06-04

发表评论

登录后才能评论

评论列表(0条)

保存