Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I use :!ls in Vim command line, it supposed to open a window at the bottom with Press ENTER or type command to continue. But my vim closes the current file.

How can I fix it?

share|improve this question

Your desired behavior only happens in GVim/MacVim which comes with lightweight terminal emulation. When executed in your terminal emulator, Vim suspends itself and ls is run in the Vim's parent shell. fg is indeed the right way to get back to Vim.

Note that you can get a much more useful directory listing with Vim's buit-in Netrw plugin. Instead of :!ls, do :Ex.

See :help netrw.

share|improve this answer

I just needed to use fg to go back to vim.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .