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
2
votes
2answers
261 views

Vim syntax partial match

I'm trying to match a new line character on a Vim syntax file, I can make it work when I use the patern within Vim but when I put it in my syntax file it doesn't highlight when I have a new line and ...
2
votes
0answers
47 views

How to make certain conceal symbols get highlighted differently than others?

I’ve recently tried to make my python more readable using the conceal functionality. So now I went from this to this . Now what really bugs me here is that ƒ, ¶,the ¥ sign, the ℤ and 𝕊 symbols and ...
4
votes
1answer
46 views

Syntax coloring is inaccurate for HTML files with CSS code in it

As you can see in the following screencast, when I open an HTML file with some CSS in it, there's some part of the file which does not show syntax coloring. Do you have experience of this? Is it ...
1
vote
1answer
87 views

syn-keyword with control characters?

(I know the goals are dumb, and I know I could set ffs=unix,dos to not see ^M; I'm just trying to understand more about vim). I was playing around with vim keywords, because I want to conceal certain ...
3
votes
1answer
157 views

First new line in multi-line vim commands has broken highlighting

In my init.vim I have the following command: nnoremap <Leader>s :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") \ . "> fg<&...
3
votes
1answer
174 views

Are opening and closing double quotes expected to be of different color in a bash script?

I've just noticed, after years using Vim, that the two double quote characters opening and closing a string in a bash script have different colors, which I can verify by simply writing var="var&...
2
votes
1answer
115 views

How can I have jinja2 indentation and syntax when keeping HTML filetype?

I have emmet installed and some more plugins that are usable on html filetypes, I would like to have syntax highlighting and have indentation for jinja2 while keeping the filetype HTML so my HTML ...
4
votes
1answer
55 views

How to get syntactic coloration for dist files

There is a standard for providing files that may have an unversioned counterpart. That standard consists in suffixing the filename with .dist, so for example phpunit.xml becomes phpunit.xml.dist. How ...
1
vote
1answer
142 views

Vim custom syntax highlighting: highlight “word=value” without spaces in between

I've asked this question on StackOverflow and they suggested to ask it here. I am trying to set a custom syntax highlighting for BSD rc.conf file which looks like: name=YES anothername=NO third="...
0
votes
1answer
63 views

Highlighting color strings with correspondent color

When tweaking color themes, one thing I really miss is a highlighting that would color the color strings with the corresponding color. Maybe this sounds confusing? An example: here is a fragment of a ...
3
votes
1answer
561 views

Conceal markdown links and extensions

I wish to fully conceal markdown links, even if they have extensions. For example: [Anchor text](http://whatever...) [Anchor text](http://whatever...){:rel="nofollow noopener noreferrer" ...
0
votes
1answer
47 views

Reloading syntax on vimrc change

My vimrc has a function that extends the default-provided syntax for C: function! Bx_c_syntax() "{{{ "A faked version of the real thing let b:match_words= \ '\<...
0
votes
2answers
439 views

How to Keep Syntax Color but Disable Highlighting in Vim?

I recently activated auto-complete using YouCompleteMe and syntax color in Vim. However, a red highlighting color appeared. I tried to disable syntax color with syntax off, but this highlighting ...
1
vote
1answer
947 views

Changing colour of pop-up coc.nvim lint warning in custom colourscheme

I'm using the colorscheme monokai and coc.nvim with pylint to lint Python code in Vim (terminal, not GUI, in terminal.app on macOS which I'm pretty sure has 256 colours). The linting pops up on a ...
-1
votes
1answer
245 views

How to overwrite the conceal background color with line color?

I've started using coc for NeoVim and I've setup a highlight for a line with error using the following: hi CocErrorLine guibg=#ce2c28 However, when the error line has a concealed character, it has a ...
2
votes
0answers
19 views

custom syntax highlight doesn't match in parentheses

In a custom java syntax file (${HOME}/.vim/syntax/java.vim) I wrote syntax match CommonVar /ret/ highlight CommonVar cterm=bold with the intention display the word ret in bold. I tested it with this ...
1
vote
0answers
15 views

Doxygen LaTeX syntax

I am using doxygen to document my code and I like to have additional markdown files which include formulas by using \f$ Formula \f$. I know markdown syntax provided by the vim-markdown plugin supports ...
3
votes
1answer
96 views

How to re-enable syntax highlighting in Vim?

Vim language highlighting has quit working only for one specific file. I've been using Vim in WSL (Ubuntu) for several months now without problems. My PC is Windows 10 Professional. Strangely, Vim is ...
0
votes
0answers
223 views

Can't get custom syntax highlight to work

I can't get custom syntax highlight of the LaTeX \footnote command to work. I'm using nvim 0.4.3 through VimR. I put the following in ./.vim/after/syntax/tex.vim (Edit: my runtimepath is ./.vim/ ...
0
votes
0answers
29 views

Syntax profile close to dosini but with extra highlighting between quotes

Unfortunately I've to work with a custom and weird file format every day. To make my life in Vim easier, I've tried several syntax settings and 'dosini' comes very close. However, the text in between ...
2
votes
2answers
353 views

Shell syntax highlighting

I've noticed in bash/shell it highlights $(...) in red, for example: However, if I change the syntax from ft=sh to ft=bash, it does not do this: What's the reason for this? Am I doing something ...
4
votes
1answer
152 views

How to get highlighting group set by spell check

How do I get the highlighting group of a text when the group is defined by the command :spell? For example when a word is misspelled I want to get the highlighting group SpellBad. We have a question ...
1
vote
1answer
31 views

The line `eval local value=\“\${WORLD_$2[$1]}\”` breaks BASH syntax highlighting by inverting quote contents

So I have a BASH script I'm modifying and I've been noticing large blocks of script with broken syntax highlighting. They appear as though I have an unpaired double quote somewhere, despite all quotes ...
0
votes
0answers
27 views

How can I display text differently from how it is actually stored?

I am making a custom syntax partially based on Markdown. I want to display links differently from how they are stored in the file. For example, [About me](about.md) in the file should be displayed as ...
2
votes
2answers
124 views

Highlight Multiple Lines of Comments

I'm on Ubuntu 18.04, vim-gtk3 8.0. I'm trying to get gvim to highlight multiple lines of comment that starts with a particular word. For example, consider the word 'NOTE': // NOTE(Ryan): This would be ...
0
votes
1answer
267 views

Highlight Particular Words Within Comments

I'm on Ubuntu 18.04, vim-gtk3 8.0. I'm trying to get gvim to highlight particular words within a comment. For example, take the word 'NOTE'. In a '.c' file: // NOTE(Ryan): ... and a '.sh' file: # ...
3
votes
0answers
26 views

`local foo=\'` script syntax highlighting error? (slash tick)

Opening vi on a script file containing local varname=\' or local varname=$' seems to mess up the highlighting colors following the tick. Is there a way to avoid this? Here is a simplified example ...
1
vote
0answers
74 views

Conceal with the highlighting of matching begin/end latex environment

I want to use vim conceal feature with the highlighting of matching begin/end latex environment (vimtex plugin). When I use the following code syn match texStatement '\\begin{itemize}' contained ...
1
vote
1answer
151 views

Fortran Syntax Highlighting detecting apostrophes as Strings

I am using VIM 7.4 with syntax highlighting on some Fortran77 source code. One comment has a single apostrophe that never is repeated/closed (eg * Bert's bees), causing the remaining source code to ...
1
vote
1answer
90 views

undercurl not visible to me in gvim on WIndows 10

I like to use undercurl to highlight spelling mistakes in Vim. I believe it does this by default. This works fine in MacOS and Linux but it isn't visible for gvim on Windows 10. Originally, I ...
0
votes
0answers
73 views

vimscript: Efficient way to extract portion from line of text

I have a plugin that does syntax highlighting and folding for a kind of data file. The syntax and folding are both dependent on textual values in specific places (columns) of current line of text. ...
1
vote
0answers
16 views

Design guideline for doing both autocompletion and highlighting?

For Vim, are there any design guidelines for simultaneously doing autocompletion and syntax highlighting? For the NFTABLES command line (and file) syntaxes, I see lots of recurring but partial syntax ...
0
votes
2answers
955 views

neovim syntax highlight with large files issue

I use neovim 0.4.3. When I open a large xml file (about 130-140k lines) syntax highlighting switches off with a message: 'redrawtime' exceeded, syntax highlighting disabled If add this line to my ...
3
votes
1answer
224 views

Unwanted highlights on page scroll

I have a pretty similar problem as in this issue with some exceptions. Basically, after I scroll page down or up Ctrl+d / Ctrl+u all non-empty lines get highlight from the end of the line to the ...
0
votes
1answer
49 views

Simplest way to add in a syntax rule

I would like to add in the following rule to my syntax to help with python files: :syn match pythonBoolean "\<self\ze\." :hi pythonBoolean cterm=bold It works when I type it in directly to the ...
0
votes
1answer
676 views

Set color of Comment only using .vimrc

I am using some preset colorthemes, but it seems that the types Identifier and Comment always use the same color -- which makes my .asm files basically just one color. I tried to change the color of ...
2
votes
0answers
43 views

Concealing \begin and \end lines in latex with MathZone

I'm trying to get the lines that have \begin{equation} and \end{equation} to be concealed. I've tried using call matchadd('Conceal','\\begin{equation\*}', 10,13,{'conceal':' '}) and it works, but it ...
2
votes
1answer
322 views

How to match this syntax group?

I'm trying to improve on the MySQL syntax highlighting, for my particular code base. I have a lot of this sort of thing FROM TBL_ENTITIES E JOIN TBL_RELATED_ENTITIES RE ON RE.entityFK = E....
2
votes
0answers
272 views

Is there a way to get improved MySQL syntax highlighting over what vim offers out of the box?

Having spent a bit of time sorting out my colorscheme for my php files, I'd now like to "prettify" my sql. (I blame lockdown). My sql is spread liberally through my php files, but I've noticed the ...
2
votes
2answers
332 views

Is it possible to make “???” a keyword that can be highlighted?

Is it possible to make ??? (3 question marks) a keyword, and highlight it? I have tried the following in a syntax file. Other strings on the line are highlighted, but not ???. \?\?\? does not work ...
2
votes
1answer
156 views

How to setup vim-clojure-highlight to work?

I've been trying to setup my Clojure dev environment with Vim, note that I'm still very new to vim but I've managed to know the basics. I've installed pathogen which has helped me get a bunch of ...
3
votes
1answer
104 views

Vim thinks Python @ operator is decorator

Python3 has the matrix multiplication operator (@) which is used to multiply numpy matrices. But when we write something like A = B @ C in vim, the @ C portion gets highlighted. Apparently Python has ...
5
votes
2answers
3k views

How to avoid “Avoid E173 (n more file(s) to edit)?”

So, when I open multiple files, but don't visit the all of them (or the last one), and I try to :quit neovim yells at me that I have to edit those files. No I don't! Stop giving me this error : ) It ...
2
votes
2answers
74 views

Is there a simple way to remove a single keyword from a syntax group (or otherwise override it in a match)?

I occasionally like to tinker with syntax files (especially conceals; I use λ for anonymous functions (lambda:, fn) in several languages). However, one complaint with conceal is that I can only use a ...
1
vote
2answers
61 views

common /after/syntax for different file types

I want some common syntax highlighting for various filetypes. Currently I have runtimepath/after/syntax/base.vim which has syntax rules I want and then I created mklink (this is windows) to base.vim ...

1 2
3
4 5
12