toggle_words 1.3

toggle_words is a Vim plugin that allows you to toggle words like:'true'=>'false', 'True'=>'False'.

  Add it to your Download Basket!

 Add it to your Watch List!


Rate it!
send us
an update
GPL (GNU General Public License) 
2.7/5 14
Vincent Wang
ROOT \ Text Editing&Processing \ Vim Plugins
toggle_words is a Vim plugin that allows you to toggle words like:'true'=>'false', 'True'=>'False'.

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

Developer comments:

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' command 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.

About Vim:

Vim is a text editor first released by Bram Moolenaar in 1991 for the Amiga computer. Vim was created as an extended version of the vi editor, with many additional features designed to be helpful in editing program source code; its full name is Vi IMproved.

While Vim is cross-platform, it is most popular on Unix-like operating systems.

Released under a software license compatible with the GNU General Public License, Vim is free and open source software. The program's license includes some charityware clauses.

Like vi, Vim's interface is based not on menus or icons but on commands given in a text user interface; its GUI mode, gVim, adds menus and toolbars for commonly used commands but the full functionality is still expressed through its command line mode.

For many users learning Vim may be slow initially, but once the basics are understood they progress quickly. To facilitate this, Vim has a built-in tutorial for beginners. There is also the Vim Users' Manual that details the basic and more advanced Vim features. This manual can be read from within Vim, or found online.

Vim also has a built-in help facility (using the :help command) that allows users to query and navigate through commands and features.




just put this script into YOUR_HOME_DIR/[._]vim/plugin folder.

What's New in This Release:

fix error of 'E488: Trailing characters'

Last updated on July 21st, 2008

#Vim plugin #boolean switcher #word toggler #Vim #boolean #value #expression

Add your review!