17 private links
The filtering system is designed after ibuffer: every dired
buffer has associated "filter stack" where user can push
filters (predicates). These filters are by default
logically "anded", meaning, only the files satsifying all the
predicates are shown.
Some filters take additional input from the user such as part of
name, regexp or extension, other filters only use a predefined
predicate such as "show only directories" or "omit dot files".
In addition, there are two "metafilters", the or' filter and the
not' filter. These take other filters as arguments and change
their logical interpretation. The or' filter takes the two filters on top of the stack, pops them and pushes a filter that matches files satisfying one or the other (or both) filters. The
not' filter pops the top filter and pushes its logical negation.
To enable or disable the filters toggle minor mode
`dired-filter-mode'. Toggling this mode preserves the filter
stack, so you can use it to quickly hide/unhide files filtered by
the current filter setup.
All the provided interactive functions are available from
dired-filter-map'. You can customize
dired-filter-prefix' to set
a prefix for this map or bind it manually to a prefix of your
choice using:
(define-key dired-mode-map (kbd "some-key") dired-filter-map)
The bindings follow a convention where the filters are mapped on
lower-case letters or punctuation, operators are mapped on symbols
(such as !, |, * etc.) and group commands are mapped on upper-case
letters. The exception to this is p' which is bound to
dired-filter-pop', which is a very common operation and warrants a
quick binding.
In addition to filtering, you can also use the same predicates to
only mark files without removing the rest. All the filtering
functions of the form dired-filter-by-*' have their marking counterpart
dired-filter-mark-by-*'. These are available from
dired-filter-mark-map'. You can customize
dired-filter-mark-prefix' a prefix for this map or bind it
manually to a prefix of your choice using:
(define-key dired-mode-map (kbd "some-key") dired-filter-mark-map)
The marking operations are not placed on stack, instead, the marks
are immediately updated by "OR"-ing them together. To remove marks
that would otherwise be selected by a filter, use prefix argument
(usually bound to C-u'). To logically negate the meaning of the filter, you can call the function with a double prefix argument (usually
C-u' `C-u')
You can use saved filters to mark files by calling
`dired-filter-mark-by-saved-filters'.
So while in a dired buffer
C-u s
you can now change switches used by ls. Add h do get a human readable file sizes
You can add other switches too, for example I changed it to -alsh and it now sorts by file size
Also see cutomize-mode and edit "Dired Listing Switches" to -alh