News for hackers. Stuff that matters.
Re:Impressions from a first-time Mac user by mastazi on Tuesday April 12, 2022 @12:04AM (#30998475)
I think this is a pretty fair article. I'll add one more:

in MacOS there is no unified way to get to the beginning or end of a line. In Linux and Windows this is done with the Home and End keys. In Mac, there are some shortcuts but they are not universal, what works in terminal may not work in a browser textarea and so on. Some programs interpret the same shortcut as "go to the very end of the text (as in a PgDown key) but that same shortcut, in another program, might go to the end of the line (like the End key).

Please let me know if I'm missing something! Every time I make a web search about this topic, I end up in various pages like this one[1] with shortcuts that don't work for me for the reasons explained above.

EDIT: I found out that there are some Mac keyboards with the Home and End keys. So it seems that this is not an OS issue but, I guess, a MacBook issue (I've only ever used MacBooks and always without external keyboard).

[1] https://djst.org/topic/what-is-the-end-key-on-a-mac/

Re:Impressions from a first-time Mac user by twblalock on Tuesday April 12, 2022 @12:20AM (#30998587)
Emacs movement keys generally work. Ctrl-A for the start of the line, Ctrl-E for the end, Ctrl-K to kill a line...
Re:Impressions from a first-time Mac user by code_biologist on Tuesday April 12, 2022 @12:49AM (#30998745)
> Ctrl-K to kill a line...

The text system also has a basic kill-yank separate from copy paste. So you can Ctrl-K to kill a line, then Ctrl-y to yank it out elsewhere in basically every text input in the OS.

Re:Impressions from a first-time Mac user by twblalock on Tuesday April 12, 2022 @01:09AM (#30998852)
Oddly this is actually nicer in macOS than Linux desktops, because Ctrl-A is normally reserved for "select all" on other OSes. Because macOS puts all the "normal" select/cut/copy/paste combos on the command key, the full set of Unixy movement keys is available on the control key.
Re:Impressions from a first-time Mac user by trissylegs on Tuesday April 12, 2022 @04:40AM (#31000088)
Gnome tweaks has a setting to enable Emacs keyboard for GTK apps. It's pretty good and supports things like M-f and M-p better than mac (which uses Option for special characters). But it does confuse some programs that don't expect it. Like Gedit doesn't seem to have a functioning Find shortcut in this mode. (It uses C-s for save so C-s for search doesn't work)
Re:Impressions from a first-time Mac user by yesenadam on Tuesday April 12, 2022 @12:37AM (#30998674)
Yep, or CMD + left/right arrow. Option + left/right arrow goes back/forward one word. Hold down Shift doing these to select what you move over.
Re:Impressions from a first-time Mac user by j00pY on Tuesday April 12, 2022 @06:00AM (#31000591)
These shortcuts were my favourite thing about moving to a Mac.
Re:Impressions from a first-time Mac user by mastazi on Tuesday April 12, 2022 @05:16AM (#31000315)
in my experience, Cmd + left/right arrow behaves like a pgup/down. Goes to the very end of the page, not end of a single line
Re:Impressions from a first-time Mac user by yesenadam on Tuesday April 12, 2022 @06:30AM (#31000770)
That's weird. Where do you mean? e.g. in a text editor? in HN comment text entry boxes?
Re:Impressions from a first-time Mac user by mastazi on Tuesday April 12, 2022 @06:57PM (#31009239)
OK I'm sorry I just went back to my Mac and found that my previous comment was incorrect, but the main problem (no way to select a line) still exist.

The issue happens on web (and on web based UIs such as Electron apps) outside of text input fields or textareas.

This is how to reproduce:

1. first we doble click on the first word of the line, to create a selection

2. At this point we expect that Cmd-shift-rightarrow will expand the selection to the rest of the line. But it doesn't because this key combination only works inside a text input or textarea. In every other desktop OS I can do shift-End at this point, and select the rest of the line.

3. option-shift arrow does work, but selects one word at a time so it is cumbersome to use

4. I had been told that I could use fn-shift-arrow in this case, but that selects all text until the end of the page (that's the one I was thinking about in my previous comment)

I just tried and reproduced the issue in Chrome and Safari.

Re:Impressions from a first-time Mac user by yesenadam on Tuesday April 12, 2022 @07:53PM (#31009632)
> no way to select a line

Hmm yeah I never noticed that. Fastest way to select a line I know is: click at the start of the line, then Shift + down arrow.

Re:Impressions from a first-time Mac user by mastazi on Tuesday April 12, 2022 @08:16PM (#31009757)
Good one! It might select the first word of the next line in some cases, but it's easy to deselect it with the left arrow. Thank you!
Re:Impressions from a first-time Mac user by yesenadam on Tuesday April 12, 2022 @08:57PM (#31010035)
It never selects the first word of next line for me.. Hmm anyway, while clicking at the start of the line, may as well just drag down to next line. :-)

Also, TIL that you can hold down CMD and drag over various words/letters on the screen, non-contiguous, then CMD-C copies them all to the clipboard. Must be handy for something!

Re:Impressions from a first-time Mac user by Destiner on Tuesday April 12, 2022 @12:37AM (#30998677)
Cmd + left/right works everywhere for me (except the terminal)
Re:Impressions from a first-time Mac user by Hamuko on Tuesday April 12, 2022 @12:39AM (#30998689)
And for those unaware of Cmd+left/right, there's also Alt+left/right for moving over one word at a time.
Re:Impressions from a first-time Mac user by a3w on Tuesday April 12, 2022 @03:31AM (#30999697)
Yes navigating via muscle memory is way better on macOS because per word cursor movement is supported.

And terminal has ctrl+a and ctrl+e. My mnemonics: A is for Anfang (german: start, beginning), e is just End.

On windows I was confused as to whether Pos1/End gets me to file ending, or line ending. I think it's the first, unless you hit a modifier key.

Re:Impressions from a first-time Mac user by yesenadam on Tuesday April 12, 2022 @03:36AM (#30999715)
And hold Shift while doing either of those, to select the text you move over.
Re:Impressions from a first-time Mac user by mastazi on Tuesday April 12, 2022 @05:17AM (#31000318)
Re:Impressions from a first-time Mac user by mastazi on Tuesday April 12, 2022 @08:18PM (#31009767)
I'm sorry, the comment that I linked above was inaccurate, but the issue still persists for me, see here https://news.ycombinator.com/item?id=31009239
Re:Impressions from a first-time Mac user by IgorPartola on Tuesday April 12, 2022 @12:09AM (#30998518)
I use a keyboard with dedicated Home and End keys and the behavior is exactly how you describe. This is definitely a software problem and one that should be fixed.
Re:Impressions from a first-time Mac user by jamesvandyne on Tuesday April 12, 2022 @12:19AM (#30998585)
Cmd-a and Cmd-e work in most/all native controls, no? Really ergonomic once you've remapped caps to cmd as well.
Re:Impressions from a first-time Mac user by code_biologist on Tuesday April 12, 2022 @12:46AM (#30998729)
^^^ you mean ctrl-a and ctrl-e? But yes, +100 to the caps lock → ctrl remapping. Trivial to do in the keyboard "modifier keys" setting, and makes emacs text movement extra fast.
Re:Impressions from a first-time Mac user by jamesvandyne on Tuesday April 12, 2022 @12:55AM (#30998770)
That's the one. Thanks for the correction. Forgot my keyboard, which has a ctrl key in place of the caps, so I've stopped mapping it.
Re:Impressions from a first-time Mac user by nerdjon on Tuesday April 12, 2022 @08:48AM (#31001910)
I have never had this issue, I just use command left or right and it goes to the beginning or end in every application except my terminal but I am pretty sure that is because it mapped command left and right to changing tabs. When in the terminal I just use home/end and it works just fine.

But I use this functionality extensively when outside the terminal.

Re:Impressions from a first-time Mac user by pkulak on Tuesday April 12, 2022 @12:11AM (#30998525)
Isn’t it just option plus right arrow?
Re:Impressions from a first-time Mac user by cptroot on Tuesday April 12, 2022 @10:54AM (#31003549)
Fn + left arrow is Home. Fn + right arrow is End.