 
 (use-package counsel
   :ensure t
-  :after ivy
+  :hook (after-init . counsel-mode)
+  :bind
+  (("C-S"      . counsel-grep-or-swiper)
+   ("<f1> SPC" . counsel-find-library)
+   ("<f2> i"   . counsel-info-lookup-symbol)
+   ("<f2> u"   . counsel-unicode-char))
   :config
   (setq counsel-mode-override-describe-bindings t
-        counsel-find-file-at-point t
-        confirm-nonexistent-file-or-buffer t
-        enable-recursive-minibuffers t)
-  (fset 'describe-function 'counsel-describe-function)
-  (fset 'describe-variable 'counsel-describe-variable))
+        counsel-find-file-at-point              t
+        confirm-nonexistent-file-or-buffer      t
+        enable-recursive-minibuffers            t))
 
 (use-package amx
   :ensure t

  :config
  (setq amx-auto-update-interval 10
        amx-history-length 5
        amx-backend 'ivy))

(use-package projectile
  :ensure t
  :diminish projectile-mode
  ;; :hook (before-init . projectile-mode)
  :init
  (setq projectile-cache-file (expand-file-name (concat user-emacs-directory ".cache/projectile.cache"))
        projectile-known-projects-file (expand-file-name (concat user-emacs-directory ".cache/projectile-bookmarks.eld")))

        ivy-wrap t
        ivy-initial-inputs-alist nil))

(use-package hydra
  :ensure t
  :defer t)

(use-package ivy-hydra
  :ensure t
  :after ivy)

(use-package ivy-rich
  :ensure t
  :config
  (setq ivy-rich-switch-buffer-align-virtual-buffer t)
  (ivy-set-display-transformer 'ivy-switch-buffer 'ivy-rich-switch-buffer-transformer))

(use-package ivy-xref
  :ensure t
  :config
  (setq xref-show-xrefs-function 'ivy-xref-show-xrefs))

