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.

3 Answers 3

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.

1
  • 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 1, 2015 at 9: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!

2
  • 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, 2017 at 7:19
  • 1
    By the way, helm-mini is enough for me to answer the question. ;-)
    – nephewtom
    Mar 30, 2017 at 7: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.

1
  • Amazing, thank you. This is the correct answer, it deserves more upvotes.
    – hraban
    Dec 4, 2022 at 23:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.