Update readme
This commit is contained in:
parent
923e72dc98
commit
1fc63a7e22
54
README.adoc
54
README.adoc
@ -1,10 +1,37 @@
|
|||||||
= rust-selection-sort.kak
|
= rust-selection-sort.kak
|
||||||
|
|
||||||
|
Sort selections by regular expression or lexicographically
|
||||||
|
|
||||||
|
== Example
|
||||||
|
|
||||||
|
. Imagine you want to sort these stages
|
||||||
|
+
|
||||||
|
[source,groovy]
|
||||||
|
----
|
||||||
|
stage('Package (#3)') {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build (#2)') {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Initialize (#1)') {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Publish (#4)') {}
|
||||||
|
----
|
||||||
|
|
||||||
|
. Select the stage and stage body with: `%sstage<ret>MLM`
|
||||||
|
. Sort the selection by step number with: `:sort-selections #\d+<ret>` (sort on whole capture) or `:sort-selections "'.+?#(\d).+?'"` (sort on first capture group, which contains only the digits)
|
||||||
|
. Note if you just run `:sort-selections<ret>`
|
||||||
|
|
||||||
== Configuration
|
== Configuration
|
||||||
|
|
||||||
[source,sh,title='sh']
|
[source,sh,title='sh']
|
||||||
----
|
----
|
||||||
cargo install https://github.com/austenadler/rust-selection-sort.kak
|
cargo install --git https://github.com/austenadler/rust-selection-sort.kak
|
||||||
----
|
----
|
||||||
|
|
||||||
[source,title='kakrc']
|
[source,title='kakrc']
|
||||||
@ -35,31 +62,6 @@ define-command sort-selections -params 0.. %{
|
|||||||
** If the regex does not contain a capture group
|
** If the regex does not contain a capture group
|
||||||
** If the regex contains at least one capture group
|
** If the regex contains at least one capture group
|
||||||
|
|
||||||
== Example
|
|
||||||
|
|
||||||
. Imagine you want to sort these stages
|
|
||||||
+
|
|
||||||
[source,groovy]
|
|
||||||
----
|
|
||||||
stage('Package (#3)') {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Build (#2)') {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Initialize (#1)') {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Publish (#4)') {}
|
|
||||||
----
|
|
||||||
|
|
||||||
. Select the stage and stage body with: `%sstage<ret>MLM`
|
|
||||||
. Sort the selection by step number with: `:sort-selections #\d+<ret>` (sort on whole capture) or `:sort-selections "'.+?#(\d).+?'"` (sort on first capture group, which contains only the digits)
|
|
||||||
. Note if you just run `:sort-selections<ret>`
|
|
||||||
|
|
||||||
== TODO
|
== TODO
|
||||||
|
|
||||||
* I don't know what will happen with multiline strings
|
* I don't know what will happen with multiline strings
|
||||||
|
Loading…
Reference in New Issue
Block a user