Is it possible to select the text of a command from a buffer in visual mode and then feed it to ex?

Like so I can modify the text of the command in the buffer and then after I press some keys have it run as the ex command?

  • 2
    Would the @ command work for you? You'd have to have : in your buffer but you could yank and then do @" (or whatever register you yanked to).
    – Tumbler41
    May 26 '17 at 19:32

First select some text visually. Then yank it (y). Then enter ex-mode (:). Finally insert the yanked text (<CTRL-R>0).

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.