Skip to content

Commit

Permalink
SPC f d -> +default/dired
Browse files Browse the repository at this point in the history
+default/dired will prompt you for a directory to open dired in. If
passed the universal argument, it will prompt you for a known project
instead.
  • Loading branch information
hlissner committed Jul 26, 2020
1 parent ccfaf3f commit 8719911
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/config/default/+evil-bindings.el
Expand Up @@ -381,7 +381,7 @@
(:prefix-map ("f" . "file")
:desc "Open project editorconfig" "c" #'editorconfig-find-current-editorconfig
:desc "Copy this file" "C" #'doom/copy-this-file
:desc "Find directory" "d" #'dired
:desc "Find directory" "d" #'+default/dired
:desc "Delete this file" "D" #'doom/delete-this-file
:desc "Find file in emacs.d" "e" #'+default/find-in-emacsd
:desc "Browse emacs.d" "E" #'+default/browse-emacsd
Expand Down
10 changes: 10 additions & 0 deletions modules/config/default/autoload/files.el
Expand Up @@ -57,3 +57,13 @@ If prefix ARG is non-nil, prompt for the search path."
(if projectile-project-search-path
(mapc #'projectile-discover-projects-in-directory projectile-project-search-path)
(user-error "`projectile-project-search-path' is empty; don't know where to search"))))

;;;###autoload
(defun +default/dired (arg)
"Open a directory in dired.
If prefix ARG is non-nil, prompt for a known project to open in dired."
(interactive "P")
(dired
(if arg
(completing-read "Open dired in project: " projectile-known-projects)
(dired-read-dir-and-switches ""))))

0 comments on commit 8719911

Please sign in to comment.