I like to use ido
for completing file paths and helm
for all other things. I have tried setting magit-completing-read-function
to magit-ido-completing-read
. This doesn't change magit-status
behaviour which calls read-directory-name
. Here is what I have set for ido
and helm
:
(use-package ido
:doc "I like `ido' for file paths' completion. Currently, the
vector syntax [remap ..] is broken and using strings there is a
workaround: https://github.com/jwiegley/use-package/issues/166"
:ensure t
:bind (("<remap> <read-file-name>" . ido-read-file-name)
("<remap> <read-directory-name>" . ido-read-directory-name))
:config
(ido-mode 1)
(setq ido-enable-flex-matching t
ido-auto-merge-work-directories-length -1
ido-save-directory-list-file (expand-file-name "ido.last"
temp-files-directory)
ido-ignore-buffers '("\\` " "^#.*" ".*freenode\.net.*"
".*irc\.slack\.com.*" "\\*helm.*")
ido-decorations '("\n-> " "" "\n " "\n ..." "[" "]" " [No match]"
" [Matched]" " [Not readable]" " [Too big]"
" [Confirm]")))
(use-package helm
:doc "Helm for everything except file paths."
:ensure t
:diminish helm-mode
:bind (("M-x" . helm-M-x)
("M-y" . helm-show-kill-ring)
("C-. C-r" . helm-grep-it))
:config
(helm-mode 1)
;; For some reason, this doesn't work. For example, `magit-status'
;; always uses `helm' for `read-file-name'.
(add-to-list 'helm-completing-read-handlers-alist
'(find-file . ido))
(add-to-list 'helm-completing-read-handlers-alist
'(dired . ido))
(add-to-list 'helm-completing-read-handlers-alist
'(read-file-name . ido-read-file-name)))
<remap>
s don't do anything becauseread-file-name
andread-directory-name
are not interactive commands so they can't have any bindings.ido-ubiquitous
as I have mentioned. I am usinghelm
for most of the things andido
only for files and directories.