Skip to content

Instantly share code, notes, and snippets.

@rileyrg
Created December 28, 2012 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rileyrg/4400583 to your computer and use it in GitHub Desktop.
Save rileyrg/4400583 to your computer and use it in GitHub Desktop.
;; Fast buffer and refile targets with fuzzy completion.
(require 'ido)
(ido-everywhere t)
(ido-mode t)
(setq ido-file-extensions-order '(".org" ".txt" ".py" ".emacs" ".xml" ".el" ".ini" ".cfg" ".cnf"))
;; disable auto searching for files unless called explicitly
(setq ido-auto-merge-delay-time 0.3)
;; (define-key ido-file-dir-completion-map (kbd "M-s")
;; (lambda()
;; (interactive)
;; (ido-initiate-auto-merge (current-buffer))))
(defun my-ido-find-tag ()
"Find a tag using ido"
(interactive)
(tags-completion-table)
(let (tag-names)
(mapc (lambda (x)
(unless (integerp x)
(push (prin1-to-string x t) tag-names)))
tags-completion-table)
(find-tag (ido-completing-read "Tag: " tag-names))))
(defun ido-recentf-open ()
"Use `ido-completing-read' to \\[find-file] a recent file"
(interactive)
(if (find-file (ido-completing-read "Find recent file: " recentf-list))
(message "Opening file...")
(message "Aborting")))
(require 'recentf)
(recentf-mode t)
(global-set-key (kbd "C-x C-r") 'ido-recentf-open)
(setq recentf-max-saved-items 50)
(provide 'rgr-buffers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment