I need to copy a sequence of (normal mode) commands and then paste it to be executed in Vim. When I try that now though it inserts it for me into the document.
How can I paste sequence of Vim (normal mode) commands?
This used to work; now with the auto-insert-mode I don't know how to make it work again, or how to search for this in the documentation.
Using Vim in Terminal on macOS Monterey
Example
JJJj
(three joins and a cursor down one line)
Say I am in huge text file containing repetitive output which I want to
transform to make it visually more concise. I don't want to punch in those JJJj
every time. Pasting the commands repetitively a few dozen (or hundred)
times is faster, maybe even only for tens of times like
JJJjJJJjJJJjJJJjJJJjJJJjJJJjJJJjJJJjJJJj
.
BEFORE
first line1
first line2
first line3
first line4
second line1
second line2
second line3
second line4
:
AFTER
first line1 first line2 first line3 first line4
second line1 second line2 second line3 second line4
:
This lets me transform thousands of lines within a few seconds.
|
? What do you try? Enter in command mode with:
and paste<C-r>+
?