ogre.hx
Restores group-wise rotation of selection contents in Helix
- Stars: 4
- Last commit:
- Created:
Restores group-wise rotation of selection contents in Helix
Restores the original group-wise rotation of selection contents for the Helix editor.
Helix #13985 changed the count on
rotate_selection_contents_forward, rotate_selection_contents_backward and
reverse_selection_contents from a group size to a repetition count. These commands
restore the old behaviour, while retaining the new selection-follows-content behaviour.
| Command | Effect |
|---|---|
:rotate-selection-contents-forward | Rotate the contents of each group of selections right |
:rotate-selection-contents-backward | Rotate the contents of each group of selections left |
:reverse-selection-contents | Reverse the contents of each group of selections |
Hyphenated so that these sit alongside the built-in underscored commands rather than replacing them, in case you still want the repetition count.
Inverting a dictionary, the case from
helix-golf. Two selections per line
over four lines, {a} the primary:
{one}: 1 1 : {one}
two : 2 2 : two
three: 3 -> 3 : three
four: 4 4 : four
2 then A-): each pair swaps in place. Without the count you would instead get one long cycle
through all eight fragments.
Install with forge, Steel’s package manager:
forge pkg install --git https://github.com/waddie/ogre.hx
Then load the plugin in your init.scm:
(require "ogre.hx/ogre.scm")
Taking over the default bindings.
(keymap (global)
(normal
("A-)" ":rotate-selection-contents-forward")
("A-(" ":rotate-selection-contents-backward"))
(select
("A-)" ":rotate-selection-contents-forward")
("A-(" ":rotate-selection-contents-backward")))
:reverse-selection-contents has no default binding.
The permutation arithmetic is pure and runs headless:
sh tests/run-all.sh
AGPL-3.0-or-later. See LICENSE.
README from waddie/ogre.hx · GNU Affero General Public License v3.0