diff --git a/core/prelude-core.el b/core/prelude-core.el index d3640a0..03fa039 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -109,6 +109,13 @@ Position the cursor at its beginning, according to the current mode." (forward-line -1) (indent-according-to-mode)) +(defun prelude-kill-whole-line (&optional arg) + "A simple wrapper around command `kill-whole-line' that respects indentation. +Passes ARG to command `kill-whole-line' when provided." + (interactive "P") + (kill-whole-line arg) + (back-to-indentation)) + (defun prelude-indent-buffer () "Indent the currently visited buffer." (interactive) diff --git a/core/prelude-global-keybindings.el b/core/prelude-global-keybindings.el index 88d7390..b5de865 100644 --- a/core/prelude-global-keybindings.el +++ b/core/prelude-global-keybindings.el @@ -80,6 +80,8 @@ (kill-line 0) (indent-according-to-mode))) +(global-set-key [remap kill-whole-line] 'prelude-kill-whole-line) + ;; Activate occur easily inside isearch (define-key isearch-mode-map (kbd "C-o") (lambda () (interactive)