2

For example lets say this text is inside buffer

%s/a/b/gI

How do I run that as a vim command, without typing it inside the vim command line.

Regards

2

In command mode:

You yank the text, say if it was on its own line

y$

then type

:

then

<ctrl-r> "

|improve this answer|||||
2

You can yank the text--even multiple lines--then type:

:@"

(That's colon, at symbol, double quote.)

In fact you could yank it to a named register, such as a, and do:

:@a

See:

:help :@
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.