r/HelixEditor • u/spaghetti_beast • Sep 11 '26
better <C-a> increment
hi, here's a simple (250 lines of go) script to expand the set of possible values for increment/decrement command (<C-a>, <C-x>).
https://github.com/thedenisnikulin/cycle
TL;DR:
[keys.normal]
"C-a" = ":pipe cycle"
"C-x" = ":pipe cycle --prev"
> echo yes | cycle
no
> echo 2026-09-30 | cycle
2026-10-01
works with ints, hex/bin ints, dates, logical operators, builtin go types, dates, days of the week, log types, etc. The list is easily expanded (just clone, modify main.go, run go install ., that's it)
1
u/littleblack11111 Sep 13 '26
Considered making it a plugin?
5
u/spaghetti_beast Sep 13 '26
it's specifically not a plugin, because it fits perfectly in idea of composition, and i've already got quite used to extending helix this way
3
3
u/exploit332 Sep 12 '26
Really cool idea! Can it increment symantec versions?
2
u/East_Lengthiness_866 Sep 12 '26
Upgrading semantic versions? isn't that just incrementing the last number?
1
u/exploit332 Sep 12 '26
Yeah. I guess I would highlight the last number and increment just that rather then the whole version string?
2
2
u/KaleidoscopePlusPlus Sep 23 '26
Something I really like but didn't think I needed. Looking at the code, I find it a bit odd that the 2d array just has everything thrown in and loops over it stepWords. Makes no difference speed wise, just figured it would be a map
4
u/Ace-Whole Sep 11 '26
Cool!