tags:

views:

98

answers:

2

Hi, 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

+4  A: 

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.

asjo
Even shorter: C-0 C-k
scottfrazer
Good point, thanks!
asjo
+1  A: 

Here's asjo's answer bound to a key:

(global-set-key "\M-k" '(lambda () (interactive) (kill-line 0)) ) ;M-k kills to the left
George
I've made the same shortcut myself, it's extremly handy in the long run. I've also found that `M-m M-k` is even more handy in the long run :)
monotux