0

When I type M-x along with some text, the found text's background and font color is hard to read (gray and bold white on top of dark blue). Is it possible to change it?

Example screenshot:

enter image description here


As theme I am using dracula along with ivy.

(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
(load-theme 'dracula t)

(ivy-mode)
(setq ivy-use-virtual-buffers t)
(setq ivy-initial-inputs-alist nil)
(setq enable-recursive-minibuffers t)

(global-set-key (kbd "M-x") 'counsel-M-x)
(define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history)

ivy faces (I believe all are default setup):

enter image description here

I was not able to do proper test using emacs -Q but it makes the found substring as bold without changing its background.

example:

enter image description here

7
  • 1
    If you are using ivy you can customize the minibuffer faces using C-h v -> ivy-minibuffer-faces -> customize
    – 46_and_2
    Apr 5 at 21:01
  • Please specify anything relevant that you are using, besides theme dracula. Or do you see the problem if you start Emacs with emacs -Q (no init file) and then just enable that theme? Put all relevant info in the question, please.
    – Drew
    Apr 5 at 23:44
  • I updated my answer not sure its enough. I am not sure its related to theme could be related to my ivy configuration.
    – alper
    Apr 6 at 10:17
  • @ 46_and_2 I have checked ivy faces but it does not show any color for me to set
    – alper
    Apr 6 at 10:20
  • You can try M-x [customize group] -> ivy-faces. There are all kinds of faces you can set here including ivy minibuffer match highlight etc.
    – 46_and_2
    Apr 6 at 14:30
0

@46_and_2's comment help me to solve to problem I was facing.

If you are using ivy you can customize the minibuffer faces using C-h v -> ivy-minibuffer-faces -> customize –

You can try M-x [customize group] -> ivy-faces. There are all kinds of > faces you can set here including ivy minibuffer match highlight etc


It was all related to ivy color configuration. Its not perfect but I was able to come up with following coloring from here (https://github.com/abo-abo/swiper/issues/2717)

(require 'package)
(package-initialize)
(require 'swiper)

(progn
  (set-face-attribute 'ivy-current-match nil :foreground "white")
  (set-face-attribute 'ivy-minibuffer-match-face-2 nil :foreground "white" :background "red")
  (set-face-attribute 'ivy-minibuffer-match-face-3 nil :foreground "white" :background "darkgreen")
  (set-face-attribute 'ivy-minibuffer-match-face-4 nil :foreground "white" :background "blue")
  ;;
  (set-face-attribute 'swiper-match-face-2         nil :foreground "white" :background "red")
  (set-face-attribute 'swiper-match-face-3         nil :foreground "white" :background "darkgreen")
  (set-face-attribute 'swiper-match-face-4         nil :foreground "white" :background "blue"))

Output:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.