The behavior is more obvious if you type something after performing the split
# split: a
As you can see it splits the current selection into smaller sub-sections (meaning it retains the current anchor & cursor) by ending the current selection when it meets the regex.
Position 0: start selection
Position 1: matches regex, end selection. Cursor must go on the
a character as it is 0 width selection.
Position 2,3,4: continue selection.
Position 5: matches regex so stop selection…
I’m just guessing here but the weird cursor behavior where it sometimes ends up on an “a” seems to be due to have a “0 width selection” between each a. If you split on
a+ you get something close to what you expected.
If you want to achieve an inverse selection then you can either do this to select anything that’s at least one character long where all of the characters are not a (written
# select: [^a]+
--+ -+ ^
you can also do a zero-width negative lookahead but then I think you have to do a merge afterwards, unless someone else knows how to do it all at once
# select: (?!a)
+++ ++ ^
# <a-_> (a.k.a. Alt-Underscore)
--+ -+ ^
As an aside if you do an append after the
split: a rather than an insert then you almost get the behaviour of the inverse selection but you also end up with a cursor at the end of you selection, which you probably don’t want.