This is probably basic but I really tried to find the answer. "C-k" deletes from the cursor to the end of the line, but is there an analogous shortcut to delete a line backwards from the cursor point? Best
# Press z as many times as you wish.
d$ will delete from current position to end of line. d^ will delete from current backward to first non-white-space character. d0 will delete from current backward to beginning of line. dw deletes current to end of current word (including trailing space)
Emacs provides many ways to delete text. The simplest way to delete text is to press the DEL key, which deletes the character immediately to the left of the cursor. See Figure 2-3 for possible locations of the DEL key on your keyboard. DEL is easiest to define by what it does: it deletes the previous character.
The Emacs way to remove the word one is inside of to press M-backspace followed by M-d . That will kill the word at point and save it to kill ring (as one unit). If the cursor is at the beginning or after the end of the word, only one of the two is sufficient.
Try C-u 0 C-k
- i.e. C-k with the prefix 0 kills from point to the start of the line. See the documentation for C-k (kill-line) for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With