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 try to run some commands like :make or :!ls , it shows the output in an altogether different screen/view and the file i am editing is not visible during this process. Is there anyway i can still see my file and edit, while the command that i executed can probably run in a window at the bottom, probably the quick fix window?

share|improve this question

You could use vim-dispatch plugin for asynchronous build (make).

or if you simply want shell command result in a quickfix window you coud use in ex-mode:

:cexpr system('ls -alh') | copen

even better, add this to you .vimrc

command -nargs=+ Run :cexpr system('<args>') | copen

and run in ex-mode:

:Run ls -alh
share|improve this answer

That behavior is totally normal. CLI Vim doesn't come with a terminal emulator and will never do. GUI Vim comes with a dumb terminal emulator, though, and I think that's what you "remember long back".

You need a plugin for running commands in a separate Vim window. ConqueTerm is the only name I can remember at the moment but I think there are one or two others.

share|improve this answer
Can you run vim inside ConqueTerm? – grawity Feb 28 '13 at 14:31
Haha. I don't even want to know. – romainl Feb 28 '13 at 14:44
@romainl I do not want it to run in a separate shell. In a vim file, if i press : , it is being displayed in the last line in the monitor. Now, when i execute the command, let the command run in bash, but is there any way that the output be shown either in the last line again, or in a quickfix window? – woodstok Mar 1 '13 at 5:41
When you do :make and there are errors, those errors are always listed in the quickfix window. If you want the output of some arbitrary command to be displayed in the quickfix window you must read through :h quickfix.txt which tells you how to format the output of your commands for use in the qf. But I suspect a serious case of XY problem, here: displaying the output of some commands in the qf window is a mean, what exactly are you trying to achieve? – romainl Mar 1 '13 at 7:38

Like romainl said, this is the normal behavior. Vim does not store the output, acting like a pager it is only shown while the external command is executed. You could capture the command output in a scratch Vim buffer (:r !ls), use a plugin like the mentioned Conque, or split a shell window outside of Vim with the help of a terminal multiplexer like screen or tmux.

share|improve this answer

Would splitting the vim windows work for you?

  • :split - splits window horizontally
  • :vsplit - splits window vertically

Then you can use of the windows just for editing the file and the second one for executing via :make.

share|improve this answer
No, i remember long back, in another system that the output used to come automatically in a small horizontal window at the bottom. I just dont know why its currently going to a different shell when this is executed... – woodstok Feb 28 '13 at 12:19
@MIkhail: You could use Vim within a terminal multiplexer such as tmux to get similar functionality. – Daniel Andersson Feb 28 '13 at 13:02
@DanielAndersson I live and sleep in tmux :). But, :make in vim helps me in jumping to line numbers with errors, which wont be there if i run make in another window. – woodstok Feb 28 '13 at 13:08
You can run make in the background or in another terminal and save the output to a file, then when it's done, read that file into the quickfix – garyjohn Feb 28 '13 at 15:36
... list with :cfile. See :help :cfile. [First comment timed out.] – garyjohn Feb 28 '13 at 15:46

You may be looking for ex-mode. If you type Q in normal mode you will get a command prompt style buffer at the bottom of the window.

More information here:

share|improve this answer

You must log in to answer this question.

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