Switch 0.9.1

Switch is a simple switch that allows quick toggling of boolean options in Vim.
Switch is a simple switch that allows quick toggling of boolean options in Vim.

This plugin enables you to toggle any vim boolean options between 'on' and 'off' using just one key mapping.

That's how it works:

- The key mapping asks for one character as input and passes it to a function;
- The function searches for the given key in the boolean options dictionary;
- The function toggle the boolean option that corresponds to the found key.

That's how to configure it:

The options dictionary is found inside the 'config' section and is structured as the following sample, where the key entries are single alphabetic characters and the value entries are vim boolean options:

:let g:prev_Switch_Dict = { 'a' : 'showmatch'
, 'b' : 'linebreak'
, 'e' : 'errorbells'
, 'f' : 'foldenable'
, 'h' : 'hlsearch' }

You should edit the options dictionary to your preference and that can be done in two ways:

- Editing it inside the switch.vim file;
- Setting it inside your .vimrc file.

To see the list of the available boolean options type :set inv

The dictionary can be quite large (as the default one is), yet switch.vim doesn't occupy any more then one key mapping. Note that getting used to those few keys you need most is far enough for this plugin to be helpful.

That's how to use it:

The default key mapping is < C-Q > (change it if you want to).

- To see the actual dictionary content you type < C-Q >< Space >;
- To toggle an option you type < C-Q >{key}


· Vim

What's New in This Release:

· Many 'key:option' pairs added to the default boolean options dictionary
· Echoing of the dictionary's keys visually improved
· Dictionary's name changed to g:prev_Switch_Dict

last updated on:
June 15th, 2008, 22:40 GMT
license type:
GPL (GNU General Public License) 
developed by:
Tomás Ribeiro Cardoso
ROOT \ Text Editing&Processing \ Vim Plugins
Download Button

In a hurry? Add it to your Download Basket!

user rating 10



Rate it!

Add your review!