Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete all the lines in one go in emacs?

Tags:

emacs

I want to delete all the lines below a particular line of emacs ? Is there any shortcut key which can delete all the lines below a particular line?

like image 214
harshal Avatar asked Dec 05 '22 09:12

harshal


1 Answers

C-u 9999999 C-k should do the trick.

If you are not at the beginning of the first line you want to kill, then use C-a C-u 9999999 C-k.

(The 9999999 can be any number larger than the number of lines you want to kill.)

An alternative to using C-u 999999 is to hold down the Control key and then hold down 9, so you get, in effect: C-9 C-9 C-9 C-9 C-9 C-9 C-9 C-k.

like image 145
Drew Avatar answered Dec 21 '22 02:12

Drew