Some time ago, I've made this question where I asked how to execute a file on the terminal with NeoVim... The solution I found was the following
:terminal bash % . Knowing that, I made the following configuration on my
The above configuration works perfectly fine, it allows me to execute a file with
python when I press
F6... And if I select some lines and press
F6 it`ll execute only the selected lines.
The problem is that in my context, I need to execute files that are not stored on the disk. Let's say I have the following
echo "Hello World"
I need to open this file with
cat file.sh | nvim - (not
nvim file.sh)... When I do that, if I try using the command
:vert botright terminal bash % I receive the error:
E499: Empty file name for '%' or '#', only works with ":p:h"
I tried using
set ft=sh but it didn't work as well. Is there any workaround for this problem? In a way that I don't need to save this file on the disk to execute it with
vim, I have a similar configuration in my
vimrc file, the only difference is that I use the commands
:vert botright '<,'> %terminal bash and
vert botright %terminal bash instead. With
vim it works perfectly fine to execute files opened from pipe. Like in
cat file.sh | vi -. This issue only exists on NeoVim.