Changing highlight line color in emacs
That would be an easy fix if you customize your init file (~/.emacs
, ~/.emacs.el
, or ~/.emacs.d/init.el
)
Turn on hl-line:
(global-hl-line-mode 1)
Set any color as the background face of the current line:
(set-face-background 'hl-line "#3e4446")
To keep syntax highlighting in the current line:
(set-face-foreground 'highlight nil)
How do I change the highlight color for selected text with Emacs / deftheme?
What you're looking for is the region
face. For example:
(set-face-attribute 'region nil :background "#666")
Change Emacs syntax highlighting colors
I find it easiest to use color-theme for this sort of thing.
But if you don't want to do that, put the cursor over the offending text, and hit M-x customize-face
. It should default to the face that the cursor is over.
See 49.1.6 Customizing Specific Items.
In emacs, how do I highlight and flash current line with a changing backcolor as the following video did?
That is Beacon mode. It eases finding the cursor (point) when changing windows or when scrolling.
Emacs hl-line: change color locally
hl-line-face
is a variable containing the face to use for hl-line-mode
, so we can make that variable buffer-local in these modes, and assign it a new custom face.
You can create a new face like this:
(defface gnus-hl-line
'((t :inherit hl-line))
"Face for highlighting the current line with `gnus-hl-line'."
:group 'hl-line)
and customize it with M-x customize-face
RET gnus-hl-line
RET
Then add this in your gnus-hl-line
function (before calling hl-line-mode
would seem most sensible).
(set (make-local-variable 'hl-line-face) 'gnus-hl-line)
emacs: how to change the foreground color of highlights (e.g., links the point is over)?
What you have discovered is that it cannot be done. For one thing, the mouse-face
text property is independent of the face
property. For another, face attributes are defined statically; they cannot be inherited dynamically.
Consider filing an Emacs enhancement request for such a capability (it is not limited to highlight
or to mouse-face
etc.), using M-x report-emacs-bug
. (Yes, that command is for enhancement requests also.)
Related Topics
Get Current Time in Hours and Minutes
How to Set Up Autocompletion for Git Commands
How to Open Sublime Text 2 Files from the Command Line in Linux to a Tab, Not a New Window
Unix Command to List Files Containing String But *Not* Containing Another String
Setting Node_Env for Node.Js + Expressjs Application as a Daemon Under Ubuntu
Changing Name of the Video While Downloading via Youtube-Dl
How Does Epoll's Epollexclusive Mode Interact with Level-Triggering
Id_Rsa.Pub File Ssh Error: Invalid Format
Should I Put Trailing Slash After Source and Destination When Copy Folders
How to Fix Symbol Lookup Error: Undefined Symbol Errors in a Cluster Environment
How to Check If a Process Is in Hang State (Linux)
How to Check That Two Folders Are the Same in Linux
Error When Trying to Run .Asm File on Nasm on Ubuntu
Installed Clang++3.6 on Ubuntu, Can't Select as Alternative
Different File Owner Inside Docker Container and in Host MAChine