From 5ed1fa6136f473501b1dfb7151e8fc218ae9647c Mon Sep 17 00:00:00 2001 From: Dante Catalfamo Date: Thu, 25 Jun 2020 12:26:42 -0400 Subject: Add Emacs dired-subtree post --- content/.gitkeep | 0 .../dired-expand-dir-on-tab/dired-subtree.png | Bin 0 -> 90453 bytes content/posts/dired-expand-dir-on-tab/index.org | 37 +++++++++++++++++++++ 3 files changed, 37 insertions(+) delete mode 100644 content/.gitkeep create mode 100644 content/posts/dired-expand-dir-on-tab/dired-subtree.png create mode 100644 content/posts/dired-expand-dir-on-tab/index.org diff --git a/content/.gitkeep b/content/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/content/posts/dired-expand-dir-on-tab/dired-subtree.png b/content/posts/dired-expand-dir-on-tab/dired-subtree.png new file mode 100644 index 0000000..561dcb1 Binary files /dev/null and b/content/posts/dired-expand-dir-on-tab/dired-subtree.png differ diff --git a/content/posts/dired-expand-dir-on-tab/index.org b/content/posts/dired-expand-dir-on-tab/index.org new file mode 100644 index 0000000..7e189e3 --- /dev/null +++ b/content/posts/dired-expand-dir-on-tab/index.org @@ -0,0 +1,37 @@ +#+TITLE: Expanding a Directory With Tab in Dired Mode +#+DATE: 2020-06-25T12:02:59-04:00 +#+DRAFT: true +#+DESCRIPTION: How to setup Emacs to expand dired directories on TAB +#+TAGS[]: emacs +#+KEYWORDS[]: emacs dired +#+SLUG: +#+SUMMARY: + +#+ATTR_HTML: :alt dired-subtree expanded +#+ATTR_HTML: :title dired-subtree Expanded +[[file:dired-subtree.png]] + +=dired= mode is one of my favourite features of Emacs. I use it so +often, it's pretty much my go-to file browser. I use it both on my +local machine, and on remote machines via TRAMP. One feature of +=dired= is the ability to enter sub-directories in the same buffer by +inserting the contents under the current directory. While this is +useful, I often want something quicker to check the contents of a +directory without either opening it in a new buffer, or inserting it +below. + +The workaround for this I use is by using the excellent [[https://melpa.org/#/dired-subtree][dired-subtree]] +package and the following ~use-package~ definition. + +#+BEGIN_SRC elisp +(use-package dired-subtree + :ensure t + :after dired + :bind (:map dired-mode-map + ("TAB" . dired-subtree-toggle))) +#+END_SRC + +Now whenever I want to expand a directory, I move my cursor over it +and press the @@html: Tab ↹@@ key. Pressing +@@html: Tab ↹@@ again on the same entry will collapse it +and hide the contents again. -- cgit v1.2.3