Emacs 相当于 Vim 的 Foldmethod = indent
问题: Emacs 是否有与 Vim 的 折叠功能等效的规范Foldmethod=缩进?
我对可以与任何 Emacs 主要模式和任何文件一起工作的东西特别感兴趣。 Emacs 搜索尚未找到明确的答案。
Question: Does Emacs have a canonical equivalent of Vim's Folding with Foldmethod=indent?
I am particularly interested in something that can work alongside any Emacs major mode and any file. The Emacs searches have not turned up a definitive answer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好像可以,不过我自己不使用折叠,所以没有尝试过。 毫不奇怪,Python 人员都非常关注这个功能。 请参阅以下内容:
Seems like it can, though I don't use folding myself, so I've not tried it. Not surprisingly, the Python folks are all about this feature. See the following:
也许选择性显示? 我将 以下函数 绑定到[f2]
不过,这是相当简单的,你真的希望它对 Pythony 缩进敏感......
更新:我昨晚盯着这个,意识到我厌倦了 Cu 进入我的专栏是(加1)......所以我将其编码:
进一步的阐述应该结合这两个功能。
另请参阅:如何在 emacs 中实现代码折叠效果
maybe selective-display? I have the following function bound to [f2]
That's pretty bare-bones, though, and you'd really want it to be Pythony-indentation sensitive....
UPDATE: I was staring at this last night, and realized that I was tired of C-u entering the column I was on (plus 1).... so I coded it up:
Further elaboration should combine the two functions.
See also: How to achieve code folding effects in emacs
我尝试了 Joe Casadonte 和 Michael Paulukonis 的所有建议,但没有一个比 vim 的效果更好。 因此,目前对OP问题的更准确答案可能是否定的。
I tried all of the suggestions by Joe Casadonte and Michael Paulukonis, but none works as nicely as the vim's one. So it seems that the more accurate answer to the OP's question may be NO at the moment.