From Mickey Petersen' blog Find files faster with the recent files package:

(require 'recentf)

;; get rid of `find-file-read-only' and replace it with something
;; more useful.
(global-set-key (kbd "C-x C-r") 'ido-recentf-open)

;; enable recent files mode.
(recentf-mode t)

; 50 files ought to be enough.
(setq recentf-max-saved-items 50)

(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 can walk through the list using ido-find-file with arrow keys. Instead can I do this with the following key bindings: Ctrl-f (next), Ctrl-b (previous)?

  • I'm guessing the question has nothing to do with recentf, and is just about binding a key in an Ido keymap. And maybe ido-find-file is relevant? – Drew Jul 13 '20 at 18:58
  • Updated to make it clearer, hope it helps @Drew – alper Jul 13 '20 at 20:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.