6 ms·
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
by mastazi 5y ago
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/ https://djst.org/topic/what-is-the-end-key-on-a-mac/
- IgorPartola 5y agoI 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.
- pkulak 5y agoIsn’t it just option plus right arrow?
- jamesvandyne 5y agoCmd-a and Cmd-e work in most/all native controls, no? Really ergonomic once you've remapped caps to cmd as well.
- code_biologist 5y ago^^^ 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.
- jamesvandyne 5y agoThat'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.
- _skel 5y agoEmacs movement keys generally work. Ctrl-A for the start of the line, Ctrl-E for the end, Ctrl-K to kill a line...
- yesenadam 5y agoYep, 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.
- mastazi 5y agoin 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
- yesenadam 5y agoThat's weird. Where do you mean? e.g. in a text editor? in HN comment text entry boxes?
- mastazi 5y agoOK 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.
- Destiner 5y agoCmd + left/right works everywhere for me (except the terminal)
- Hamuko 5y agoAnd for those unaware of Cmd+left/right, there's also Alt+left/right for moving over one word at a time.
- a3w 5y agoYes 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.
- yesenadam 5y agoAnd hold Shift while doing either of those, to select the text you move over.
- mastazi 5y agodoesn't work for me https://news.ycombinator.com/item?id=31000315 https://news.ycombinator.com/item?id=31000315
- mastazi 5y agoI'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 https://news.ycombinator.com/item?id=31009239
- bumblebritches5 5y ago
- nerdjon 5y agoI 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.
- cptroot 5y agoFn + left arrow is Home. Fn + right arrow is End.