小编Lum*_*men的帖子

Vim宏:增加非连续行的数字

我正在使用一个YAML文件,它有一个整数作为ID,每4-6行出现一次.我希望在此文件的中间添加一条记录(为了便于阅读),以保持顺序编号的完整性.

文件格式如下.有任何想法吗?

- id: 1
  type: string
  option: diff_string
  other: alt_string   // note: 'other' option does not appear for all records

- id: 2
  type: string
  option: diff_string

//new record would go here as id: 3, increasing id: # of all following records by 1

- id: 3
  type: string
  option: diff_string
  other: alt_string
Run Code Online (Sandbox Code Playgroud)

vim macros yaml

6
推荐指数
1
解决办法
1041
查看次数

标签 统计

macros ×1

vim ×1

yaml ×1