summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
authorAlan Pearce2017-05-04 11:23:43 +0200
committerAlan Pearce2017-05-04 11:23:43 +0200
commite4afa65a2fa90ba330b03f34e21cafa0b12b877b (patch)
tree6661df02e2936334b8c0643eca3a2ecb2c6b0756 /emacs
parent755ccce37c2e1e72e3934fd66009d1f510b9c456 (diff)
downloadnixfiles-e4afa65a2fa90ba330b03f34e21cafa0b12b877b.tar.lz
nixfiles-e4afa65a2fa90ba330b03f34e21cafa0b12b877b.tar.zst
nixfiles-e4afa65a2fa90ba330b03f34e21cafa0b12b877b.zip
Emacs: Use counsel-imenu
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init.org23
1 files changed, 0 insertions, 23 deletions
diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org
index 0f33162f..72db3f1f 100644
--- a/emacs/.emacs.d/init.org
+++ b/emacs/.emacs.d/init.org
@@ -1371,7 +1371,6 @@ replacement for helm so far.
 (use-package swiper
   :bind (("C-s" . swiper)
          ("C-r" . swiper)
-         ("C-x i" . ivy-imenu-goto)
          ("C-=" . swiper))
   :diminish ivy-mode
   :demand t
@@ -1379,28 +1378,6 @@ replacement for helm so far.
             (ivy-mode 1)
             (setq ivy-re-builders-alist '((t . ivy--regex-plus))
                   ivy-extra-directories '("./"))
-            (defun ivy-imenu-get-candidates-from (alist  &optional prefix)
-              (cl-loop for elm in alist
-                       nconc (if (imenu--subalist-p elm)
-                                 (ivy-imenu-get-candidates-from
-                                  (cl-loop for (e . v) in (cdr elm) collect
-                                           (cons e (if (integerp v) (copy-marker v) v)))
-                                  (concat prefix (if prefix ".") (car elm)))
-                               (and (cdr elm) ; bug in imenu, should not be needed.
-                                    (setcdr elm (copy-marker (cdr elm))) ; Same as [1].
-                                    (list (cons (concat prefix (if prefix ".") (car elm))
-                                                (copy-marker (cdr elm))))))))
-
-            (defun ivy-imenu-goto ()
-              "Go to buffer position"
-              (interactive)
-              (let ((imenu-auto-rescan t) items)
-                (unless (featurep 'imenu)
-                  (require 'imenu nil t))
-                (setq items (imenu--make-index-alist t))
-                (ivy-read "imenu items:"
-                          (ivy-imenu-get-candidates-from (delete (assoc "*Rescan*" items) items))
-                          :action (lambda (k) (goto-char k)))))
             (ivy-set-actions 'ivy-switch-buffer '(("k" (lambda (x)
                                                          (kill-buffer x)
                                                          (ivy--reset-state ivy-last))