[Vim]用行号参与替换

一个小技巧。Vim有好处千种,”替换”只是其中一个。 除了强大的正则表达式,\=也是一个好用的工具。 比如要生成这么一个文件 This is number 1 This is number 2 This is number 3 This is number 4 This is number 5 This is number 6 This is number 7 This is number 8 This is number 9 This is number 10 方法当然有很多。用\=可以这么做: 先输入一行 This is number X 复制出另外9行 yy9p 得到 This is number […]