Function: evil-join

evil-join is an interactive and byte-compiled function defined in evil-commands.el.

Signature

(evil-join BEG END)

Documentation

Join the selected lines.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-commands.el
(evil-define-operator evil-join (beg end)
  "Join the selected lines."
  :motion evil-line
  (let ((count (count-lines beg end))
        last-line-blank)
    (when (> count 1)
      (setq count (1- count)))
    (goto-char beg)
    (dotimes (i count)
      (when (= (1+ i) count) ; i.e. we're just before the last join
        (evil-move-beginning-of-line)
        (setq last-line-blank (looking-at "[ \t]*$")))
      (join-line 1))
    (and last-line-blank (indent-according-to-mode))))