Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8767545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:50:35+00:00 2026-06-13T16:50:35+00:00

Using VIM I want to execute current sql file and see results. I’ve tried

  • 0

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:
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:50:36+00:00Added an answer on June 13, 2026 at 4:50 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to map w! in vim to save a file using sudo silently
How do I search from the end of file using VIM? I want to
I want to do the following for multiple files using Vim: Copy all text
I'm using vim 7.0. I want the following code be indented in the following
I'm using wrap in vim, but I want vim to otherwise behave as though
I'm using VIM with pythoncomplete. When I'm making a completion, the current window is
I am using vim 7.x I am using alternate file. I have a mapping
I want to develop C on Windows, but I really like just using vim
While using Vim I'll sometimes want to look at a function definition or a
Using VIM, it is easy to display line numbers for any given file with:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.