Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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