How to run commands/scripts outside of Nvim?

616 Views Asked by At

This is a rewrite of this question. For me this is a difficult question to put in words, please let me know if this is still unclear.

I wish I could run scripts in NVIM like in VIM, by running scripts outside the editor and not in the internal NVIM terminal emulator.

For example, listing files with ls

Running running : !ls on vim:

Vim :!ls

Result: It places the the editor in the background, as if I had typed CTRL-Z. I need to type a key to bring the editor back to the foreground. This is how I like it, because I can quickly go back to the terminal and see what was the result of my command, if I want to.

Vim :!ls result

Running running : !ls on vim:

Nvim :!ls

It opens a quick fix. Not what I want.

Nvim :!ls result

Using :termial ls

Nvim :terminal ls

It opens a terminal emulator. I can see the advantages for it. I can easily copy/paste from the terminal buffer, or keep it around. It is just not what I want for the most part.

Nvim :terminal ls result

Do you know how this could be achieved?

0

There are 0 best solutions below