Ⅰ. 插件描述
Sort statements at the top of your file alphabetically.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'euoia/vim-sort-top'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'euoia/vim-sort-top'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'euoia/vim-sort-top'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/euoia/vim-sort-top
Ⅳ. 文档说明
# vim-sort-top
Sort the statements at the top of your file alphabetically.
Requires the sort executable in your PATH.
Usage
To sort the use statements:
:call SortTop("use")To sort the use statements when your PHP file is saved, add this to your.vimrc:
autocmd BufWrite *.php silent execute 'call SortTop("use")'You can use it sort require statements too:
:call SortTop("require")And so on...