1.rang(1,10)
2.s to replace
:s/^/\=range(1,10)
and then:
:1,10s/^/"/g
next: g is unnecessary
:1,10s/$/",/
you want change the range to 51-60
each num = num+50
%s/\d\+/\=submatch(0)+50/
and you can use another methold to try:
write a temp number :
"60",
yy
10 p
:let i=60 |g/60/s//\=i/|let i=i+2
then:
some links:
https://blog.csdn.net/zengchongxu/article/details/51336643vim 下把所有数字替换为 "数字"。
https://blog.csdn.net/joe_007/article/details/8308920
https://blog.csdn.net/hylaking/article/details/80270763 vi/vim的巧妙使用-数值加减,递增(转),序列等
vim(gvim)正则表达式查找替换(4)-生成连续数字或行号