When writing documents occasionally I want to insert Unicode characters into the text. Sometimes I know the character code and sometimes I look it up on the web.Currently I go to insert mode and then use <Ctrl-V>u{four digit hex number}, which can be very laborious. Is there an easier way of inserting the characters (maybe some form of pasting)?
What is the easiest way to insert Unicode characters into a document?
insert mode;unicode;input methods
Preface: This has nothing to do with Vim as such, but I will show you what I consider to be the best way to insert these characters by far; Vim's digraph system is more or less the same, but it only works with Vim. This will work in all applications.This will only work for X11 systems (Linux, BSD, etc.). For Windows, there's AllChars. It hasn't been updated in a while, but I can confirm it works well with Windows 7 (used it at my previous job). I believe OS X also has good facilities to do this built in the OS; if you use OS X, I encourage you to check them out, but as I've never really used OS X I can't point you to them.The below is (part of) a draft weblog article I have in the pipeline. Unfortunately a truly comprehensive guide doesn't exist (yet), and the below doesn't describe all the features it offers (for example, some parts about dead keys are missing) and could be better written in some parts, but I think it's still useful enough.A compose sequence is pressing the Compose key and then one or more characters to produce some character not found on your keyboard, for example, pressing  Compose, immediately followed by  and a might produce an .By default, Compose isnt bound to any key1; the Right Alt key (aka. Alt Gr) is often used, but you set this to any key you want.Set it using xmodmapYou can use xmodmapto set this:$ xmodmap -e 'keysym Alt_R = Multi_key'     # Set it right Alt$ xmodmap -e 'keysym Caps_Lock = Multi_key' # Set it to Caps Lock$ xmodmap -e 'keysym F12 = Multi_key'       # You're free to use *any* key, like F12You probably want to add this to your ~/.Xmodmap file2:! Set compose keykeysym Alt_R = Multi_keySet it using XKBYou can also set the compose key as an option to XKB withsetxkbmap:setxkbmap -option compose:ralt  # Right altsetxkbmap -option compose:caps  # Caps LockTo make these permanent, add the command to your X startup file, oralternatively, you can also set it in /etc/X11/xorg.conf:Section InputDevice    Identifier Keyboard0    Driver kbd    Option XkbOptions compose:ralt    #Option XkbOptions compose:capsEndSectionOr, in a more modern style, you can create a file/etc/X11/xorg.conf.d/90-compose.conf:Section InputClass    Identifier Set compose key    MatchIsKeyboard on    Option XkbOptions compose:raltEndSectionA list of possible values can be found in xkeyboard-config(7), section Position of Compose key3.Setting up dead keysA dead key is chiefly used to add a accent or diacritic to a letter (such as the umlaut, accent grave, etc.), although it can be used to create any character. It works by...TODO'keycode 133 = dead_greek NoSymbol SuperRhttp://zuttobenkyou.wordpress.com/2011/08/24/xorg-using-the-us-international-altgr-intl-variant-keyboard-layout/http://stackoverflow.com/questions/14922007/how-to-enter-greek-alpha-under-xorkeycode 48 = dead_grave apostrophe<dead_grave> <space>       : `   grave # GRAVE ACCENT<dead_grave> <dead_grave>  : `   grave # GRAVE ACCENT<dead_grave> <a>           :    agrave # LATIN CAPITAL LETTER A WITH GRAVEMaking a ~/.XCompose fileThe default Compose file if ~/.XCompose is missing is/usr/share/X11/locale/$LANG/Compose. Having your own ~/.XCompose overrides the default, but you can still include the default with:include %LChanges to any Compose file takes effect when you restart an application. You don't need to restart X.Compose keyA 'compose sequence' is pressing the Compose key and then one or more characters to produce some character, for example:<Multi_key> <quotedbl> <a> :  adiaeresisMeans that pressing Compose, immediately followed by  anda produces an .<Multi_key> denotes that we're using the Compose key.we then follow this by a list of one or more keys, these have to be keysyms, which are symbolic representations of keys used by X (See the Keysyms section).Followed by a :, followed by the result.The result:<Multi_key> <a>          :   adiaeresis<Multi_key> <b> <b>      :   adiaeresis<Multi_key> <c> <c> <c>  :   adiaeresis<Multi_key> Alt <d>      :   adiaeresis<Multi_key> Ctrl <e>     :   adiaeresisNote: A Compose file is case-sensitive, so A is not the same as a.Dead keysTODOMake it work in GTK & QtSet the environment variables GTK_IM_MODULE & QT_IM_MODULE to xim.Bourne shell:# Make compose key work for GTK, Qtexport GTK_IM_MODULE=ximexport QT_IM_MODULE=ximC shell:# Make compose key work for GTK, Qtsetenv GTK_IM_MODULE ximsetenv QT_IM_MODULE ximSee AlsoCompose(5)XKBComposeKey at edubuntu wikiComposeKey at Ubuntu wikiArchLinux WikiHow to make Compose work in GTK and Qt apps?Compose key at WikipediaDead key at WikipediaAllChars (compose key for MS Windows)Enabling Compose Key in GNOME.My ~/.XComposeThis is the ~/.XCompose that I use;I used a script to generate this, but I accidentally overwrote this when compiling it >_< So I need to rewrite it.Also take note of this line:<Multi_key> <i> <b> : NL65AEGO0721647952Pressing Compose ib will insert this string (a random test IBAN number); very useful for testing applications where such a number is required to create some object (Person, Organisation); XCompose can also serve as a snippet tool :-)Footnotes1:Some UNIX keyboards had a dedicated Compose key (like thisSUN),but this is fairly uncommon these days.2:Depending on your existing setup, this may or may not be read at startup,depending on your config, add the line xmodmap ~/.Xmodmap to either~/.xinitrc or ~/.xsession;also see the ArchLinux wiki.3:Reproduced for your benefit:    Position of Compose key    +------------------------------------------------------+    |Option                Description                     |    +------------------------------------------------------+    |compose:ralt          Right Alt                       |    |compose:lwin          Left Win                        |    |compose:lwin-altgr    3rd level of Left Win           |    |compose:rwin          Right Win                       |    |compose:rwin-altgr    3rd level of Right Win          |    |compose:menu          Menu                            |    |compose:menu-altgr    3rd level of Menu               |    |compose:lctrl         Left Ctrl                       |    |compose:lctrl-altgr   3rd level of Left Ctrl          |    |compose:rctrl         Right Ctrl                      |    |compose:rctrl-altgr   3rd level of Right Ctrl         |    |compose:caps          Caps Lock                       |    |compose:caps-altgr    3rd level of Caps Lock          |    |compose:102           <Less/Greater>                  |    |compose:102-altgr     3rd level of <Less/Greater>     |    |compose:paus          Pause                           |    |compose:prsc          PrtSc                           |    |compose:sclk          Scroll Lock                     |    +------------------------------------------------------+