ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Incrementor

by eBookArchitects ST2/ST3

A Sublime Text 2 Plugin that can generate a sequence of numbers using search and replace.

Details

  • 2 2019.09.08.15.06.16
    3 2016.09.01.01.52.34
  • github.​com
  • github.​com
  • 1 week ago
  • 2 hours ago
  • 7 years ago

Installs

  • Total 7K
  • Win 4K
  • OS X 2K
  • Linux 1K
Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4
Windows 3 0 2 1 0 3 3 3 3 4 2 0 0 2 2 1 2 0 1 1 1 3 4 1 2 0 1 1 4 2 2 2 0 0 1 3 0 3 0 2 5 3 1 3 1 2
OS X 3 3 2 0 0 1 1 2 0 1 0 0 1 2 1 0 1 0 0 1 2 0 1 1 0 0 1 1 2 0 1 0 1 3 0 1 2 0 0 0 2 2 1 0 0 3
Linux 1 0 0 1 1 1 2 3 1 4 2 0 3 0 2 1 0 1 0 1 2 0 0 0 0 0 0 0 2 1 1 0 1 1 3 1 0 0 1 0 1 0 0 1 0 1

Readme

Source
raw.​githubusercontent.​com

Sublime Text 2 Plugin: The Incrementor

A Sublime Text 2 Plugin that can generate a sequence of numbers using search and replace.

There is a Sublime Text 3 port available here.

Example (Before):

10. Bob
12. Larse
15. Billy

Find: [0-9]+\. Replace: \i\.

Example (After):

1. Bob
2. Larse
3. Billy

You can also take start and step arguments \i(start,step) in parenthesis.

Example (Before):

10. Bob
12. Larse
15. Billy

Find: [0-9]+\. Replace: \i(10,10)\.

Example (After):

10. Bob
20. Larse
30. Billy

Lastly, The Incrementor also supports negative steps! \i(start,-step)

Example (Before):

10. Bob
12. Larse
15. Billy

Find: [0-9]+\. Replace: \i(100,-10)\.

Example (After):

100. Bob
90. Larse
80. Billy

Using

Use the Command Palette (Ctrl+Shift+P) and search for Incrementor: Generate a sequence of numbers to prompt for your find and replace.

Installing

Use Github here or Sublime Package Control

Linux:

Copy the directory to: "~/.config/sublime-text-2/Packages"

Windows 7:

Copy the directory to: "C:\Users\<username>\AppData\Roaming\Sublime Text 2\Packages"

Windows XP:

Copy the directory to: "C:\Documents and Settings\<username>\Application Data\Sublime Text 2\Packages"

Todo

  • Replace based on order of selection as well as their direction. (Difficult)
  • Scroll to matching pattern like sublime's default find window. (Easy)
  • Allow prepending 0s to the initial number. (001, 002, 003, 004, etc.) (Intermediate)
  • Add number of replaced items in statusbar after completion. (Intermediate)

Contributors

Don't forget to add yourself!

eBook Architects, Chris, Toby, AJ

License

Creative Commons Attribution 2.0 Generic