首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

在vim中运作python

2012-06-26 
在vim中运行pythonvim7.3自带对python2.7的支持(vim72对应python2.6)?read this:http://vim.wikia.com/wik

在vim中运行python

vim7.3自带对python2.7的支持(vim72对应python2.6)

?

read this:

http://vim.wikia.com/wiki/Python_-_check_syntax_and_run_script

?

in a word, all you need to do is just append the following lines to vimrc:

?

"===========  F5 run python ====================autocmd BufRead *.py set makeprg=python\ -c\ "import\ py_compile,sys;\ sys.stderr=sys.stdout;\ py_compile.compile(r'%')"autocmd BufRead *.py set efm=%C\ %.%#,%A\ \ File\ "%f"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%mautocmd BufRead *.py nmap <F5> :!python %<CR>autocmd BufRead *.py set tabstop=4autocmd BufRead *.py set nowrapautocmd BufRead *.py set go+=b
?

?

save it and restart gvim, now when hit F5, a dos command window will pop up and your python code runs there.

?

?

?

?

?

?

?

?

热点排行