Ⅰ. 插件描述
Python compiler script for VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'tlvince/vim-compiler-python'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'tlvince/vim-compiler-python'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'tlvince/vim-compiler-python'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/tlvince/vim-compiler-python
Ⅳ. 文档说明
This is a mirror of http://www.vim.org/scripts/script.php?script_id=477
A very basic python compiler script. The last line of errorformat:
\%-G%.%#
is meant to suppress all further error messages after the traceback has been
dealt with so that it will be possible to use :clast to go to the last error
location which in most cases in Python is the one that has caused the error to
happen.
Please note that if python is not in the path you have to edit the line:
setlocal makeprg=python
so that it contains the path of the python interpreter (e.g.c:\python22\python).
If you want to syntaxcheck the current python file without executing it, you
could use the following function (from python_box.vim):
function! CheckPythonSyntax()
let curfile = bufname("%")
exec ":make " . "-c " . "\"import py_compile; py_compile.compile(r'" . bufname("%") . "')\""
endfunction