skywind3000 / asyncrun.vim

:rocket: Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
https://www.vim.org/scripts/script.php?script_id=5431
MIT License
1.86k stars 111 forks source link

遇到`input()`的时候会报错:‘EOF when reading a line’ & anaconda支持 #206

Open Firestar-Reimu opened 4 years ago

Firestar-Reimu commented 4 years ago
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 "!python3 %"
             else
                    exec "AsyncRun -raw python3 %"
                    exec "copen"
                    exec "wincmd p"
            endif
    endif
endfunc

这样在遇到input()的时候会报错:‘EOF when reading a line’,但是我已经打了%

以及,我用anaconda作为默认python时应该用什么语句?

skywind3000 commented 4 years ago

因为 quickfix 窗口并不能接受任何输入。

你可以试试:

:AsyncRun -mode=term -pos=tab   python3 %

anaconda 的话,把 python 换成完整指向 anaconda python 的路径。

Firestar-Reimu commented 4 years ago

我发现let g:asyncrun_open = 0并不能关掉quickfix窗口,而我并不想让它显示,怎么办呢(自动不显示那种)