Emacs: Open Recently Opened File

By Xah Lee. Date: . Last updated: .

This page shows you how to open recently opened files.

Alt+x recentf-mode to turn it on. Then, Alt+x recentf-open-files to list recently opened file.

To open the file, just press a digit key. Or, move cursor to the line and press Enter.

emacs recentf 2014-06-12
emacs Alt+x recentf-open-files

Turn on Recentf for Future Sessions

To turn it on for future sessions, put this in your emacs init:

(recentf-mode 1) ; keep a list of recently opened files

Assign a Key Shortcut

It's good to give it a easy key to call recentf-open-files. For example:

;; set F7 to list recently opened file
(global-set-key (kbd "<f7>") 'recentf-open-files)

For more key choices, see Emacs: How to Define Keys.

Open File topics

  1. Emacs: File Manager, dired
  2. Emacs: Bookmark Tutorial
  3. Emacs: Open Recently Opened File
  4. Emacs: Open File Fast
  5. Emacs: Open Last Closed File
  6. Emacs: Open File Path Under Cursor

Buffer topics

  1. Emacs: List Buffers
  2. Emacs: Switch Buffer
  3. Emacs: New Empty Buffer
  4. Emacs: Next/Previous User Buffer
Patreon me $5 patreon

Or Buy Xah Emacs Tutorial

Or buy a nice keyboard: Best Keyboard for Emacs

If you have a question, put $5 at patreon and message me.