Unable to clear beginning of Cu string in Emacs

I execute the following command in Emacs unsuccessfully

C-u

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

+5
source share
6 answers

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

C-Spc Ca Cw
+8
source

You can also accomplish this using the arg prefix for kill-ine (usually Ck). From Emacs help (Ch k Ck):

With a null argument, kills the text before the dot in the current line.

So you can do

C-u 0 C-k

or even better

C-0 C-k
+13
source

:

M-0 C-k 

+7

C-u Bash "Emacs Mode", Emacs. :

C-a C-k

, . Svante , .

+6

I don't know where you read about C-u, but it is tied to a universal argument in Emacs.

If you want to kill the entire line, call kill-whole-linewhich is related to C-S-backspace. No matter which column the cursor is in, it will kill the entire row from start to finish.

+2
source

I have a little function related to the chord key:

(defun kill-start-of-line ()
  "kill from point to start of line"
  (interactive)
  (kill-line 0))

(define-key global-map "\M-#" 'kill-start-of-line)

M- # usually Alt-Shift-3, not the new DotNet language

I'm sure I saw it somewhere else, but did not save the original link.

+2
source

All Articles