Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [makeprg]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
64 views

Cannot read from .tmp file error when using make (E282)

I have a script that include the following lines: &l:makeprg = $'manim {expand("%:t")} {scene} {flags} --fps 30 --disable_caching -v WARNING --save_sections' make The command runs ...
Barzi2001's user avatar
  • 606
3 votes
4 answers
643 views

Working with large Visual Studio oriented codebase

I have been using Vim for about 2 years on my personal C++ project on Ubuntu with great success. I build using g++ and make, as my build system. In vim, I can build the project without problem using :...
BobMorane's user avatar
0 votes
1 answer
61 views

Provide console (stdin) input to program when compiled and run with :make?

Is it possible to run a blocking input statement in your code when it is run from within the vim buffer? For example: #include <iostream> int main(void) { int x; std::cin >> x; ...
First User's user avatar
1 vote
0 answers
52 views

Makeprg runs in different directory than `pwd`

When I run a command using make, it runs from a different directory than running it as a regular command with !. My app is a CBRA, and I open vim from within a component. The top-level app, though, is ...
BassguitarBill's user avatar
0 votes
2 answers
174 views

Translate file paths in quickfix list

I'm using msys + vim + ninja + MSVC on windows. When building, the quickfix list has errors that use the windows path, ie c:\work\folder\file.cpp Vim handles it ok-ish, it can open the files, but ...
user92979's user avatar
  • 101
2 votes
4 answers
504 views

Edit compile and run cycle

I've just got the hang of the wonders of :make and the ability to cycle through the errors. Obviously, I have to do a set makeprg with the settings I need and everything is nice, but the problem is ...
Paul92's user avatar
  • 197
0 votes
1 answer
169 views

Is this :compiler script configured properly for pylint, a python linter?

I am pretty new to Vim and coding in general. I'm trying to improve my compile-edit-compile cycle for Python. I just learned about Vim's :make and quickfix system; it's really cool. I would like to do ...
Kiteration's user avatar
1 vote
2 answers
3k views

Make and run from vim

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 ...
Paul92's user avatar
  • 197
1 vote
1 answer
57 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/ >&...
Edward Chamberlain's user avatar
1 vote
1 answer
196 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 ...
raylight's user avatar
  • 535
1 vote
1 answer
128 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, ...
Edward Chamberlain's user avatar
1 vote
4 answers
713 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 ...
InsertSON's user avatar
  • 386
0 votes
1 answer
139 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 ...
kanayt's user avatar
  • 101
1 vote
1 answer
458 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 ...
TamaMcGlinn's user avatar
1 vote
2 answers
286 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" <&...
Y.T.'s user avatar
  • 113
-1 votes
1 answer
110 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 %...
Y.T.'s user avatar
  • 113
1 vote
1 answer
81 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? ...
noibe's user avatar
  • 189
1 vote
1 answer
67 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 ...
First User's user avatar
-1 votes
1 answer
1k 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 ...
Visrut's user avatar
  • 125
1 vote
1 answer
261 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!...
Jay McCarthy's user avatar
3 votes
2 answers
311 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 ...
xaxa's user avatar
  • 177
1 vote
2 answers
523 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 ...
D. Ben Knoble's user avatar
  • 26.4k
0 votes
1 answer
68 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 " ...
BaRud's user avatar
  • 491
0 votes
1 answer
39 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 "...
Albert Gil Moreno's user avatar
1 vote
1 answer
127 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 ...
noibe's user avatar
  • 189
0 votes
1 answer
710 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 ...
Alex's user avatar
  • 11
0 votes
0 answers
27 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 ...
Gaurang Tandon's user avatar
6 votes
3 answers
7k 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....
Addman's user avatar
  • 161
1 vote
1 answer
261 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 ...
GGCristo's user avatar
1 vote
1 answer
207 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 ...
Josiah's user avatar
  • 113
1 vote
1 answer
573 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 ...
Jason's user avatar
  • 203
2 votes
1 answer
131 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 ...
kayush's user avatar
  • 147
2 votes
0 answers
299 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 ...
Husain's user avatar
  • 285
3 votes
1 answer
174 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.
mdiep's user avatar
  • 131
2 votes
3 answers
3k 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 ...
Natjo's user avatar
  • 123
2 votes
3 answers
536 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 ...
A Gold Man's user avatar
8 votes
2 answers
525 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 ...
Sora Minazuki's user avatar
2 votes
1 answer
687 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 ...
Salahuddin Ahmed's user avatar
2 votes
1 answer
570 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 ...
felixgb's user avatar
  • 23
2 votes
1 answer
636 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 ...
anon's user avatar
  • 33
1 vote
2 answers
863 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 "...
RadlyEel's user avatar
  • 141
1 vote
1 answer
193 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 ...
Janek_Kozicki's user avatar
1 vote
0 answers
50 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 ...
Mahmoud Al-Qudsi's user avatar
1 vote
2 answers
1k 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 ...
d.k's user avatar
  • 692
5 votes
1 answer
6k 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 -...
wrtlprnft's user avatar
  • 173
1 vote
1 answer
961 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 ...
Josh Pinto's user avatar
3 votes
2 answers
2k 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 ...
piotao's user avatar
  • 143
3 votes
2 answers
2k 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 ...
mbilyanov's user avatar
  • 707
1 vote
2 answers
684 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/...
Ôrel's user avatar
  • 163
6 votes
1 answer
214 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;\...
cbaumhardt's user avatar
  • 2,139