Ⅰ. 插件描述
Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'sillybun/autoformatpythonstatement'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'sillybun/autoformatpythonstatement'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'sillybun/autoformatpythonstatement'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/sillybun/autoformatpythonstatement
Ⅳ. 文档说明
# autoformat-python
Introduction
This is a plugin aimed to autoformat python statement. When you finish type a line and type <Cr> to start a new line, the previous line will be formatted automatically.
It also boost the start new line time for large python file. No delay at all.
Details
if you write python file like that:
a =1+2<cursor>that looks ulgy, right? Don't worry. With the help of this plugin, you simply press return button in insert mode or normal mode, then the code will be formated automatically by autopep8 into this:
a = 1 + 2
<cursor>Installation
Use your plugin manager of choice.
- Add
Bundle 'https://github.com/sillybun/autoformatpythonstatement'to .vimrc - Run
:BundleInstall - And change to the plugin directory and run in shell
./install.sh
- Add
- Add
Plug 'https://github.com/sillybun/autoformatpythonstatement', {'do': './install.sh'}to .vimrc - Run
:PlugInstall
- Add
Usage
Everytime you type enter, the previous line will be formatted automatically.
:ChangeFormatCurrentLineMode: this command is to switch the plugin on/off state.