您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

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

5b51 2022/1/14 8:23:19 python 字数 1343 阅读 624 来源 www.jb51.cc/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

概述

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 docstrings作为注释(vim语法高亮)全部内容,希望文章能够帮你解决突出显示python docstrings作为注释(vim语法高亮)所遇到的程序开发问题。


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶