      ("L" (lambda (path) "Insert org-link with absolute path"
             (with-ivy-window (insert (format "[[%s]]" path)))) "insert org-link (abs. path)")))
 
-  ;; Configure `counsel-rg', `counsel-ag' & `counsel-pt'
-  (dolist (cmd '(counsel-ag counsel-rg counsel-pt))
-    (ivy-add-actions
-     cmd
-     '(("O" +ivy-git-grep-other-window-action "open in other window")))))
+  (ivy-add-actions
+   'counsel-ag ; also applies to `counsel-rg' & `counsel-pt'
+   '(("O" +ivy-git-grep-other-window-action "open in other window"))))
 
 
 (def-package! counsel-projectile

    [remap persp-switch-to-buffer] #'+ivy/switch-workspace-buffer
    [remap imenu-anywhere]         #'ivy-imenu-anywhere)

  (ivy-mode +1))


;; Show more buffer information in switch-buffer commands
(def-package! ivy-rich
  :after ivy
  :config
  (dolist (cmd '(ivy-switch-buffer +ivy/switch-workspace-buffer
                 counsel-projectile-switch-to-buffer))
    (ivy-set-display-transformer cmd '+ivy-buffer-transformer)))


(def-package! counsel

  ;; posframe doesn't work well with async sources
  (dolist (fn '(swiper counsel-rg counsel-ag counsel-pt counsel-grep counsel-git-grep))
    (setf (alist-get fn ivy-display-functions-alist) #'ivy-display-function-fallback)))


;; Used by `counsel-M-x'
