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:

It is likely to be wrong
'errorformat'option. Try doing(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:makewithout 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
? 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
setlocalin autocmd, notset. Withsetyou set default'makeprg'for all buffers that will be opened after sql one.