更改折叠中的文本
我注意到折叠文本可以显示有用的信息。它们通常显示类似
+-- 5 行:
------------------------ --------------------
是否可以更改这些行中的文本?我注意到 foldexpr
中有些东西是可能的,但是否可以完全重新设计折叠?
例如+
; :“上面一行可能有注释”:第 27 行:长度 5
谢谢
I noticed that fold texts can show useful information. They usually show something like
+-- 5 lines: <div id="header-inner">--------------------------------------------
Is it possible to change the text in those lines? I noticed that something is possible in foldexpr
but would it be possible to completely redesign folds?
e.g.+ <div id="header-inner"> : "possible comment from line above" : row 27 : length 5
thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从你的问题中我不明白一些事情,例如你正在使用哪种折叠方法,或者“行”数指的是什么,但这里有一个自定义的折叠文本函数,它应该大致完成你想要的操作:
解释:
希望这有帮助。它应该可以轻松地根据您的需求进行定制。
There are a few things I don't understand from your question, such as which foldmethod you are using, or what the number of "rows" refers to, but here's a custom foldtext function that should do roughly what you want:
Explanation:
Hope this helps. It should be easily tailored to your needs.
您还可以从 Steve Losh 的 bitbucket 存储库页面关于vim。
它的外观非常漂亮,也非常有组织性!
要了解它是什么样的,您可以在这个 youtube 视频中查看。
You can also inspect the folding config from Steve Losh’s bitbucket repo page about vim.
It has very beautiful appearance, which is also very organized!
To see what it is like, you might ckeck it out in this youtube video.