(unbind-key "C-x C-z")
#+END_SRC
+http://endlessparentheses.com/kill-entire-line-with-prefix-argument.html?source=rss
+#+BEGIN_SRC emacs-lisp :tangle yes
+(defmacro bol-with-prefix (function)
+ "Define a new function which calls FUNCTION.
+Except it moves to beginning of line before calling FUNCTION when
+called with a prefix argument. The FUNCTION still receives the
+prefix argument."
+ (let ((name (intern (format "endless/%s-BOL" function))))
+ `(progn
+ (defun ,name (p)
+ ,(format
+ "Call `%s', but move to BOL when called with a prefix argument."
+ function)
+ (interactive "P")
+ (when p
+ (forward-line 0))
+ (call-interactively ',function))
+ ',name)))
+
+(global-set-key [remap paredit-kill] (bol-with-prefix paredit-kill))
+(global-set-key [remap org-kill-line] (bol-with-prefix org-kill-line))
+(global-set-key [remap kill-line] (bol-with-prefix kill-line))
+#+END_SRC
+
Default of *C-k* is to kill from the point to the end of line. If
'kill-whole-line' (see [[id:0a1560d9-7e55-47ab-be52-b3a8b8eea4aa][the kill-whole-line part in "General stuff"]]) is
set, including newline. But to kill the entire line, one still needs a
*C-a* in front of it. So I change it, by defining a function to do just this for
me. Lazyness++.
-#+BEGIN_SRC emacs-lisp :tangle yes
+#+BEGIN_SRC emacs-lisp :tangle no
(defun kill-entire-line ()
"Kill this entire line (including newline), regardless of where point is within the line."
(interactive)
(kill-line)
(back-to-indentation))
-(unbind-key "C-z")
(bind-key* "C-k" 'kill-entire-line)
(global-set-key [remap kill-whole-line] 'kill-entire-line)
#+END_SRC
And the same is true when I'm in org-mode, which has an own kill function...
(the keybinding happens later, after org-mode is loaded fully)
-#+BEGIN_SRC emacs-lisp :tangle yes
+#+BEGIN_SRC emacs-lisp :tangle no
(defun jj-org-kill-line (&optional arg)
"Kill the entire line, regardless of where point is within the line, org-mode-version"
(interactive "P")
(bind-key "C-M-r" 'org-capture)
(bind-key "C-c r" 'org-capture)
(bind-key "C-S-<f12>" 'bh/save-then-publish)
-(bind-key "C-k" 'jj-org-kill-line org-mode-map)
+;(bind-key "C-k" 'jj-org-kill-line org-mode-map)
#+END_SRC