This thread here discuss about piping output of shell command into a new buffer in vim but it does not discuss it by using the current buffer like
%new | r !%gcut -d '"' -f2,4,6,8,10
where the percentage sign %
tries to use the current buffer, unfortunately resulting to
E499: Empty file name for '%' or '#', only works with ":p:h"
so
How can I pipe the shell-command-edited buffer into a new buffer in Vim?
:new | r !gcut -d '"' -f2,4,6,8,10 #
#
is a placeholder for "the previous file".
If you have spaces in the filename, then use quotes
:new | r !gcut -d '"' -f2,4,6,8,10 "#"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With