为 Sublime Text 2 中的每个选择添加一个数字,每个选择增加一次 [英] Add a number to each selection in Sublime Text 2, incremented once per selection

查看:17
本文介绍了为 Sublime Text 2 中的每个选择添加一个数字,每个选择增加一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在 Sublime Text 2 中添加插入一个每个光标递增一次的数字?

Is there a way to add insert a number that is incremented once per cursor in Sublime Text 2?

例如,以|为光标:

Lorem ipsum dolor sit amet, |
vehicula sed, mauris nam eget| 
neque a pede nullam, ducimus adipiscing, 
vestibulum pellentesque pellentesque laoreet faucibus.|

想要的结果:

Lorem ipsum dolor sit amet, 1|
vehicula sed, mauris nam eget2| 
neque a pede nullam, ducimus adipiscing, 
vestibulum pellentesque pellentesque laoreet faucibus.3|

这个功能是原生存在的,还是有插件提供?

Does this functionality exist natively, or is there a plugin providing it?

推荐答案

我推荐插件 Text Pastry.数字序列命令正是您所需要的.

I recommend the plugin Text Pastry. The Number Sequence command is the one you need.

我更喜欢使用插入Nums命令:

Text Pastry 内置了对 Insert Nums 语法的支持提供由一个空格分隔的三个数字:

Text Pastry has a build in support for the Insert Nums syntax by providing three numbers separated by one space:

N M P

N:起始索引.

M 表示将添加到索引中的步长每个选择.

M represents the step size which will be added to the index for each selection.

P 必须 > 0 并将用于填充索引前导零.

P must be > 0 and will be used to pad the index with leading zeroes.

这篇关于为 Sublime Text 2 中的每个选择添加一个数字,每个选择增加一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆