sample .kak file
Opening Command Output in a New Buffer - DEV Community
Pipe to register? - #3 by FlyingWombat
edit -scratch messages
exec ‘%d’
exec ‘|echo from exec;date’
set-register | %sh{
echo “from reg echo”;
date }
exec ‘"|pge’
line 5 using the | register is a very direct way of getting output from the shell into a buffer.
However it appears to fail with newlines i.e.
|“some
shell
command”
fails even when entered with the exec command.
I can get around this by writing a shell script and using it at the pipe prompt.
I would rather express the shell script in %sh{ } as at line 6 to avoid writing
a separate shell script.
Line 6 works but the best I can find so far requires the additional exec ‘"|p’
i.e. first copy the %sh output to the pipe register (or perhaps any register) then copy the register into the buffer.
Given there is a command to write %sh{} output to a register, is there a way to write %sh{} output into the current buffer (selection) in one step?
thanks,
Greg