Sublime 3 中的增量值/数字

编程入门 行业动态 更新时间:2024-10-26 12:25:33
本文介绍了Sublime 3 中的增量值/数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在 Sublime 中运行的文件中有多行这样的 <VValue type="int" value="0"/>;每个 value 递增 0, 1, 2, 3 等等...

I have multiple lines like this <VValue type="int" value="0" /> in files running in Sublime; each where the value increments 0, 1, 2, 3 etc...

我需要更改这些值,+60.所以,0 会变成 60,1 会变成 61 等等.

I need to change these values, +60. So, 0 would become 60, 1 would be 61 etc.

如何在 Sublime 中选择多行并用正则表达式附加它们?我不确定选择数字本身的命令......在另一个线程中提到了类似 \d+ 的东西 - Sublime Text 2 增量数字

How do I select the multiple lines and append them with regex in Sublime? I'm not sure of the command to select the number itself... something like \d+ was mentioned in another thread - Sublime Text 2 increment numbers

注意,我跳过了一个数字来分隔运行文件的软件中的一些内容,所以它确实需要一个 +60 到 value 命令,而不是直接替换所有和增量(如上面的线程),因为如果你跟着我,那会甩掉被跳过的那个.例如,0, 1, 3, 4, 5 应该等于 60, 61, 63, 64, 65 而不是 60, 61,62、63、64.

Note, I skip one number to separate some content in the software the files run in, so it really needs to be a +60 to the value command instead of just a direct replace all and increment (as in the thread above) as that would throw off the one that was skipped, if you follow me. For example, it could be 0, 1, 3, 4, 5 that should equal 60, 61, 63, 64, 65 and not 60, 61, 62, 63, 64.

我是否需要像 TextPastry 这样的东西,并使用数字序列命令?如果是这样,我不确定它是如何工作的,希望得到评论.

Do I need something like TextPastry, and to use the Number Sequence Command? If so, I'm not sure how that works and would appreciate comments.

感谢您的帮助:)

编辑;我想我可以在 Text Pastry 中使用自动步进功能吗?有人可以告诉我如何...安装和使用.

Edit; I think I can use the Auto Step feature in Text Pastry? Can someone kindly run me through this how to... install and use.

推荐答案

不幸的是,Text Pastry 不够强大(据我所知).您需要一些评估程序包.我们将在这里使用 Sublime-Evaluate.

Unfortunately, Text pastry is not powerful enough (as far as I know). You need some evaluator package. We'll use Sublime-Evaluate here.

简单地安装它(假设你已经安装了包管理器)

To install it (assuming you have package manager installed) simply

Command+Shift+p -> ip -> Enter -> evaluate -> 回车现在只需选择要更改的数字(启用正则表达式搜索):

Command+Shift+p -> ip -> Enter -> evaluate -> Enter Now just select the numbers you want to change (search with regex enabled):

(?<=<VValue type="int" value=")\d+(?=" />)

Alt+回车.现在他们被选中了.

Alt+Enter. Now they are selected.

选择后的向右箭头.输入 +60.现在Ctrl+Shift+← 3次选择

Right arrow to go after the selection. Type +60. Now Ctrl+Shift+← 3 times to select

0+601+60...n+60

0+60 1+60 ... n+60

在每一行.现在 Command+Shift+e 就完成了(或者,您可以 Command+Shift+p -> evaluate -> 回车.

on each line. Now Command+Shift+e and you are done (alternatively, you can Command+Shift+p -> evaluate -> Enter.

更多推荐

Sublime 3 中的增量值/数字

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

发布评论

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

>www.elefans.com

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