-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-ido.el
51 lines (42 loc) · 1.49 KB
/
init-ido.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
;; Use C-f during file selection to switch to regular find-file
(ido-mode t)
(ido-everywhere t)
(setq ido-enable-flex-matching t)
(setq ido-use-filename-at-point nil)
(setq ido-auto-merge-work-directories-length 0)
(setq ido-use-virtual-buffers t)
(require 'ido-ubiquitous)
(ido-ubiquitous-mode t)
(require 'smex)
(global-set-key (kbd "M-x") 'smex)
(require 'idomenu)
;; Allow the same buffer to be open in different frames
(setq ido-default-buffer-method 'selected-window)
(when (eval-when-compile (< emacs-major-version 24))
(defun sanityinc/ido-choose-from-recentf ()
"Use ido to select a recently opened file from the `recentf-list'"
(interactive)
(if (and ido-use-virtual-buffers (fboundp 'ido-toggle-virtual-buffers))
(ido-switch-buffer)
(find-file (ido-completing-read "Open file: " recentf-list nil t))))
(global-set-key [(meta f11)] 'sanityinc/ido-choose-from-recentf))
(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-find-file-in-tag-files ()
(interactive)
(save-excursion
(let ((enable-recursive-minibuffers t))
(visit-tags-table-buffer))
(find-file
(expand-file-name
(ido-completing-read
"Project file: " (tags-table-files) nil t)))))
(provide 'init-ido)