Increment Selection

Have you ever wanted to increment large number of numbers in bulks?

Let’s say you have hundreds or even thousands of strings called <string>0</string>. But you don’t want to go through each line and manually update the strings <string>0</string>, <string>1</string>, <string>2</string> and so on. That would be ludicrous and SO unbelievably cumbersome.

Here’s how to do it:

  1. Using Sublime Text 3 install the plugin:
    1. Tools > Install Package Controls
    2. Tools > Command Palette > Install Package > TextPastry
  2. Rename <string>0</string> til <string>null</string>
  3. Select the first instance of null
  4. Select all occurrences of null with this shortcut: ctrl+cmd+G
  5. Open Text Pastry (alt+cmd+N)
  6. Enter this command: \i(0,1). That will replace all occurrences of null with numbers starting from 0 and increment with 1.
Dette indlæg blev udgivet i Miscellaneous. Bogmærk permalinket.

Skriv et svar