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
2010-10-07 10:34:13
Even shorter: C-0 C-k
scottfrazer
2010-10-07 10:59:23
Good point, thanks!
asjo
2010-10-10 18:46:58
+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
2010-10-08 06:53:51
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
2010-10-10 22:19:12