News for hackers. Stuff that matters.
Re:I don’t know how to count that low by fao_ on Monday October 25, 2021 @05:11PM (#28993182)
With the Compose Key, which is a feature of all linux distributions:

compose + a + e = æ

compose + o + / = ø

compose + a + o = å

https://en.wikipedia.org/wiki/Compose_key

Something I find absolutely criminal is that this hasn't taken off in a broader sense, and that most users memorize the unicode terms for characters like ©, rather than just typing a simple, eminently memorable sequence like (compose + o + c)

Re:I don’t know how to count that low by sudobash1 on Monday October 25, 2021 @05:54PM (#28993616)
Vim uses something similar to this which it calls digraphs (see :help digraph). http://vimdoc.sourceforge.net/htmldoc/digraph.html

Ctrl+k a e = æ

Re:I don’t know how to count that low by randlet on Monday October 25, 2021 @07:40PM (#28994630)
TIL. Thanks. I love how I keep learning new things about vim after years of daily usage.
Re:I don’t know how to count that low by sundarurfriend on Wednesday October 27, 2021 @04:46AM (#29010875)
You can also add your own digraphs. I've used this to make entering emojis easier, for eg.

    execute 'digraph :) 128578'
so that Ctrl-K :) in insert mode inserts . (`execute 'digraph :\| 128528'` => , `execute 'digraph /\ 128591' ` => , etc.) Edit: I guess HN strips emojis from comments? Just try these and find out which ones they are, I guess!

This was before I knew that the Julia plugin allows emoji entry too (\:<Tab>), but I still find this more convenient for the common ones because the names of emoji are all over the place.

Re:I don’t know how to count that low by Moru on Monday October 25, 2021 @05:45PM (#28993532)
Yes, I was so sad when I "upgraded" from Atari to Windows and I could no longer do this. That it's still not standard is a mystery.

It wasn't standard on Atari either but that it even was a thing 30 odd years ago shows yet again that we're not always as innovative as we think.

Re:I don’t know how to count that low by __d on Monday October 25, 2021 @06:51PM (#28994175)
You might find http://wincompose.info/ helpful: it adds this functionality to Windows.
Re:I don’t know how to count that low by Moru on Tuesday October 26, 2021 @01:28AM (#28996718)
Thankyou! I wonder if there is some patent stopping this from being included in windows by default...
Re:I don’t know how to count that low by hackmiester on Monday October 25, 2021 @07:05PM (#28994303)
Microsoft Word does have compose, sort of(?). control+apostrophe followed by e results in é, for instance. I have no idea why it isn’t OS wide. It works some other places, but not all.
Re:I don’t know how to count that low by _carbyau_ on Monday October 25, 2021 @10:50PM (#28995874)
Windows most everywhere:

Hold ALT while typing the Extended ASCII number for a character on the numpad (not the row of numbers above the letters) results in that char.

For é: Hold Alt while typing 130 on numpad.

TIL, apparently this can be extended to unicode too.

https://superuser.com/questions/1024948/windows-10-alt-code-...

Re:I don’t know how to count that low by Moru on Tuesday October 26, 2021 @01:23AM (#28996694)
Yes, but learning numbers isn't realy comparable to be able to just guess the compose buttons. o¨ makes ö, ao makes å. If you want the copyright sign you type o+c.
Re:I don’t know how to count that low by _carbyau_ on Tuesday October 26, 2021 @07:46PM (#29007907)
True. Different compromises on capability vs usability.
Re:I don’t know how to count that low by tomxor on Monday October 25, 2021 @08:16PM (#28994940)
Relevant excerpt for those wondering what "every Linux distro" means more specifically (xorg):

> On Xorg the default Compose Key is ⇧ Shift+AltGr [...] The X keyboard driver does not allow the key used for Compose to also function as a modifier.

Which might explain why my altgr doesn't seem to work when I try it since it's mapped to mod in i3.

Re:I don’t know how to count that low by fao_ on Tuesday October 26, 2021 @07:29AM (#28998997)
Wayland uses XKB, as does everything else under the sun. XKB is the layer that implements the Compose Key (Actually, you need to configure it via XKB because other methods like ibus do not bother reading ~/.XCompose which allows you to set your own custom compose sequences)
Re:I don’t know how to count that low by mkl on Monday October 25, 2021 @05:42PM (#28993498)
A feature of only some keyboard layouts though? Ordinary US layout doesn't seem to have a compose key mapped by default.
Re:I don’t know how to count that low by fao_ on Tuesday October 26, 2021 @07:27AM (#28998980)
It takes two seconds to map using Gnome Tweaks or something else (Usually XModMap). I map it to right alt which is usually AltGr and not used anyway, and it performs superior to AltGr
Re:I don’t know how to count that low by CRConrad on Wednesday October 27, 2021 @06:34AM (#29011421)
Works for Anglophones. For the rest of us, who have some keys on the right (near the Enter key) occupied by Å, Ä, Ö or similar, we need Alt-Gr to get curly and square brackets, backslash, etc.
Re:I don’t know how to count that low by CRConrad on Monday October 25, 2021 @06:56PM (#28994220)
I was thinking they meant "in Emacs" or "on a Macintosh" or something.