A minimalistic yet versatile file manager based on Dired
This package gives Dired the following features:
- Multiple window layouts
- Always available file preview
- Isolated sessions
- Asynchronous directory listing
- A modern and composable user interface
A Dired, a ranger, a neotree, this is Dirvish ;)
Figure 1. dirvish
: A file browser/manager with live preview
sessions.mp4
Figure 2. dirvish-dired
: A brand new Dired.
side.mp4
Figure 3. dirvish-side
: A “neotree” leveraging Dired.
non-blocking-dired.mp4
Figure 4. Huge directories no longer hung up Emacs
Dirvish is available on Melpa, you can install it directly via package-install
if you have melpa in your package-archives
.
(straight-use-package 'dirvish)
To install it manually, first clone this repository, then add path/to/dirvish
to your load-path
.
(add-to-list 'load-path "/path/to/dirvish")
;; If you want the extensions as well
(add-to-list 'load-path "/path/to/dirvish/extensions")
(require 'dirvish)
Start a Dirvish session by M-x
dirvish
or dirvish-dired
.
dirvish-dired
creates a session in current window (likedired
).dirvish
creates a session that makes use of the whole frame.
dirvish-toggle-fullscreen
allows you to toggle the fullscreen state of the
current session.
Dirvish doesn’t change any of your Dired config nor rebind any keys in
dired-mode-map
. As a result, a Dired user already knew how to use Dirvish. (see
also: How is Dirvish related to Dired?)
It is also recommended to enable dirvish-override-dired-mode
, which makes all
your Dired entry commands including dired[-other-window/tab/frame]
initialize or
reuse a Dirvish session automatically.
Several small extension packages to Dirvish are maintained in the subdirectory extensions/. They are installed together with Dirvish if you pull the package from MELPA, Dirvish can work properly with or without them though. These extensions are inactive by default and can be enabled manually if desired.
Currently the following extensions come with the package:
- dirvish-side.el: Toggle Dirvish in side window like neotree.
- dirvish-yank.el: Multi-stage copy/pasting of files.
- dirvish-menu.el: Keybindings help menu powered by
transient.el
. - dirvish-peek.el: Preview files when narrowing candidates using minibuffer.
- dirvish-vc.el: Version-control (git) integration for Dirvish.
- dirvish-extras.el: Extra commands, UI elements, preview dispatchers for Dirvish.
With these extensions it is possible to adapt Dirvish such that it matches your preference or behaves similar to other familiar file explorers.
See Configuration.org (included docs for extensions).
Generally speaking, Dirvish should be able to handle most of the file exploring/managing tasks, after all it is backed by the superb Dired. Besides, choose Dirvish over packages listed below gives you:
- An unified user interface in all your file managing scenarios.
- File preview at your disposal.
- Less package configs to maintain or worry about.
neotree
works pretty well as a simple project explorer. But sadly, compare to
dirvish[-side]
, this package is not built on top of Dired, which means you have
to learn or configure a different set of commands, meanwhile, it is way less
powerful as Dired/Dirvish in terms of file managing.
Same as neotree
, but treemacs
is a much more mature yet complex package. It can
even be used as a general rendering backend of any tree-like structures, you may
find this package useful when you have related needs. It might be an overkill
for simple project exploring tasks due to its complexity and huge codebase.
dired-sidebar
and dirvish-side
do almost exact the same thing: create a file
explorer at side window that leveraging the power of Dired. dired-sidebar
also
includes some basic integration with serveral 3rd-party packages and other small
niceties such as file watching. dirvish-side
, at least for now, is relatively
primitive.
See this discussion.
- There maybe incompatibilities with other third-party Dired packages.
Please feel free to report any issues.
A Dirvish session holds a set of buffers with dirvish-mode
as its major-mode
. As
discussed above, since dirvish-mode
is a derived mode from dired-mode
, most of
the Dired commands work exactly the same in a dirvish-mode
buffer.
Nonetheless, Dirvish and Dired handle these aspects differently:
- Isolated sessions
-
Each Dirvish has its own window layout along with some other isolated niceties such as header string. This makes it easy for Dirvish to adapt itself towards different file management tasks (See screenshots).
- Buffer management
-
dired
command and friends create new Dired buffers, hence navigating through the file system always end up with a lot of Dired buffers. To avoid this, one can either replacedired-find-file
withdired-find-alternate-file
or enabledired-kill-when-opening-new-dired-buffer
, but they introduce two new issues:- The Dired buffers in other windows/tabs/frames might be killed unexpectedly
- The Dired buffers are no longer reusable
As a comparison, the directory/preview buffers are reused during a Dirvish session and get killed when user explicitly exit the session.
- Mode line
-
Dirvish has its own mode-line that can be customized with
dirvish-mode-line-format
, hence thedired-switches-in-mode-line
option doesn’t work in Dirvish.
See Preview strategies.
This package is inspired a lot by ranger.el, thanks @ralesi for creating and maintaining it.
The name dirvish is a tribute to vim-dirvish.