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 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
add comment

4 Answers

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
1  
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? –  MIkhail 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
add comment

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
add comment

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
1  
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... –  MIkhail 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. –  MIkhail 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
show 1 more comment

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: http://vimdoc.sourceforge.net/htmldoc/intro.html#Ex-mode

share|improve this answer
add comment

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.