I am new to vim, so I was trying to modify an existing vimrc script file. The script will take the contents of the current buffer and copy it to a new window, and then start Python. The script works, but the preview window always makes up 50% of the current window.
This is the script:
" 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>
I tried installing lines, installing preview, installing pvh, winc 10 -, ... but nothing works. So does anyone know how I can change the height of the preview window?
source
share