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?

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

2 Answers 2

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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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