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 ...
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 ...
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
...
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 ...
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 ...
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
...
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. ...
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 ...
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 :...
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....
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 ...
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 ...
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 ...
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 ...
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 ...
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.
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/...
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 ...
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 ...
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 ...
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 ...
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 :...
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 ...
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 ...
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.
...
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:
...
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
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
makeprg × 56quickfix × 17
vimrc × 6
errorformat × 6
key-bindings × 4
neovim × 3
terminal-buffer × 3
make × 3
vimscript × 2
command-line × 2
microsoft-windows × 2
filetype × 2
filetype-tex × 2
error × 2
filetype-python × 2
filetype-c++ × 2
compile-vim × 2
ftplugin × 2
regular-expression × 1
gvim × 1
terminal × 1
autocmd × 1
replace × 1
external-command × 1
bash × 1