diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2022-08-21 17:44:13 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2022-09-14 00:45:42 +0100 |
commit | 4c4fbf6980906fdf57028d56995c621fbe8cdff7 (patch) | |
tree | cd138ff4bb65443129470b9718e8e96911a13d2c /Emacs/.config/emacs/config.org | |
parent | 42e2bf38906e7888397a7a9b746eb71d8ebb89f1 (diff) | |
download | dotfiles-4c4fbf6980906fdf57028d56995c621fbe8cdff7.tar.gz dotfiles-4c4fbf6980906fdf57028d56995c621fbe8cdff7.tar.bz2 dotfiles-4c4fbf6980906fdf57028d56995c621fbe8cdff7.zip |
(Emacs)+dired insert all subdirectories -dired display functions
Just a nice bit of functionality, also added bindings for stuff I've
needed when using dired recently.
Diffstat (limited to 'Emacs/.config/emacs/config.org')
-rw-r--r-- | Emacs/.config/emacs/config.org | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index a4767dd..95ce998 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -1460,24 +1460,13 @@ are some corners I'd like to adjust). :config (with-eval-after-load "evil-collection" (evil-collection-dired-setup)) - (defun +dired/display-thumb-or-file () - "If the file under point is a image file then display a -thumb, otherwise open the file." + + (defun +dired/insert-all-subdirectories () + "Insert all subdirectories currently viewable." (interactive) - (let* ((filename (dired-get-filename)) - (ext (file-name-extension filename))) - (if (or (string= ext "png") - (string= ext "jpg") - (string= ext "jpeg") - (string= ext "gif")) - (image-dired-display-thumb) - (find-file-other-frame filename)))) - - (defun +dired/maybe-frame (&optional ARG) - (interactive "P") - (if ARG - (call-interactively #'dired-other-frame) - (call-interactively #'dired))) + (dired-mark-directories nil) + (mapcar #'dired-insert-subdir (dired-get-marked-files)) + (dired-unmark-all-marks)) (nmmap :keymaps 'dired-mode-map @@ -1487,8 +1476,8 @@ thumb, otherwise open the file." (local-leader :keymaps 'dired-mode-map "l" #'dired-maybe-insert-subdir - "u" #'dired-undo - "i" #'+dired/display-thumb-or-file)) + "m" #'dired-mark-files-regexp + "u" #'dired-undo)) #+end_src *** fd-dired |