reddit / emacs

[ANN] Dirvish V1.9 released - a polished Dired with batteries included

alexluigit · 2022-07-17 12:37
alexluigit · 2022-07-17 12:37
Repository: [https://github.com/alexluigit/dirvish](https://github.com/alexluigit/dirvish) A summary on Dirvish from u/_noctuid [https://github.com/alexluigit/dirvish/issues/34](https://github.com/alexluigit/dirvish/issues/34) Join the discussion: [https://github.com/alexluigit/dirvish/discussions](https://github.com/alexluigit/dirvish/discussions) For doom users, you can try out Dirvish by adding +dirvish flag to the dired module now, the version of Dirvish that doom uses is pretty old though.
DefiantAverage1 · 2022-07-17 13:05
That looks awesome! May I ask which font and theme you use? I've also started using dirvish myself. As snappy as dired and as featureful as ranger!
alexluigit · 2022-07-17 13:13
I believe the font used in the screenshot is Victor Mono. The theme is the builtin modus-vivendi from Prot. Glad you liked it!
QueenOfHatred · 2022-07-17 14:08
Oh man, thats actually good enough to make me move from using vterm/ansi-term for any file management purposes, to this.
alexluigit · 2022-07-17 14:24
You can actually drag'n'drop marked files from Dired to other applications such as web browser (in Emacs 29). For that I uninstalled my GUI file manager (since that's the only reason I kept a GUI file manager), so now Dirvish is actually my sole file manager :)
wysteriary · 2022-07-17 17:26
> You can actually drag'n'drop marked files from Dired to other applications such as web browser (in Emacs 29) Wow! No way, is this really specific to emacs 29?
MitchellMarquez42 · 2022-07-17 18:28
Just installed and did some tweaking with keybindings. This is wonderful.
TheGramm · 2022-07-17 19:14
Yup, its in 29! https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS#L1844
BulkyLoad87 · 2022-07-17 19:24
How stable 29 is? Are you building it from top of the master tree?
stuudente · 2022-07-17 19:25
This is great!
ATangoForYourThought · 2022-07-17 19:44
I wish it was possible to have image previews without creating a second buffer
TheGramm · 2022-07-17 19:49
Yes to both
holgerschurig · 2022-07-17 21:00
One can "un-pin" packages in Doom, then GIT HEAD will be installed.
dzecniv · 2022-07-17 22:56
Saved! https://wikemacs.org/wiki/Dired#Dirvish_-_a_polished_Dired_with_batteries_included
ares623 · 2022-07-17 22:59
Is there a demo video?
madwilliamflint · 2022-07-17 23:06
That's sexy as hell right there.
Brax8888 · 2022-07-18 00:11
how do you do this. I was googling for it a bit ago
licjon · 2022-07-18 01:28
I am trying it out with the sample config. It has some cool features. I guess I will have to take some time to learn how to use it because it doesn't work as similarly to dired as I would expect.
kamui78 · 2022-07-18 01:46
I tried this package and it is indeed an interesting concept. I don't know if it is possible to improve this but the generation of the previews is quite slow. This is the main reason I will still stick with the default dired experience, at least for now. It does help that my files are all named in a sensitive way so I can understand about the content without having to preview it. Good luck with your project. It is a neat idea.
alexluigit · 2022-07-18 02:48
Thank you!
alexluigit · 2022-07-18 02:48
Thank you!
azfrak · 2022-07-18 02:51
In packages.el `(unpin! dirvish)` although I did this just then and got an error, and error has been around for a few days at least. [https://github.com/doomemacs/doomemacs/issues/6562](https://github.com/doomemacs/doomemacs/issues/6562) Probably best to hold off on unpinning it for now, although there is a fix listed which will likely be pushed to master soon. [https://github.com/doomemacs/doomemacs/issues/6562#issuecomment-1186590918](https://github.com/doomemacs/doomemacs/issues/6562#issuecomment-1186590918)
shackra · 2022-07-18 02:55
boy! looking good af
alexluigit · 2022-07-18 03:09
Thanks for your feedback! > but the generation of the previews is quite slow. What file type of preview generation is slow? Or did you mean it's slow in general? Here is a quick demo video of previewing image files: [https://user-images.githubusercontent.com/16313743/179439740-76ebd4a8-132c-4535-b1f5-d0415eba5e55.mp4](https://user-images.githubusercontent.com/16313743/179439740-76ebd4a8-132c-4535-b1f5-d0415eba5e55.mp4) Image preview is the most computational-intensive preview method in Dirvish, preview other type of files (like text) would feel even snappier than this. If by slow you mean the preview for directory, you should check out [this](https://github.com/alexluigit/dirvish/blob/main/CUSTOMIZING.org#sample-1-directory-preview-using-exa-command). Edit: `imagemagick` is required for image preview. `ffmpegthumbnailer` is required for video preview. The deme video above is recorded in a very old PC.
alexluigit · 2022-07-18 03:21
Thanks for this!
alexluigit · 2022-07-18 03:29
It is possible. To achieve this, we can either: \- draw the image in the dired buffer \- put the image in a childframe (see dired-posframe) But I don't think they are good solutions for image preview or preview in general because it also introduce issues like: \- image will inevitably mess up / cover the buffer content, it's unnecessary complexities for both developer and users. \- we might need to provide extra commands for users to select the image, but that's not a problem with previewing images in a different window. You can just do \`other-window\` and move your cursor like in a normal buffer. Select/rotate/zoom in/zoom out the image, copy the metadata, etc.
alexluigit · 2022-07-18 03:30
Thank you!
kamui78 · 2022-07-18 03:34
Sorry, I should have been more specific. While video files and images have a fast preview, the pdf preview, which are generated with pdf-tools I guess, is slow. Your demo is definitely fast. Is it the same with pdf files? I have a lot of pdf books and a lot of them have more than 500 pages. Maybe the sluggishness with pdfs is due to the pdf-tools package?
alexluigit · 2022-07-18 03:44
In most of the situations you can actually use Dirvish in the same way you use Dired. I put a lot of keybindings in the sample config just to let people know these features exist. You can adopt them one by one, `dirvish-quicksort` would be a good start (to replace `dired-sort-toggle-or-edit`).
alexluigit · 2022-07-18 04:06
I'm planning to make one. Stay tuned!
alexluigit · 2022-07-18 04:08
Thank you!
alexluigit · 2022-07-18 04:24
Ah, my bad. The pdf was previously previewed by the help of `pdftoppm` executable, I disabled that while I was refactoring the code. You can try it with this for now: [outdated content deleted] Maybe I'll make this as the default pdf previewer, at least I'll mention it in the docs.
FarmBoy2222 · 2022-07-18 04:33
I am absolutely loving using dirvish, but as a doom user its been a little tricky to get working properly. I know you have your section on it: [https://github.com/alexluigit/dirvish/blob/main/CUSTOMIZING.org#working-with-doom-emacs](https://github.com/alexluigit/dirvish/blob/main/CUSTOMIZING.org#working-with-doom-emacs) the +dirvish flag helps (even though it isn't documented) but it looks like there is still some work to do. I shall try give it a go.
[deleted] · 2022-07-18 04:35
[deleted]
alexluigit · 2022-07-18 04:36
> It does help that my files are all named in a sensitive way so I can understand about the content without having to preview it. I agree. In reality we don't need file preview all the time, so you don't have to use the `dirvish` command, just enable dirvish-override-dired-mode and use `dired/dired-jump` (dired-jump is the most frequent command I use, I only use `dirvish` from time to time), it keeps all the features except file preview. When you feel the need to access the file preview, just invoke `dirvish-toggle-fullscreen`. If you don't need those extra features provided by Dirvish, I believe Dired would be a better choice for you :)
funk443 · 2022-07-18 05:10
Looks great!
FOSSbflakes · 2022-07-18 05:22
Very neat, great work. Unfortunately it isn't playing well with my centaur-tabs config at the moment, but all the functionality is still there so keeping it :).
shackra · 2022-07-18 05:26
please do! video demos are always cool to watch
FarmBoy2222 · 2022-07-18 06:09
the following will help with the quitting keymap. Still working on disabling the vc highlight options: ``` (map! :map dirvish-mode-map :n "b" #'dirvish-goto-bookmark :n "z" #'dirvish-show-history :n "f" #'dirvish-file-info-menu :n "F" #'dirvish-toggle-fullscreen :n "l" #'dired-find-file :n "h" #'dired-up-directory :n "q" #'quit-window :localleader "h" #'dired-omit-mode) ```
alexluigit · 2022-07-18 06:41
The vc state you see at the left fringe in doom is not from dirvish, instead it's put there by doom, more specifically the `diff-hl` package. To remove it you should remove the `diff-hl-dired-mode-unless-remote` function from `dired-mode-hook`. see: https://github.com/doomemacs/doomemacs/blob/33c5f3721a704c72e49efc5960be3785d1a80b81/modules/emacs/dired/config.el#L74
FarmBoy2222 · 2022-07-18 06:44
I did find the dired-mode-unless-remote. I am just trying to find the least annoying way to disable it in the user config instead of commenting the line out in the doom modules. Remove hook is looking promising. If I find a way I will post here. Quick dumb question from me. How do you enable fullscreen by default?
alexluigit · 2022-07-18 06:50
> How do you enable fullscreen by default? I'm not sure I understand you correctly, but isn't the `dirvish` command gives you a fullscreen session?
alexluigit · 2022-07-18 06:50
Thank you!
alexluigit · 2022-07-18 06:52
I'll look into this. Thanks for the feedback.
FarmBoy2222 · 2022-07-18 06:56
Ah, this is a doom issue. If you invoke it with `SPC o -` it attempts to open normal dired and stuffs up the fullscreen mode somehow. The preview window is also pretty broken in doom
alexluigit · 2022-07-18 07:14
Maybe you can remap that key to `dirvish` or `dirvish-dwim`. > The preview window is also pretty broken in doom I'm not sure what do you mean by "broken", it maybe relates to your popup rules in doom. See:https://github.com/alexluigit/dirvish/issues/18
FarmBoy2222 · 2022-07-18 07:22
That was it! Thanks so much for your help! For reference this is what I have now. It appears to work fine for the most part. ``` (setq dirvish-attributes '(all-the-icons file-size collapse subtree-state vc-state git-msg)) (set-popup-rule! "^ \\*Dirvish.*" :ignore t) (map! :map dirvish-mode-map :n "b" #'dirvish-goto-bookmark :n "z" #'dirvish-show-history :n "f" #'dirvish-file-info-menu :n "F" #'dirvish-toggle-fullscreen :n "l" #'dired-find-file :n "h" #'dired-up-directory :n "?" #'dirvish-dispatch :n "q" #'quit-window :localleader "h" #'dired-omit-mode) (after! dirvish (require 'dired-x)) ```
konrad1977 · 2022-07-18 07:58
Maybe ask for a more high res image? Like this one https://user-images.githubusercontent.com/16313743/179333496-9b911fee-1305-45a0-99b0-7e81297d98a0.png
efpee · 2022-07-18 08:02
Very nice ! Does someone else experience issues with *dired-view-file* with this package ? (bound by default to "v") > In Dired, examine a file in view mode, returning to Dired when done. > When file is a directory, show it in this buffer if it is inserted. > Otherwise, display it in another buffer. > I get normal behavior described above when a file is selected, but nothing happens when file is a directory .
[deleted] · 2022-07-18 08:03
[deleted]
dzecniv · 2022-07-18 08:27
done, I put a 800x600 version (this one is too big and IDK how to re-scale it in place).
kamui78 · 2022-07-18 08:46
I will definitely try it. Would you please fix the formatting? Now it is a big garbled. Do I need to install pdftoppm?
alexluigit · 2022-07-18 10:13
Yes, you'll have to install it. > I will definitely try it. Would you please fix the formatting? See: https://github.com/alexluigit/dirvish/blob/main/CUSTOMIZING.org#sample-1-preview-pdf-files-with-generated-thumbnail I'll make the `dirvish-media-properties` command support PDF files as well.
alexluigit · 2022-07-18 10:33
Fixed in the latest commit. Thank you for reporting this!
FarmBoy2222 · 2022-07-18 11:40
random other question. I noticed you used `dirvish-media-properties` in the example image on the repo, but it appears this is a one time function call. Is there an intention to have it always be there when looking at media files or is this more your personal configuration?
FarmBoy2222 · 2022-07-18 13:19
Someone put up a fix for the doom stuff https://github.com/doomemacs/doomemacs/pull/6568
rockatanescu · 2022-07-18 13:24
I'm rediscovering Emacs after a couple of years with Jetbrains IDEs and one of the things I wished Emacs could do better is improve the dired experience. This is it! Thank you so much for your work!
Brax8888 · 2022-07-18 14:42
I tried the pinned dirvish and honestly didn't get it, could be that +icons crews it up but it didn't look how the repo looked and it messed with my Modeline. I was meaning to unpin doom themes . But I use the technique of having basically one file for my config being config.org though init.el still exists on its own for now.
ATangoForYourThought · 2022-07-18 15:33
Well, I have a current complexity where I want to switch to another buffer, forget to toggle off the previews and see the image preview stay in place and then have to switch back to dirvish buffer, toggle previews off and then switch to the buffer I want.
your_sweetpea · 2022-07-18 20:20
~~Maybe I just didn't take the time get it configured right, but when I tried out Dirvish it honestly looked quite bad and was impossible to close without leaving a mess of my frame, leaving several oddly sized windows for me to clean up.~~ **EDIT:** after reinstalling it seems to be working fine. I don't hate the Dired override and could see myself getting somewhere with that, but it still seems to behave a bit weirdly for my preferences (ex: closing itself when opening a file). I might fork it and use it as a base to write my own Dired override if you don't mind, stripping out the other bits.
azfrak · 2022-07-19 00:16
Good to hear. I had +icons when I tried, but the person who opened the issue didnt have that listed in their config description (although doesnt mean it wasn't included). There us a pull request to fix this though so should be sorted regardless very soon :) https://github.com/doomemacs/doomemacs/pull/6568
alexluigit · 2022-07-19 02:05
I'd love to give user a option to show the media properties automatically, but I need to find a solution to minimize or eliminate the delay caused by this functionality since querying the mediainfo take sometime.
alexluigit · 2022-07-19 02:06
Thanks for sharing this!
alexluigit · 2022-07-19 02:12
You want to use commands like `switch-to-buffer` inside a fullscreen dirvish and expect dirvish to quit/hide itself afterwards, am I understand you correctly? If that's the case, you can try out the latest commit.
alexluigit · 2022-07-19 02:18
> but when I tried out Dirvish it honestly looked quite bad and was impossible to close without leaving a mess of my frame This indicates that there are some errors occurred during the initialization , usually you'll see something in the backtrace (after toggle-debug-on-error), would you mind open an issue? > I might fork it and use it as a base to write my own Dired override if you don't mind, stripping out the other bits. I don't mind at all since it's a GPL-licensed project. Feel free to ask if you need any help.
FarmBoy2222 · 2022-07-19 04:02
I think the guy who made the PR had +icons in his config. And looking at the doom config it should be fine to have it there
your_sweetpea · 2022-07-19 05:28
Huh. I hate to have cried wolf but after reinstalling it seems to be working perfectly (other than the missing programs in my path). I'll edit my above content, sorry about that.
alexluigit · 2022-07-19 07:56
No worries. The situation you described in the original post (the crossed-out text) actually happened quite often while I was developing the package, so I understand your confusing when that happens.
lilytex · 2022-07-19 12:11
Does it support [extended attributes](https://en.wikipedia.org/wiki/Extended_file_attributes)? I'm building a navigation system in both GUI using Dolphin and terminal parsing the file Dolphin uses for storing this info, but having it in emacs would be awesome
alexluigit · 2022-07-20 05:48
Nope. Is it easy to implement them by the help of some CLI tools? Perhaps we can have a extension for it.
efpee · 2022-07-20 08:00
> ex: closing itself when opening a file Do you have any idea how to tweak this behavior ? I would also prefer leaving latest open dired buffers open.
your_sweetpea · 2022-07-20 08:22
I've honestly not investigated it further, I would recommend trying `C-h k <enter>` on a file in the dirvish buffer then poking through the codepath to see if there's anything there that could hint at a configuration variable or function to advise. Rather than deleting itself it could also theoretically be demoting itself in the buffer-list so that it's no longer second, and therefore no longer the first candidate to be switched to (ie. if dirvish reuses buffers, it could move itself to the bottom of the buffer-list then rename itself so its name starts with a space, making it a hidden buffer). I noticed that dirvish already has better (depending on your preferences) buffer reuse than dired, at least, since navigating to another directory opens it in the same buffer rather than a new one, so it's possible.
lilytex · 2022-07-20 10:37
I use a quick and dirty method to get them in the terminal which relies on KDE tools ([Baloo](https://community.kde.org/Baloo) and Dolphin) To get them from the terminal you need a indexer process running in the background, which in my case is Baloo Dolphin then exposes this tags in a file `~/.local/share/user-places.xbel` I search for the tag structure in this file: ```xml <bookmark href="tags:/project"> <bookmark href="tags:/repo"> ``` And then you can list all the files having that tag using Baloo: `baloosearch tag:repo` `baloosearch tag:projects` I combine them using fzf to move to that directory: ```zsh tag=$(cat ~/.local/share/user-places.xbel | grep -F 'bookmark href="tags:/' | grep -vF ' <bookmark href="tags:/">' | sed -E 's#[ ]*<bookmark href="tags:/([^"]+)">#\1#' | fzf --multi --preview 'baloosearch tag:{1}'); directory=$(baloosearch tag:$tag | fzf --multi --preview "ls '{1}'"); cd "$directory" ```
kamui78 · 2022-07-20 12:24
I have installed the pdftoppm and it is definitely much better. I cannot dismiss all of the tree windows that dirvish creates. If I press q only the middle one is dismissed. In my case q activates kill-this-buffer. This works with dired because there is always one visible buffer. Is there a suggested way to close all of the dirvish buffers or should I write a function myself? EDIT: Found the solution here: https://github.com/alexluigit/dirvish/blob/main/CUSTOMIZING.org Remapped q to quit-window. It works very well now.
kamui78 · 2022-07-20 13:35
I get this error and the previews have stopped working: Error running timer: (void-function dirvish-pdf-preface-preview-dp) Any hint on how can I fix it?
alexluigit · 2022-07-20 13:58
For the kill-buffer issue, you should use the `dirvish-quit` (bound to `q` by default), it does the cleaning for you automatically. Are you using the latest commit? I added this preview method after we had this discussion. Or maybe you don't have those extensions in your `load-path`.
alexluigit · 2022-07-20 14:17
``` (setq dirvish-reuse-session t) ```
alexluigit · 2022-07-20 14:58
So basically what you are doing here is to tag some directories with different label and save these tags in a file that can be queried with later, am I understand you correctly? What's the benefits of using extended attributes over solutions like bookmark in Emacs? I don't know much about extended attrs but from your description it seems not hard to implement it in elisp without the Dolphin dependency. If you really want this, perhaps open a [discussion](https://github.com/alexluigit/dirvish/discussions) and see how other people think about it.
lilytex · 2022-07-20 15:57
Yes, basically this is it, sorry if the example was convoluted. Plus is you want to track all the xattrs/tags no matter how they were created (e.g. through some external program, or through copying instead of only through dirvish) then a file indexer of some sort is necessary to discover them. The difference with bookmarks is that bookmarks are like having one tag only, i.e. you can only search through all your bookmarks for the needed folder. Having tags allows you to search across all your project files, or or your repos, or all your elisp folders which for example could include a folder with pdf learning resources and also repos with specific code you want to work on. This is what I'm currently using with the fzf example. Having multiple tags per folder, and I think this is the real deal, allows you to write a "query" matching all folders that are repos in elisp, or all the learning resources about elisp (which will be the queries "repo" AND "elisp", "learning" AND "elisp" respectively) I will open a discussion, it can be an interesting topic Glad I've come to know dirvish, it looks great!
efpee · 2022-07-21 01:16
>(setq dirvish-reuse-session t) This allows indeed to keep previous session open but does not solve below use case. Use case description : you are under a folder looking for a file, you open one file, realize it is not expected one and close associated buffer * Current result : you are now switched to another buffer, need to switch buffer back to dirvish folder before resuming your file search * Expected result : you are now switched back last dirvish buffer (used to open the file), you can directly resume your file search * Note : this is default behavior with dired, reproduced with emacs -Q
kamui78 · 2022-07-21 09:26
I have installed dirvish with use-package. What should I load with load-path? I followed the install section of the documentation. Maybe I have overlooked something?
alexluigit · 2022-07-21 14:33
Fixed at latest commit.
alexluigit · 2022-07-21 14:36
If you pull the package from MELPA I believe extensions/\*\*.el are already in your load-path. Would `(require 'dirvish-media)` raise an error?
kamui78 · 2022-07-22 01:54
There are no error messages. But now I have a weird issue, my rightmost panel does not update anymore. It is stuck to my current directory. I can load dirvish-media without problems. But the preview function is still not working. Same errors as before. I have isolated the error. It happens only if I set this variable: (setq dirvish-preview-dispatchers (cl-substitute 'pdf-preface 'pdf dirvish-preview-dispatchers)) Without it I am back to having a sluggish pdf preview, since it relies on pdf-tools, but it works.
alexluigit · 2022-07-22 04:43
Would you mind open an issue? Post your steps to reproduce the problem with recipes similar to [this one](https://github.com/alexluigit/dirvish/issues/84#issuecomment-1189305923) so that we can diagnose the problem much easier.
No_Statistician_9040 · 2022-08-05 10:26
Wait just getting into emacs is all of this only emacs?
alexluigit · 2022-08-05 12:53
Apart from some [cli tools](https://github.com/alexluigit/dirvish/blob/main/docs/EXTENSIONS.org#prerequisites), yes, only Emacs.
mellowmoonling · 2022-08-13 14:56
How does the preview work there with the details on the right? What config settings are you using? I have this and can not seem to get the preview and details like that to show up: ``` (use-package dirvish ;; :disabled :custom (dirvish-attributes '(all-the-icons file-size collapse subtree-state vc-state git-msg)) :init (dirvish-override-dired-mode) :config (dirvish-peek-mode) ;; Dired options are respected except a few exceptions, see *In relation to Dired* section above (setq dired-dwim-target t) (setq delete-by-moving-to-trash t) ;; Enable mouse drag-and-drop files to other applications (setq dired-mouse-drag-files t) ; added in Emacs 29 (setq mouse-drag-and-drop-region-cross-program t) ; added in Emacs 29 ;; Make sure to use the long name of flags when exists ;; eg. use "--almost-all" instead of "-A" ;; Otherwise some commands won't work properly (setq dired-listing-switches "-l --almost-all --human-readable --time-style=long-iso --group-directories-first --no-group") ) ```
alexluigit · 2022-08-14 09:15
https://www.reddit.com/r/emacs/comments/w16hmk/comment/igmpy6d/?utm\_source=share&utm\_medium=web2x&context=3
mellowmoonling · 2022-08-14 12:56
Ah so it's a call to `dirvish-media-properites`. I get this back trace when I call that on a jpeg: ``` Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) dirvish-media-properties() funcall-interactively(dirvish-media-properties) call-interactively(dirvish-media-properties record nil) command-execute(dirvish-media-properties record) counsel-M-x-action("dirvish-media-properties") ivy-call() ``` Do you have the config that you use posted anywhere?
alexluigit · 2022-08-14 14:25
Can you see the image in the preview window? Do you have \`imagemagick\` installed? My personal config can be found [here](https://github.com/alexluigit/emacs-grandview#a-polished-dired-with-batteries-included-dirvishel), the problem you encountered is more like a dependency issue though.
unlimited_void_bkk · 2022-08-15 12:44
What is meant by batteries here?
mellowmoonling · 2022-08-15 15:12
Thanks. Yeah I do have `imagemagick` installed and the images do show up when I'm in the `C-x C-f` auto complete mini-buffer from `ivy`.
alexluigit · 2022-08-15 17:25
I'm not sure if it's a ivy issue. Mind open a issue? Or paste your minimal config to reproduce this issue here would be helpful.
alexluigit · 2022-08-15 17:30
Basically means it includes everything that relates to file management. I borrowed this term from python. See https://en.wikipedia.org/wiki/Python\_(programming\_language)#cite\_note-About-33