4/26/2020

Run Python Script in Vim

Add below Vim settings into .vimrc to run current editing python script in Vim seamlessly.
It assumes 'python3' is already in the PATH environment variable.

autocmd BufReadPost *.py :command! Py !python3 %:t
cnoreabbrev py Py

Run the editing python script with the customized "py" command :

:py