Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement repeat function for register original insert (help needed) #2743

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Implement repeat function for register original insert (help needed) #2743

wants to merge 2 commits into from

Conversation

sql-koala
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant