Hot answers tagged

13 votes

Quickfix support for Python tracebacks

Built in compiler plugin pyunit As already suggested by jamessan, one option is to use the built in compiler plugin pyunit: :compiler pyunit :set makeprg=python3\ % :make This has the downside, that ...
siho's user avatar
  • 231
9 votes
Accepted

Quickfix support for Python tracebacks

Vim comes with a set of "compiler" scripts, one of which is called "pyunit". If you run :compiler pyunit and then :make (with your suggested value for 'makeprg'), quickfix is ...
jamessan's user avatar
  • 10.8k
6 votes
Accepted

How to set up compiler globally?

Use :compiler!. From :h :compiler: :comp[iler][!] {name} Set options to work with compiler {name}. Without the "!" options are set for the ...
Peter Rincker's user avatar
6 votes

How to customize % symbol in makeprg command

You can modify what is being expanded using so called filename modifiers. See the help at :h filename-modifiers (link). In your case you can e.g. use :set makeprg=gcc\ -Wall\ -g\ %\ -o\ %< See ...
Christian Brabandt's user avatar
5 votes
Accepted

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

As stated on the question, :h map-bar suggests escaping the pipe with with \|. However, grep apparently understands that as a literal bar, thus the backslash needs to be escaped as well. This should ...
lsrdg's user avatar
  • 450
5 votes
Accepted

Terminal setup when running make from Vim

From :h :make: The ":make" command executes the command given with the 'makeprg' option. This is done by passing the command to the shell given with the 'shell' option. This works almost like typing ...
muru's user avatar
  • 24.6k
5 votes
Accepted

Why is make running against a wrong file?

The right-hand side of let &makeprg = ... is evaluated only once. If you put that command in your .vimrc as it is, %expands to /home/sporty/.vimrc and you get the interesting effect you describe. ...
Sato Katsura's user avatar
  • 3,969
5 votes

Running make from vim

Yes, Vim has the built in :make command which executes make by default, but you can set up other build systems by setting makeprg. There’s no progress visualisation by default, but once :make is done ...
Tae's user avatar
  • 2,075
4 votes

Determining makefile based on source file name

The trick is to forget about wrapping your mind around set syntax, and use let instead: let &makeprg = 'make -f ' . fnameescape(substitute(expand('%'), '\m_test\.cpp$', '.makefile', '')) See :...
Sato Katsura's user avatar
  • 3,969
4 votes

Open quickfix window without focusing it

Actually asyncrun has that feature. According to the document: AsyncRun displays its output in quickfix window, so if you don't use :copen {height} to open quickfix window, you won't see any output....
WW00WW's user avatar
  • 290
4 votes
Accepted

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

My understanding is that the makeprg setting is primarily used to change the actual make/build program and in your case the program isn't changing...it's always 'make'. Since :make accepts arguments ...
B Layer's user avatar
  • 19.4k
4 votes
Accepted

How to change make command

why is stderr redirected to stdin, In order to have both end up in the quickfix list. what is that second command with tee doing, man tee. It redirects stdin into a file and into stdout. It's ...
Luc Hermitte's user avatar
  • 16.8k
4 votes

Check if :make fails

Vim will set v:shell_error with a :make invocation, same as it does for other ways it executes external commands using the shell. The most likely reason why you're not seeing the error code of the ...
filbranden's user avatar
  • 28.1k
4 votes
Accepted

Difference between make and make!

This is happening because while :make! doesn't jump to the first error message, it actually sets the quickfix cursor at it. So when you use :cnext it will actually try to go to the second error, which ...
filbranden's user avatar
  • 28.1k
4 votes

How to Create Sublime-Like Build Systems in Vim?

There are, in fact, some predefined build scripts, and it is relatively straightforward to create your own. These are known as compiler plugins or scripts, and live in the compiler directory of ...
D. Ben Knoble's user avatar
  • 24.6k
3 votes
Accepted

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

As of 7.4.1802, Vim is supposed to quickfix lines up to 4096 bytes long instead of truncating them.
jamessan's user avatar
  • 10.8k
3 votes

Quickfix support for Python tracebacks

quickfix.py parses the traceback into a vim-friendly errorformat. Here is an example of running it on a file with a single line 1 / 0. ❯❯❯ quickfix.py tests/errors/div_by_zero.py "tests/errors/...
jadelord's user avatar
  • 131
3 votes

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

Your first command was closer: :vnew makes a new vertical window. :vertical is the modifier that changes how other commands work: :vertical terminal make ts run-server Will get you the terminal. If ...
D. Ben Knoble's user avatar
  • 24.6k
3 votes
Accepted

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

Using 'makeprg': set makeprg=docker\ run\ --rm\ -v\ $(pwd):/src\ container\ make Unfortunately, the \ are necessary for set to keep the spaces; single quoting won't work here. Now you can run :make ...
D. Ben Knoble's user avatar
  • 24.6k
3 votes
Accepted

Debug how vim calls makeprg

how to debug it? You can use the :verbose command to increase verbosity of a specific command. In this particular case, you need verbosity level above 3 to see the actual shell command executed by ...
filbranden's user avatar
  • 28.1k
3 votes
Accepted

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

Assuming that the plugin is using the standard scheme for filetype specific configuration... Probably the simplest way to override is by creating a file in $MYVIMDIR/after/ftplugin with filename that ...
B Layer's user avatar
  • 19.4k
3 votes
Accepted

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

Yes. This is basically a 2 part question. Can you compile a program in vim, yes :make will run your Makefile, you can also set makeprg to your compile program if its different. type :he :make and :...
Gambo's user avatar
  • 166
3 votes
Accepted

`:make` not echoing output to the command line

This happens because a 'shellpipe' of the default of > (which is the default on Windows) doesn't really work on Powershell. It seems to have it produce a file that uses UTF-16 encoding and then ...
filbranden's user avatar
  • 28.1k
3 votes

Make and run from vim

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 ...
Luc Hermitte's user avatar
  • 16.8k
3 votes

Working with large Visual Studio oriented codebase

Not really the answer you are looking for but I thought I'd share it in case anyone finds it useful. Whenever I have to use Visual Studio, the first thing I do is to register gVim as an external tool. ...
Friedrich's user avatar
  • 878
2 votes
Accepted

Vim ErrorFormat question for Gradle compiler plugin

I suggest doing it like this: let &errorformat = \ '%E%\m:%\%%(compileJava%\|compileTarget%\)%f:%l: error: %m,' . \ '%E%f:%l: error: %m,' . \ '%Z%p^,' . \ '%-G%.%#' Proof: ...
lcd047's user avatar
  • 3,650
2 votes

Quickfix with makeprg running in a different directory

For example, if your ninja output directory is '$SRC/out' :set makeprg=ninja\ -C\ $SRC/out Note: the space should escape by backslash
Daniel YC Lin's user avatar
2 votes

maven colored logging breaks filepath

Vim does not support Ansi escape color codes. The AnsiEsc.vim plugin attempts to fix this for some cases. However I doubt AnsiEsc can be combined with the quickfix list in any meaningful way. I ...
Peter Rincker's user avatar
2 votes

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

saginaw pointed out in a now deleted comment that running :silent! make | redraw! | cw instead of :make solves my problem. If I run it the program compiles, and if there is an error the QuickFix list ...
cbaumhardt's user avatar
  • 2,079
2 votes
Accepted

How to capture errors from make in terminal window

I have made a small plugin vpager. That allows to dump the terminal output back into Vim. The last commit in addition allows to use the output and dump it into the quickfix list. So you can simply do ...
Christian Brabandt's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible