Skip to content
This repository

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

branch: master

incrementor.py update from Matthew Wolf

The modification is to allow a loop in the incrementation. E.g., \i(100,-10, 50) replaces with numbers starting from 100, decrementing by -10, repeating after 50 is reached.
latest commit 6a40db4476
Toby Stevenson codenamekt authored August 20, 2013
Octocat-spinner-32 Default (Linux).sublime-keymap Removed extra key definitions. Adjusted main key combo for naming con… September 19, 2012
Octocat-spinner-32 Default (OSX).sublime-keymap Fixed typo issue #1 September 19, 2012
Octocat-spinner-32 Default (Windows).sublime-keymap Fixed typo issue #1 September 19, 2012
Octocat-spinner-32 README.markdown Updated Contributors, Usage, Installation sections. September 19, 2012
Octocat-spinner-32 incrementor.py incrementor.py update from Matthew Wolf August 20, 2013
README.markdown

Sublime Text 2 Plugin: The Incrementor

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

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 keybinding to prompt for your find and replace.

Windows: [Ctrl + G, Ctrl + R] Mac OSX: [Super + G, Super + R] Linux: [Ctrl + G, Ctrl + R]

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

Something went wrong with that request. Please try again.