Motivation: Reduce the feedback loop when writing new code as much as possible.
Currently, I need to do a full bazel build of my project whenever I have made changes. However, often the mistakes I have made when first writing code would be evident just from compiling the current file.
For autocompletion, I build a compile_commands.json file using bazel. If I grep for the current file in that, there is a compile command in there that takes less than a second if I put it in a separate file and
chmod +x it. The question is, how can I best integrate this in Vim? I was unable to find any plugins that already do this.
compile_commands.json is generated for an LSP-client plugin; I currently use CoC. So it might be logical to build this as an extension of the LSP client plugin.
I think it wouldn't be logical to set the makeprg, since that is normally used to compile the whole project.