News for hackers. Stuff that matters.
Re:Ask HN: The most useful Mac keyboard shortcuts? by koopuluri on Monday August 05, 2019 @10:39PM (#20621603)
cntrl+a: go to start of a line

cntrl+p: go up one line

cntrl+n: go down one line

cntrl+k: cut line proceeding cursor

cntrl+f: forward one char

cntrl+b: back one char

These work everywhere you can type text on Mac: including in this HN text box, in the url bar, etc. I absolutely love these shortcuts...

Re:Ask HN: The most useful Mac keyboard shortcuts? by grzm on Monday August 05, 2019 @11:01PM (#20621716)
IIRC, these are enabled by default if the text view is a standard NS* text view (don't recall the actual class). It's always a bit of a surprise when I find a window where these don't work, and that's a good indication that someone has implemented their own class for the text view. Little nugget holdover from those Unix-loving NeXT devs.
Re:Ask HN: The most useful Mac keyboard shortcuts? by tobr on Tuesday August 06, 2019 @06:59PM (#20630515)
You missed the best one, ctrl+t: swap the left and right characters adjacent to cursor. Fixes about 90% of typos.

> These work everywhere you can type text on Mac

Supposedly they even work on iOS if you plug in a keyboard, which is pretty unexpected if you think about it.

Re:Ask HN: The most useful Mac keyboard shortcuts? by hnzix on Monday August 05, 2019 @10:58PM (#20621694)
and cntrl+e: end of line

aka Emacs keybinds.

Re:Ask HN: The most useful Mac keyboard shortcuts? by chess93 on Monday August 05, 2019 @11:04PM (#20621738)
I was wondering why these worked everywhere. I had no idea it was a mac feature.