Function: vertico-repeat-select

vertico-repeat-select is an autoloaded, interactive and byte-compiled function defined in vertico-repeat.el.

Signature

(vertico-repeat-select)

Documentation

Select a Vertico session from the session history and repeat it.

If called from an existing Vertico session, you can select among previous sessions for the current command.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/vertico-20260913.1525/vertico-repeat.el
;;;###autoload
(defun vertico-repeat-select ()
  "Select a Vertico session from the session history and repeat it.
If called from an existing Vertico session, you can select among
previous sessions for the current command."
  (interactive)
  (vertico-repeat--run
   (let* ((current-cmd vertico-repeat--command)
          (trimmed
           (delete-dups
            (or
             (cl-loop
              for session in vertico-repeat-history
              if (or (not current-cmd) (eq (car session) current-cmd))
              collect
              (list
               (symbol-name (car session))
               (replace-regexp-in-string
                "\\s-+" " "
                (string-trim (cadr session)))
               session))
             (user-error "No repeatable session"))))
          (max-cmd (cl-loop for (cmd . _) in trimmed
                            maximize (string-width cmd)))
          (formatted (cl-loop
                      for (cmd input session) in trimmed collect
                      (cons
                       (concat
                        (and (not current-cmd)
                             (propertize cmd 'face 'font-lock-function-name-face))
                        (and (not current-cmd)
                             (make-string (- max-cmd (string-width cmd) -4) ?\s))
                        input)
                       session)))
          (enable-recursive-minibuffers t))
     (cdr (assoc (completing-read
                  (if current-cmd
                      (format "History of %s: " current-cmd)
                    "Completion history: ")
                  (completion-table-with-metadata
                   formatted
                   '((display-sort-function . identity)
                     (cycle-sort-function . identity)))
                  nil t nil t)
                 formatted)))))