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
1answer
336 views

ruby syntax highlighting lost on long files

With a "long" ruby file (896 lines in my case) the ruby syntax highlighting is lost when I G to the bottom of the file. Once that happens and I go back to the top with gg, the syntax highlighting ...
0
votes
0answers
13 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 ...
18
votes
4answers
8k views

How do I prevent vim from hiding symbols in markdown and json?

This drives me crazy, I do :set ft=text To see something, otherwise all the links disappear in markdown and quotes in JSON. How do disable this once and for all?
2
votes
0answers
13 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
12 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
40 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 ...
10
votes
1answer
1k views

How can I highlight matching “%” names (e.g. if/end, for/end) defined by matchit.vim on selection?

Currently my Vim highlights matching parentheses, brackets, quotes, etc. with Cyan background and white foreground -- the cursor can be moved between these with %. Thanks to my matchit.vim, I can also ...
0
votes
0answers
12 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 ...
0
votes
0answers
25 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/ ...
2
votes
2answers
57 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 ...
0
votes
1answer
134 views

Vim syntax line matching mechanism

Can someone explain or link to valid explanation information on the syntax highlighting mechanism. In particular I am having having a hard time understanding how rules are applied. Imagine the ...
3
votes
1answer
64 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 ...
3
votes
0answers
24 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
1answer
24 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 ...
1
vote
1answer
59 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 ...
2
votes
2answers
46 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
0answers
22 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 ...
0
votes
0answers
9 views

Conceal but using a variable string that comes from a function

Vim has a conceal functionality that allows, for example, Markdown links [link-text](link-url) to be concealed as link-text. I'm trying to make the value of link-text come from a function instead. For ...
0
votes
1answer
50 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: # ...
1
vote
0answers
25 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
32 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 ...
1
vote
2answers
642 views

VIM How to enable .ts .tsx .js (for front-end) code highlight?

I have .vimrc plugins " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim' Plugin 'nanotech/jellybeans.vim' " ...
0
votes
0answers
14 views

Making language-specific markdown code blocks more distinguishable from normal text in conceal mode

I'm playing with markdown concealing mode provided by plasticboy/vim-markdown. But I found a problem with language-specific fenced code blocks which, if they're small so there's almost no highlighting ...
3
votes
1answer
147 views

How can I change Javascript syntax to higlight objects?

I am trying to emulate the Atom JavaScript syntax highlighting in vim, but there are a few things missing. Namely, I'd like to highlight objects and their chains in red. It'd be dandy if I could ...
0
votes
0answers
34 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. ...
2
votes
1answer
75 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 ...
1
vote
1answer
54 views

Concealing the code for `braket` package for LaTeX with vimtex + `tex-conceal`

I am using vimtex with latexmk and using conceal setting provided by vim and extending it with an additional plug-in : KeitaNakamura/tex-conceal.vim. Additionally, I use a package braket to encode \...
1
vote
0answers
14 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 ...
1
vote
2answers
106 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 ...
1
vote
1answer
20 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
23 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
0answers
15 views

Stylizing a string that contains a regular expression

In textmate (and I assume every other editor), it has a nice feature where it colorizes a regular expression inside a string (r-string in python). For example here is how it looks in Texmate: Is ...
0
votes
1answer
27 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
33 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
139 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
30 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 ...
5
votes
3answers
872 views

Improve performance of syntax highlighting in Vim

I have some C++ sources files which are in a few mega-bytes (a few tens thousands lines) to view and edit. The performance looks really bad in Vim. Refersh (<C-l>) or input single char in insert ...
2
votes
2answers
55 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
180 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 ...
3
votes
0answers
38 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 ...
1
vote
1answer
49 views

vim hangs when I open a typescript file

I have a vim 8.2 on a Gentoo Linux running on a more or less 8 years old PC. I almost never have a performance issue with vim, unless you open a one-line huge xml oder json file, but those are vary ...
2
votes
1answer
43 views

How can I change the syntax highlighting for currently highlighted search item?

When I search for something with / I get a series of finds, and as I press n for next, it highlights the next one. I always think I'm on the wrong one. Maybe my eyes see green and red, and they think ...
0
votes
0answers
39 views

Only default syntax highlighting works

I'm using nVim v0.4.3 I can't seem to get anything but the default syntax highlighting working. (I'm especially trying to get yats typescript syntax highlighting working) I've tried disabling every ...
0
votes
1answer
114 views

Fold: Different highlight style for fold of each filetype

Extend of this question of fold: Fold: foldtext() for each filetype We have fold for each filetype now but each fold need different highlight style of color, because highlight is global I tried to ...
5
votes
1answer
275 views

Interactive syntax-highligting: highlight the current region only

Often enough a text file is structured as a collection of blocks or cells of some kind. E.g., slides in a Tex Beamer presentation, bibtex items, function definitions, etc. I wonder if vim can ...
1
vote
1answer
64 views

Syntax highlighting for fish script not working

I have both Vim version 8.1.1550 and NVIM v0.4.3 on MacOS 10.14.6 I wrote the following lines in my .vimrc file as recommended enter link description here set nocompatible filetype off set rtp+=~/....
2
votes
1answer
31 views

Any reason why one should avoid to force the linking of highlight groups in syntax files?

tl;dr Are there any undesirable side-effects connected to the use of :highlight! default link {from-group} {to-group} as compared to :highlight default … that I should be aware of when editing/...
0
votes
1answer
88 views

Installing a Vim package. syntax highlighting does not turn on

I want to use the nuweb.vim extension for syntax highlighting nuweb files. Long story short, nuweb files are basically a super-set of latex files. There is added syntax and markers to embed code-...
0
votes
1answer
66 views

List of Vimscript comment keyword highlights

While editing my vimrc I noticed that some keywords get highlighted at the beginning of lines, like Note: and Reminder:. I tried to find this syntax group in the vim.vim syntax file, but to no avail. ...
2
votes
0answers
23 views

1
2 3 4 5
9