1

I just got into :make and I love the ability to browse the errors.

However, in my usual workflow, I am interested in running make and then running some executable. So my to-go option so far was to run something along the lines of :!pushd build && make && ./bin/exec. As I said, I love the way I can browse the compile issues I get with :make, but can I somehow combine this with running the executable?

Editing the makefile to include this as a target is not an option unfortunately.

2 Answers 2

2

Since editing your makefile is not an option then may need to edit your 'makeprg' setting to accommodate your build process

:setlocal makeprg build\ &&\ make\ &&\ ./bin/exec

See 'makeprg' for more details

3

As Peter mentioned, you can execute your program and send its outputs to the quickfix window.

If you want to execute it elsewhere (which could be necessary if you run an interactive program, or if your wish to execute it in a terminal), then a little bit of programming is required. See this almost-duplicate Q/A for a solution: https://vi.stackexchange.com/a/34584/626

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.