11

What's the best way to get the recently opened files in helm. Without helm I just did C-c C-f and then arrow up to get the last opened file. And with M-r I was able to to a regexp search through recently opened files. Both doesn't work with helm anymore.

I have

(setq helm-ff-file-name-history-use-recentf t)

in my .emacs file, but it doesn't seem to have any effect.

student
  • 1,007
  • 9
  • 29

3 Answers3

14

Indeed, if helm-ff-file-name-history-use-recentf set to true, helm-find-files is supposed to use recentf-list instead of file-name-history.

To enable the recenf minor mode, I have those lines in my init file:

; keep a list of recently opened files                                                                      
 (recentf-mode 1)
 (setq-default recent-save-file "~/.emacs.d/recentf")  

What about M-x helm-recentf?

helm-recentf is an interactive autoloaded Lisp function in
`helm-files.el'.

(helm-recentf)

Preconfigured helm for recentf.

You may also be interested by recent files within Emacs.

Nsukami _
  • 6,341
  • 2
  • 22
  • 35
  • 2
    So `helm-find-files` seems to be suposed to provide a history of files anyway (either via `file-name-history` or via `recentf-list`). Both doesn't seem to work for me. `helm-recentf` per se and `helm-mini` works, but that's another thing. Could you add a screenshot of how `helm-find-file` is suposed to display recently opened files (both via `file-name-history` and via `helm-recentf`)? Do I need to press any shortcuts to get it displayed? – student Aug 01 '15 at 09:36
13

Perhaps this isn't quite what you're looking for, but I really like using helm-mini, which includes a small browser for recent open files (by calling helm-recentf as Nsukami suggests you use). Here is an example, taken from this amazing post on helm:

helm-mini

Not only does it show all of your open buffers, but it's my most convenient way to view recently opened files. I'd recommend giving it a try!

GJStein
  • 593
  • 3
  • 9
  • 3
    Those posts are *farking* great, but can become too daunting for beginners to helm. They are full of plenty good tricks and advices, though they have a steep learning curve and I do not consider them appropriate for a quick hack or solution. I guess **emacs.stackexchange** is in part here to solve that. – nephewtom Mar 30 '17 at 07:19
  • 1
    By the way, `helm-mini` is enough for me to answer the question. ;-) – nephewtom Mar 30 '17 at 07:26
3

There's a helm-ff-file-name-history command that displays recently opened files. By default this one is bound to C-c h when in helm-find-files mode.

Also there is a C-h m command that displays help on currently active helm command. You can see key bindings and available commands there.