Questions tagged [makeprg]

The program that will be run when the `:make` command is executed.

Filter by
Sorted by
Tagged with
1
vote
1answer
20 views

Issue with makeprg Shell Script $? Variable

I have the following .vimrc: let &makeprg="./run-tests" The contents of run-tests: #!/bin/sh error_file=$(mktemp) coverage run --source "$PWD" --branch -m pytest tests/ >&...
1
vote
1answer
53 views

How can I return to the file that I'm editing when I execute it from inside Vim?

Let's say that I have the following node.js script: console.log("test") If I use the command :set makeprg=node\ % | set autowrite | make I'll execute this node.js code and see the following ...
1
vote
3answers
158 views

How to Create Sublime-Like Build Systems in Vim?

I am currently new to neovim. Something that has me a bit stuck is being able to easily run my code. The text editor I used before trying out vim was Sublime Text 3, and, in that text editor, all I ...
1
vote
1answer
42 views

Change Directory with Errorformat

I'm trying to write an errorformat for JUnit. Directory structure from cwd is: unsw/piazza/PiazzaForum.java unsw/piazza/Thread.java unsw/test/PiazzaTest.java Amongst all the cruft outputted by JUnit, ...
0
votes
0answers
22 views

Default javac Compiler Plugin Does not Display Shell Output

I want to compile and run a generated java executable inside of Vim quickfix. My .vimrc: function! Make(script) if &ft ==# "c" || &ft ==# "cpp" compiler gcc elseif &...
0
votes
1answer
67 views

Java path required in .vimrc

Normally you would compile java using this: javac Hello.java java Hello Under certain conditions you can compile from Vim by just typing :make by placing this in .vimrc autocmd Filetype java set ...
1
vote
1answer
210 views

Execute compile command from compile_commands.json for current file

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 ...
-1
votes
1answer
58 views

make appending strange folder to my makeprg on Windows

I recently came to use NeoVim and I was trying to configure my vim to run a single file using :make command (My g++ is from MinGW), I tried to use :let &makeprg = 'g++ -Wall -Wextra -std=c++17 -o %...
1
vote
2answers
62 views

`:make` not echoing output to the command line

I have a simple makefile as follow: all: A.cpp g++ -o A.exe A.cpp .\A In A.cpp, #include <iostream> using namespace std; int main() { cout << "Hello World!\n" <&...
1
vote
1answer
37 views

Difference between make and make!

According to the help page the only difference between :make and :make! is that the latter doesn't jump to the first error. So why isn't :make! <Bar> silent cnext<CR> equivalent to :make? ...
1
vote
1answer
48 views

Compile man pages written in groff_man?

What would you reccommend as makeprg for compiling nroff documents (for man pages)? I currently have it set to mandoc because it works when I do it from the terminal: mandoc foo.1 When I run :make, it ...
1
vote
1answer
159 views

How can I make vim ignore a filetype plugin's makeprg setting?

I am using a plugin that sets makeprg to some value specific to the filetype's programming language. I want to use my global setting instead, because I also use Makefiles. How can I do this? Thank you!...
-1
votes
1answer
463 views

How to compile a program and open the output in a vertical terminal window?

How can I write a command that does the following? With one mapping, compile and/or run a program based on the filetype (*.c, *.cpp, *.js, *.py, etc.), and open a vertical terminal window with the ...
3
votes
2answers
91 views

Debug how vim calls makeprg

I'm trying to set up pylint to work with :make command in Vim 8.2. I've set :compiler pylint but running :make gives me pylint's help message, so some arguments seem to be passed incorrectly. :set ...
1
vote
2answers
189 views

Check if :make fails

I just setup this mapping for my latex development: nnoremap <buffer> <LocalLeader>o :make %:r.pdf <Bar> !open %:r.pdf<CR><CR><CR> But I wondered about checking if ...
0
votes
1answer
42 views

error not formatted as per efm

I have created a mwe plugin to show my problem for fortran ft. tree ftrial ftrial ├── autoload │   └── makes.vim └── ftplugin └── fortran_mk.vim with cat ftrial/autoload/makes.vim " ...
1
vote
1answer
101 views

How to change make command

In my ~/.config/nvim/ftplugin/tex.vim I have the following: set makeprg=pdflatex\ -halt-on-error\ -file-line-error\ -synctex=1\ % set errorformat=%f:%l:\ %m however when I run make the command that ...
0
votes
1answer
26 views

Quickfix stack doesn't work when using make -j

As mentioned in other questions, using make -C buildpath as makeprg in Vim and the appropriate errorformat triggers the nice handling of the quickfix directory stack. That is, the quickfix uses the "...
0
votes
1answer
251 views

Quickfix won't parse :make output

My makeprg is set to: cd build/ && cmake --build . --config Debug && ctest && gdb -q -ex run ./a This allows me to build application, run tests and start debugging session ...
0
votes
0answers
26 views

How to use bash aliases in ftplugin files? [duplicate]

I want to be able to compile and run C++ files directly from inside vim. I have a custom compilation alias gmm defined in ~/.bash_aliases. I do not want to copy it over to my ~/.vim/ftplugin/cpp.vim ...
1
vote
2answers
421 views

Running vim's ':make' using ':term'

Is there a way that I can have the :make command output itself to a terminal window in vim? In the 8.1 release, they added the :term command, which allows you to run an external program in a vim ...
4
votes
3answers
2k views

Running make from vim

I would like to use vim as a c++ IDE. Is there a possibility to run "make" and see the "make" progression in a separate (newly opened) pane. Also, the consecutive execution of the binary would be nice....
0
votes
1answer
86 views

Bind makeprg to a shell command

I want to make something like this: let &makerpg = '[ -f Makefile] && make || cd build && [ -f Makefile ] && make || cd ../build && [ -f Makefile ] && make ...
1
vote
1answer
111 views

How do I remap the :make command to run a docker container?

I use a custom docker container to build my project so my "make" command is actually docker run --rm -v $(pwd):/src container make $arg. I'd like to be able to type :make $arg in command mode and ...
1
vote
1answer
289 views

How to show make command's output in vertically split buffer?

I want the behavior of :vnew term://make ts run-server but using the make command instead of invoking term. I have tried :make ts run-server | vert copen but that still takes over the entire terminal ...
2
votes
1answer
98 views

How to have two different makefile mapped to two different keys?

I am using F5 to compile my programs From my .vimrc set makeprg=make\ -f\ ~/makefile\ %< noremap <F5> :make<CR> But I want to add one other way to compile my programs which compiles a ...
2
votes
0answers
115 views

Configuring Multiple Compiler Plugins in a Single Project

Vim has compiler plugin feature which enables the user to write a compiler configuration, and then running :make will trigger the command, and errorformat will parse the output and will print any ...
3
votes
1answer
86 views

Default parameter for :make if $* is empty?

Is it possible to provide a default if $* is empty in a :make? I'd like to specify :makeprg so that: :make runs swift build :make foo bar runs swift foo bar.
1
vote
2answers
617 views

Silencing :make command

I am setting makeprg to perl % to run my Perl script (if there's a better way, I'm up for that, too), and it works just fine, except that it reproduces the first line of output prefixed with the text "...
20
votes
4answers
5k views

Quickfix support for Python tracebacks

Say I have a python script with a runtime error: $ cat example.py #! /usr/bin/env python3 a = 1/0 which gives: $ python3 example.py Traceback (most recent call last): File "example.py", line ...
5
votes
2answers
2k views

Quickfix with makeprg running in a different directory

How can I start a build with my makeprg running in a different directory than the working directory of vim and still catch errors in quickfix so that I can jump between them? The problem is that ...
2
votes
3answers
2k views

Open quickfix window without focusing it

I run my make commands asynchronously in vim with the asyncrun plugin. I use this code in my .vimrc to open the quickfix window automatically everytime I run an asynchronous make command in order to ...
8
votes
2answers
401 views

How to capture errors from make in terminal window

Vim 8.1's release note seems to indicate that you can feed output from make running in a terminal window to a quickfix list, but I couldn't find any detailed explanation. Is there a way to do this ...
2
votes
1answer
521 views

Quickfix navigation not working properly

I'm trying to lint my C files inside vim. I know that quickfix should help in this case. I found the following pc-lint file maintained by Craig Emery. I have this file in vim/vim80/compiler. if ...
3
votes
2answers
1k views

How to set up a Build > Make > Run cycle for a C++ project?

I am trying to come up with a way to handle C++ projects with Vim. I have sorted out syntax and code completion etc. to some extend. Now, I am curios to hear about how people handle their Build > Make ...
2
votes
1answer
505 views

Using an interactive interpreter as makeprg

Is there any way to use an interactive interpreter as the makeprg? I want the interpreter to stay interactive after invoking :make. For example, if I wanted to invoke python on the current file and ...
2
votes
1answer
426 views

How to set up compiler globally?

In my vimrc, I have a compiler myCompiler. When the editor starts up, everything is fine. When I switch to a new file, the compiler settings (makeprg and errorformat) revert to their defaults. How ...
1
vote
1answer
152 views

vim :make :cwindow, I need error length character limit larger than 1000

I am compiling a program with :make command, then I examine g++ errors using :cwindow. The problem is that the error produced by g++ is longer than 1000 characters and it is cut. Currently I have to ...
1
vote
0answers
44 views

Can't hide quickfix before executing makeprg

I'm trying to hide the quickfix window while building, so that it doesn't show outdated info. I can, of course, execute :ccl at any time to close quickfix. Additionally, I've used autocmd to call a ...
1
vote
2answers
889 views

How to redirect a make program's stdout when using it in Vim?

I use Google closure-compiler to check syntax errors in a JS file, the problem is that if there is no error it gives the source of the file to its STDOUT and with the default settings this counts as ...
4
votes
1answer
5k views

How to escape pipe character in `:make`, `:grep` and friends

I'm trying to use :grep to search for one of several words. Since grep accepts regular expressions, I figured I could just use the pipe character | to build a single expression for both words: :grep -...
1
vote
1answer
807 views

How to run make in Vim, open results in split window and show the compilation time?

I would like to run :make in Vim, while also allowing the user to edit a file while we're waiting for the compilation to finish, then when the compilation is finished open the result in a split window ...
2
votes
2answers
1k views

How to customize % symbol in makeprg command

When I set makeprg using: set makeprg=gcc\ -Wall\ -g\ %\ -o\ % and then invoke :make Vim does not pass proper filenames, because this command is translated as: gcc -Wall -g file.c -o file.c and ...
1
vote
2answers
564 views

maven colored logging breaks filepath

If I use the color logging for maven, the file path is corrupted by the coloring syntax: ^[[1;31m[ERROR]^[[m /home/foo/bar/src/main/java/com/domain/bar/App.java instead of [ERROR] /home/foo/bar/src/...
6
votes
1answer
190 views

Returning from :make to source code has sometimes a step too much

To work with pascal files, my .vimrc contains this code: "" Work with pascal files augroup make_pascal autocmd! autocmd FileType pascal :compiler fpc autocmd FileType pascal :set makeprg=clear;\...
3
votes
1answer
875 views

Terminal setup when running make from Vim

What exactly is Vim doing when executing the :make command? I was expecting that it just executes the content of the makeprg variable just like running :!make and additionally collects the output, ...
2
votes
1answer
429 views

Why is make running against a wrong file?

I am trying to get VIM to run the right makefile for a specific source file. For example, if the current file is ui8_c_buff_test.cpp and if I use the makeprg configuration below and run make, let &...
3
votes
1answer
407 views

Determining makefile based on source file name

For current source file with the following name pattern: xxx_test.cpp how do you execute make file with the following patter xxx.makefile. I tried using set makeprg=make\ -f\ fnameescape(substitute(...
0
votes
1answer
702 views

Make: Nothing to be done for 'build'

I am using a Gradle compiler plugin for Vim. I run :compiler gradle and then :make build, and Gradle build is executed and error results properly parsed (many thanks to @lcd047 answering my question). ...
4
votes
1answer
440 views

Vim ErrorFormat question for Gradle compiler plugin

I am trying to fix a compiler plugin for Gradle. Gradle generates error messages of the type: :compileJava/file/path/Main.java:52: error: cannot find symbol public static ABC abc; ...