vim-expand


Ⅰ. 插件描述

Expand things like {foo,bar}, {1..10} and $HOME inline with a single command

Ⅱ. 基本信息

创建日期:  2014-12-10
使用用户:  3
Github星:  21
插件作者:  Oliver Caldwell

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'olical/vim-expand'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'olical/vim-expand'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'olical/vim-expand'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/olical/vim-expand

Ⅳ. 文档说明

# vim-expand

Allows you to filter your current line or visual selection through the [expand][] function in place via the :Expand command. This allows you to write things like the following.

function {add,remove}User() {
    // ...
}

And expand it to this.

function addUser() {
    // ...
}

function removeUser() {
    // ...
}

You can also use things like {1..10} to iterate through numbers as well as environment variables such as $HOME, so it works much like bash brace and variable expansion. Read the [expand][] documentation for all the details, but basically it supports a lot of things.

Usage

Simply execute :Expand on your desired line or visually select a block of lines, such as the function above, and then execute :Expand. Vim will automatically populate the range in front of the command for you. Of course you can enter a manual range with :1,3Expand.

Installation

Add Olical/vim-expand to your favourite plugin manager such as [vim-plug][], which I'm currently using in my [dotfiles][].

Plug 'Olical/vim-expand'

License

The [Unlicense][], so you can use this however you want, wherever you want. The full license file can be found in this directory within the UNLICENSE file.

Author

[Oliver Caldwell][] / [@OliverCaldwell][]

添加新评论