Universal way to write Unicode characters

input-methodunicodex11

I sometimes want to write special Unicode characters, like an em-dash (—), in various programs like vim, Chrome (like just now!), or LibreOffice.

In LibreOffice, I can achieve this via a dedicated dialog box found under the Insert menu. Other programs don't seem to have a built-in way. My solution in these cases is to look up the character on Wikipedia, copy it, and paste it in.

Is there a universal way to write Unicode characters in any program that accepts text input in Linux without having to copy and paste from somewhere where it's already printed?

Best Answer

Either you can enable an Compose key, or you can press CtrlShiftU followed by the Unicode hexadecimal number of the character (leading zeroes can be skipped). For example, Æ is CtrlShiftU, then C6. This works on GNOME Terminal, Terminator, Google Chrome and a number of other applications, with Xterm (and according to comments, Emacs) not working.

On GNOME, to enable Compose, go to the Keyboard settings, then ShortcutsTypingAlternative Characters Key and map it to something (say, Right Alt). Then you press the Compose key, and - thrice to get an em-dash: —. (The arrows in this paragraph are all Compose->.)

enter image description here

Related Question