class myClass(models.Model): [folded code] class Meta: [folded code] def __unicode__(self): [folded code] def save(self,*args,**kwargs): [folded code]
所以我的问题是,有没有任何Python代码折叠插件可以做到这一点?我迄今没有找到任何东西,而且我已经尝试了很多这样的Vim插件.
description
Because of its reliance on significant whitespace rather than explicit block delimiters,properly folding Python code can be tricky. The Python Syntax deFinition that comes bundled with Vim doesn’t contain any fold directives at all,and the simplest workaround is to
:set foldmethod=indent
,which usually ends up folding a lot more than you really want it to.There’s no shortage of Vim plugins for improved Python folding,but most seem to suffer from cobbled-together algorithms with bizarre,intractable bugs in the corner cases. SimpylFold aims to be exactly what its name suggests: simple,correct folding for Python. It’s nothing more than it needs to be: it properly folds class and function/method deFinitions,and leaves your loops and conditional blocks untouched. There’s no BS involved: no screwing around with unrelated options (which several of the other plugins do),no choice of algorithms to scratch your head over (because there’s only one that’s correct); it just works,simply.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。