Improve ivy-switch-buffer transformer

- Highlights remote/tramp files with ivy-remote face
- Highlights non-file-visiting buffers with ivy-subdir face
- Highlight modified buffers with ivy-modified-buffer face
- Disable built-in ivy-switch-buffer transformer (redundant with our own
  transformer)
This commit is contained in:
Henrik Lissner 2019-04-10 19:22:29 -04:00
parent 5e8687cd45
commit 3ef2abfb22
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 16 additions and 3 deletions

View file

@ -19,9 +19,18 @@
Buffers that are considered unreal (see `doom-real-buffer-p') are dimmed with
`+ivy-buffer-unreal-face'."
(if (doom-real-buffer-p (get-buffer candidate))
candidate
(propertize candidate 'face +ivy-buffer-unreal-face)))
(let ((b (get-buffer candidate)))
(cond ((ignore-errors
(file-remote-p
(buffer-local-value 'default-directory b)))
(ivy-append-face candidate 'ivy-remote))
((doom-unreal-buffer-p b)
(ivy-append-face candidate +ivy-buffer-unreal-face))
((not (buffer-file-name b))
(ivy-append-face candidate 'ivy-subdir))
((buffer-modified-p b)
(ivy-append-face candidate 'ivy-modified-buffer))
(candidate))))
;;;###autoload
(defun +ivy-rich-buffer-icon (candidate)