Switch out ido for ivy

This commit is contained in:
Jeremy Dormitzer 2019-11-27 10:12:29 -05:00
parent 1a55d71285
commit ca29ae8034

View File

@ -187,7 +187,7 @@ Magit is objectively the best Git interface.
Use ido-mode for completion within Magit:
#+BEGIN_SRC emacs-lisp
(setq magit-completing-read-function 'magit-ido-completing-read)
;; (setq magit-completing-read-function 'magit-ido-completing-read)
#+END_SRC
** Forge
@ -1081,7 +1081,7 @@ And a global keybinding to open an org file:
#+BEGIN_SRC emacs-lisp
(defun find-org-file (file)
(interactive
(list (ido-completing-read+
(list (completing-read
"Find org file: "
(directory-files (agenda-files) t))))
(find-file file))
@ -1910,9 +1910,9 @@ This mode requires that [[https://github.com/ledger/ledger][ledger]] be installe
(defun ledger-import-ofx (bank file)
(interactive
(list
(ido-completing-read+ "Bank: "
(completing-read "Bank: "
(mapcar #'car bank-alist))
(ido-read-file-name "OFX file: ")))
(read-file-name "OFX file: ")))
(if-let ((ledger-autosync (executable-find "ledger-autosync")))
(let* ((bank-def (alist-get bank bank-alist))
(acct (alist-get 'acct bank-def))
@ -2824,35 +2824,51 @@ An Emacs interface to MPD, the Music Player Daemon
* Ido
Interactively do things! Some more info in [[https://masteringemacs.org/article/introduction-to-ido-mode][this blog post]].
#+BEGIN_SRC emacs-lisp
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(ido-mode 1)
;; (setq ido-enable-flex-matching t)
;; (setq ido-everywhere t)
;; (ido-mode 1)
#+END_SRC
Enable it everywhere:
#+BEGIN_SRC emacs-lisp
(use-package ido-completing-read+
:config
(ido-ubiquitous-mode 1))
(use-package crm-custom
:config
(crm-custom-mode 1))
;; (use-package completing-read
;; :config
;; (ido-ubiquitous-mode 1))
;;
;; (use-package crm-custom
;; :config
;; (crm-custom-mode 1))
#+END_SRC
The horizontal completion is ugly. Make it vertical:
#+BEGIN_SRC emacs-lisp
(use-package ido-vertical-mode
:config
(ido-vertical-mode 1)
(setq ido-vertical-define-keys 'C-n-and-C-p-only))
;; (use-package ido-vertical-mode
;; :config
;; (ido-vertical-mode 1)
;; (setq ido-vertical-define-keys 'C-n-and-C-p-only))
#+END_SRC
The default auto-merge time is too short.
#+BEGIN_SRC emacs-lisp
(setq ido-auto-merge-delay-time 1.5)
;; (setq ido-auto-merge-delay-time 1.5)
#+END_SRC
* Ivy
An alternative minibuffer completion framework:
#+BEGIN_SRC emacs-lisp
(use-package counsel
:config
(ivy-mode 1)
(setq ivy-height 20
ivy-wrap t)
(with-eval-after-load 'projectile
(setq projectile-completion-system 'ivy))
:general
("C-s" #'swiper-isearch))
(use-package ivy-hydra
:after counsel)
#+END_SRC
* graphviz
#+BEGIN_SRC emacs-lisp
(use-package graphviz-dot-mode
@ -3114,7 +3130,7 @@ Emacs has excellent built-in SQL support.
(interactive
(list
(intern
(ido-completing-read+
(completing-read
"GraphQL env: "
(mapcar #'car graphql-env-alist)))))
(let* ((gql-params (alist-get env graphql-env-alist))
@ -3127,7 +3143,7 @@ Emacs has excellent built-in SQL support.
(interactive
(list
(intern
(ido-completing-read+
(completing-read
"GraphQL env: "
(mapcar #'car graphql-env-alist)))))
(graphql-set-env env)
@ -3413,7 +3429,7 @@ Some functions to make my day job easier.
(defun call-with-lola-env (callback)
(let ((process-environment
(cons (format "LOLA_ENV=%s"
(ido-completing-read+
(completing-read
"Environment: "
'("local" "development" "staging")))
process-environment)))
@ -3568,7 +3584,7 @@ The aws-mfa command:
(defun op-copy-password (item)
(interactive
(list
(ido-completing-read+ "1Password item: " (op-list-items))))
(completing-read "1Password item: " (op-list-items))))
(if-let ((password (op-get-item-field (op-get-item item) "password")))
(with-temp-buffer
(insert password)
@ -3612,7 +3628,7 @@ The aws-mfa command:
(interactive
(list
(intern
(ido-completing-read+
(completing-read
"Devpi index to use: "
(mapcar #'car devpi-indices)))))
(cl-letf* ((index-alist (alist-get index-name devpi-indices))