2021-11-22 05:57:41 +00:00
|
|
|
;;; +dired.el -*- lexical-binding: t -*-
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
2022-05-06 15:23:02 +00:00
|
|
|
(with-eval-after-load '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)))
|
2021-11-22 05:57:41 +00:00
|
|
|
|
2022-04-28 20:49:22 +00:00
|
|
|
;;; [[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))))
|
|
|
|
|
2021-11-22 05:57:41 +00:00
|
|
|
(provide '+dired)
|
|
|
|
;;; +dired.el ends here
|