Running :make from gVim in Background

后端 未结 7 1130
失恋的感觉
失恋的感觉 2020-12-01 00:46

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

7条回答
  •  离开以前
    2020-12-01 01:29

    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

    call Async_Impl(tool_cmd, vim_cmd)
    

    to

    call Async_Impl(tool_cmd, vim_cmd)
    call Async_Impl("tail -f ". temp_file, "")
    

    That should change all Async commands to open up a second command window with the output.

提交回复
热议问题