windows 10, emacs 26.1
Suppose I open 10 files. And then restart Emacs. After restart I need to see what files (recent) I was open before. Is it possible to show some buffer that contain name of this 10 files?
install counsel
(https://oremacs.com/2015/04/09/counsel-completion/)
Run M-x counsel-recentf
Press C-c C-o
to export the file list to a buffer
Your question is a duplicate of that one. Thanks to that reference to a blog entry, I included
(require 'recentf)
(recentf-mode 1)
(setq recentf-max-menu-items 25)
(global-set-key "\C-x\ \C-r" 'recentf-open-files)
in my .emacs
file.
Customize recentf-mode
to on
and "Save and Apply". Afterwards you get an "Open recent" sub-menu in the "File" pull down menu.
You can visit and edit recentf-list
by M-x recentf-edit-list
.
In answer to your followup question in comments (it really should be a separate question, or you should edit this question to make clear that you want to use the minibuffer etc.):
If you use Icicles then:
You can get recentf
-recorded files as completion candidates during buffer-name completion (this happens by default) - see option icicle-buffer-include-recent-files-nflag
:
An integer > 0 means include recent files during buffer-name completion. This means file names managed by
recentf-mode
- see (emacs) File Conveniences. An integer < 0 means do not include them. When they are included, the value is the maximum number of such candidates to include.You can toggle this option (between + and -) using
C-x R
in the minibuffer during buffer-name completion.
You can use command icicle-recent-files
to open any recently visited file - only such files are completion candidates for this command. See Icicles - Visit Recent Files or Files for Emacs Tags.
You can use command icicle-remove-file-from-recentf-list
to remove any number of file names from the recentf-list
, with completion.
ido-mode
, you may like(setq ido-use-virtual-buffers t)
together withrecentf-mode
. This allows you to switch theido
way to a previously killed file buffer, simply re-visiting the file.