Yea, anything is fine as far as it is working.
But usually when you want to edit text in XVim text view, think followings in order.

    1. Find if there is a method named with "xvim_" which solves your problem (and use it if found)
    2. Use [self insertText:replacementRange:] for any edit(insert,delete,replace) of a text. (This is handled by an undo manager properly)
    3. If you find some editing operation is shared by several Vim commands, think about create xvim_ prefixed method in NSTextView+VimOperation category.

I wonder if your code here is handled by an undo manager properly.

Let me know if you have further questions.

Thank you for your great improvements!