Wanting to stay simple as possible I refrain from using Helm or Ivy etc. and use IDO. Ido-switch-buffer is supposed to allow me to access recently opened buffers quite efficiently with the help of recentf. which I enabled as well. My config thus reads

(recentf-mode t)
(setq recentf-max-menu-items 25)
(setq recentf-max-saved-items 25)

(ido-mode t)
(setq ido-everywhere t)   
(global-set-key (kbd "C-x C-b") 'ido-switch-buffer)

but when I invoke ido-switch-buffer, listed first are log files, scratch buffe,etc. only later followed by files I care about.

Am I forgetting something in the config? A recentf file is created and written to, so I suppose its working.

1 Answer 1


M-x recentf-ido-find-file (my favorite)

(defun recentf-ido-find-file ()
  "Find a recent file using ido."
  (let ((file (ido-completing-read "Choose recent file: " recentf-list nil t)))
    (when file
      (find-file file))))

and M-x ido-recenf-open

(defun ido-recentf-open ()
  "Use `ido-completing-read' to \\[find-file] a recent file"
  (if (find-file (ido-completing-read "Find recent file: " recentf-list))
      (message "Opening file...")
    (message "Aborting")))

I am using them from years: Helpful: Recently opened files in ido-mode

  • thanks, so that customizes the process entirely. I thought that was, what recentf and ido in conjunction where for oO
    – CD86
    Commented Oct 18, 2019 at 12:46
  • what is the difference between those two functions?
    – CD86
    Commented Nov 3, 2019 at 12:57

Your Answer

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

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