flipwords.vim


Ⅰ. 插件描述

This Vim plugin provides a command that changes the order of 2 delimited pieces of text

Ⅱ. 基本信息

创建日期:  2012-04-17
使用用户:  3
Github星:  4
插件作者:  Marko Mahnič

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

## Flipwords

The plugin Flipwords provides the command Flip that changes the order of two
delimited words on a single line.

Examples

Flip    - flip two white-space delimited words
Flip ,    - flip two items in a comma-delimited list 
Flip , )    - flip last two parameters (nested parens are not handled)
Flip = ;    - flip two words delimited by '=' and ';' (c assignment)
Flip = )    - flip two words delimited by '=' where the second 
        word ends with and includes ')'

Some effects of the Flip command (the coursor is at the character following '|'):

~~ let |b = a
:Flip =
~~ let |a = b

~~ call doThis(|"one", "two", "three")
:Flip ,
~~ call doThis(|"two", "one", "three")

~~ call doThis("one", |"two", "three")
:Flip ,
~~ call doThis("one", |"three"), "two"

~~ call doThis("one", |"two", "three")
:Flip , )
~~ call doThis("one", |"three", "two")

~~ if |result == getValue() " some comment
:Flip == )\zs
~~ if |getValue() == result " some comment

添加新评论