(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.
This commit is contained in:
@@ -1460,24 +1460,13 @@ are some corners I'd like to adjust).
|
|||||||
:config
|
:config
|
||||||
(with-eval-after-load "evil-collection"
|
(with-eval-after-load "evil-collection"
|
||||||
(evil-collection-dired-setup))
|
(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."
|
|
||||||
(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)
|
(defun +dired/insert-all-subdirectories ()
|
||||||
(interactive "P")
|
"Insert all subdirectories currently viewable."
|
||||||
(if ARG
|
(interactive)
|
||||||
(call-interactively #'dired-other-frame)
|
(dired-mark-directories nil)
|
||||||
(call-interactively #'dired)))
|
(mapcar #'dired-insert-subdir (dired-get-marked-files))
|
||||||
|
(dired-unmark-all-marks))
|
||||||
|
|
||||||
(nmmap
|
(nmmap
|
||||||
:keymaps 'dired-mode-map
|
:keymaps 'dired-mode-map
|
||||||
@@ -1487,8 +1476,8 @@ thumb, otherwise open the file."
|
|||||||
(local-leader
|
(local-leader
|
||||||
:keymaps 'dired-mode-map
|
:keymaps 'dired-mode-map
|
||||||
"l" #'dired-maybe-insert-subdir
|
"l" #'dired-maybe-insert-subdir
|
||||||
"u" #'dired-undo
|
"m" #'dired-mark-files-regexp
|
||||||
"i" #'+dired/display-thumb-or-file))
|
"u" #'dired-undo))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** fd-dired
|
*** fd-dired
|
||||||
|
|||||||
Reference in New Issue
Block a user