Ⅰ. 插件描述
Automatically align as you type (autoalign): bib c c++ html maple matlab tex vimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/autoalign'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/autoalign'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/autoalign'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/AutoAlign
Ⅳ. 文档说明
[AutoAlign V12 AND LATER REQUIRES VIMBALL V18 OR LATER TO UNPACK]
[AutoAlign also requires vimscript#294]
Note: this plugin is not a right-margin justification tool; see vimscript#177 for that
AutoAlign is currently composed of one regular plugin and six ftplugins. As you type statements such as (for vim)
let xyz= 1
let x= 2
the ftplugin/vim/AutoAlign script will call upon the Align command to line up those equal signs, resulting in aligned equal signs (which can't be usefully shown here due to browsers' use of proportional fonts).
Similarly the c ftplugin will do so for
x= 3;
xy[0]= 4;
abc->def= 5;
one= 2;
(it only applies to what you're currently typing, it doesn't take any previously existing lines into account). For c++,
= signs, <<, and >> operators get aligned. For maple, :=.
Former Version Notes:
5: AutoAlign maps and functions changed to allow use of "." to repeat entry of =... expressions. Uses g:mapleader instead of a built-in backslash to access AlignMaps. First release of AutoAlign using vim's user-help.
4: Now supports: bib c cpp tex vim. AutoAlign now breaks the undo sequence at every align operation, so one undo undoes the entire AutoAlign. Bugfix: (with virtual edit) has been fixed (when backspacing over ==). Bugfix: unwanted beeping due to virtual edit being off fixed
3: Now supported: bib c tex vim. :AA toggles AutoAlign on and off. AutoAlign now auto-aligns only blocks of alignable text. cecutil.vim included (SaveMark, SaveWinPosn, etc)
(alpha/beta version available at http://www.drchip.org/astronaut/vim/index.html#AUTOALIGN)