0

Screenshot_20201111_201729

This is the display when I typed :AsyncRun -mode=term -pos=bottom ~/.anaconda/bin/python %.

But if I set:

filetype plugin on
map <F5> :call RunPython()<CR>
function! RunPython()
    exec "w"
    if &filetype == 'python'
        if search("@profile")
            exec "AsyncRun kernprof -l -v %"
            exec "copen"
            exec "wincmd p"
        elseif search("set_trace()")
            exec "!~/.anaconda/bin/python %"
        else
            exec "AsyncRun -mode=term -pos=bottom ~/.anaconda/bin/python %"
            exec "copen"
            exec "wincmd p"
        endif
    endif
endfunc

in my .vimrc, it will display the quickfix window which I do not want.

Screenshot_20201111_202200

How to disable the quickfix window?

  • Your function includes copen, which opens the quickfix window... also, the executes are not needed. – D. Ben Knoble Nov 11 '20 at 14:43
  • Thanks! I deleted them and everything went OK – 1900011604 Nov 14 '20 at 12:38
1

Remove the lines that open the quickfix list (:copen).

Aside—if you use :execute for simple Ex commands, it’s usually enough to do just the command (so just :copen, :wincmd p, etc.). Even the colon’s aren’t necessary in most places.

0

Now it looks laike this:

filetype plugin on
map <F5> :call RunPython()<CR>
function! RunPython()
    exec "w"
    if &filetype == 'python'
        if search("@profile")
            exec "AsyncRun kernprof -l -v %"
        elseif search("set_trace()")
            exec "!~/.anaconda/bin/python %"
        else
            exec "AsyncRun -mode=term -pos=bottom ~/.anaconda/bin/python %"
        endif
    endif
endfunc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.