toggle_words.vim


Ⅰ. 插件描述

toggle words like:'true'=>'false', 'True'=>'False' etc

Ⅱ. 基本信息

创建日期:  2006-10-12
使用用户:  19
Github星:  6
插件作者:  Vincent Wang

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

" Documentation:
"   The purpose of this plugin is very simple, it can toggle words among
"   'true'=>'false', 'True'=>'False', 'if'=>'elseif'=>'else'=>'endif' etc .
"
"   To use it, move the cursor on some words like 'true', 'False', 'YES', etc,
"   call command
"     :ToggleWord
"
"   It will toggle 'true'=>'false', 'False'=>'True', 'YES'=>'NO' etc. Yes,
"   this script will try to take the case into account when toggling words, so
"   'True' will be toggled to 'False' instead of 'false'. Currently the way to
"   check the case is very simple, but it works well for me.
"
"   You can define a map for 'ToggleWord' comand to make it easier:
"     nmap ,t :ToggleWord<CR>
"
"   This script can search the candicate words to toggle based on
"   current filetype, for example, you can put the following configuration
"   into your .vimrc to define some words for python:
"      let g:toggle_words_dict = {'python': [['if', 'elif', 'else']]}
"  
"   There are some default words for toggling predefined in the
"   script(g:_toogle_words_dict) that will work for all filetypes.
"   Any comment, suggestion, bug report are welcomed.

添加新评论