about summary refs log tree commit diff stats
path: root/lisp/+dired.el
blob: 9a2e01a28bb6619c25336bfbcca6b7683ed6f59e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
;;; +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