;;; +dired.el -*- lexical-binding: t -*-

;;; Code:

(require 'vertico)

(defun +dired-goto-file (file)
  "ADVICE for `dired-goto-file' to make RET call `vertico-exit'."
  (interactive                          ; stolen from `dired-goto-file'
   (prog1
       (list (dlet ((vertico-map (copy-keymap vertico-map)))
               (define-key vertico-map (kbd "RET") #'vertico-exit)
               (expand-file-name (read-file-name "Goto file: "
                                                 (dired-current-directory)))))
     (push-mark)))
  (dired-goto-file file))

;;; [[https://www.reddit.com/r/emacs/comments/u2lf9t/weekly_tips_tricks_c_thread/i4n9aoa/?context=3][Dim files in .gitignore]]

(defun +dired-dim-git-ignores ()
  "Dim out .gitignore contents"
  (require 'vc)
  (when-let ((ignores (vc-default-ignore-completion-table 'git ".gitignore"))
             (exts (make-local-variable 'completion-ignored-extensions)))
    (dolist (item ignores)
      (add-to-list exts item))))

(provide '+dired)
;;; +dired.el ends here
