Wednesday, November 13, 2024

shortcut – How to delete the text between the insertion point and the start of the line or paragraph

You can usually use Ctrl+W to delete a word to the left, or Option+Del to delete a word to the left. The most consistently available as you mentioned is Cmd+Shift+Arrow then Delete. If you wanted Unix/Bash (readline) shortcuts to make it easy to look up again, Ctrl+U was used for “delete left of cursor”. I used it frequently on ChromeOS to delete my password if my muscle memory told me I’d gotten it wrong, but then they removed that option at some point.

https://linux.die.net/man/1/bash#:~:text=command%20is%20unbound.-,Killing%20and%20Yanking,-kill%2Dline%20

Killing and Yanking

kill-line (C-k) Kill the text from point to the end of the line.

backward-kill-line (C-x Rubout) Kill backward to the beginning of the line.

unix-line-discard (C-u) Kill backward from point to the beginning of the line. The killed text is saved on the kill-ring.

kill-whole-line Kill all characters on the current line, no matter
where point is.

kill-word (M-d) Kill from point to the end of the
current word, or if between words, to the end of the next word. Word
boundaries are the same as those used by forward-word.

backward-kill-word (M-Rubout) Kill the word behind point. Word
boundaries are the same as those used by backward-word.

shell-kill-word (M-d) Kill from point to the end of the current word,
or if between words, to the end of the next word. Word boundaries are
the same as those used by shell-forward-word.

shell-backward-kill-word
(M-Rubout) Kill the word behind point. Word boundaries are the same as
those used by shell-backward-word.

unix-word-rubout (C-w) Kill the
word behind point, using white space as a word boundary. The killed
text is saved on the kill-ring.

You will likely need to create a custom shortcut with Automator or Karabiner Elements that combines the Cmd+Shift+Left Arrow with Del when you press Ctrl+U or whatever combination is available that makes sense to you.

Related Articles

Latest Articles