News for hackers. Stuff that matters.
Re:Regarding the Em Dash by jasoncrawford on Saturday January 06, 2018 @10:07PM (#16088884)
Tip: On a Mac, you can type an em-dash with shift-option-hyphen. (An en-dash is just option-hyphen.)
Re:Regarding the Em Dash by twhb on Sunday January 07, 2018 @12:42AM (#16089450)
Follow-up tip: also on a Mac, go to System Preferences → Keyboard and check “Show keyboard and emoji viewers in menu bar”. Then, hit the icon just added to the menu bar and select “Show Keyboard Viewer”. With it open, hold down Option, Option+Shift, etc, to live-preview what will be typed.

For symbols not there, hit Control+Command+Space to open the emoji/unicode typer. Hit the icon in the upper right to switch to a view where you can add favorites, like those arrows above.

Some favorite shortcuts of mine besides the dashes:

- Option+; → … (proper ellipsis)

- Option+[ and Option+Shift+[ → “ and ” (admittedly, typing in an editor with smart quotes is better)

- Option+] and Option+Shift+] → ‘ and ’

- Option+= → ≠

- Option+Shift+= → ±

- Option+x → ≈

- Option+, → ≤

- Option+. → ≥

- Option+Shift+8 → ° (degree symbol, don’t confuse with similar characters)

- Option+p → π

I read something related to Perl 6 work that resonated: Unicode opens up a lot more possibilities than we’ve taken advantage of, we just don’t yet have the hardware to make it convenient. Keys labels as screens is a perennial idea; maybe once somebody does a great job of it, we’ll see those Option shortcuts frequently used.

Re:Regarding the Em Dash by colanderman on Sunday January 07, 2018 @01:03AM (#16089520)
Personally I’m a big fan of the compose key for such matters. (Both OS X and Linux.) The mnemonics I find easier to remember.

• Compose . . → …

• Compose < " and Compose > " → “ and ”

• Compose < ' and Compose > ' → ‘ and ’

• Compose / = → ≠

• Compose + - → ±

• (couldn't figure out ≈)

• Compose < = → ≤

• Compose > = → ≥

• Compose o o → °

• (no compose for π)

Re:Regarding the Em Dash by chrismorgan on Sunday January 07, 2018 @08:42AM (#16090814)
~~ → ≈

I’ve customised my Compose key quite a bit.

I added things like:

- Greek characters from Vim’s digraphs, so p star = π, l star = λ, &c. (Looks like WinCompose’s defaults now actually include asterisk-first ones, star p → π, so I might drop my additions.)

- Emoji, :), :D, XD, :/, :S, &c.

- Improved curly quotes, whereby I super-conveniently type curly quotes all the time: ;; → ‘, :: → “, '' → ’, "" → ”. (Look at them on the keyboard to figure out the reasoning. ∷ is available as 2:.)

I contemplated, but didn’t add, Vim’s box drawing digraphs; there are a few collisions, and I only ever use box drawing characters in Vim, so I’ll just use Ctrl+K there.

http://temp.chrismorgan.info/.XCompose is my current .XCompose. I’m using Windows these days, so that’s with WinCompose.

Re:Regarding the Em Dash by username223 on Sunday January 07, 2018 @11:53AM (#16091468)
> - Emoji, :), :D, XD, :/, :S, &c.

Aagh! I mean... and so it comes full circle. Does no one remember when "emoticons" were sideways ASCII art? Does no one wonder why entry (8) in a list gets turned into "open paren smiley face with sunglasses?" Kids these days...

Re:Regarding the Em Dash by chrismorgan on Sunday January 07, 2018 @06:24PM (#16093380)
Oh, I remember it full well. But even in those comparatively early days when only :-( and :-) had specific Unicode codepoints [HN filters out emoji, imagine the appropriate codepoints yourself], I preferred to use them to :-) and :-(.

Why do I use all the fancy Unicode things? Because they’re there!

Re:Regarding the Em Dash by colanderman on Sunday January 07, 2018 @12:36PM (#16091681)
~~ doesn't work on OS X ;)
Re:Regarding the Em Dash by anjbe on Sunday January 07, 2018 @03:20AM (#16089871)
> (no compose for π)

You can create your own compose sequences in ~/.XCompose. I mapped pi to Compose * p, taking the idea from Plan 9: https://9fans.github.io/plan9port/man/man7/keyboard.html

Re:Regarding the Em Dash by Freak_NL on Sunday January 07, 2018 @05:39AM (#16090284)
If a particular compose sequence strikes you as sensible and suitable for everyone, you can submit patches upstream as well. I believe the base tables reside in Xorg, and GTK uses these as an upstream source, but I'm not completely sure.

I've did this for vowels with macrons — ā (-a), ō (-o), ū (-u), in particular because they are useful in romanised Japanese.

Re:Regarding the Em Dash by gk1 on Saturday January 06, 2018 @10:34PM (#16088979)
There are a few reasons why I switched from PC to Mac, but there's only one reason I'll never switch back—it's this em-dash shortcut.
Re:Regarding the Em Dash by chrismorgan on Sunday January 07, 2018 @01:24AM (#16089578)
Once you acquire a Compose key, you never can go back. `Compose - - -` = —. I write with curly quotes, hyphens, minuses, dashes, superscripts, Greek letters, &c. all thanks to my Compose key. (Constraining myself to ASCII is actually hard, and I only use straight quotes when it’s actually what I need, when programming.)

My last laptop ran Arch Linux; but I was willing to switch to Windows for the superb hardware that is Microsoft’s Surface Book, once WSL existed, and I knew that WinCompose existed—had either of these two items not been possible, I could not have switched to Windows.

Re:Regarding the Em Dash by ashark on Saturday January 06, 2018 @11:35PM (#16089184)
The em-dash shortcut, system-wide remapping of CAPS LOCK to CTRL from the GUI in about 15 seconds flat, a top-level modifier key (command) that's respected enough by developers that it mostly retains its "I belong to the OS and, therefore, to the user, not to you, mere program" character, and a de facto standard package manager that leaves the base system the hell alone, almost never breaks, and can install many of the binary packages I want.

Also if I went back to Linux I'd have to figure out how to remap my window controls to Spectacle's defaults, which'd probably take forever or end up being impossible in the window manager I settled on or whatever.

It's the little things.

Re:Regarding the Em Dash by hn_643 on Sunday January 07, 2018 @07:29AM (#16090622)
> a top-level modifier key (command) that's respected enough by developers that it mostly retains its "I belong to the OS and, therefore, to the user, not to you, mere program" character

Really? Every program on OSX seems to use some weird combination of CMD/SHIFT/CTRL/OPT keys but I don't know if I've ever seen a single Windows/Linux program use the Windows key.

Re:Regarding the Em Dash by alanfalcon on Saturday January 06, 2018 @11:14PM (#16089109)
I had to program this and other special characters—notably •, ™, and ®—as an autohotkey script on my work PC. I was going insane. I already had autohotkey going to reverse the direction of Windows’ stubbon backwards scroll anyway. (Once I used so-called “natural scrolling” for a week it became impossible to understand why anyone would choose anything else.)
Re:Regarding the Em Dash by xemoka on Sunday January 07, 2018 @12:03AM (#16089297)
Hey, you can do that reversal with a registry edit too eh: http://www.vvse.com/blog/blog/2012/02/27/reverse-scrolling-o...
Re:Regarding the Em Dash by ScottBurson on Sunday January 07, 2018 @12:17AM (#16089346)
When you move your eyes downward, the world seems to move up. Do you therefore call that "looking up"?
Re:Regarding the Em Dash by alanfalcon on Sunday January 07, 2018 @10:04AM (#16091056)
No. I’d get dizzy real fast if that very natural association between movement and perception were suddenly reversed though. (Somehow that didn’t happen when I started using natural scrolling, only when trying to go back from it.)
Re:Regarding the Em Dash by sjwright on Saturday January 06, 2018 @10:55PM (#16089040)
Also for me:

Opt-P for Pi π Opt-8 for Bullet • Opt-Shift-8 for Degree °

(And there are simple, memorable shortcuts for Pounds, Cents, Yen, Euro, Trademark, Copyright, Ohms, Infinity, and lots of math notation...)

Re:Regarding the Em Dash by kps on Saturday January 06, 2018 @11:29PM (#16089162)
On *nix with xkb, you can get these by selecting the 'us(mac)' layout. You'll need an AltGraph key (i.e. Option), which is usually on AltRight in Windows fashion.
Re:Regarding the Em Dash by jacobwyke on Saturday January 06, 2018 @10:16PM (#16088919)
On Windows with the numpad: Alt + 0151 (en-dash is Alt + 0150)
Re:Regarding the Em Dash by csixty4 on Saturday January 06, 2018 @11:30PM (#16089165)
Install WinCompose and it's right alt + three dashes (---)
Re:Regarding the Em Dash by bmpafa on Saturday January 06, 2018 @10:37PM (#16088994)
Easy-peazy! Makes me wish I still had a numpad :/
Re:Regarding the Em Dash by sandov on Sunday January 07, 2018 @05:06AM (#16090172)
On linux:

[ctrl + shift + u] then write "2014" and press [enter]

Re:Regarding the Em Dash by gnicholas on Sunday January 07, 2018 @01:06AM (#16089529)
And iOS will auto-correct two hyphens to an em-dash, which is faster than long-holding the dash and sliding over to the em-dash.
Re:Regarding the Em Dash by gshubert17 on Saturday January 06, 2018 @10:49PM (#16089024)
Thanks, I have been looking for that. But it's command-hyphen for en-dash, and shift-command-hyphen for em-dash on my Mac.
Re:Regarding the Em Dash by Bud on Sunday January 07, 2018 @02:15AM (#16089720)
It emphatically is NOT shift-command-hyphen on ANY Mac. It's shift-option-hyphen, and has been since the Reagan Administration.
Re:Regarding the Em Dash by gshubert17 on Monday January 08, 2018 @11:31AM (#16097821)
You're right. It is as you describe on my 2015 MacBook Air running 10.12.6.

But on my 2009 iMac running 10.11.6, using LibreOffice, option-hyphen did produce an en-dash, but command-hyphen did. So either LibreOffice or some configuration setting somewhere on this Mac is responsible for this nonstandard behavior.

Thanks.

Re:Regarding the Em Dash by wtallis on Saturday January 06, 2018 @11:22PM (#16089136)
Why do you have command and option reversed? Are you using a non-Apple keyboard?
Re:Regarding the Em Dash by gshubert17 on Monday January 08, 2018 @11:22AM (#16097769)
This is curious.

I use an Apple keyboard with a numeric keypad on the right. From left to right on the lowest row, the keys are Control, Option (Alt), Command, Space, and so on.

I was using LibreOffice 5.1.6.2 to try this. It looks like LibreOffice has remapped the keys.

Re:Regarding the Em Dash by macintux on Saturday January 06, 2018 @10:29PM (#16088967)
Thanks. I think I've been using en-dash out of ignorance over the years.
Re:Regarding the Em Dash by triplesec on Sunday January 07, 2018 @02:40PM (#16092241)
on this Mac i can only get the same double-length hyphen from either shift-option-hyphen or option-hyphen - hyphen — — — – – – both other options
Re:Regarding the Em Dash by psergeant on Saturday January 06, 2018 @10:20PM (#16088928)
iOS, type two hyphens and it gets auto-created
Re:Regarding the Em Dash by freshyill on Saturday January 06, 2018 @10:27PM (#16088957)
Or hold on the hyphen and you can get an emdash, endash, or bullet.
Re:Regarding the Em Dash by mpblampo on Saturday January 06, 2018 @10:43PM (#16089013)
True on Android too.