50 lines
1.3 KiB
EmacsLisp
50 lines
1.3 KiB
EmacsLisp
(require 'ido)
|
|
(setq
|
|
ido-use-virtual-buffers t
|
|
ido-enable-flex-matching t
|
|
;; ido-enable-regexp nil
|
|
ido-case-fold t)
|
|
|
|
;; (ido-mode 'buffers)
|
|
;; (ido-mode 1)
|
|
;; (ido-everywhere 1)
|
|
;; (global-set-key (kbd "C-x C-l") 'ido-switch-buffer)
|
|
|
|
(require 'ido-completing-read+)
|
|
(ido-ubiquitous-mode 1)
|
|
(setq completion-styles
|
|
'(basic partial-completion emacs22 substring prefix initials)
|
|
completion-cycle-threshold nil)
|
|
|
|
(defun cp/ido-toggle-flex ()
|
|
"Toggle the value of `ido-enable-flex-matching'."
|
|
(interactive)
|
|
(setq ido-enable-flex-matching
|
|
(not ido-enable-flex-matching)))
|
|
|
|
(defun cp/setup-ido-keys ()
|
|
(cp-set-keys
|
|
:keymap ido-completion-map
|
|
:bindings
|
|
`((,(kbd "C-n") ido-next-match)
|
|
(,(kbd "C-p") ido-prev-match)
|
|
(,(kbd "C-x C-p") ido-toggle-prefix)
|
|
(,(kbd "M-n") next-history-element)
|
|
(,(kbd "M-p") previous-history-element)
|
|
(,(kbd "C-l") cp/ido-toggle-flex))))
|
|
|
|
(add-hook 'ido-setup-hook 'cp/setup-ido-keys)
|
|
|
|
;; TODO - something to show documentation for a candidate, instead of
|
|
;; selecting it.
|
|
(require 'smex)
|
|
(global-set-key (kbd "M-x") 'smex)
|
|
|
|
(require 'ido-mini)
|
|
|
|
(global-set-key (kbd "C-x C-l") 'ido-mini)
|
|
(ido-vertical-mode 1)
|
|
|
|
;; is this being saved by desktop.el and actually being disabled here?
|
|
;; (toggle-uniquify-buffer-names)
|