Wednesday, 9 January 2019

How can I execute a Vim selection or range in bash without replacing it?


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?



Answer



Type the :w command like this:


:w !command

As you type it, it will appear like this:


:'<,'>w !command

See


:help :w_c

No comments:

Post a Comment

Where does Skype save my contact&#39;s avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...