Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Emacs how to delete from current line to the end of file?

What should I type in emacs to delete the file from the cursor to the end of file ?

like image 822
Vincent Avatar asked Apr 14 '13 09:04

Vincent


People also ask

How do I delete content 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 you go to the next line in Emacs?

To go to a specific line: Type M-x goto-line <Enter>, then type the line number followed by <Enter>. There are also shortcuts. Type the command "help -q emacs goto" in a local window to find out about it.

How do I delete all text in Emacs?

To be clear, C-a means press and hold Control while hitting a , and so on.

How do I delete 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

Deleting from the cursor to the end of the file is not something I do often enough to bind to make it worth binding to a single key. I'd do this:

  • C-space (set-mark)
  • M-> (end-of-buffer)
  • C-w (kill-region)

Just because it combines common actions and is therefore easy to remember.

There may be a sequence that uses fewer keys, but I prefer the simple.

like image 181
Eric Miller Avatar answered Sep 21 '22 07:09

Eric Miller