4

Emacs 26.1, Windows 10, dired+

Suppose I has folder with 2 subfolders. In every folders has files. Is it possible , to show all files in one buffers. Smt like this:

enter image description here

P.S. If I use "i" (dired-maybe-insert-subdir) in dired mode

enter image description here

it's not good, because I need to press 4 times to open all folders.
But I want with ONE press to show all folders/files and all its subfolders and files.

2 Answers 2

4

If you use dired-aux, which is built-in in Emacs and you can easily require in your init file, you can then press i on a directory in a Dired buffer and have its contents displayed in the current buffer.

i is dired-maybe-insert-subdir. As per the documentation (C-h k i):

Insert this subdirectory into the same dired buffer.

If it is already present, just move to it (type M-x dired-do-redisplay to refresh), else inserts it at its natural place (as ls -lR would have done). With a prefix arg, you may edit the ls switches used for this listing. You can add R to the switches to expand the whole tree starting at this subdirectory. This function takes some pains to conform to ls -lR output.

If you do C-u i in the parent directory, you will see all the sub-directories in the buffer. In your example, move up one directory, press C-u i on TEMP and add the -R switch.

4
  • Not good. I updated my post May 14, 2019 at 9:13
  • 3
    As per the quoted documentation, if you do C-u i in the parent directory, you will see all the sub-directories in the buffer. In your example, move up one directory, press C-u i on TEMP and add the -R switch. May 14, 2019 at 9:37
  • @ManuelUberti: Now that OP has updated the question to say that i is not sufficient, please integrate your last comment into your answer, as I think it answers the question. Thx.
    – Drew
    May 14, 2019 at 13:45
  • Oh sure, you're right. Done. May 14, 2019 at 17:41
0

Subdirectories in Dired

The simplest way to include multiple directories in one Dired buffer is to specify the options -lR for running ls. (If you give a numeric argument when you run Dired, then you can specify these options in the minibuffer.) That produces a recursive directory listing showing all subdirectories at all levels.

Dired and find

To search for files with names matching a wildcard pattern use M-x find-name-dired. It reads arguments directory and pattern, and chooses all the files in directory or its subdirectories whose individual names match pattern.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.