Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delete line backwards (Emacs)

Tags:

emacs

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

like image 960
Vass Avatar asked Oct 07 '10 10:10

Vass


People also ask

How do you delete a line in Emacs?

# Press z as many times as you wish.

How do you delete 5 words in backward direction in Linux?

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)

How do you delete text in Emacs?

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.

How do I kill a word in Emacs?

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.


1 Answers

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.

like image 168
asjo Avatar answered Sep 22 '22 14:09

asjo