Skip to main content

Questions tagged [syntax-highlighting]

Syntax highlighting is the use of colours, size, typeface, or other attributes to visually indicate it has a special meaning and therefore make it easier to understand the text. For example, marking language keywords with a specific colour.

Filter by
Sorted by
Tagged with
1 vote
0 answers
24 views

I'm using treesitter inside neovim, for all of the awesome reasons we already know. My (legacy) code has a lot of SQL statements in PHP strings. Using TS I've got it to recognise SQL inside PHP ...
Codemonkey's user avatar
0 votes
1 answer
48 views

(This is a second attempt at solving the underlying problem from `hi clear` in colorscheme unsetting certain LaTeX highlights, posted in response to comments made under Maxim Kim's answer.) I am using ...
jwodder's user avatar
  • 179
1 vote
1 answer
109 views

I am using Vim 9.1.1800, installed via Homebrew on macOS Sonoma 14.7.8. Currently, when I open the following minimal *.tex document in Vim: \documentclass{article} \begin{document} \textbf{Bold} and \...
jwodder's user avatar
  • 179
2 votes
1 answer
88 views

My script includes synID() but does not work on a help file after nvim 0.10.0. It is because nvim starts to use treesitter highlighting and does not set the syntax option. Is there any alternative ...
Rick Howe's user avatar
  • 423
1 vote
1 answer
78 views

I have installed the up-to-date tree-sitter-typescript, and it works well in typescript files without shebang. I searched online but couldn't find any particularly similar questions. Some people ...
WeariTraveller's user avatar
0 votes
0 answers
83 views

I have this right now, local servers = { pyright = vim.tbl_deep_extend('force', default_settings, { settings = { python = { analysis = { ...
six's user avatar
  • 1
1 vote
1 answer
187 views

I'm using nvim v0.11.1 with nvim-treesittter. I often edit Python code with strings containing SQL, and I would like to apply highlighting on the SQL strings. I've created a file ~/.config/nvim/...
David Froger's user avatar
1 vote
2 answers
180 views

When editing a .tex file, is it possible to change the syntax highlighting after a file is loaded so that @ is able to be recognized as part of a command? Normally, this is done at load-time when .sty,...
karlh's user avatar
  • 435
0 votes
1 answer
91 views

I have set several commands in my .vimrc file, all of which work besides: :hi MatchParen cterm=none ctermbg=white ctermfg=red My other commands are: :colorscheme wildcharm ...
defoacspro's user avatar
2 votes
1 answer
129 views

I want to stop Vim from spell checking inside LaTeX comments. In my .vimrc I have the line: syntax match Comment /%/ contains=@NoSpell It does not work, but if I reload .vimrc with :so ~/.vimrc it ...
Daniel's user avatar
  • 107
0 votes
1 answer
165 views

I am looking to color the parentheses in Python and other languages and the the tags in HTML. But the thing is, I want the parentheses at different levels to be colored differently. Basically, I am ...
Guest User's user avatar
2 votes
2 answers
137 views

I recently updated zsh and homebrew, and cannot determine where the error arose. When I launch vim, I see the usual syntax highlighting like this: The moment I interact with vim in any way (cursor ...
kipawaa's user avatar
  • 93
0 votes
0 answers
31 views

I was using this method for highlighting invalid pattern of variable names: hi link variable_name Variable syntax match variable_name "\v[A-Za-z][A-Za-z0-9]{0,15}" skipwhite contained \ ...
John Greene's user avatar
0 votes
1 answer
65 views

I stumbled across this amazing colorscheme (I wish I knew where to find it): screenshot I recreated the python file shown and I noticed that that colorscheme has several more syntactical elements ...
javadude's user avatar
-1 votes
1 answer
79 views

This question is about Tree theory and the handling of such tree concept used by Vim syntax/highlighting in a typical syntax/mylanguage.vim. Is it true, for Vim, that exactly one path is ONLY ...
John Greene's user avatar
0 votes
2 answers
103 views

Working on a new syntax file for nftables (here). If a syntax file has introduced (oh, let us) say about 50 more unique colors via highlight (and highlight link) statements, where should these many ...
John Greene's user avatar
1 vote
1 answer
89 views

I'm trying to use Vim with ASIP Designer and read files written in nML, a description language for processor designs. I searched Google and the community with the tag "nML" but saw no ...
Yike Li's user avatar
  • 13
0 votes
1 answer
361 views

When I format text either as a Markdown code span or Markdown code block, using backticks, like ``` code block ``` `code span` then Vim highlights only the backticks, not the text inside. For me it ...
decision-making-mike's user avatar
1 vote
1 answer
150 views

I'm trying to set up a minimal Vim configuration, and want to highlight all instances of the words FOO and BAR inside all *cpp files. My .vimrc: syntax enable source config/highlights.vim Inside ...
user54579's user avatar
1 vote
1 answer
30 views

I have some javascript files with hard coded base64 strings, and there is horrible lag between cursor commands. When I did a syntime report, I am seeing: 3.553307000 589 38 0.196905000 0....
patrick's user avatar
  • 113
0 votes
0 answers
36 views

I've tried to create syntax file for C code generated via Perl's Template::Toolkit 2, using same sourcing like as in tt2html.vim - just changed html.vim to c.vim (those are all in standard ...
Vadim Goncharov's user avatar
1 vote
0 answers
50 views

I'm having trouble getting good syntax highlighting for typescript files. The issue is that reserved words are highlighted as Error: Looking at :scriptnames I see the default typescript highlighting ...
Erik Hesselink's user avatar
1 vote
0 answers
44 views

I'm trying to resolve https://github.com/chr4/nginx.vim/issues/24, where Lua code embedded inside Nginx config is highlighted incorrectly: I've managed to trim down the highlighting code to a minimal ...
iBug's user avatar
  • 307
0 votes
0 answers
75 views

When opening a file whose filetype extension is governed by ftdetect, i wish to write a single-line to the vim status bar (bottom line) that says something like: To enable syntax highlighting for this ...
John Greene's user avatar
0 votes
3 answers
143 views

I've got a EBNF that needs to be Vim-syntaxed: header :== 'header' ( '{' 'header1' ( '{ 'header2' nest_3? 'trailer2' '}' )? 'trailer1' '}' )? 'trailer' Railroad diagram gets me: And I'm struggling ...
John Greene's user avatar

1
2 3 4 5
16