|Description||Interactive Do MiniBuffer Enhancement|
|Author||Kim F. Storm|
|Part of Emacs||yes|
Ido - Interactively do things is a very convenient way to find files and switch buffers.
(ido-mode) (ido-everywhere 1)
- Move to next ido suggestion.
- Move to previous ido suggestion.
- Temporarily revert to the default find-file behavior. Handy if ido won't behave as you'd like.
- Accept the provided text as is, instead of selecting the currently proposed completion.
Enable Fuzzy Matching
(setq ido-enable-flex-matching t)
(setq ido-case-fold t)
If Recentf is enabled, you can use [C-x b] (or M-x ido-switch-buffer) to visit recently closed files by enabling virtual buffers:
(setq ido-use-virtual-buffers t)
Ido's default behavior when there is no matching file in the current directory is to look in recent working directories. If you prefer to limit [C-x C-f] (or M-x ido-find-file) to the current directory you can disable this auto-merge behavior:
(setq ido-auto-merge-work-directories-length -1) ;; disable auto-merge
You can still look in other working directories explicitly with.
Directory Caching on Windows
On Windows operating systems it can be unreliable to cache directory listings: the directory may not appear to be modified even though files have been added or removed. Ido caches directory listings by default, which may cause confusion on Windows. You can disable caching:
(when (equal system-type 'windows-nt) (setq ido-max-dir-file-cache 0)) ; caching unreliable
If you'd like to tweak the default file sorting, like making Org-files appear first, tell ido which files to give a higher sort priority:
(setq ido-file-extensions-order '(".org" ".txt" ".py" ".emacs" ".xml" ".el" ".ini" ".cfg" ".conf"))
Sort by mtime instead of alphabetically
If you prefer to sort ido filelist by mtime instead of alphabetically use the package ido-sort-mtime (available in MELPA), which is more reliable than the script below. Which breaks on TRAMP files or if you enter //, etc:
(add-hook 'ido-make-file-list-hook 'ido-sort-mtime) (add-hook 'ido-make-dir-list-hook 'ido-sort-mtime) (defun ido-sort-mtime () (setq ido-temp-list (sort ido-temp-list (lambda (a b) (time-less-p (sixth (file-attributes (concat ido-current-directory b))) (sixth (file-attributes (concat ido-current-directory a))))))) (ido-to-end ;; move . files to end (again) (delq nil (mapcar (lambda (x) (and (char-equal (string-to-char x) ?.) x)) ido-temp-list))))
Smex, a M-x enhancement