Fix s-backspace for non-evil users

This commit is contained in:
Henrik Lissner 2019-12-23 17:20:59 -05:00
parent d1becfce89
commit b88ff2a563
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 16 additions and 1 deletions

View file

@ -129,6 +129,20 @@ true end of the line. The opposite of `doom/backward-to-bol-or-indent'."
(setq doom--last-forward-pt (point))
(goto-char eol))))))
;;;###autoload
(defun doom/backward-kill-to-bol-and-indent ()
"Kill line to the first non-blank character. If invoked again afterwards, kill
line to beginning of line. Same as `evil-delete-back-to-indentation'."
(interactive)
(let ((empty-line-p (save-excursion (beginning-of-line)
(looking-at-p "[ \t]*$"))))
(funcall (if (fboundp 'evil-delete)
#'evil-delete
#'delete-region)
(point-at-bol) (point))
(unless empty-line-p
(indent-according-to-mode))))
;;;###autoload
(defun doom/dumb-indent ()
"Inserts a tab character (or spaces x tab-width)."