【问题标题】:Sublime text, write multiple lines with increasing numbers崇高的文字,写多行,数字越来越多
【发布时间】:2015-11-29 07:57:19
【问题描述】:

在 Sublime 文本中,通过选择多行,或 Ctrl+单击多行,我可以同时编辑所有行。我想要的是,这些行中的数字会有所不同;每行增加。

目前,例如,我会选择 6 行,按 Ctrl+Shift+L 在每行上获取多个光标,然后写例如article > h1 { font-weight:normal; },出来的是:

article > h1 { font-weight:normal; }
article > h1 { font-weight:normal; }
article > h1 { font-weight:normal; }
article > h1 { font-weight:normal; }
article > h1 { font-weight:normal; }
article > h1 { font-weight:normal; }    

从这里开始,如果我希望它适用于从 h1h6 的所有元素,我将手动编辑每一行以更改数字。

所以我的问题是,在这种情况下,Sublime Text 可以在每一行中输出越来越多的数字吗?或者在将它们全部设置为 1 之后,是否有另一种更简单的手动更改它们的方法?

【问题讨论】:

    标签: sublimetext3 sublimetext


    【解决方案1】:

    有几个包可以帮助你插入数字序列,包括Text PastryInsert Nums等等。

    例如,如果您使用 Text Pastry,您可以通过以下方式实现您想要的:

    1. 选择 6 行。
    2. 输入article > h
    3. ctrl/cmd+alt+n 打开 Text Pastry 命令行。
    4. 输入1,然后按enter
    5. 输入{ font-weight:normal; }

    第 3 步和第 4 步会将序列 1, 2, ... 插入到您当前的选择中。

    【讨论】:

    • cmd + alt + n 在 sublime Text 3 中没有打开任何内容
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-12
    • 2021-12-18
    • 2017-06-02
    • 2019-05-15
    • 2010-10-18
    • 1970-01-01
    相关资源
    最近更新 更多