Hacker News new | ask | show | jobs
by vocram 1417 days ago
Text navigation works in the same way on Linux/mac using readline key bindings.
1 comments

Not sure what you're implying here. CLI applications? Because they'd obviously behave the same.

The issues I've noticed are around desktop applications. For example if I select some text in KWrite (KDE's "Notepad") by using SHIFT+CTRL+LEFT_ARROW then it will select the word. If I do the equivalent in Notes (macOS) it will select the whole line, not just the word (I tested this just now too).

This platform specific behavioural differences isn't something that's unique when comparing to KWrite vs Notes, I just picked those applications as an example. It also isn't just SHIFT+CTRL+LEFT_ARROW that differs. There's a quite a few subtle differences when using the keyboard to navigate around text areas. None of them significant but they're always enough to break my concentration when trying to get stuff done.

A lot of these can be redefined. Both on Linux and on macOS though. So you can absolutely make the two platforms behave the same way, given enough time and motivation. So we are just talking about defaults here.

Text entry fields in mac programs accept emacs mode ctrl combos. c-a, e, u etc.
I just tried that in 3 different applications: Finder (search bar), Notes, and Slack (just in case it was an Electron specific behaviour). I couldn't get those readline/emacs bindings to work on either. This is a brand new MacBook Pro with all the defaults for the UK region so it's definitely not something I've (knowingly) disabled.

Is this something that needs to be enabled? Or is it dependant on something else to work? It's definitely a feature I'd welcome.

Weird! https://support.apple.com/en-us/HT201236 lists them under "document shortcuts." Well, not c-u although I swear that one worked too. Maybe they removed them and this document is out of date? I haven't used a mac in a long time, so it's possible. Damn shame if they did, I always liked that feature.

[edit] A friend checked on his Montery machine and said they work as expected in system text boxes.

Ahh c-u was the one I tried so that explains why it didn't work.

Thanks for the link, that will come in handy!

> SHIFT+CTRL+LEFT_ARROW then it will select the word. If I do the equivalent in Notes (macOS) it will select the whole line, not just the word (I tested this just now too).

Use option instead of control here.

Ahh yes, that works. Thanks for the tip. That'll come very in handy.