Questions tagged [syntax-highlighting]
is the feature of displaying text, especially source code, in different colors and fonts according to the meaning of different terms.
248 questions
0
votes
1
answer
35
views
Having issue with syntax highlighting in rust-ts-mode in emacs 30
I'm using Emacs 30 on macOS 26.0.1. I've tried both emacs-plus@30 and compiling Emacs 30.2.5 from source with --with-tree-sitter.
I'm not sure if this is an issue or expected behavior, but in my Rust ...
0
votes
0
answers
42
views
Can I switch the mode for a region?
I'm wondering:
Say I have a Perl script that includes a HTML "here doc"; can I mark the here-doc and switch the mode to HTML for the region (to help editing it)?
I'm using Emacs 27.2 (Linux)....
0
votes
0
answers
53
views
eshell colorize diff output via highlighting
so far on my windows machine I am not able to get colored lines for diffs in eshell
This would be crucial for me to use it as my goto git tool as I prefer not to use magit.
With
(defun tietan/hs-diff-...
2
votes
1
answer
128
views
syntax highlighting with ob-go
I'm using ob-go from melpa and go-ts-mode, which I set to be automatically loaded with .go files. Code execution of org-mode go code blocks with C-c C-c works.
However, while syntax highlighting works ...
2
votes
1
answer
188
views
Deferring `magit` load without breaking highlight in `git-commit`
I am interacting with git via a set of zsh functions/aliases I've grown over the years, so I don't typically need magit. In fact, I only have magit installed to provide syntax highlight for when git ...
1
vote
0
answers
39
views
Make show-parens-mode recognize changed syntax table
I'm using a lot of bra-ket-like notation in LaTeX-mode, meaning things like ⟨f|, so I put
(modify-syntax-entry ?\⟨ "(|" LaTeX-mode-syntax-table)
(modify-syntax-entry ?\⟩ ")|" LaTeX-...
1
vote
2
answers
141
views
crontab syntax highlighting
Let's look at crontab -e in Emacs vs Vim.
Emacs
If I run crontab -e in Emacs:
EDITOR=emacs crontab -e
it looks like this:
So we basically have two colors. One for comments and one for crontab text.
...
0
votes
1
answer
427
views
Better accuracy syntax highlighting
So I spent a bit of time making my own theme for emacs since none of them were quite right for me, and I'm really loving it as a text editor, but I'm wondering if there was a package that would give ...
0
votes
1
answer
98
views
Tex equation block highlighting in org-mode
I would like to highlight \begin{equation} ... \end{equation} Tex environments with a different color in org-mode.
Inline Tex expressions (delimited by the $ symbol) can be highlighted as follows:
(...
0
votes
2
answers
374
views
org-mode: example blocks are no longer syntax highlighted in emacs
After upgrading to emacs 29.2 and org 9.7, my example blocks are no longer syntax highlighted in emacs. They used to be syntax highlighted when I specified the block's language. Any ideas?
I use Doom, ...
0
votes
1
answer
1k
views
How to use tree-sitter parser for syntax highlighting?
I'm trying to setup Emacs for editing Roc (https://www.roc-lang.org/) source code. I have an LSP server for Roc and tree-sitter parser for Roc installed.
Unfortunately I failed to find tree-sitter ...
2
votes
0
answers
145
views
Disable syntax highlighting after single quote in HTML mode
I manually edit an HTML file which contains plain text and HTML tags. How can I prevent emacs' html-mode to treat single-quotes ' (i.e. apostrophes) as string separator? For example in <pre>This ...
0
votes
1
answer
62
views
Define new comment style with string literals rather than characters
I am trying to define another comment style, similar to what we can do with modify-syntax-entry:
(modify-syntax-entry ?/ ". 124b")
(modify-syntax-entry ?* ". 23")
(modify-syntax-...
1
vote
2
answers
4k
views
How enable tree-sitter modes (*-ts-mode) that aren't built-in?
My Emacs (29.1) comes with the some tree-sitter modes:
c-ts-mode
go-ts-mode
js-ts-mode
...
I downloaded the compiled .dll and they work out of box.
However, there are some languages that tree-sitter ...
0
votes
1
answer
748
views
How does emacs/eglot decide which syntax element to highlight and how could I change it?
For example, I'm writing a Lua file. I noticed that the table keys are not highlighted:
I'd like to make the table keys show in a different color than values, like what Emacs does for YAML:
But I ...