Created
July 28, 2012 21:44
-
-
Save Frozenlock/3194922 to your computer and use it in GitHub Desktop.
Open command shows a list of recent file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;---------------------------------------------------- | |
;;;==== Open command shows a list of recent file ==== | |
;---------------------------------------------------- | |
(require 'recentf) | |
;; enable recent files mode. | |
(recentf-mode t) | |
; 200 files ought to be enough. | |
(setq recentf-max-saved-items 200) | |
(defun ido-recentf-open () | |
"Use `ido-completing-read' to \\[find-file] a recent file" | |
(interactive) | |
(if (find-file (ido-completing-read "Find recent file: " | |
(remove-if | |
'(lambda (arg) (string-match ".tex\\|.txt" arg)) | |
recentf-list))) | |
(message "Opening file...") | |
(message "Aborting"))) | |
(global-set-key (kbd "C-x C-f") 'ido-recentf-open) ; I never directly open a file anyway, so bind the keys with recent documents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment