Function: vertico-directory-up

vertico-directory-up is an autoloaded, interactive and byte-compiled function defined in vertico-directory.el.

Signature

(vertico-directory-up &optional N)

Documentation

Delete N names before point.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/vertico-20260821.1200/vertico-directory.el
;;;###autoload
(defun vertico-directory-up (&optional n)
  "Delete N names before point."
  (interactive "p")
  (when (and (> (point) (minibuffer-prompt-end))
             (eq 'file (vertico--metadata-get 'category)))
    (let ((path (buffer-substring-no-properties (minibuffer-prompt-end) (point)))
          found)
      (when (string-match-p "\\`~[^/]*/\\'" path)
        (delete-minibuffer-contents)
        (insert (expand-file-name path)))
      (dotimes (_ (or n 1) found)
        (save-excursion
          (let ((end (point)))
            (goto-char (1- end))
            (when (search-backward "/" (minibuffer-prompt-end) t)
              (delete-region (1+ (point)) end)
              (setq found t))))))))