Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yulanggong/IncrementSelection
Add a number to each selection in Sublime Text, incremented once per selection
https://github.com/yulanggong/IncrementSelection
increment insert package plugin python sublime-text
Last synced: 15 days ago
JSON representation
Add a number to each selection in Sublime Text, incremented once per selection
- Host: GitHub
- URL: https://github.com/yulanggong/IncrementSelection
- Owner: yulanggong
- License: mit
- Created: 2013-02-02T15:30:48.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-09-19T13:18:14.000Z (about 7 years ago)
- Last Synced: 2024-08-01T05:23:51.983Z (3 months ago)
- Topics: increment, insert, package, plugin, python, sublime-text
- Language: Python
- Size: 8.79 KB
- Stars: 113
- Watchers: 5
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Increment Selection
==================Add a number to each selection in Sublime Text, incremented once per selection.
You may also insert the number of line containing the selection by using the '#' symbol.This plugin is based on [Riccardo Marotti's answer](http://stackoverflow.com/a/14578077) on StackOverflow. The default hotkey is ctrl alt i or cmd ctrl i.
Usage
-------Place the cursors where you need:
![step 1](http://i.stack.imgur.com/rBPkj.png)
Insert the number the counter should start from (in this case 1):
![step 2](http://i.stack.imgur.com/hODtW.png)
Select the number you typed (shift <—):
![step 3](http://i.stack.imgur.com/EJLco.png)
Type the shortcut:
![step 4](http://i.stack.imgur.com/w7wpJ.png)
Examples
----------Tips: `[]` stands for a selection, `|` stands for a caret.
[1] text [1] text [1] -> 1| text 2| text 3|
[a] text [a] text [a] -> a| text b| text c|
[A] text [A] text [A] -> A| text B| text C|
[01] text [01] text [01] -> 01| text 02| text 03|
[05,2] text [05,2] text [05,2] -> 05| text 07| text 09|
[5,-1] text [5,-1] text [5,-1] -> 5| text 4| text 3|
[a,3] text [a,3] text [a,3] -> a| text d| text g|
Increment follows the difference between the first and second element:
[10] text [9] text [1] -> 10| text 9| text 8|[a] text [c] text [a] -> a| text c| text e|
Generate line numbers:
[#] line -> 1| line
[#] line -> 2| line
[#] line -> 3| line
[#] line -> 4| line
[#] line -> 5| line