1

I want to paste multiple lines in command mode. (After the colon) How can I do this? When pasting either a ^m pops out or just pastes the first line.

3 Answers 3

2

http://vimdoc.sourceforge.net/htmldoc/cmdline.html#:bar

| can be used to separate commands, so you can give multiple commands in one line. If you want to use | in an argument, precede it with \.

Sign up to request clarification or add additional context in comments.

Comments

1

As you're trying to paste some text, it must be in a register already. I assume it is unnamed register then to execute it press :@@

And, no, you cannot just insert it into the cmdline unless you've replaced all CRs with | (and even then it may not work properly depending on the command you paste).

Comments

0

You can put a range like this:

:for i in range(1,255) | put='192.168.0.' . i | endfor

Or if you have a text on the clipboard:

:0put +

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.