How to output all lines to python console in vim?

I set the F2 hint with map <f2> :w<cr>:! D:\Python34\python %<cr>, when I open the python file in vim and press F2, the python file will be executed. For a simple example, here is my python file and is open in gvim.

enter image description hereenter image description here

python, , , . : F2 ( python gvim), python , python python, , , Obj().hello python gvim, , gvim python, , , vim ? :!D:\Python34\python -i % , enter image description here - , 1) :!D:\Python34\python -i % , gvim , , vim. 2) python python. Wiondow

, , , , gvim , ? enter image description here

+4
3

( GVIM Python), :!start Windows:

nnoremap <f2> :w<cr>:!start D:\Python34\python -i %<cr>

, Python. :

nnoremap <f2> :w<cr>:!start cmd /c type % && D:\Python34\python -i %<cr>

+1

, Vim- Conque :

0

Python (2.7).

  • , ( - ) python .
  • python ( vim )
  • import demo
  • , demo.SomeModule().meth()
  • vim
  • python reload(demo)
  • demo.SomeModule().differentMeth()

vim / , . vim , PYTHONSTARTUP, , . , r() , .

, . , , ; .

0

All Articles