Function: evil-delete-back-to-indentation

evil-delete-back-to-indentation is an interactive and byte-compiled function defined in evil-commands.el.

Signature

(evil-delete-back-to-indentation)

Documentation

Delete back to the first non-whitespace character.

If point is before the first non-whitespace character of a current line then delete from the point to the beginning of the current line. If point is on the beginning of the line, behave according to evil-backspace-join-lines.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-commands.el
(evil-define-command evil-delete-back-to-indentation ()
  "Delete back to the first non-whitespace character.
If point is before the first non-whitespace character of a
current line then delete from the point to the beginning of the
current line.  If point is on the beginning of the line, behave
according to `evil-backspace-join-lines'."
  (let ((beg (if (<= (current-column) (current-indentation))
                 (line-beginning-position)
               (save-excursion (evil-first-non-blank) (point)))))
    (cond
     ((and (bolp) (evil-replace-state-p)) (evil-replace-backspace))
     ((bolp) (evil-delete-backward-char-and-join 1))
     ((evil-replace-state-p)
      (while (< beg (point)) (evil-replace-backspace)))
     (t (delete-region beg (point))))))