0

I want to send a visual block as a stand-in for a command, such as

:!echo < something from the visual block

How could I do this in vim?

steveyang
  • 9,178
  • 8
  • 54
  • 80
  • you want `something from the visual block` or `the whole visual block`? – Kent Feb 22 '13 at 11:06
  • @Kent The whole visual block. I want to send the text as standard input to what I selected to the underlying system commands. – steveyang Feb 22 '13 at 11:18

2 Answers2

2

Easiest is to yank the visual selection (while in visual mode) into a register, and then start the command (:!echo ...) and insert the register's contents on the command-line via <C-R>".

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
0

One way is to use the Command-line window via q:, as shown in this screen capture:

enter image description here

emallove
  • 1,417
  • 1
  • 17
  • 22