Skip to content

Commit

Permalink
Added function and key binding to use ido for recent files
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhorn424 authored and eschulte committed Jan 12, 2012
1 parent 3d782a8 commit 4239d7d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
13 changes: 7 additions & 6 deletions starter-kit-bindings.org
Expand Up @@ -43,12 +43,13 @@ Key Bindings.

** File finding
#+begin_src emacs-lisp
(global-set-key (kbd "C-x M-f") 'ido-find-file-other-window)
(global-set-key (kbd "C-x C-p") 'find-file-at-point)
(global-set-key (kbd "C-c y") 'bury-buffer)
(global-set-key (kbd "C-c r") 'revert-buffer)
(global-set-key (kbd "M-`") 'file-cache-minibuffer-complete)
(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "C-x M-f") 'ido-find-file-other-window)
(global-set-key (kbd "C-x C-p") 'find-file-at-point)
(global-set-key (kbd "C-c y") 'bury-buffer)
(global-set-key (kbd "C-c r") 'revert-buffer)
(global-set-key (kbd "M-`") 'file-cache-minibuffer-complete)
(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "C-x f") 'recentf-ido-find-file)
#+end_src

** Window switching. (C-x o goes to the next window)
Expand Down
22 changes: 22 additions & 0 deletions starter-kit-defuns.org
Expand Up @@ -51,3 +51,25 @@ a lambda doesn't already exist in the list.
"Enable things that are convenient across all coding buffers."
(run-hooks 'starter-kit-coding-hook))
#+end_src

#+srcname: starter-kit-recentf-ido-find-file
#+begin_src emacs-lisp
(defun recentf-ido-find-file ()
"Find a recent file using Ido."
(interactive)
(let* ((file-assoc-list
(mapcar (lambda (x)
(cons (file-name-nondirectory x)
x))
recentf-list))
(filename-list
(remove-duplicates (mapcar #'car file-assoc-list)
:test #'string=))
(filename (ido-completing-read "Choose recent file: "
filename-list
nil
t)))
(when filename
(find-file (cdr (assoc filename
file-assoc-list))))))
#+end_src

0 comments on commit 4239d7d

Please sign in to comment.