I have tried Googling but I couldn't find anything relevant.
Is it possible to program in Python on VIM and do something like
:!iPython
to have Python execute the code?
Last time I tried that, it just opened up Python in the terminal.
Save the current buffer with :w
, then :!/usr/bin/env python %
.
or even better set aw
in your .vimrc, follow by
:pyf %
this will not incur you to bring up shell and hence better.
if you want you can map it and save in your .vimrc following cmd
map <F8> pyf %<CR>
hitting F8 will execute your python file
/usr/bin/env python
- :pyf
will always use /usr/bin/pythonX
(depending on python3 vs python2).