Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to clear a beginning of a line by C-u in Emacs

Tags:

emacs

I run the following command in Emacs unsuccessfully

C-u

How can you clear the beginning of a line in Emacs?

like image 209
Léo Léopold Hertz 준영 Avatar asked May 04 '09 00:05

Léo Léopold Hertz 준영


2 Answers

You can also accomplish this by using a prefix arg for kill-ine (usually C-k). From the Emacs help (C-h k C-k):

With zero argument, kills the text before point on the current line.

So, you can do

C-u 0 C-k

or even better

C-0 C-k
like image 109
Ryan E Avatar answered Jan 03 '23 16:01

Ryan E


You can set the mark, go to the beginning, kill till mark:

C-Spc C-a C-w
like image 43
Svante Avatar answered Jan 03 '23 15:01

Svante