emacsdiredido

How to omit certain folders on ido-switch-buffers and ido-dired?


I would like to ignore certain folders turning up via ido-dired when changing buffers in Emacs. These folders are system folders on a Mac and should not be removed otherwise, so at least I would like to hide them (especially annoying is, for example, ~/Documents which is suggested when one wants to change to ~/Downloads and thus starts to type Do...).

To this end, I found ido-ignore-directories and I used the following line in .emacs to omit these folders:

(setq ido-ignore-directories (quote ("~/Applications" "~/Documents" "~/Library" "~/Movies" "~/Music" "~/Pictures" "~/Public")))

The problem is, that they are still suggested when I use ido-dired.

How can the folders be hidden on ido-dired?

Update

When setting ido-ignore-directories as suggested by npostavs, the folder still appear: enter image description here


Solution

  • To this end, I found ido-ignore-directories and I used the following line in .emacs to omit these folders:

    (setq ido-ignore-directories (quote ("~/Applications" "~/Documents" "~/Library" "~/Movies" "~/Music" "~/Pictures" "~/Public")))
    

    ido-ignore-directories is the correct variable, but it matches just the directory name itself, not the full path.

    (setq ido-ignore-directories
          '("Applications/" "Documents/" "Library/" "Movies/" "Music/" "Pictures/" "Public/"))