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
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityFor 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
In command mode:
You yank the text, say if it was on its own line
y$
then type
:
then
<ctrl-r> "
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 :@