2

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.

Drew
  • 75,699
  • 9
  • 109
  • 225
CD86
  • 543
  • 2
  • 9

1 Answers1

1

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

(defun recentf-ido-find-file ()
  "Find a recent file using ido."
  (interactive)
  (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"
  (interactive)
  (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

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