Ⅰ. 插件描述
Reindent a complete file based on indent information taken out of indent file.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/reindent'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/reindent'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/reindent'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/Reindent
Ⅳ. 文档说明
If you like well formatted files use this plugin to chage the indention of a complete file.
Annotations:
The indention information is taken out of the VIM Indent-files. This
script processes them in a little different way than vim itself, therefore
it is possible that the indent-functions have to be rewritten before they
work.
This script tries to rewrite the indent functions automatically (during
this a file "reindent.tmp" will be created in your current working
directory).
There may be indent functions out there that don't work with this script because they are too complex to be rewriten automatically with my
code.
Preconditions:
- A indent function has to exist for your current file (indentexpr is set)
- Your current working directory has to be writable if Indent-function has to be rewritten.
Usage:
- Copy this file to your plugin directory
- start vim with i.E. a HTML-File
- Hit <Lead>R (If you don't know what <Leader> is read :help leader
or press R to reindent).
If using menus you will find a new menu item "Reindent" in menu
"Syntax".
- Customize the Keystroke with an Entry in your .vimrc i.E.:
map ff <Plug>reindent " call reindent by pressing ff