summaryrefslogtreecommitdiff
path: root/lisp/init-ido.el
blob: ae1c8ea51d61ff6933a1a09bd33a717017286d03 (plain)
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
(require-package 'flx)
(require-package 'flx-ido)
(require-package 'ido-vertical-mode)
(require-package 'ido-ubiquitous)
(require-package 'ido-at-point)

(setq ido-enable-prefix nil
      ido-enable-flex-matching t
      ido-default-file-method 'selected-window
      ido-default-buffer-method 'selected-window
      ido-create-new-buffer 'always
      ido-use-filename-at-point 'guess
      ido-auto-merge-work-directories-length -1
      ido-max-prospects 10
      ido-save-directory-list-file "~/.emacs.d/cache/ido.hist"
      ido-max-directory-size 100000)

(add-hook 'dired-mode-hook
          '(lambda ()
             (set (make-local-variable 'ido-use-filename-at-point) nil)))

(setq ido-file-extensions-order
      '(".org" ".txt" ".md" ".rst" ".tex" ".py" ".el" ".hs"))

(setq completion-ignored-extensions
      (append '(".pdf" ".out" ".log" ".fls" ".fdb" ".fdb_latexmk")
              completion-ignored-extensions))

;; Disable ido faces to see flx highlights.
(setq ido-use-faces nil)

(ido-mode 1)
(ido-vertical-mode 1)
(ido-everywhere 1)
(flx-ido-mode 1)
(ido-ubiquitous-mode 1)
(ido-at-point-mode)

;; From prelude
(defun km/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))))

(key-chord-define-global ",r" 'km/recentf-ido-find-file)
(key-chord-define-global ",b" 'ido-switch-buffer)

(provide 'init-ido)