How do I delete everything from my cursor's current position to the beginning of the line?
For example, say I'm running npm run start, and my cursor is positioned just before start? How do I remove npm run with a keyboard shortcut, leaving start?
npm run █start
I'm expecting something like how Ctrl + W deletes the last word. Similarly, is there a shortcut to delete from current cursor position to the beginning of the line?
I'm using Oh My Zsh shell on Mac 10.12.
Some shortcuts here -
unix-line-discard (C-u)
Kill backward from point to the beginning of the line. The killed text is saved on the kill-ring.
It is also useful to see man bash.
In case you use Z shell (executable zsh), you should add this line: bindkey \^U backward-kill-line to your .zshrc file. See this.