我刚接触vim,所以试图编辑vimrc文件中的现有脚本。该脚本将当前缓冲区的内容复制到一个新窗口中,然后运行Python。
该脚本可以正常工作,但预览窗口始终是当前窗口的50%。
以下是该脚本:
" Preview window for python
fu! DoRunPyBuffer2()
pclose! " force preview window closed
setlocal ft=python
" copy the buffer into a new window, then run that buffer through python
sil %y a | below new | sil put a | sil %!python -
" indicate the output window as the current previewwindow
setlocal previewwindow ro nomodifiable nomodified
" back into the original window
winc p
endfu
command! RunPyBuffer call DoRunPyBuffer2()
map <f5> :RunPyBuffer<CR>
我尝试过设置set lines,set previewheight,set pvh,winc 10-等等,但似乎都没有起作用。有人知道我如何改变预览窗口的高度吗?