Running Python code in Vim
I am writing Python code using Vim, and every time I want to run my code, I type this inside Vim:
This gets frustrating, so I was looking for a quicker method to run Python code inside Vim. Executing Python scripts from a terminal maybe? I am using Linux.
how about adding an
FileType python, create a mapping:
nnoremap <buffer> <F9> :exec '!python' shellescape(@%, 1)<cr>
then you could press
<F9> to execute the current buffer with