emacs: recentf for recent file ido completion
authorPeng Li <seudut@gmail.com>
Sat, 30 May 2015 18:49:04 +0000 (02:49 +0800)
committerPeng Li <seudut@gmail.com>
Sat, 30 May 2015 18:49:04 +0000 (02:49 +0800)
emacs.d/config/my-packages.el
emacs.d/init.el

index c47cb96..c4f36e2 100644 (file)
@@ -48,6 +48,7 @@
     flymake-google-cpplint
     flymake-cursor
     google-c-style
+    recentf-ext
   ) "a list of packages to ensure are installed at launch.")
 
 (require 'cl)
index c08899a..a549bfd 100644 (file)
 (require 'init-ggtags)
 
 (global-unset-key "\C-o")
+(global-set-key (kbd "C-o C-o") 'keyboard-quit);; same as C-g to quit
 (global-set-key (kbd "C-o C-f") 'ido-find-file)
+(global-set-key (kbd "C-o C-r") 'recentf-ido-find-file)
 (global-set-key (kbd "C-o C-b") 'ido-switch-buffer)
+(global-set-key (kbd "C-o C-j") 'ido-find-file)
 
-(global-set-key (kbd "C-o g") 'ggtags-find-file)
-(global-set-key (kbd "C-o t") 'ggtags-find-tag-dwim)
+
+(global-set-key (kbd "C-o C-g") 'ggtags-find-file)
+(global-set-key (kbd "C-o C-t") 'ggtags-find-tag-dwim)
 
 (global-set-key (kbd "M-g M-g") 'magit-status)
 
 
 (require 'init-c-cpp)
 
+(require 'recentf)
+(recentf-mode 1)
+(setq recentf-max-menu-items 100)
+(defun recentf-ido-find-file ()
+  "Find a recent file using Ido."
+  (interactive)
+  (let ((file (ido-completing-read "Choose recent file: " recentf-list nil t)))
+    (when file
+      (find-file file))))
+
+(require 'recentf-ext)