5 ms·
Tip: On a Mac, you can type an em-dash with shift-option-hyphen. (An en-dash is just option-hyphen.)
by jasoncrawford 9y ago
Tip: On a Mac, you can type an em-dash with shift-option-hyphen. (An en-dash is just option-hyphen.)
- deleted 9y ago[deleted]
- twhb 9y agoFollow-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.
- colanderman 9y agoPersonally 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 π)
- anjbe 9y ago> (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 https://9fans.github.io/plan9port/man/man7/keyboard.html
- Freak_NL 9y agoIf 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.
- chrismorgan 9y ago~~ → ≈ 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 http://temp.chrismorgan.info/.XCompose is my current .XCompose. I’m using Windows these days, so that’s with WinCompose.
- username223 9y ago> - 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...
- chrismorgan 9y agoOh, 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!
- colanderman 9y ago~~ doesn't work on OS X ;)
- gnicholas 9y agoAnd 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.
- sandov 9y agoOn linux: [ctrl + shift + u] then write "2014" and press [enter]
- triplesec 9y agoon this Mac i can only get the same double-length hyphen from either shift-option-hyphen or option-hyphen - hyphen — — — – – – both other options
- jacobwyke 9y agoOn Windows with the numpad: Alt + 0151 (en-dash is Alt + 0150)
- psergeant 9y agoiOS, type two hyphens and it gets auto-created
- macintux 9y agoThanks. I think I've been using en-dash out of ignorance over the years.
- gk1 9y agoThere 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.
- alanfalcon 9y agoI 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.)
- xemoka 9y agoHey, you can do that reversal with a registry edit too eh: http://www.vvse.com/blog/blog/2012/02/27/reverse-scrolling-on-windows-7/ http://www.vvse.com/blog/blog/2012/02/27/reverse-scrolling-o...
- ScottBurson 9y agoWhen you move your eyes downward, the world seems to move up. Do you therefore call that "looking up"?
- alanfalcon 9y agoNo. 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.)
- ashark 9y agoThe 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.
- gshubert17 9y agoThanks, I have been looking for that. But it's command-hyphen for en-dash, and shift-command-hyphen for em-dash on my Mac.
- wtallis 9y agoWhy do you have command and option reversed? Are you using a non-Apple keyboard?
- gshubert17 9y agoThis 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.
- Bud 9y agoIt emphatically is NOT shift-command-hyphen on ANY Mac. It's shift-option-hyphen, and has been since the Reagan Administration.
- gshubert17 9y agoYou'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.