Input methods for Unicode characters in editors and the shell
doc.perl6.org
doc.perl6.org
Option-e then a vowel produces that vowel with an acute accent. I think "español". (Oh, `option-n, n` produces ñ). Option-! produces ¡ (upside down bang used in spanish).
Option-u then vowel produces vowel with umlaut/diëresis ö ï ä ë.
Option dash is an en-dash and shift-option-dash is an em-dash. Option-< is ≤ and option-> is ≥. option-= is ≠. shift-option-2 (ie option-@) produces the euro sign € (I wonder why it isn't option-$, it was probably already used for something else, oh well, only so much room for mnemonics).
Those are the only ones I currently remember, because those are the ones I use anything close to regularly, but many other non-ascii characters have similar mnemonics using the option key, if I need one I look it up and use it.
Works in just about any software at all, including the terminal.
I don't know why other OS's haven't done similar. Maybe lack of that useful extra 'option' key, the other meta keys may already be taken for other purposes in other OS's.
What uncharacteristically unintuitive for Apple. On my keyboard (Linux with AltGr dead keys), AltGr-` followed by a vowel produces a grave accent, AltGr-' produces an acute accent, and AltGr-" produces an umlaut.
To type ñ, type Compose, ~, n.
To type →, type Compose, -, >.
To type €, type Compose, C, =.
To type —, type Compose, -, -, -.
To type {vulcan salute, which HN strips}, type Compose, L, L, A, P. (Actually, this doesn't work for me, although it is present in /usr/share/X11/locale/en_US.UTF-8/Compose.
I personally like to map Compose to the Menu key, because the Menu key's default behavior is totally useless.
If it's standard in Linux (?) wonder why OP didn't mention it?
setxkbmap -option compose:menu
to add it to the menu key.On OS X you get a set of different accents, dash sizes, ligatures, quotes, Greek symbols, and so on.
This non-sense has resulted in most of my co-workers swapping keyboards altogether with the English keyboard and writing the ascii equivalent of special letters (ae → æ, d → ð, þáði → tadi, etc.) because swapping keybards (even though it is only one command; Shift + Option + Space) becomes such a pain if you have to do so many times over the day.
I don't see why people would begrudge the ability to use the 'proper' mathematical symbols just because they're slightly harder to type.
Of course, it's another situation where Perl 6 is just crazy, but crazy awesome :)
The only way to fix these problems though is to increase their use, so ultimately the end goal will be worth it. That seems to have been the Perl 6 mantra for a decade or so.
setxkbmap -option compose:ralt
Now, right Alt (AltGr) is your compose key.Then, for example:
à is Compose + ` + a
ö is Compose + " + o
ß is Compose + s + s
ç is Compose + , + c
€ is Compose + = + e
In Emacs, the easiest way to input Unicode directly is to set read-quoted-char-radix to 16 in your .emacs. Then use C-q (typically bound to quoted-insert) to input a glyph directly via hex code point. ∀ is C-q + 2200
λ is C-q + 3bb
∃ is C-q + 2203
若 is C-q + 82e5
世 is C-q + 4e16
An easier way is to dial up a character map program like gucharmap and copy and paste.I just found it's editable in the Gnome settings editor. Browse to Keyboard->Shortcuts->Typing. Then click the "Disabled" next to Compose, which will allow selection of the compose key. The directions at the bottom of the settings window are simply incorrect, or don't apply to this particular screen, I dunno. Regardless, it works well for most common characters (the only language I regularly type with need for them is Spanish, so it covers all the bases there).
On the other hand, I guess I'm running OS X so I merely need to re-memorize all the Mac mnemonics that I knew back when I used OS 9, and have now forgotten in favor of GNU screen's digraphs....
Before I found out about the built-in panel I wrote a menu bar app[0] that does copy directly to the clipboard, and I still use it since that's what I need more often than the "paste into previous app" behavior of the built-in panel.
For example I just needed to insert some UTF-8 characters into MacVim, which doesn't support this palette. So I had to:
- switch to Safari
- open the palette and find the character
- make sure a text field is focused *
- double-click to insert *
- finally copy the character *
Those last few steps wouldn't be needed if one could simply copy just the character from the palette.
(Disclaimer: normally I would just search google for "Unicode _____", but wanted to try this after seeing it mentioned)
echo "{"
echo '{'
echo "\{"
echo '\{'
all fail. This makes tcsh totally unsuitable to work with, for example, JSON expressions. alias precmd 'echo `date` "#@#" `pwd` "#@#" `history 1` >> ~/.complete_history'
This basically saves all my commands to a file (which is very handy, by the way).So somehow this interferes with the curly braces. I put the history part in double-quotes, and now it works:
alias precmd 'echo `date` "#@#" `pwd` "#@#" "`history 1`" >> ~/.complete_history'
Thanks for helping me solve this :)