diff --git a/.python-version b/.python-version
new file mode 100644
index 0000000..cc1923a
--- /dev/null
+++ b/.python-version
@@ -0,0 +1 @@
+3.8
diff --git a/InsertNums.py b/InsertNums.py
index 10ddea0..74f7c20 100644
--- a/InsertNums.py
+++ b/InsertNums.py
@@ -4,6 +4,7 @@
# Modules for expression evaluation
import math
import random
+import itertools
import sublime
import sublime_plugin
@@ -339,7 +340,7 @@ def run(self, edit, format='', quiet=False):
env = dict(
_=value, i=i, p=eval_value, s=step, n=len(selections),
# Modules
- math=math, random=random, re=re
+ math=math, random=random, re=re, itertools=itertools
)
if EXPRMODE:
del env['s'] # We don't need the step here
diff --git a/README.md b/README.md
index e14aba9..3644fac 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,49 @@
-# Insert Nums for Sublime Text 2 and 3.
+# Insert Nums
-A **Sublime Text 2 and 3** plugin, that inserts (consecutive) numbers across multiple selections or modifies the selections' contents with expressions. Huge configurability.
+A [Sublime Text](https://www.sublimetext.com) plugin,
+to insert (consecutive) numbers across multiple selections
+or modifiy selections' contents
+with expressions using sophisticated expressions syntax.
## Installation
-You can install *Insert Nums* via [Package Control][pkgctrl] by searching for **Insert Nums**.
+### Package Control
-Alternatively, you can download the Zip and copy it to your Sublime Text Packages folder, or use `git clone`.
+The easiest way to install is using [Package Control](https://packagecontrol.io). It's listed as `Insert Nums`.
+
+1. Open `Command Palette` using ctrl+shift+P or menu item `Tools → Command Palette...`
+2. Choose `Package Control: Install Package`
+3. Find `Insert Nums` and hit Enter
+
+### Manual Setup
+
+Alternatively, you can clone this repository into Sublime Text's Packages folder.
+
+> [!NOTE]
+>
+> To find _Packages_ folder call _Menu > Preferences > Browse Packages.._
+
+#### OSX
+
+```sh
+#!/usr/bin/env bash
+cd ~/Library/Application\ Support/Sublime\ Text/Packages/
+git clone https://github.com/SublimeText/InsertNums "Insert Nums"
+```
+
+#### Linux
+
+```sh
+cd ~/.config/sublime-text/Packages
+git clone https://github.com/SublimeText/InsertNums "Insert Nums"
+```
+
+#### Windows
+
+```dos
+cd "%APPDATA%\Sublime Text\Packages"
+git clone https://github.com/SublimeText/InsertNums "Insert Nums"
+```
## Usage
@@ -105,7 +142,7 @@ Detailed syntax definition: [format_syntax.txt](format_syntax.txt)
- `i`: Just an integer holding the counter for the iteration; starts at `0` and is increased by `1` in every loop
- `_`: The current value before the expression (`start + i * step`)
- `p`: The result of the previously evaluated value (without formatting); `0` for the first value
- - `math`, `random` and `re`: Useful modules that are pre-imported for you
+ - `math`, `random`, `re` and `itertools`: Useful modules that are pre-imported for you
*Note*: The return value does not have to be a number type, you can also generate strings, tuples or booleans.
@@ -271,6 +308,20 @@ The `|` pipe is used to show the meaning of piping the current selection to the
25
36
```
+
+- `::list(itertools.product(['a', 'b', 'c'], ['x', 'y', 'z']))[i]`
+
+ ```
+ ('a', 'x')
+ ('a', 'y')
+ ('a', 'z')
+ ('b', 'x')
+ ('b', 'y')
+ ('b', 'z')
+ ('c', 'x')
+ ('c', 'y')
+ ('c', 'z')
+ ```
### Alpha insert
@@ -401,11 +452,12 @@ And many more ...
## Contributors
-- [James Brooks](http://james.brooks.so), Twitter: [@jbrooksuk](https://twitter.com/jbrooksuk)
+- [James Brooks](http://pinkary.com/@jbrooksuk), Twitter: [@jbrooksuk](https://twitter.com/jbrooksuk)
- [@FichteFoll](https://github.com/FichteFoll), Twitter: [@FichteFoll](https://twitter.com/FichteFoll)
- Marco Novaro, [@MarcoNovaro](https://github.com/MarcoNovaro)
- Oleg Geier, Twitter: [@relikd](https://twitter.com/relikd)
- Arthur Comben, Twitter: [@anthillape](https://twitter.com/anthillape)
+- [@logworthy](https://github.com/logworthy)
# License