{"id":17760568,"url":"https://github.com/fuco1/dired-hacks","last_synced_at":"2026-01-27T17:36:40.848Z","repository":{"id":14131942,"uuid":"16837335","full_name":"Fuco1/dired-hacks","owner":"Fuco1","description":"Collection of useful dired additions","archived":false,"fork":false,"pushed_at":"2024-03-30T18:31:22.000Z","size":576,"stargazers_count":827,"open_issues_count":53,"forks_count":73,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-05-01T22:56:52.666Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fuco1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["Fuco1"],"patreon":"matusgoljer","custom":"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=A5PMGVKCQBT88"}},"created_at":"2014-02-14T13:01:29.000Z","updated_at":"2024-05-30T01:29:49.506Z","dependencies_parsed_at":"2023-02-19T13:15:54.030Z","dependency_job_id":"d6f4ce64-a8b7-478d-940b-eecbfe393efa","html_url":"https://github.com/Fuco1/dired-hacks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuco1%2Fdired-hacks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuco1%2Fdired-hacks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuco1%2Fdired-hacks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuco1%2Fdired-hacks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fuco1","download_url":"https://codeload.github.com/Fuco1/dired-hacks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246644095,"owners_count":20810687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-26T19:05:43.848Z","updated_at":"2026-01-27T17:36:40.789Z","avatar_url":"https://github.com/Fuco1.png","language":"Emacs Lisp","readme":"* [dired-hacks](#dired-hacks--)\n* [Contribute!](#contribute)\n* [Packages](#packages)\n   * [dired-hacks-utils](#dired-hacks-utils)\n   * [dired-filter](#dired-filter)\n      * [Stack operations](#stack-operations)\n      * [Built-in filters](#built-in-filters)\n      * [Saved filters](#saved-filters)\n      * [Filter groups](#filter-groups)\n      * [Other features](#other-features)\n   * [dired-avfs](#dired-avfs)\n   * [dired-open](#dired-open)\n   * [dired-rainbow](#dired-rainbow)\n   * [dired-subtree](#dired-subtree)\n      * [Interactive functions](#interactive-functions)\n   * [dired-ranger](#dired-ranger)\n      * [Multi-stage copy/pasting of files](#multi-stage-copypasting-of-files)\n      * [Bookmarks](#bookmarks)\n   * [dired-narrow](#dired-narrow)\n   * [dired-list](#dired-list)\n   * [dired-collapse](#dired-collapse)\n\n# dired-hacks [![Build Status](https://travis-ci.org/Fuco1/dired-hacks.svg?branch=master)](https://travis-ci.org/Fuco1/dired-hacks) [![Paypal logo](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=A5PMGVKCQBT88) [![Patreon](https://c5.patreon.com/external/logo/logomarkOrange.svg)](https://www.patreon.com/user?u=3282358\u0026ty=h)\n\nCollection of useful dired additions.  I don't want this to become\nanother `dired+`, so I'm splitting all the functionality into separate\nmutually independent packages.  All shared functionality and helpers\nwill be extracted into a single package `dired-hacks-utils`, so that\nwill be the only dependence.\n\nIn addition, all the packages require [dash.el](https://github.com/magnars/dash.el)\n\nPlease note that only the packages that are listed in this readme are\n\"finished\" (means in package repositories, with usable UI etc.).  All\nthe other files are work-in-progress packages you could probably use,\nbut it would be a bit more painful.\n\n# Contribute!\n\nIf you want to support this project, you can do it in the following ways:\n\n* Contribute code. Since this collection comes from my own config, it\n  mostly contains stuff I use or find useful.  If you have an idea\n  that is not yet implemented and will benefit this project, feel free\n  to implement it and submit a pull request. If you have any concerns\n  whether your contribution will be accepted, ask beforehand. You can\n  email the author or\n  [start an issue](https://github.com/Fuco1/dired-hacks/issues/new) on\n  the tracker.\n* Contribute ideas. Even if you can't code Emacs Lisp, you can still\n  contribute valuable ideas for other programmers to implement. Simply\n  [start new issue](https://github.com/Fuco1/dired-hacks/issues/new)\n  on the tracker and submit your suggestion.\n* You can make a financial donation through\n  [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=A5PMGVKCQBT88)\n  or [Patreon](https://www.patreon.com/user?u=3282358\u0026ty=h).  If you like dired-hacks and can spare a modest\n  amount on a donation, feel free to do so.  These donations are\n  expressions of your gratitude and are used for my personal \"rewards\"\n  (books, games, music etc.).  You can also gift me a game on\n  [Steam](http://steamcommunity.com/profiles/76561198265034071/wishlist)\n  or buy something on\n  [Amazon](http://www.amazon.com/gp/registry/wishlist/2I8DOQH8OZEUR).\n  Regardless of the donations, dired-hacks will always be free both as\n  in beer and as in speech.\n\n# Packages\n\n## dired-hacks-utils\n\nSet of utility functions used in all the `dired-hacks` packages.\n\nThis package also provides these interactive functions:\n\n* `dired-hacks-next-file` - go to next file, skipping empty and non-file lines\n* `dired-hacks-previous-file` - go to previous file, skipping empty\n  and non-file lines\n* `dired-utils-format-information-line-mode` - Format the information\n  (summary) line file sizes to be human readable (e.g. 1GB instead of\n  1048576).\n\n## dired-filter\n\nThe filtering system is designed after ibuffer: every dired\nbuffer has associated \"filter stack\" where user can push\nfilters (predicates).  These filters are by default\nlogically \"anded\", meaning, only the files satsifying all the\npredicates are shown.\n\nSome filters take additional input from the user such as part of\nname, regexp or extension, other filters only use a predefined\npredicate such as \"show only directories\" or \"omit dot files\".\n\nIn addition, there are two \"metafilters\", the `or` filter and the\n`not` filter.  These take other filters as arguments and change\ntheir logical interpretation.  The `or` filter takes the two\nfilters on top of the stack, pops them and pushes a filter that\nmatches files satisfying one or the other (or both) filters.  The\n`not` filter pops the top filter and pushes its logical negation.\n\nTo enable or disable the filters, toggle minor mode\n`dired-filter-mode`.  Toggling this mode preserves the filter\nstack, so you can use it to quickly hide/unhide files filtered by\nthe current filter setup.\n\nAll the provided interactive functions are available from\n`dired-filter-map`.  You can customize `dired-filter-prefix` to set a\nprefix for this map or bind it manually to a prefix of your choice\nusing:\n\n    (define-key dired-mode-map (kbd \"some-key\") dired-filter-map)\n\nThe bindings follow a convention where the filters are mapped on\nlower-case letters or punctuation, operators are mapped on symbols\n(such as !, |, * etc.)  and group commands are mapped on upper-case\nletters.  The exception to this is `p` which is bound to\n`dired-filter-pop`, which is a very common operation and warrants a\nquick binding.\n\nIn addition to filtering, you can also use the same predicates to\nonly mark files without removing the rest.  All the filtering\nfunctions of the form `dired-filter-by-*` have their marking\ncounterpart `dired-filter-mark-by-*`.  These are available from\n`dired-filter-mark-map`.  You can customize\n`dired-filter-mark-prefix` a prefix for this map or bind it\nmanually to a prefix of your choice using:\n\n    (define-key dired-mode-map (kbd \"some-key\") dired-filter-mark-map)\n\nThe marking operations are not placed on stack, instead, the marks are\nimmediately updated by \"OR\"-ing them together.  To remove marks that\nwould otherwise be selected by a filter, use prefix argument (usually\nbound to `C-u`).  To logically negate the meaning of the filter, you\ncan call the function with a double prefix argument (usually `C-u`\n`C-u`)\n\nYou can use saved filters to mark files by calling\n`dired-filter-mark-by-saved-filters`.\n\n### Stack operations\n\nTo remove the filter from the stack, use `dired-filter-pop` or\n`dired-filter-pop-all`\n\nTo break a metafilter apart, you can use `dired-filter-decompose`\nto decompose the parts of the metafilter and push them back to\nthe stack.\n\nYou can transpose the filters on the top of the stack using\n`dired-filter-transpose`\n\n### Built-in filters\n\nHere's a list of built-in filters:\n\n* `dired-filter-by-name`\n* `dired-filter-by-regexp`\n* `dired-filter-by-extension`\n* `dired-filter-by-dot-files`\n* `dired-filter-by-omit`\n* `dired-filter-by-garbage`\n* `dired-filter-by-predicate`\n* `dired-filter-by-file`\n* `dired-filter-by-directory`\n* `dired-filter-by-mode`\n* `dired-filter-by-symlink`\n* `dired-filter-by-executable`\n\nYou can see their documentation by calling M-x `describe-function`.\n\nSpecifically, `dired-filter-by-omit` removes the files that would\nbe removed by `dired-omit-mode`, so you should not need to use\nboth---in fact it is discouraged, as it would make the read-in\nslower.\n\nWhen called with negative prefix argument, some filters can read\nmultiple values.  The resulting predicate is often much faster than\nhaving the filter repeated with single argument.  Read the\ndocumentation to learn more about the calling conventions.\nCurrently, these filters support reading multiple arguments:\n\n* `dired-filter-by-extension`\n\nTo define your own filters, you can use the macro\n`dired-filter-define`.  If you define some interesting filter,\nplease consider contributing it to the upstream.\n\n### Saved filters\n\nIn addition to the built-in filters and your own custom filters,\nthis package provides an option to save complex compound filters\nfor later use.  When you set up a filter stack you would like to\nsave, call `dired-filter-save-filters`.  You will be prompted for a\nname under which this stack will be saved.\n\nThe saved filter will be added to `dired-filter-saved-filters`\nvariable, which you can also customize via the customize interface\nor manually add entries with `push` or `add-to-list`.  If you use\ncustomize, calling `dired-filter-save-filters` will automatically\nsave the new value into your customize file.\n\nYou can delete saved filters with `dired-filter-delete-saved-filters`.\n\nTo use a saved filter, you can use either\n`dired-filter-add-saved-filters` or\n`dired-filter-load-saved-filters`.  The first pushes the saved\nfilter on top of the currently active stack, the second clears\ncurrent filter stack before loading the saved filter configuration.\n\nAn example use is to create filters for \"logical groups\" of files,\nsuch as media files, image files or files used when programming in\ncertain environment (for example, show files with .h and .c\nextensions).  Saved filters save you the time of setting up the\nfilters each time you want this specific view.\n\nAs a concrete example of above, author uses a saved filter \"media\"\nwith value:\n\n    (extension \"ogg\" \"flv\" \"mpg\" \"avi\" \"mp4\" \"mp3\")\n    ;; show all files matching any of these extensions\n\n### Filter groups\n\nFurthermore, instead of only filtering the dired buffer by\nremoving lines you are not interested in, you can also group\nlines together by filters.  That is, lines (files,\ndirectories...) satisfying a filter will be moved together under\na common drawer.  This mechanism works in analogy with ibuffer\nfilter groups.\n\nThe variable `dired-filter-group-saved-groups` contains\ndefinitions of filter groups.  You can create and save multiple\nfilter groups (views) and switch between them by setting the\n`dired-filter-group` variable.\n\nTo enable or disable the filter groups toggle minor mode\n`dired-filter-group-mode`.  Toggling this mode preserves the active\nfilter group so you can use it to quickly group and ungroup the\nfiles.\n\nHere is a screenshot with an active filter group.  Notice that regular\nfiltering works also with filter groups.\n\n![Filter group](http://i.imgur.com/qtiDX1c.png)\n\nPlacing the point on the drawer header and hitting `RET` folds it.\nHitting `RET` again expands it.\n\n![Folding](http://i.imgur.com/TDUsEKq.png)\n\nThe `dired-filter-group-saved-groups` used in the above screenshot is the following:\n\n```elisp\n((\"default\"\n  (\"PDF\"\n   (extension . \"pdf\"))\n  (\"LaTeX\"\n   (extension \"tex\" \"bib\"))\n  (\"Org\"\n   (extension . \"org\"))\n  (\"Archives\"\n   (extension \"zip\" \"rar\" \"gz\" \"bz2\" \"tar\"))))\n```\n\nYou can of course be more imaginative and use filtering based on other\ncriteria than just extensions ;)\n\n### Other features\n\nYou can clone the currently visible dired buffer by calling\n`dired-filter-clone-filtered-buffer`.\n\n## dired-avfs\n\nAdds [avfs](http://avf.sourceforge.net/) support for seamless archive\nbrowsing.  This extension therefore depends on the presence of `avfsd`\non your system.  In debian-derived distributions you can usually do\n\n    apt-get install avfs\n\n`avfs` is probably also available for Mac OS.  You're out of luck on\nWindows, sorry.\n\nOnce the daemon is installed, run it with `mountavfs` and everything\n\"Should Just Work™\".\n\n## dired-open\n\nWhile emacs already has the `auto-mode-alist`, this is often\ninsufficient.  Many times, you want to open media files, pdfs or\nother documents with an external application.  There's remedy for\nthat too, namely `dired-guess-shell-alist-user`, but that is still\nnot as convenient as just hitting enter.\n\nThis package adds a mechanism to add \"hooks\" to `dired-find-file` that\nwill run before emacs tries its own mechanisms to open the file, thus\nenabling you to launch other application or code and suspend the\ndefault behaviour.\n\nBy default, two additional methods are enabled,\n`dired-open-by-extension` and `dired-open-subdir`.\n\nThis package also provides other convenient hooks:\n\n* `dired-open-xdg` - try to open the file using `xdg-open`\n* `dired-open-guess-shell-alist` - try to open the file by\n  launching applications from `dired-guess-shell-alist-user`\n* `dired-open-call-function-by-extension` - call an elisp function\n  based on extension.\n\nThese are not used by default.\n\nYou can customize the list of functions to try by customizing\n`dired-open-functions`.\n\nTo fall back to the default `dired-find-file`, you can provide the\nprefix argument (usually `C-u`) to the `dired-open-file` function.\nThis is useful for example when you configure html files to be\nopened in browser and you want to edit the file instead of view it.\n\nNote also that this package can handle calls when point is not on a\nline representing a file---an example hook is provided to open a\nsubdirectory under point if point is on the subdir line, see\n`dired-open-subdir`.\n\nIf you write your own handler, make sure they do *not* throw errors\nbut instead return nil if they can't proceed.  Please, don't forget to\nsubmit interesting handlers!\n\n## dired-rainbow\n\nThis package adds more customizable highlighting for files in dired\nlistings.  The group `dired-faces` provides only nine faces and\nisn't very fine-grained.\n\nThe definitions are added by several macros, currently available\nare:\n\n* `dired-rainbow-define` - add face by file extension\n* `dired-rainbow-define-chmod` - add face by file permissions\n\nYou can display their documentation by calling (substituting the\ndesired macro name):\n\n    M-x describe-function RET dired-rainbow-define RET\n\nHere are some example uses:\n\n```scheme\n(defconst my-dired-media-files-extensions\n  '(\"mp3\" \"mp4\" \"MP3\" \"MP4\" \"avi\" \"mpg\" \"flv\" \"ogg\")\n  \"Media files.\")\n\n(dired-rainbow-define html \"#4e9a06\" (\"htm\" \"html\" \"xhtml\"))\n(dired-rainbow-define media \"#ce5c00\" my-dired-media-files-extensions)\n\n; boring regexp due to lack of imagination\n(dired-rainbow-define log (:inherit default\n                           :italic t) \".*\\\\.log\")\n\n; highlight executable files, but not directories\n(dired-rainbow-define-chmod executable-unix \"Green\" \"-[rw-]+x.*\")\n```\n\nPutting it all together, the following is a basic setup (essentially a\npseudo-port of [LS_COLORS](https://github.com/trapd00r/LS_COLORS)\nobtained by inspecting a terminal and approximating colors with\n[Tailwind CSS](https://tailwindcss.com/docs/colors/)).\n\n```scheme\n(use-package dired-rainbow\n  :config\n  (progn\n    (dired-rainbow-define-chmod directory \"#6cb2eb\" \"d.*\")\n    (dired-rainbow-define html \"#eb5286\" (\"css\" \"less\" \"sass\" \"scss\" \"htm\" \"html\" \"jhtm\" \"mht\" \"eml\" \"mustache\" \"xhtml\"))\n    (dired-rainbow-define xml \"#f2d024\" (\"xml\" \"xsd\" \"xsl\" \"xslt\" \"wsdl\" \"bib\" \"json\" \"msg\" \"pgn\" \"rss\" \"yaml\" \"yml\" \"rdata\"))\n    (dired-rainbow-define document \"#9561e2\" (\"docm\" \"doc\" \"docx\" \"odb\" \"odt\" \"pdb\" \"pdf\" \"ps\" \"rtf\" \"djvu\" \"epub\" \"odp\" \"ppt\" \"pptx\"))\n    (dired-rainbow-define markdown \"#ffed4a\" (\"org\" \"etx\" \"info\" \"markdown\" \"md\" \"mkd\" \"nfo\" \"pod\" \"rst\" \"tex\" \"textfile\" \"txt\"))\n    (dired-rainbow-define database \"#6574cd\" (\"xlsx\" \"xls\" \"csv\" \"accdb\" \"db\" \"mdb\" \"sqlite\" \"nc\"))\n    (dired-rainbow-define media \"#de751f\" (\"mp3\" \"mp4\" \"MP3\" \"MP4\" \"avi\" \"mpeg\" \"mpg\" \"flv\" \"ogg\" \"mov\" \"mid\" \"midi\" \"wav\" \"aiff\" \"flac\"))\n    (dired-rainbow-define image \"#f66d9b\" (\"tiff\" \"tif\" \"cdr\" \"gif\" \"ico\" \"jpeg\" \"jpg\" \"png\" \"psd\" \"eps\" \"svg\"))\n    (dired-rainbow-define log \"#c17d11\" (\"log\"))\n    (dired-rainbow-define shell \"#f6993f\" (\"awk\" \"bash\" \"bat\" \"sed\" \"sh\" \"zsh\" \"vim\"))\n    (dired-rainbow-define interpreted \"#38c172\" (\"py\" \"ipynb\" \"rb\" \"pl\" \"t\" \"msql\" \"mysql\" \"pgsql\" \"sql\" \"r\" \"clj\" \"cljs\" \"scala\" \"js\"))\n    (dired-rainbow-define compiled \"#4dc0b5\" (\"asm\" \"cl\" \"lisp\" \"el\" \"c\" \"h\" \"c++\" \"h++\" \"hpp\" \"hxx\" \"m\" \"cc\" \"cs\" \"cp\" \"cpp\" \"go\" \"f\" \"for\" \"ftn\" \"f90\" \"f95\" \"f03\" \"f08\" \"s\" \"rs\" \"hi\" \"hs\" \"pyc\" \".java\"))\n    (dired-rainbow-define executable \"#8cc4ff\" (\"exe\" \"msi\"))\n    (dired-rainbow-define compressed \"#51d88a\" (\"7z\" \"zip\" \"bz2\" \"tgz\" \"txz\" \"gz\" \"xz\" \"z\" \"Z\" \"jar\" \"war\" \"ear\" \"rar\" \"sar\" \"xpi\" \"apk\" \"xz\" \"tar\"))\n    (dired-rainbow-define packaged \"#faad63\" (\"deb\" \"rpm\" \"apk\" \"jad\" \"jar\" \"cab\" \"pak\" \"pk3\" \"vdf\" \"vpk\" \"bsp\"))\n    (dired-rainbow-define encrypted \"#ffed4a\" (\"gpg\" \"pgp\" \"asc\" \"bfe\" \"enc\" \"signature\" \"sig\" \"p12\" \"pem\"))\n    (dired-rainbow-define fonts \"#6cb2eb\" (\"afm\" \"fon\" \"fnt\" \"pfb\" \"pfm\" \"ttf\" \"otf\"))\n    (dired-rainbow-define partition \"#e3342f\" (\"dmg\" \"iso\" \"bin\" \"nrg\" \"qcow\" \"toast\" \"vcd\" \"vmdk\" \"bak\"))\n    (dired-rainbow-define vc \"#0074d9\" (\"git\" \"gitignore\" \"gitattributes\" \"gitmodules\"))\n    (dired-rainbow-define-chmod executable-unix \"#38c172\" \"-.*x.*\")\n    ))\n```\n\n*Note*: the [256 color cheat\nsheet](https://jonasjacek.github.io/colors/) includes conversion from\nthe Xterm colors used by LS_COLORS to the HEX codes used by\n`dired-rainbow`. Using that conversion an enterprising individual with a grasp of `sed`/`awk` could put together a\n*real* port of [LS_COLORS](https://github.com/trapd00r/LS_COLORS) to `dired-rainbow`.\n\n### Related packages\n\nThere is a related package called [diredfl](https://github.com/purcell/diredfl/) which extracts the extra fontification rules from Dired+ and packages them in a modern Emacsy way.  They enhance things like the date face, permissions face and similar.  Check it out!\n\n## dired-subtree\n\nThe basic command to work with subdirectories in dired is `i`,\nwhich inserts the subdirectory as a separate listing in the active\ndired buffer.\n\nThis package defines function `dired-subtree-insert` which instead\ninserts the subdirectory directly below its line in the original\nlisting, and indent the listing of subdirectory to resemble a\ntree-like structure (somewhat similar to `tree(1)` except the pretty\ngraphics).  The tree display is somewhat more intuitive than the\ndefault \"flat\" subdirectory manipulation provided by `i`.\n\nThere are several presentation options and faces you can customize\nto change the way subtrees are displayed.\n\nYou can further remove the unwanted lines from the subtree by using\n`k` command or some of the built-in \"focusing\" functions, such as\n`dired-subtree-only-*` (see list below).\n\nIf you have the package `dired-filter`, you can additionally filter\nthe subtrees with global or local filters.\n\nA demo of basic functionality is available on youtube:\nhttps://www.youtube.com/watch?v=z26b8HKFsNE\n\n### Interactive functions\n\nHere's a list of available interactive functions.  You can read\nmore about each one by using the built-in documentation facilities\nof emacs.  It is adviced to place bindings for these into a\nconvenient prefix key map, for example `C-,`\n\n* `dired-subtree-insert`\n* `dired-subtree-remove`\n* `dired-subtree-toggle`\n* `dired-subtree-cycle`\n* `dired-subtree-revert`\n* `dired-subtree-narrow`\n* `dired-subtree-up`\n* `dired-subtree-down`\n* `dired-subtree-next-sibling`\n* `dired-subtree-previous-sibling`\n* `dired-subtree-beginning`\n* `dired-subtree-end`\n* `dired-subtree-mark-subtree`\n* `dired-subtree-unmark-subtree`\n* `dired-subtree-only-this-file`\n* `dired-subtree-only-this-directory`\n\nIf you have package `dired-filter`, additional command\n`dired-subtree-apply-filter` is available.\n\n## dired-ranger\n\nThis package implements useful features present in the\n[ranger](http://ranger.github.io/) file manager which are missing\nin dired.\n\n### Multi-stage copy/pasting of files\n\nA feature present in most orthodox file managers is a \"two-stage\"\ncopy/paste process.  Roughly, the user first selects some files,\n\"copies\" them into a clipboard and then pastes them to the target\nlocation.  This workflow is missing in dired.\n\nIn dired, user first marks the files, then issues the\n`dired-do-copy` command which prompts for the destination.  The\nfiles are then copied there.  The `dired-dwim-target` option makes\nthis a bit friendlier---if two dired windows are opened, the other\none is automatically the default target.\n\nWith the multi-stage operations, you can gather files from\n*multiple* dired buffers into a single \"clipboard\", then copy or\nmove all of them to the target location.  Another huge advantage is\nthat if the target dired buffer is already opened, switching to it\nvia ido or ibuffer is often faster than selecting the path.\n\nCall `dired-ranger-copy` to add marked files (or the file under\npoint if no files are marked) to the \"clipboard\".  With non-nil\nprefix argument, add the marked files to the current clipboard.\n\nPast clipboards are stored in `dired-ranger-copy-ring` so you can\nrepeat the past pastes.\n\nCall `dired-ranger-paste` or `dired-ranger-move` to copy or move\nthe files in the current clipboard to the current dired buffer.\nWith raw prefix argument (usually C-u), the clipboard is not\ncleared, so you can repeat the copy operation in another dired\nbuffer.\n\n### Bookmarks\n\nUse `dired-ranger-bookmark` to bookmark current dired buffer.  You\ncan later quickly revisit it by calling\n`dired-ranger-bookmark-visit`.\n\nA bookmark name is any single character, letter, digit or a symbol.\n\nA special bookmark with name `dired-ranger-bookmark-LRU` represents\nthe least recently used dired buffer.  Its default value is \\`.  If\nyou bind `dired-ranger-bookmark-visit` to the same keybinding,\nhitting \\`\\` will instantly bring you to the previously used dired\nbuffer.  This can be used to toggle between two dired buffers in a\nvery fast way.\n\nThese bookmarks are not persistent.  If you want persistent\nbookmarks use the bookmarks provided by emacs, see (info \"(emacs)\nBookmarks\").\n\n## dired-narrow\n\nThis package provides live filtering of files in dired buffers.  In\ngeneral, after calling the respective narrowing function you type a\nfilter string into the minibuffer.  After each change the changes\nautomatically reflect in the buffer.  Typing C-g will cancel the\nnarrowing and restore the original view, typing RET will exit the live\nfiltering mode and leave the dired buffer in the narrowed state.  To\nbring it back to the original view, you can call `revert-buffer`\n(usually bound to \u003ckbd\u003eg\u003c/kbd\u003e).\n\nDuring the filtering process, several special functions are available.\nYou can customize the binding by changing `dired-narrow-map`.\n\n* `dired-narrow-next-file` (\u003ckbd\u003e\\\u003cdown\\\u003e\u003c/kbd\u003e or \u003ckbd\u003eC-n\u003c/kbd\u003e) - move the point to the next file\n* `dired-narrow-previous-file` (\u003ckbd\u003e\\\u003cup\\\u003e\u003c/kbd\u003e or \u003ckbd\u003eC-p\u003c/kbd\u003e) - move the point to the previous\nfile\n* `dired-narrow-enter-directory` (\u003ckbd\u003e\\\u003cright\\\u003e\u003c/kbd\u003e or \u003ckbd\u003eC-j\u003c/kbd\u003e) - descend into\nthe directory under point and immediately go back to narrowing mode\n\nYou can customize what happens after exiting the live filtering mode\nby customizing `dired-narrow-exit-action`.\n`dired-narrow-exit-action` may be executed automatically,\nwhen there is only one file left while narrowing.\nIn order to enable this feature, add `(setq dired-narrow-exit-when-1-left t)` to your config.\nIt makes sense when you use find-file as your exit action, e.g.\n`(setq dired-narrow-exit-action 'dired-narrow-find-file)`.\nA chosen file will be quickly highlighted before executing `dired-narrow-exit-action`.\nThis behavior is controlled by variables `dired-narrow-enable-blinking`,\n`dired-narrow-blink-time` and by a face `dired-narrow-blink`.\n\n\nThese narrowing functions are provided:\n\n* `dired-narrow`\n* `dired-narrow-regexp`\n* `dired-narrow-fuzzy`\n\nYou can also create your own narrowing functions quite easily.  To\ndefine new narrowing function, use `dired-narrow--internal` and\npass it an apropriate filter.  The filter should take one argument\nwhich is the filter string from the minibuffer.  It is then called\nat each line that describes a file with point at the beginning of\nthe file name.  If the filter returns nil, the file is removed from\nthe view.  As an inspiration, look at the built-in functions\nmentioned above.\n\n## dired-list\n\nProduce a file listing with a shell incantation and make a dired\nout of it!\n\nThis package provides one principal function, `dired-list` which\ncan be used to produce dired buffers from shell programs outputing\ntext roughly in the format of `la -ls`.\n\nFor most standard output formats the default filter and sentinel\nshould work, but you can also provide your own if the situation\nrequires it.\n\nMost of the time you can pipe a zero-delimited list of files to `ls`\nthrough `xargs(1)` using\n\n    | xargs -I '{}' -0 ls -l '{}'\n\nwhich creates a compatible listing.  For more information read the\ndocumentation of `dired-list`, for example by invoking\n\n    C-h f dired-list RET\n\nin emacs.\n\nIn addition to the generic interface this package implements common\nlistings (patches and extensions welcome!), these are:\n\n* `dired-list-mpc`\n* `dired-list-git-ls-files`\n* `dired-list-hg-locate`\n* `dired-list-locate`\n* `dired-list-find-file`\n* `dired-list-find-name`\n* `dired-list-grep`\n\n## dired-collapse\n\nOften times we find ourselves in a situation where a single file\nor directory is nested in a chain of nested directories with no\nother content.  This is sometimes due to various mandatory\nlayouts demanded by packaging tools or tools generating these\ndeeply-nested \"unique\" paths to disambiguate architectures or\nversions (but we often use only one anyway).  If the user wants\nto access these directories they have to quite needlessly\ndrill-down through varying number of \"uninteresting\" directories\nto get to the content.\n\nThis minor mode is in main inspired by how GitHub renders these\npaths: if there is a chain of directories where each one only has\none child, they are concatenated together and shown on the first\nlevel in this collapsed form.  When the user clicks this\ncollapsed directory they are immediately brought to the deepest\ndirectory with some actual content.\n\nTo enable or disable this functionality use `dired-collapse-mode` to\ntoggle it for the current dired buffer.  To enable the mode globally\nin all dired buffers, use `global-dired-collapse-mode`.\n\nIf the deepest directory contains only a single file this file is\ndisplayed instead of the last directory.  This way we can get\ndirectly to the file itself.  This is often helpful with config\nfiles which are stored in their own directories, for example in\n`~/.config/foo/config` and similar situations.\n\nThe files or directories re-inserted in this manner will also\nhave updated permissions, file sizes and modification dates so\nthey truly correspond to the properties of the file being shown.\n\nThe path to the deepest file is dimmed with the\n`dired-collapse-shadow` face so that it does not distract but at the\nsame time is still available for inspection.\n\nThe mode is integrated with `dired-rainbow` so the nested files\nare properly colored according to user's rules.\n\nThe directory without collapsed path might look something like this:\n\n![before](http://i.imgur.com/Xje5Nmo.png)\n\nAfter collapsing:\n\n![after](http://i.imgur.com/mm6gFbX.png)\n","funding_links":["https://github.com/sponsors/Fuco1","https://patreon.com/matusgoljer","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=A5PMGVKCQBT88","https://www.patreon.com/user?u=3282358\u0026ty=h"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuco1%2Fdired-hacks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuco1%2Fdired-hacks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuco1%2Fdired-hacks/lists"}