In emacs, when I diff code I lose the syntax highlighting. With my theme anyway all text is light gray. Added lines do have a green background, and removed lines do have a red background, etc. But the code keywords, etc are not colored like they are when I'm using that language's mode. Is there a way to turn on ruby syntax highlighting in diffs?
As an example of a tool that does this - if you look at diffs on github the code syntax highlighting is there, as well as highlighting for added/removed lines.
Syntax coloring in diffs is enabled by default in Emacs 27.
Related
I'm using Electron theme in my VS Code and it works great, but the colors of text are different accross languages (I work with .vue .js .html .ts).
For example JS
'semicoloned string': green
"double quoted string": light-green
`template literals string`: white
meanwhile in TS everything is white, and for HTML the colors are completely different.
Is there a way how to extend this theme for the same color of syntax highlighting accross all languages I work with?
VSCode 1.30.2
I could swear I had this working in previous versions. But now selecting View>Toggle Render Whitespace does not show invisibles such as spaces, tabs, and returns.
My setting for Editor: Render Whitespace is 'all'.
What setting have I missed, or misconfigured? I've run out of places to look.
They can be a quite faint gray against certain editor backgrounds. Try:
"workbench.colorCustomizations": {
"editorWhitespace.foreground": "#ff0000"
}
to make sure you really don't have them.
I've just installed Fedora 23 and I've encountered a problem I've never seen in many years of using Emacs.
Emacs won't allow me to highlight text. I noticed it first when trying to click-and-drag with the mouse, but then I tested it by setting the mark and moving the cursor - no highlighting.
The <drag-mouse-1> command description indicates that dragging should set a region and highlight text. Transient-mark-mode is enabled, and I'm running Emacs in its own (non-terminal) window. I can't find any other information about this. Any ideas?
Edit: On closer inspection, I can act on the region that I try to highlight as normal (cutting, copying, etc.). It seems like Emacs IS highlighting, it's just not SHOWING the highlighting. A less serious problem, but one I'd still like to fix and don't know how.
Sounds like the highlight color is the same as or similar to your background color. Try M-x list-faces-display and look at face region. That also provides you an entry point for changing any of the faces displayed - just click the face name to open Customize for the face.
I use org-mode to generate html pages and htmlize.el to render the syntax highlighting for the code block in the org files. The thing is that htmlize seems grab the the background color of my emacs color theme and use it to color the white spaces (see the pic below) instead of leaving them as untouched. Anyone else has this problem? how to change that?
I'm a vim user trying to feel at home in Emacs. I really like the different color for the null lines at the bottom I have in vim, like in this image:
I tried messing around with the set-face-background of Emacs but I haven't find an equivalent option for this.
How can I achieve this customization in Emacs?
You can use the whitespace-mode to highlight various invisible characters and boundaries. See also "Fringes" and "Displaying Boundaries" in Emacs Info.