3

When using Gvim on Linux I can use :!ls to list files and directories 'in-line' in Gvim to navigate around the file structure and open files.

However, on Windows when using :!dir, a cmd window opens listing the files there. This is fine, but not as convenient as the in-line :!ls version. Is there a way to emulate this behavior with the Windows version of gvim?

1
  • 5
    I don't use Windows a lot, so don't have a direct answer; but a better alternative to using :!ls would be to just use :edit . (or :split ., :tabedit ., etc.). Vim includes a file manager plugin by default (netrw), which makes it much easier to do operations like opening files, etc. There are also some alternatives around in case you don't like netrw (e.g. NERDTree, dirvish, many more). Commented May 29, 2017 at 22:27

2 Answers 2

5

You should use the Plugin AsyncRun. It allows the execution of external commands in the background as well as loading output back into a buffer or the quickfixlist. And it works well on Windows.

0

If you want to upgrade to Neovim, you can use :term. It will open a new split that can run a terminal emulator. You can set up an alias in your .vimrc so that it runs bash and thus has all of the basic commands that are native to a linux system.

edit: Now as of vim 8 you can use a terminal emulator as well, so neovim isn't necessary.

3
  • 1
    :terminal is a Neovim command. The OP is using Gvim, not Neovim.
    – Rich
    Commented Jun 13, 2017 at 8:41
  • @Rich Yeah good catch, I've updated my answer to include that.
    – Gleland
    Commented Jun 13, 2017 at 23:53
  • try my extend of neomake :github.com/tracyone/neomake-multiprocess
    – tracyone
    Commented Sep 12, 2017 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.