Skip to main content
Share Your Experience: Take the 2024 Developer Survey
14 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
  • 241
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
  • 11.1k
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
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
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
  • 460
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,135
4 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
  • 141
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
  • 300
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.9k
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
  • 17.4k
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
  • 29k
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
  • 29k
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
  • 26.4k
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
  • 26.4k
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
  • 26.4k
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
  • 11.1k
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
  • 29k
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.9k
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
  • 29k
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
  • 17.4k
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
  • 2,111
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

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
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
2 votes

How to capture errors from make in terminal window

I guess caddbuffer is currently the best way to achieve what I want.
Sora Minazuki's user avatar
2 votes

Bind makeprg to a shell command

If you need to do sh/bash commands, you should run it via sh -c let &makeprg = 'sh -c "..."'
D. Ben Knoble's user avatar
  • 26.4k
2 votes
Accepted

Using an interactive interpreter as makeprg

You can run :make to lint and then run :terminal if there are no errors. command! -nargs=* -bang -complete=file_in_path PythonMake call <SID>PythonMake("<bang>", <q-args>) function! ...
Peter Rincker's user avatar
2 votes

Open quickfix window without focusing it

Running wincmd p after the copen should work; you jump to the quickfix window and then right back to the window you were in e.g. autocmd QuickFixCmdPost * botright copen 8 | wincmd p see :h wincmd, :...
flemingfleming's user avatar
2 votes

Running make from vim

You can make use of vim terminal in vim 8.0 and later to handle asynchronous jobs. Thus, to launch make in a vertical split, you can do: :vertical terminal make I have a small function (with a ...
Biggybi's user avatar
  • 2,770

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