Saturday, February 27, 2016

Re: how to transfer output of ':.w !sh' back to current buffer

On 26.02.16 08:29, Roman wrote:
> I use ':.w !sh' to run some lines with shell commands
> Is any way to transfer output of this commands back to buffer or maybe
> to split buffer window or do something like ':r !sh $current_line'

The easiest way to return the result is not to use ":.w", but the !
command instead. To quickly confirm that the pipe output returns,
perhaps type:

!!echo "No-one expects the Spanish Inquisition"

To confirm the return trip on e.g. a whole paragraph, place the cursor
on its start, and type:

!}gawk '{gsub(/\<the\>/,"FROG"); print}'

If there are any "the" words, the transformation is not hard to spot.

And if the outcome is not what's desired, there's undo.

Now your commands/scripts can be unleashed with confidence.

Erik

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment