Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change the highlight color for selected text with Emacs / deftheme?

Tags:

emacs

I'm using Emacs 24; I've installed the zenburn theme, which is great, except I cannot see the selection highlight easily with the highlight color provided by zenburn:

enter image description here

By "selection" color, I mean the color of text that I've selected by setting a mark (C-space and moving the cursor to select text).

For the life of me, I cannot figure out how to change it. I've tried changing every combination of highlight, selection, etc.. that I can think of in zenburn-theme.el, but nothing seems to change it.

**For sanity's sake, I've tried changing other colors in the theme to make sure Emacs is loading the file properly - it is - those changes work.*

I would have especially thought that changing highlight would work, but no customizations to the highlight line seem to work:

;;;; Built-in                                                                                                                                                                             ;;;;; basic coloring                                                     ...                                                                                                          `(highlight ((t (:background ,zenburn-bg-05 :foreground ,zenburn-yellow))))   

How can I change the selection color?

like image 561
Rob Avatar asked Sep 08 '13 14:09

Rob


People also ask

How do I change the highlight color in emacs?

To customize colors for color syntax highlighting, see the section on font-lock . To change the foreground or background color in Emacs through the windowing interface, you can use the menu commands Foreground Color->Other and Background Color->Other in the Edit->Text Properties menu.

How do you change the highlight color when selecting?

To change the highlight text colour, click the first box beside “Selected Text” and choose your preferred colour in the resulting colour panel and then click “Done”. Use the second box to change the highlight background colour.

How do you change the highlight color in flutter?

2021 answer If you are using a custom theme, you can define the textSelectionTheme and use the TextSelectionThemeData to define cursorColor and highlighted color to your liking.


1 Answers

What you're looking for is the region face. For example:

(set-face-attribute 'region nil :background "#666") 
like image 135
tungd Avatar answered Sep 21 '22 17:09

tungd