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.

Filter by
Sorted by
Tagged with
0
votes
0answers
25 views

Markdown and Latex highlighting (font lock) in R Markdown file

I am using polymode to edit rmarkdown files. Exporting to e.g. pdf is super simple and works very well. R code chunks are also properly highlighted. But: I do quite often use latex code inside (r)...
0
votes
1answer
30 views

font-lock keywords and syntax-table mutually interfering

I would like to define something that font-locks a bit like a new sort of string-literal/comment. I might write: (font-lock-add-keywords 'emacs-lisp-mode (list '("<<.*>>" 0 'my-custom-...
0
votes
0answers
24 views

In Spacemacs, in a Perl or Go file, is there a way to get syntax highlighting for SQL strings?

For heredocs and backtick strings in Perl or Go code respectively, I would like to get SQL syntax highlighting. Can this be done?
1
vote
1answer
30 views

Scilab-mode syntax highlighting

I'm trying to install (and run) scilab-mode, but the syntax highlighting does not work when I open .sci or .sce file. I use the exact configuration described in the scilab.el package. https://www....
7
votes
2answers
156 views

Syntax highlighting fails on clone-indirect-buffer-other-window

I normally use indirect buffers while I edit python code in python-mode, I create them by running clone-indirect-buffer-other-window. While the syntax highlighting of the main buffer looks just fine, ...
0
votes
1answer
83 views

How to disable semantic highlighting in lsp-mode?

Language server mode has a variable for semantic highlighting lsp-ht, I would like to disable all syntax highlighting in lsp-mode, is this possible. (setq lsp-enable-links nil) (setq lsp-enable-...
0
votes
0answers
36 views

How can I get Tex-latex-mode style inline math fontification in Org mode?

I enjoy the inline math fontification that the AucTeX TeX-latex-mode provides – both the theme-responsive coloring and visual indication for sub- and super-scripted math. I have worked in plain ...
1
vote
1answer
34 views

Improving org-block-begin-line, splitting in several faces

The face org-block-begin-line allows to customize the first line of the following block #+BEGIN_SRC lang :var arg1=1 arg2=2 ... #+END_SRC However, I would like to customize the faces within the line,...
10
votes
1answer
277 views

Highlighting upcoming dates in org mode agenda

I have entries in my org file similar to: * Birthdays :PROPERTIES: :CATEGORY: birthday :END: %%(org-anniversary 1981 1 2) Harry (%d) What I would like is for these to appear in the agenda (say) 2 ...
1
vote
0answers
23 views

sh-mode: Correctly indent and highlight inside bash's subshell substitution $()?

I noticed that bash will correctly apply syntax highlighting inside the subshell substitution in VALUE="Hello $(echo World)." But when creating a more complicated value, e.g. VALUE="Hello $( ...
1
vote
1answer
158 views

Using org-mode for writing. Would like text in quotes to be highlighted and also character names

I'm using org-mode to write a novel and I would like to have any text between "quotes" to be a different color, just to be able to easily see when a character is talking. Also, if I could have a ...
0
votes
1answer
95 views

Custom verbatim environments/macros in AucTeX

Here's my MWE: \documentclass{article} \newenvironment{tscode}{}{} \def\tscode|#1|{} \begin{document} \tsinline|efwe| \begin{tscode} efihw$feiw$ \end{tscode} \end{document} % Local Variables: % ...
2
votes
1answer
23 views

Show @ symbol in different color in clojure mode

I want to show @ symbols (meaning dereference) in red in clojure-mode. How do I do that?
0
votes
1answer
101 views

How to auto highlight buffer or region in web-mode?

I'm using web-mode 13.1.25, but was until today on 12.x with the same issue. It seems I need to continually choose Highlight buffer (C-c C-h) as otherwise, certain functions misbehave. These steps ...
0
votes
2answers
47 views

Chinese Text commentary syntax highlighting

Plain text inherited from ctext.org contain the following syntax: {{...}} 堯年十六,以唐侯升為天子,遂以為號。{{《論語·泰伯》疏 案曰:堯典正義云:徧檢書傳無帝堯卽位之年,則此似非伏生大傳文,疑出書緯。}} 辯章百姓。{{見《毛詩·采菽》正義、《史記·五帝紀》索隱、《後漢書》注}} ...
0
votes
0answers
26 views

Refresh code indentation over a region

I have this: #!/usr/bin/bash while read f; do { #Try echo "$f" } || { # Catch printf "error" } done < "${1:-/dev/stdin}"; And I would like this in one ...
1
vote
0answers
51 views

How to highlight references of local functions and variables?

I want my local function names (those declared in the current file and picked by font-lock-function-name-face) and my variable names (font-lock-variable-name-face) to be highlighted across the whole ...
2
votes
1answer
30 views

Are comment style flags insufficient to separate SQL comments?

I am trying to understand why SQL mode accepts -* as a comment block start. In sql.el, I read: (defvar sql-mode-syntax-table (let ((table (make-syntax-table))) ;; C-style comments /**/ ... ...
1
vote
0answers
27 views

Why does sql-mode think -* starts a block comment?

While typing in a SQL mode buffer, I noticed that -* starts a block comment. Why? It happens whenever I type an asterisk/star character (ASCII 42) directly after a simple dash/hyphen/minus character (...
0
votes
1answer
36 views

org-babel for vimscript or most similar language

Since I couldn't find anything as per title, does anyone know what org-babel language could be used as workaround? Currently I surround code blocks with #+begin_src sh, though in particular the ...
6
votes
1answer
430 views

How to highlight graphql template literals (gql) in js(x) files?

Inside of a jsx file, I want to use a gql template literal to define GraphQL queries. Could I in emacs make that section of the jsx file highlight graphql syntax, instead of just showing it as a ...
4
votes
2answers
83 views

How to highlight the current scope with C family languages?

While it's possible to highlight a block using the character under the cursor, is there a way to highlight the scope of the current cursor? I'm interested in something like QtCreator's block-...
0
votes
1answer
36 views

Highlight some specific text in Emacs

I am using web-mode for my php files: http://web-mode.org/ And I call often a php function which looks like this: __lg('Some text here', 'Global', NULL, FALSE); This function can be call with only ...
0
votes
1answer
241 views

org-mode only highlights some source blocks, not all

I write my emacs configuration file in org mode, which works fine, only that org-mode does not highlight some source blocks. I set (setq org-src-fontify-natively t), but this only seems to take ...
1
vote
2answers
289 views

How to export babel source blocks with syntax highlighting to ODT in org-mode in Emacs 27?

In Emacs 27, babel source blocks do not export syntax highlighting to ODT format. The same org document is exported as expected in Emacs 25. Versions: GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-...
2
votes
1answer
95 views

ESS Syntax Highlighting for Negative Numbers?

I know how to set coloring for an interactive R session in ESS + Emacs for all numbers. Is there a way to drill down further and set different colors for negative numbers?
0
votes
0answers
17 views

how to disable multiline highlighting for org-emphasis?

Be default, org-emphasis can span across 2 lines (but not 3), e.g., the words "is an" is highlighted as bold in the following example: This *is an* example. I don't want that kind of highlighting, i....
0
votes
2answers
120 views

hl-line-mode interferes with custom syntax highlighting [duplicate]

Recently, using fic-mode as reference, I implemented a way for words like TODO, etc. to be highlighted. Here is the code: (defun todo/pos-in-doc-or-comment-region-p (pos) (memq (get-char-property ...
1
vote
0answers
23 views

Migrate Webstorm Code Highlighting

I am currently using Webstorm as my daily driver but I am trying to look into Emacs and possibly transition. One of the most important things to me that I have spent the last 3 years on was to ...
4
votes
3answers
2k views

Syntax highlight doxygen comments in C/C++? (c-doc-comment-style)

Is it possible to syntax highlight doxygen in C/C++ code? QtCreator and Vim both support basic highlighting so \param, \note... etc are highlighted differently.
1
vote
1answer
93 views

highlight-regexp groups for syntax highlighting

I want to highlight certain words to a color using highlight-regexp. The words I want to highlight are "fn", "let", "mut", etc. for rust development. The code I have so far is this: (add-hook '...
26
votes
2answers
2k views

Extending org-mode with more markups

I want to add a markup and formatting for such markup, i.e. <kbd>...</kbd> with a box surrounds such markup. I also want the mark up to be compatible with (setq org-hide-emphasis-markers t)...
6
votes
1answer
98 views

How to prevent emacs from fontifying empty part of the line?

As an example, if I start a one line comment: ;; Comment⏎ Emacs will fontify the the whole line, from the beginning of line, occupying the entire width of the window, as comment. This can be made ...
0
votes
0answers
33 views

Changing colors of text between two pre-specified markers

I am editing some TeX files, in emacs in which contains lots of text between @{ and @} markers. Is it possible to modify TeX's highlighting so that text between those brackets get colored in yellow, ...
1
vote
0answers
42 views

Syntax highlight strings in compilation-mode

Is it possible to activate syntax highlighting for strings in compilation mode? Sometimes the compilation error output of some C++ linter is quite unreadable. Lengthy types and function definitions ...
4
votes
1answer
1k views

Exporting highlighted source code to pdf in Org-Mode

I'm trying to export some python code with syntax highlighted to a pdf, from org-mode. Even though I can export to html without any issues I could not find a way to export it to pdf. n.b. I'm using ...
4
votes
1answer
562 views

org-mode batch export: Missing syntax highlighting

I'm having issues achieving any syntax highlighting in the results of the following command: emacs nix.org --batch -f org-html-export-to-html --kill I know this question has been asked a few times ...
1
vote
0answers
42 views

EMACS doesn't grey out comments

When I comment out code with combination of /* and */ in JavaScript nothing happens with text and it stays the same color. (You can see it in second part of code, one that is not grayed out but is ...
3
votes
1answer
46 views

How to re-enable syntax highlighting of code that have been disabled by #if preprocessor statements

Code between #if SYMBOL and #endif is greyed out in cc-mode if the SYMBOL has not been defined within the current file. The project that I´m currently working on has a common code base for Mac and ...
8
votes
2answers
444 views

How can I nest one syntax table in another?

I've written a simple mode for handling JSON. It uses the derived machinery to re-use most of json-mode's code. However one addition is you can insert elisp into the JSON text which is evaluated at ...
1
vote
0answers
212 views

Syntax highlighting not working in Emacs (in Python mode)

When I Python-mode I have noticed that occasionally my syntax highlighting is not working. I have noticed this when using the Cyberpunk theme as well as the Tango-Dark theme. Closing and reopening ...
0
votes
1answer
408 views

Dynamic syntax highlighting (font-lock-mode) stops working in emacs 25.3

About 15-20 minutes into using emacs my syntax highlighting stops dynamically updating. Instead any new text just uses the color of the text right before it. Any ideas on how to debug this issue or ...
5
votes
1answer
219 views

Highlight matching quotes

Is it possible to highlight matching quotes as show-paren-mode does with parentheses? The characters I'm looking to highlight are "dumb" quotes, both single (Unicode: apostrophe, U+0027) and double (...
0
votes
0answers
803 views

Export org-mode code blocks with minted style

I am trying to export org-mode source blocks to pdf via Latex and I use minted to get syntax highlighting. My org file looks like this: #+latex_header: \usepackage[utf8]{inputenc} %% For unicode ...
1
vote
0answers
85 views

Fix org-mode agenda highlighting

I'm having an issue with highlighting in Org agenda: Can't make the link and tags Gray when the item is marked as Done. I've tried to play with different properties of the font-lock definition, but ...
6
votes
2answers
2k views

Highlight current line without changing colours

I use (global-hl-line-mode 1) in order to highlight the current line. This changes the text colours of the highlighted line. Is it possible to highlight while keeping the current syntax highlighting ...
2
votes
1answer
56 views

Preventing syntax highlighting in the wrap-prefix

When Emacs wraps long lines, is there a way to prevent the wrap prefix from having syntax highlighting (font-lock) or any such special properties? Specifically, I have the following settings: ;; ...
0
votes
1answer
86 views

Search based fontification not working

In trying to learn Emacs Lisp on Emacs 25.3.1, I decided to implement a minimal version of fic-mode. Following is the code: (defun todo/pos-in-doc-or-comment-region-p (pos) (memq (get-char-property ...
0
votes
0answers
65 views

Auto highlighting text when paste a new content

This is my first post here. I have Emacs installed at work and at home. The functionality is slightly different when I use highlighting and I cannot figure out which options to change. At work, I ...
11
votes
2answers
4k views

How to get semantic syntax highlighting on emacs for C/C++ code

I'm new to emacs and programming in general so please bear with me. I'm trying to use emacs as my C/C++ IDE, and I noticed that in CC mode the variables/functions seemed to be highlighted only during ...