Implement repeat function for register original insert (help needed) #2743
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi guys,
there is a useful function of register original insert
<c-r><c-o>
that is not clearly documented in Insert.txt, but is demonstrated here for example:
http://vimcasts.org/episodes/pasting-from-insert-mode/ (2:45)
When you repeat such an insert using dot, the current content of the register is inserted. Lets say we have:
"cat" "dog"
On cat, we can do
ci"<bs><del>'<c-r><c-o>'<esc>
and have'cat'
.Now, we can repeat that on dog.
I have a working prototype for this but need some help. (from looking at the diff, you will see the basic idea: push down the conversion from InsertCommand.Paste to InsertCommand.Insert text to get it recorded repeatable)
It does not work with a mapping yet (which is what one really wants), so this does not work yet:
nnoremap cs"' ci"<bs><del>'<c-r><c-o>'<esc>
Where do I need to look at the code?