I'd like to select some text in vim and then execute it in bash. I know of the following procedure:

  1. select text using V or v
  2. :!!

However, this replaces the selection with the output of the command. What if I don't want that?

link|improve this question

60% accept rate
feedback

1 Answer

up vote 5 down vote accepted

Type the :w command like this:

:w !command

As you type it, it will appear like this:

:'<,'>w !command

See

:help :w_c
link|improve this answer
Thanks, exactly what I was looking for – Klaas van Schelven Aug 31 '11 at 17:34
feedback

Your Answer

 
or
required, but never shown

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