在特定点折叠JSON

编程入门 行业动态 更新时间:2024-10-26 13:22:55
本文介绍了在特定点折叠JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个JSON文件,并希望在每行中使用一个切换开关( z a )对其进行折叠,并使用一个称为subsection的键.我考虑过使用像这样的全局命令:

I have a JSON file and would like to fold it with a toggle (za) at every line with a key called subsection. I thought about using a global command like:

:g/subsection/za

但是它不起作用,因为全局命令期望将编辑功能作为第二个参数,并且 z a 未编辑.

but it doesn't work since a global command expects an editing function as the second argument, and za is not editing.

有什么想法吗?

推荐答案

怎么样::g/subsection/norm za

来自:h :g

To repeat a non-Ex command, you can use the ":normal" command: > :g/pat/normal {commands}

更多推荐

在特定点折叠JSON

本文发布于:2023-07-11 12:03:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1093987.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:在特定   JSON

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!