Emacs Recently Opened Files

Deja Vu

Emacs has a nice add-on to show recently opened files. It's simple to set up and simple to use.

Add the following code to your Emacs init file (.emacs) which should reside in your home directory. ~/.emacs. Use ls -la to find it, or in Emacs use Ctrl-x Ctrl-f ~/.emacs.

; Recently Opened Files - use recentf
(require 'recentf)
; Enable recentf mode
(recentf-mode t)
; Show last 10 files
(setq recentf-max-menu-items 10)
; Reset C-x C-r to display recently opened files
(global-set-key "\C-x\ \C-r" 'recentf-open-files)

As you probably know, in Emacs init file, any line starting with a semi-colon (;) is a comment and ignored by Emacs.

Save the init file and restart Emacs.

Hit Ctrl-x Ctrl-r to get a list of recently opened files.

Scroll to the file you want open and hit enter.

 Done.