sponsor Vim development Vim logo Vim Book Ad

UniCycle : Unicode character cycler

 script karma  Rating 86/35, Downloaded by 2442  Comments, bugs, improvements  Vim wiki

created by
Jason Diamond
 
script type
utility
 
description
This script cycles through certain Unicode characters while typing. It only
works if set encoding=utf-8.

When on, the hyphen (-), period (.), apostrophe ('), and quote (")
characters are mapped to the appropriate functions within this file.

When you enter two hyphen characters in a row, the first hyphen character
will cycle to an EN DASH character. A third hyphen will turn the EN DASH
into an EM DASH. A fourth hyphen will turn your EM DASH back into a
HYPHEN-MINUS.

Entering three periods in a row will replace all three periods with a
HORIZONTAL ELLIPSIS character.

Entering an apostrophe will try to determine if the apostrophe should be a
LEFT SINGLE QUOTATION MARK or RIGHT SINGLE QUOTATION MARK. It does this by
looking at the character to the left of the new character. You can cycle
between LEFT SINGLE QUOTATION MARK, APOSTROPHE, and RIGHT SINGLE QUOTATION
MARK by repeatedly hitting your apostrophe key.

Quote characters are treated in the same manner as apostrophe characters.
You get either a LEFT DOUBLE QUOTATION MARK, normal QUOTATION MARK, or RIGHT
DOUBLE QUOTATION MARK based on the previous character and how many times you
hit your quote key in a row.
 
install details
To install, drop it in your plugins directory. To use, execute the
:UniCycleOn command. Turn turn it off, execute :UniCycleOff.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
unicycle.vim 1 2005-10-20 6.0 Jason Diamond Initial upload
ip used for rating: 3.237.15.145

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github