If currently in a mutable chunk of text, use "i" in order to apply the historyPosition to the insertPosition, and continue inserting there.
Use motions like "c" and "d" within the mutable chunk.
While the implementation of "c" and "d" and extensions like ci{diw is straight-forward if it is possible to edit the current mutable chunk of text, the issue might be that the theoretically mutable chunk of text cannot be altered, is only available in a different scope or possibly not available at all.
If it's not doable in 10 loc it's probably not worth it.
If currently in a mutable chunk of text, use "i" in order to apply the historyPosition to the insertPosition, and continue inserting there. Use motions like "c" and "d" within the mutable chunk.
While the implementation of "c" and "d" and extensions like
ci{
diw
is straight-forward if it is possible to edit the current mutable chunk of text, the issue might be that the theoretically mutable chunk of text cannot be altered, is only available in a different scope or possibly not available at all. If it's not doable in 10 loc it's probably not worth it.