branch: elpa/dirvish commit acbd29d248d08c954ac65a3a977db931b3dd272d Author: Alex Lu <hellosimon1...@hotmail.com> Commit: Alex Lu <hellosimon1...@hotmail.com>
chore: bump to 2.3.0 🎉 --- dirvish-extras.el | 2 +- dirvish-fd.el | 2 +- dirvish-tramp.el | 2 +- dirvish-widgets.el | 2 +- dirvish.el | 2 +- docs/CUSTOMIZING.org | 91 +++++++++++++++++++++++++++++++++++--- docs/EXTENSIONS.org | 70 ++++++----------------------- extensions/dirvish-collapse.el | 2 +- extensions/dirvish-emerge.el | 2 +- extensions/dirvish-history.el | 2 +- extensions/dirvish-icons.el | 2 +- extensions/dirvish-ls.el | 2 +- extensions/dirvish-narrow.el | 8 ++-- extensions/dirvish-peek.el | 2 +- extensions/dirvish-quick-access.el | 2 +- extensions/dirvish-rsync.el | 2 +- extensions/dirvish-side.el | 2 +- extensions/dirvish-subtree.el | 2 +- extensions/dirvish-vc.el | 2 +- extensions/dirvish-yank.el | 2 +- 20 files changed, 119 insertions(+), 84 deletions(-) diff --git a/dirvish-extras.el b/dirvish-extras.el index ec1f8dc576..2981aa752a 100644 --- a/dirvish-extras.el +++ b/dirvish-extras.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/dirvish-fd.el b/dirvish-fd.el index af2eb5ee0c..8a18ae7ef2 100644 --- a/dirvish-fd.el +++ b/dirvish-fd.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/dirvish-tramp.el b/dirvish-tramp.el index e1b705a830..87d9f40017 100644 --- a/dirvish-tramp.el +++ b/dirvish-tramp.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/dirvish-widgets.el b/dirvish-widgets.el index 3062213bdf..c5db45a3a1 100644 --- a/dirvish-widgets.el +++ b/dirvish-widgets.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/dirvish.el b/dirvish.el index 1564b367c9..7f5f905bcb 100644 --- a/dirvish.el +++ b/dirvish.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/docs/CUSTOMIZING.org b/docs/CUSTOMIZING.org index 3150d299f9..ef8fa5328e 100644 --- a/docs/CUSTOMIZING.org +++ b/docs/CUSTOMIZING.org @@ -149,12 +149,6 @@ different file types, assigning specific handlers for each. Functions called in the regular preview buffer. -** =find-dired= integration - -=find-dired= should work seamlessly with Dirvish. However, there are currently no -plans to integrate Dirvish further into its output buffer, as =dirvish-fd= offers -a superior alternative. See [[file:EXTENSIONS.org][Extensions:dirvish-fd.el]] for more information. - * Dirvish "Attributes" A Dirvish attribute is a visual indicator displayed inline within dired buffers, @@ -256,7 +250,7 @@ header-line are displayed in separate buffers and their corresponding windows. These buffers are initialized with ~dirvish-misc-mode~. To customize the settings of these buffers, append your configuration to ~dirvish-misc-mode-hook~. -* File preview in multiple window layouts +* File preview with various window layouts ~M-x dirvish~ creates a full-frame window *layout* consists of a central file listing window accompanied by an preview window and 0 or more additional parent @@ -454,6 +448,87 @@ Contributions to this list are welcome! https://github.com/alexluigit/dirvish/wiki/Contrib-preview-dispatchers +* =fd= integration + +Dirvish integrates [[https://github.com/sharkdp/fd][fd]] at its core. + +** Install =fd= + +Please ensure [[https://github.com/sharkdp/fd][fd]] is installed on your OS before using relevant features. + +@@html:<details>@@ +@@html:<summary>@@ @@html:<b>@@Toggle install instructions@@html:</b>@@ @@html:</summary>@@ + +@@html:<h2>@@macOS@@html:</h2>@@ +#+begin_src bash +brew install fd +#+end_src + +@@html:<h2>@@Debian-based@@html:</h2>@@ +#+begin_src bash +apt install fd-find +#+end_src + +@@html:<h2>@@Arch-based@@html:</h2>@@ +#+begin_src bash +pacman -S fd +#+end_src + +@@html:<h2>@@FreeBSD@@html:</h2>@@ +#+begin_src bash +pkg install fd-find +#+end_src + +@@html:<h2>@@Windows@@html:</h2>@@ +#+begin_src bash +# install via Scoop: https://scoop.sh/ +scoop install fd +#+end_src + +@@html:</details>@@ + +** Non-blocking large directory opening + +Opening large directories (e.g., 50,000+ files) using Dired can cause noticeable +freezing. This occurs because Dired's default method involves synchronously +calling the =ls= shell command, processing its entire output, and adding text +properties before displaying the buffer, blocking user input until completion. +While acceptable for small directories, this behavior is disruptive for very +large ones. + +Dirvish addresses this by offering an asynchronous alternative using the =fd= +command. To enable it, set the ~dirvish-large-directory-threshold~ variable to a +suitable file count (e.g., 20000). When opening a directory exceeding this +threshold, Dirvish initiates an asynchronous =fd= process instead of calling +Dired. It then incrementally parses the output and populates the buffer, +avoiding the freeze associated with synchronous operations and keeping Emacs +responsive. + +** Use =dirvish-fd= directly + +You can also use ~dirvish-fd~ directly to list all entries in a directory. +Here is a quick demo of how it works: + +https://user-images.githubusercontent.com/16313743/170814774-98cc598d-6bc5-4fc3-9eea-21c98d6d4772.mp4 + +Let's break it down: + +1. C-u C-u M-x ~dirvish-fd~, input /test/ as the search pattern +2. M-x ~dirvish-fd-switches-menu~ for additional filtering +3. Press =f= (show file only,no directories) +4. Press =-e=, input "/py,yaml/", meaning search for these 2 extensions only +5. Press =-E=, input "/Emacs/", exclude the glob in the results +6. Press =RET=, refresh the results + +This command becomes more powerful when combined with the ~dirvish-narrow~ +extension, which adds asynchronous filtering capabilities. See: [[file:EXTENSIONS.org][Extensions]] + +** About =find-dired= + +=find-dired= should work seamlessly with Dirvish. However, there are currently no +plans to integrate Dirvish further into its output buffer, as =dirvish-fd= offers +a superior alternative. + * Sample config ** Dirvish @@ -492,6 +567,8 @@ you don't have to require them explicitly if you installed dirvish from MELPA or '(vc-state subtree-state nerd-icons collapse git-msg file-time file-size) dirvish-side-attributes '(vc-state nerd-icons collapse file-size)) + ;; open large directory (over 20000 files) asynchronously with `fd' command + (setq dirvish-large-directory-threshold 20000) :bind ; Bind `dirvish-fd|dirvish-side|dirvish-dwim' as you see fit (("C-c f" . dirvish) :map dirvish-mode-map ; Dirvish inherits `dired-mode-map' diff --git a/docs/EXTENSIONS.org b/docs/EXTENSIONS.org index dbd9a9e118..09e9e5eb5f 100644 --- a/docs/EXTENSIONS.org +++ b/docs/EXTENSIONS.org @@ -210,62 +210,6 @@ breeze. No manual editing anymore! *Figure 3*. left: ~dirvish-quicksort~ right: ~dirvish-ls-switches-menu~ -* Dirvish as the interface of *fd* command (dirvish-fd.el) - -Please ensure [[https://github.com/sharkdp/fd][fd]] is installed on your OS before using this extension. - -@@html:<details>@@ -@@html:<summary>@@ @@html:<b>@@Toggle install instructions@@html:</b>@@ @@html:</summary>@@ - -@@html:<h2>@@macOS@@html:</h2>@@ -#+begin_src bash -brew install fd -#+end_src - -@@html:<h2>@@Debian-based@@html:</h2>@@ -#+begin_src bash -apt install fd-find -#+end_src - -@@html:<h2>@@Arch-based@@html:</h2>@@ -#+begin_src bash -pacman -S fd -#+end_src - -@@html:<h2>@@FreeBSD@@html:</h2>@@ -#+begin_src bash -pkg install fd-find -#+end_src - -@@html:<h2>@@Windows@@html:</h2>@@ -#+begin_src bash -# install via Scoop: https://scoop.sh/ -scoop install fd -#+end_src - -@@html:</details>@@ - -This is probably the BEST =fd= frontend, here is a quick demo: - -https://user-images.githubusercontent.com/16313743/170814774-98cc598d-6bc5-4fc3-9eea-21c98d6d4772.mp4 - -Let's break it down: - -1. M-x ~dirvish-fd~, input /test/ as the search pattern and confirm -2. M-x ~dirvish-fd-switches-menu~ for additional filtering -3. Press =f= (show file only,no directories) -4. Press =-e=, input "/py,yaml/", meaning search for these 2 extensions only -5. Press =-E=, input "/Emacs/", exclude the glob in the results -6. Press =RET=, refresh the results - -Note that ~dirvish-quicksort~ and ~dirvish-ls-switches-menu~ also works in this -buffer. Feel free to experiment with other switches. - -This extension also provides the ~dirvish-fd-jump~ command which allows you to go -to any directory in the file system using results from =fd= command as completions. - -TODO: try implementing #213 - * Turn Dirvish into a tree browser (dirvish-subtree.el) This extension enhances Dirvish with the ~dirvish-subtree-toggle~ command, a @@ -337,3 +281,17 @@ If [[https://github.com/oantolin/orderless][orderless]] is installed, it is auto =completion-regexp-list= from your input string for file list filtering. The matching style is determined by your =orderless= configuration. If =orderless= is not available, the regexp list is generated using ~split-string~ instead. + +~dirvish-narrow~ also operates within buffers generated by ~dirvish-fd~. When +narrowing in such buffers, input starting with "#" enables two-stage filtering. +A new =fd= process is spawned whenever the minibuffer input changes. The portion +of the input immediately following the initial "#" is passed as a pattern +argument to =fd=, while the remainder of the input (after the =fd= pattern) serves +as a secondary filter applied by Dirvish. For example, with the minibuffer input +=#foo,bar baz=, the =fd= process runs with a pattern like =--and=foo --and=bar=, and +its results are then filtered within Dirvish using =baz=. If you remove the +leading "#" character, =fd= is instructed to list all entries recursively without +any pattern filtering, and the entire minibuffer content is used as the filter +pattern within Dirvish. This two-level filtering is advantageous for +directories containing a large number of files (e.g. =/= or =$HOME=), as the initial +=fd= filtering significantly reduces the processing time. diff --git a/extensions/dirvish-collapse.el b/extensions/dirvish-collapse.el index bf3a914812..33a530e9a0 100644 --- a/extensions/dirvish-collapse.el +++ b/extensions/dirvish-collapse.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/extensions/dirvish-emerge.el b/extensions/dirvish-emerge.el index fb87f34890..27038bdf9e 100644 --- a/extensions/dirvish-emerge.el +++ b/extensions/dirvish-emerge.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/extensions/dirvish-history.el b/extensions/dirvish-history.el index 9fac31b371..0d27d33f03 100644 --- a/extensions/dirvish-history.el +++ b/extensions/dirvish-history.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/extensions/dirvish-icons.el b/extensions/dirvish-icons.el index 2da3fc2172..68bda0cc81 100644 --- a/extensions/dirvish-icons.el +++ b/extensions/dirvish-icons.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/extensions/dirvish-ls.el b/extensions/dirvish-ls.el index 760d0d67ec..246ace43e6 100644 --- a/extensions/dirvish-ls.el +++ b/extensions/dirvish-ls.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/extensions/dirvish-narrow.el b/extensions/dirvish-narrow.el index be1bceb4da..59421e2985 100644 --- a/extensions/dirvish-narrow.el +++ b/extensions/dirvish-narrow.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later @@ -14,7 +14,7 @@ ;;; Code: -(require 'dirvish) +(require 'dirvish-fd) ;; Credit: copied from `orderless.el' (defcustom dirvish-narrow-match-faces @@ -105,7 +105,7 @@ always (isearch-no-upper-case-p re t))) (dirvish-prop :narrow-info (list async rel igc))) (dirvish--run-with-delay mc :narrow - (lambda (action) + (lambda (_action) (with-current-buffer (cdr (dv-index (dirvish-curr))) (when (dirvish-prop :fd-info) (dirvish-fd--start-proc)) (save-excursion @@ -123,7 +123,7 @@ (when (dv-curr-layout (dirvish-curr)) (force-mode-line-update t)))))) (dirvish-define-attribute narrow-match - "NARROW MATCH." + "Highlight matched part of narrowed files." (cl-loop with (_ regexps case-fold-search) = (dirvish-prop :narrow-info) with n = (length dirvish-narrow-match-faces) with ovs = nil for regexp in regexps and i from 0 diff --git a/extensions/dirvish-peek.el b/extensions/dirvish-peek.el index 638533e62b..ba44811d2c 100644 --- a/extensions/dirvish-peek.el +++ b/extensions/dirvish-peek.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/extensions/dirvish-quick-access.el b/extensions/dirvish-quick-access.el index b5f07cd1dc..0ebe1113c2 100644 --- a/extensions/dirvish-quick-access.el +++ b/extensions/dirvish-quick-access.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/extensions/dirvish-rsync.el b/extensions/dirvish-rsync.el index d18b793476..a1e965d307 100644 --- a/extensions/dirvish-rsync.el +++ b/extensions/dirvish-rsync.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/extensions/dirvish-side.el b/extensions/dirvish-side.el index 50c621cacb..f4fafffce7 100644 --- a/extensions/dirvish-side.el +++ b/extensions/dirvish-side.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/extensions/dirvish-subtree.el b/extensions/dirvish-subtree.el index 6439d170c6..73b9c8026b 100644 --- a/extensions/dirvish-subtree.el +++ b/extensions/dirvish-subtree.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/extensions/dirvish-vc.el b/extensions/dirvish-vc.el index 0e95ee0327..82f141a910 100644 --- a/extensions/dirvish-vc.el +++ b/extensions/dirvish-vc.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/extensions/dirvish-yank.el b/extensions/dirvish-yank.el index 06bd8354d2..25355ad8c6 100644 --- a/extensions/dirvish-yank.el +++ b/extensions/dirvish-yank.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2025 Alex Lu ;; Author : Alex Lu <https://github.com/alexluigit> -;; Version: 2.2.7 +;; Version: 2.3.0 ;; Keywords: files, convenience ;; Homepage: https://github.com/alexluigit/dirvish ;; SPDX-License-Identifier: GPL-3.0-or-later