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.
787 questions
1 vote
0 answers
24 views
How to syntax highlight SQL placeholders like ":myParam" in PHP when I'm using nvim & Treesitter
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 ...
0 votes
1 answer
48 views
Loading a colorscheme in a white-on-black terminal results in various built-in highlight groups being cleared
(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 ...
1 vote
1 answer
110 views
`hi clear` in colorscheme unsetting certain LaTeX highlights
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 \...
2 votes
1 answer
89 views
synID() on treesitter highlighting
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 ...
1 vote
1 answer
78 views
Why are TypeScript files with shebang in nvim rendered in gray?
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 ...
0 votes
0 answers
83 views
How to ignore missing modules for pyright LSP in nvim-lspconfig?
I have this right now, local servers = { pyright = vim.tbl_deep_extend('force', default_settings, { settings = { python = { analysis = { ...
1 vote
1 answer
187 views
How to set a highlight group on the captured name of a tree-sitter node?
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/...
1 vote
2 answers
180 views
TeX syntax: is it possible to change from "stylish" to "non-stylish" after the file is loaded?
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,...