about summary refs log tree commit diff
path: root/tools
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-12-17T11·46+0000
committerVincent Ambo <tazjin@google.com>2019-12-17T11·46+0000
commit5727b6d24f2e462d53d2c44f50bd5b07276eb024 (patch)
tree7f18d2420a39718cbb0c223c74e3331735081d53 /tools
parent7965f3ba3a79633a0a87c57aa9e14ce11ec1d3a1 (diff)
refactor(emacs.d): Move ivy configuration to use-package r/173
Diffstat (limited to 'tools')
-rw-r--r--tools/emacs/config/bindings.el6
-rw-r--r--tools/emacs/config/init.el32
-rw-r--r--tools/emacs/config/settings.el14
3 files changed, 31 insertions, 21 deletions
diff --git a/tools/emacs/config/bindings.el b/tools/emacs/config/bindings.el
index 9b98d5893f73..8f54d9cf554f 100644
--- a/tools/emacs/config/bindings.el
+++ b/tools/emacs/config/bindings.el
@@ -5,9 +5,6 @@
 ;; What does <tab> do? Well, it depends ...
 (define-key prog-mode-map (kbd "<tab>") #'company-indent-or-complete-common)
 
-;; Counsel stuff:
-(global-set-key (kbd "C-c r g") 'counsel-rg)
-
 ;; imenu instead of insert-file
 (global-set-key (kbd "C-x i") 'imenu)
 
@@ -40,7 +37,4 @@
 ;; Open a file in project:
 (global-set-key (kbd "C-c f") 'project-find-file)
 
-;; Use swiper instead of isearch
-(global-set-key "\C-s" 'swiper)
-
 (provide 'bindings)
diff --git a/tools/emacs/config/init.el b/tools/emacs/config/init.el
index 83621a99f9c1..bf36f6651a18 100644
--- a/tools/emacs/config/init.el
+++ b/tools/emacs/config/init.el
@@ -36,6 +36,11 @@
   :hook ((prog-mode . company-mode))
   :config (setq company-tooltip-align-annotations t))
 
+(use-package counsel
+  :after (ivy)
+  :config (counsel-mode 1)
+  :bind (("C-c r g" . counsel-rg)))
+
 (use-package dash)
 (use-package dash-functional)
 (use-package dottime :config (dottime-display-mode t))
@@ -43,18 +48,43 @@
 (use-package ht)
 (use-package hydra)
 (use-package idle-highlight-mode :hook ((prog-mode . idle-highlight-mode)))
+
+(use-package ivy
+  :config
+  (ivy-mode 1)
+  (setq enable-recursive-minibuffers t)
+  (setq ivy-use-virtual-buffers t))
+
+(use-package ivy-pass :after (ivy))
+
+(use-package ivy-prescient
+  :after (ivy prescient)
+  :config
+  (ivy-prescient-mode))
+
+(use-package multiple-cursors)
+
 (use-package paredit :hook ((lisp-mode . paredit-mode)
                             (emacs-lisp-mode . paredit-mode)))
-(use-package multiple-cursors)
+
 (use-package pinentry
   :config
   (setq epa-pinentry-mode 'loopback)
   (pinentry-start))
 
+(use-package prescient
+  :after (ivy counsel)
+  :config (prescient-persist-mode))
+
 (use-package rainbow-delimiters :hook (prog-mode . rainbow-delimiters-mode))
 (use-package rainbow-mode)
 (use-package s)
 (use-package string-edit)
+
+(use-package swiper
+  :after (counsel ivy)
+  :bind (("C-s" . swiper)))
+
 (use-package telephone-line) ;; configuration happens outside of use-package
 (use-package term-switcher)
 (use-package undo-tree :config (global-undo-tree-mode))
diff --git a/tools/emacs/config/settings.el b/tools/emacs/config/settings.el
index 0bcf73b0e794..274dcdde3554 100644
--- a/tools/emacs/config/settings.el
+++ b/tools/emacs/config/settings.el
@@ -1,18 +1,4 @@
-(require 'prescient)
-(require 'ivy-prescient)
 (require 'uniquify)
-(require 'ivy-pass)
-
-;; Make ivy go!
-(ivy-mode 1)
-(counsel-mode 1)
-
-(setq ivy-use-virtual-buffers t)
-(setq enable-recursive-minibuffers t)
-
-;; Enable support for prescient in ivy & configure it
-(ivy-prescient-mode)
-(prescient-persist-mode)
 
 ;; Move files to trash when deleting
 (setq delete-by-moving-to-trash t)