I use gVim in windows to edit my code (mostly C++). I use :make in gVim to compile the project, but this is a blocking operation, that prevents me from using gVim until the compilation is complete. How can I do :make asynchronously and still get the benefits of reading the errors back into Vim and jump to the errors in source code? Bonus points if I get to see the make process in real time. Right now the :make redirects the output into a file, hence I don't get to see the progress of make.
相关问题
- Angular: ngc or tsc?
- Where is the implementation of included C++/C head
- Emacs shell: save commit message
- How to change the first two uppercase characters o
- Insert text into current buffer from function
相关文章
- 如何让 vim 支持 .cshtml 文件的代码高亮
- Auto-save in VIM as you type
- How can I use gcc's -I command to add recursiv
- Vim: overloaded mapping for multiple modes
- How to use relative line numbering universally in
- php module does not compile. Does not recognize “s
- Why does the C++ compiler give errors after lines
- Compile drools guided decision table into rules
Have a look at @tpope's dispatch.vim
https://github.com/tpope/vim-dispatch#readme
Video Trailer: http://vimeo.com/63116209
What I do is
( where MyMake is the custom command which can switch to appropriate dir, make, and copen 20. )
and I am doing my job while build goes in the other window.
Other option:
You can redirect make progress to some file from the shell or within vim (:!make&). And then by using
Achieve the same result as you'd use :make
You won't be able to see the progress of make (within Vim) unless you install a very recent version of Vim (v7.4 and many patches, or simply Vim 8). Now there are a few plugins that've taken advantage of it. My BuildToolsWrapper is one of them. I've tested it successfully on linux and on windows.
Before that we needed other tricks. I remember Marc Weber's plugin which was able to emulate background compilation on Windows. There was a few others. I let others list them.
see this script
Have a look at my AsyncCommand plugin. It's just wraps the vim syntax required to execute something and load it with --remote. I've uploaded AsyncCommand 2.0 that includes an
AsyncMake
command.Add the script to your
.vim/plugin
and you can build with:AsyncMake
or:AsyncMake target
. Errors will be opened in your quickfix once the make completes.Responding to comment for more readable code:
To see the build results on Windows, if you have cygwin/unxutils/something with tail in your path, then in asynccommand.vim, change
to
That should change all Async commands to open up a second command window with the output.
Try using
(more info on ":help !start") - that way vim doesn't have to wait for the process started to finish - you can just keep on going with your editing).