2017-06-08 11:47:56 +02:00
|
|
|
;;; completion/ido/config.el -*- lexical-binding: t; -*-
|
2017-02-19 18:55:11 -05:00
|
|
|
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +ido-init-h ()
|
2017-02-19 18:55:11 -05:00
|
|
|
(setq ido-ignore-buffers
|
|
|
|
'("\\` " "^\\*ESS\\*" "^\\*Messages\\*" "^\\*Help\\*" "^\\*Buffer"
|
|
|
|
"^\\*.*Completions\\*$" "^\\*Ediff" "^\\*tramp" "^\\*cvs-"
|
|
|
|
"_region_" " output\\*$" "^TAGS$" "^\*Ido")
|
|
|
|
ido-use-faces nil
|
|
|
|
ido-confirm-unique-completion t
|
|
|
|
ido-case-fold t
|
|
|
|
ido-enable-tramp-completion nil
|
|
|
|
ido-enable-flex-matching t
|
|
|
|
ido-create-new-buffer 'always
|
|
|
|
ido-enable-tramp-completion t
|
|
|
|
ido-enable-last-directory-history t
|
|
|
|
ido-save-directory-list-file (concat doom-cache-dir "ido.last"))
|
|
|
|
|
2018-06-03 15:01:21 +02:00
|
|
|
(unless (member "\\`.DS_Store$" ido-ignore-files)
|
|
|
|
(push "\\`.DS_Store$" ido-ignore-files)
|
|
|
|
(push "Icon\\?$" ido-ignore-files))
|
2017-02-19 18:55:11 -05:00
|
|
|
|
2018-06-03 15:01:21 +02:00
|
|
|
(define-key! (ido-common-completion-map ido-completion-map ido-file-completion-map)
|
|
|
|
"\C-n" #'ido-next-match
|
|
|
|
"\C-p" #'ido-prev-match
|
|
|
|
"\C-w" #'ido-delete-backward-word-updir
|
|
|
|
;; Go to $HOME with ~
|
|
|
|
"~" (λ! (if (looking-back "/" (point-min))
|
|
|
|
(insert "~/")
|
|
|
|
(call-interactively #'self-insert-command))))
|
2017-02-19 18:55:11 -05:00
|
|
|
|
2019-07-23 17:24:56 +02:00
|
|
|
(defadvice! +ido--sort-mtime-a ()
|
2017-02-19 18:55:11 -05:00
|
|
|
"Sort ido filelist by mtime instead of alphabetically."
|
2019-07-23 12:30:47 +02:00
|
|
|
:override #'ido-sort-mtime
|
2017-02-19 18:55:11 -05:00
|
|
|
(setq ido-temp-list
|
|
|
|
(sort ido-temp-list
|
|
|
|
(lambda (a b)
|
|
|
|
(time-less-p
|
|
|
|
(sixth (file-attributes (concat ido-current-directory b)))
|
|
|
|
(sixth (file-attributes (concat ido-current-directory a)))))))
|
|
|
|
(ido-to-end ;; move . files to end (again)
|
2017-06-08 11:47:56 +02:00
|
|
|
(cl-loop for x in ido-temp-list
|
|
|
|
if (char-equal (string-to-char x) ?.)
|
|
|
|
collect x)))
|
2019-07-26 19:57:13 +02:00
|
|
|
(add-hook! '(ido-make-file-list-hook ido-make-dir-list-hook)
|
|
|
|
#'ido-sort-mtime)
|
2017-02-19 18:55:11 -05:00
|
|
|
|
2018-06-03 15:01:21 +02:00
|
|
|
;;
|
|
|
|
(ido-mode 1)
|
|
|
|
(ido-everywhere 1)
|
|
|
|
(ido-ubiquitous-mode 1)
|
|
|
|
(ido-vertical-mode 1)
|
|
|
|
(flx-ido-mode +1)
|
|
|
|
(crm-custom-mode +1)
|
|
|
|
|
|
|
|
;;
|
2019-07-18 15:27:20 +02:00
|
|
|
(remove-hook 'ido-setup-hook #'+ido-init-h))
|
2018-06-03 15:01:21 +02:00
|
|
|
|
|
|
|
;;
|
2019-07-18 15:27:20 +02:00
|
|
|
(add-hook 'ido-setup-hook #'+ido-init-h)
|