I do not want to see empty buffer after makeprg in VIM

django, vim

Solution

It is likely to be wrong `'errorformat'` option. Try doing

:make!

(with bang!) and see whether this window appears. If it does not, this is true and you should read `:h 'errorformat'` and also set it in addition to `'make'`. Or just never use plain `:make` without bang and forget about jumping to errors (if that script is able to output information about errors).

Another idea: Could you show the output of

:au ShellCmdPost,QuickFixCmdPre,QuickFixCmdPost

? It may also be a problem of some plugin or vimrc code that is launched on one of these three events.

By the way, you have two things in commands you posted that may be improved. First, mapping should be written as `nnoremap`. You don’t need remapping here and it may save your time when you add some other mapping to your vimrc.

Second, use `setlocal` in autocmd, not `set`. With `set` you set default `'makeprg'` for all buffers that will be opened after sql one.

Problem

Using VIM I want to execute current sql file and see results. I've tried the following (`./manage.py dbshell` is a Django wrapper over `psql`) ``` nmap <silent> <Leader>r :make<CR> autocmd FileType sql set makeprg=cat\ %\\\|./manage.py\ dbshell ``` It works fine. But after Press ENTER or type command to continue VIM always shows me empty buffer (maybe it is error list). How to skip its opening? If I run the same in command mode it will be as I've expected (without annoying buffers) ``` :!cat %|./manage.py dbshell ``` My SQL script contains a single select statement. And the magic buffer looks like:

Original source