我有一个YAML格式的文本文件,并希望为VIM定义自定义折叠,但我不知道如何去做(尽管阅读了折叠的VIM文档).该文件由YAML"文档"组成,如下所示:
---
title: My Title
attr1: value1
attr2: value2
---
title: Next Item
attr1: value3
---
title: One More Item
...
Run Code Online (Sandbox Code Playgroud)
我希望得到的折叠文本看起来像这样:
+---- 2 lines: My Title ----
+---- ? lines: Next Item ---
Run Code Online (Sandbox Code Playgroud)
任何建议表示赞赏!谢谢!