diff --git a/modules/completion/ivy/autoload/ivy.el b/modules/completion/ivy/autoload/ivy.el index e9f60d44c..77b55093a 100644 --- a/modules/completion/ivy/autoload/ivy.el +++ b/modules/completion/ivy/autoload/ivy.el @@ -25,6 +25,14 @@ ;; Library ;; +;;;###autoload +(defun +ivy-projectile-find-file-transformer (str) + "Highlight entries that have been visited. This is the opposite of +`counsel-projectile-find-file'." + (cond ((get-file-buffer (projectile-expand-root str)) + (propertize str 'face '(:weight ultra-bold :slant italic))) + (t str))) + ;;;###autoload (defun +ivy-recentf-transformer (str) "Dim recentf entries that are not in the current project of the buffer you diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index 6072c696c..9e20cc4f3 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -89,6 +89,8 @@ immediately runs it on the current candidate (ending the ivy session)." :config ;; Dim recentf entries that are not in the current project. (ivy-set-display-transformer 'counsel-recentf '+ivy-recentf-transformer) + ;; Highlight entries that have been visited + (ivy-set-display-transformer 'counsel-projectile-find-file '+ivy-projectile-find-file-transformer) (require 'counsel-projectile) (setq counsel-find-file-ignore-regexp "\\(?:^[#.]\\)\\|\\(?:[#~]$\\)\\|\\(?:^Icon?\\)")