Show full output of command :hi
in scratch window:
:Redir hi
Show full output of command :!ls -al
in scratch window:
:Redir !ls -al
Evaluate current line with node
and show full output in scratch window:
" current line
console.log(Math.random());
" Ex command
:.Redir !node
" scratch window
0.03987581000754448
Evaluate visual selection + positional parameters with bash
and show full output in scratch window:
" content of buffer
echo ${1}
echo ${2}
" Ex command
:%Redir !bash -s foo bar
" scratch window
foo
bar
Thanks romainl for amazing work! I implement this command with lua script, with some extra commands to get repl-like features.
Also, this lua implementations support
vertical
andhorizontal
modifiers.And note that this lua script doesn't use
sh -c
to do things, it spawns process directly, so no shell commands available but also no shell escaping needed.My implementation in lua