What's the deal with Deno? We talk with a major contributor to find out. Listen now.

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
0answers
36 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
189 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
37 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
886 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
59 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
401 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
40 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
109 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
44 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
43 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 ...
1
vote
1answer
106 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
82 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
2
votes
1answer
62 views

Highlight search phrase within quickfix window listing

One can change the search color of search terms with the Search highlight scheme. Similarly one can change the color of a line in the quickfix window with QuickFixLine. However, how does one change ...
2
votes
1answer
45 views

Rules for 2-tier recursive syntaxes

I have matched parentheses, but highlighting failed as it transcends up the recursion stack. I just need to know if there is a solution to tracking pairs of delimiters during Vim highlight syntax of ...
5
votes
1answer
361 views

How to make a syntax region stop on empty lines?

I would like to adapt this syntax file so that the formatting in VIM matches more closely what this online Markdown editor (GitLab-flavor) displays (the output on the right is relevant, this is how I ...
1
vote
1answer
32 views

Highlight region with keyword in it

I have this file Another comment program start end This is a comment Anything after end or before program must be highlighted as a Comment. I've battled with vim for hours, what am I doing wrong? ...
7
votes
2answers
1k views

Syntax highlighting is gone after :bufdo :e

I'm using console vim within a tmux window, therefore occasionally vim doesn't recognize that files have been modified (gvim does it on a focus change AFAIK) and in order to avoid getting inconsistent ...
0
votes
1answer
41 views

syntax match: redundant end of line marker “$”

I am looking to create a new syntax. This is what I have so far: syntax match jl_comment "^# .*" but I have noticed other examples using pattern like this: "^# .*$" Example: https://github.com/...
0
votes
0answers
471 views

ALE for golang-syntax checking is not working

I'm trying to build an environment for my vim to code golang. I've installed the Golang with the version 1.14 in the path of /usr/local/go. Also, I installed the vim-plugin ALE and vim-go. Here is ...
0
votes
0answers
136 views

vim 8: C++ syntax highlighting has some minor fault

I'm using vim 8 to code C++11. I've installed the vim plugins: YCM, ALE, vim-code-dark and vim-cpp-enhanced-highlight, however, it seems that there is some error on syntax highlighting. As you see, ...
1
vote
2answers
95 views

Match and highlight urls

I'm trying to make it so urls are highlighted and a shortcut can be used when the cursor is on top of one to open it in browser. Added this to a syntax file: syn match matchURL '/http[s]\?:\/\/[[:...
0
votes
0answers
260 views

Trouble sourcing YAML syntax highlighting

I'm doing some Ansible work (on RHEL 8), so I want the YAML configs for vim. I have a yaml.vim file containing the syntax/etc, and a ~/.vimrc file: autocmd BufNewFile,BufRead *.yaml,*.yml so ~/.vim/...
18
votes
5answers
6k views

Vim syntax pattern to highlight python keyword argument

I'm struggling with learning vim regexps (I don't know any other regexp very well either), so the main problem is to define regexp that would match some_function_call(simple_value, keyword=value) ...
1
vote
1answer
233 views

How to use code highlighting and checking in markdown?

In writing markdown files, I may use code blocks with ``` and `. Is there a way I can use code highlighting and checking on just the code blocks inside markdown files?
1
vote
2answers
123 views

Regex missing matching words

I am trying to add some custom highlighting to my Vim. But my regex matching is not working correctly. let ignoreHiInComments = '^\s*\(\/\/.*\)\@<!' "Ignore highlighting in C++ comments call ...
1
vote
1answer
43 views

How to get syntax highlighting for the embeded python within vimscript?

As title, how to get syntax highlighting for the embeded python within vimscript? Is there a plugin that does syntax highlighting for embeded script?
1
vote
2answers
85 views

why wont vi recognize html?

I recently launched a RHEL instance on an EC2 container. I got the apache web server to launch, now I'm trying to write some html in /var/www/html to get my website going. I open index.html in vi , ...
4
votes
0answers
57 views

How can I test and debug my syntax files?

I'm trying to make a syntax file for Raku. The major challenge I'm running into is that I have no automated means to test that my highlighting works as expected. I have to keep another tab open, ...
2
votes
0answers
77 views

Can't use special characters in listchars even if setting scriptencoding to utf-8

Here is my .vimrc file: set encoding=utf-8 scriptencoding utf-8 set list set listchars=tab:→· When I open vim, it will show an error message E474: Invalid argument: listchars=tab:→· My vim is Vi ...
4
votes
0answers
34 views

Is it possible to use syn match dynamically

I know that syn match can work with the regular expression to do some custom highlight settings. I'm thinking if it can work dynamically. For example, I'm doing a c++ project and I want to highlight ...
1
vote
1answer
68 views

Comment highlight group does not work without reloading .vimrc

The following line in my ~/.vimrc: hi Comment ctermfg=gray does not take effect unless I start Vim and then use :source to reload .vimrc. As far as I can tell, all of the other hi commands work ...
3
votes
2answers
600 views

Overriding highlighting style for one syntax

My colour scheme (morning) doesn't play nice with the quickfix window: I cannot read the selected item's location, because the foreground and background colours are the same. Because of this I want to ...
2
votes
1answer
76 views

Why does a custom 'contained' highlight match interfere with the C syntax highlighting?

I am having an issue, which I was able to reduce to the following sequence of commands: setf c syntax region templatyExpression matchgroup=Special start='{{' end='}}' syntax region templatyStatement ...
3
votes
1answer
117 views

Syntax highlight rule for a block comment using indentation

I have the following code and I want to define a syntax highlight rule that will show all lines as commented out starting at the line with ## till the indentation ends just before the last print line. ...
35
votes
3answers
11k views

Can Vim interpret terminal color escape codes?

Many CLI programs output nicely-highlighted text. While most of them check if the output is going to a file, some include the terminal escape codes. I like the output with the escape codes, but ...
2
votes
1answer
131 views

Syntax region only if at top of file

I have a syntax I'm trying do make. It's yaml embedded in markdown for use with Hugo. The yaml region is enclosed by --- and this must be at the top of the file. --- [yaml front matter stuff] . . . --...
1
vote
1answer
61 views

Vim syntax group not stopping

I recently upgraded to vim 8.2.0100 on Mac, and the markdown highlighting appears to have changed to be buggy. Here is an example: Normal syntax *Highlighting has started* Highlight continues ...
1
vote
0answers
96 views

Javascript syntax-highlight for JsDoc comments

I now use plugin vim-javascript just to have a nice syntax highlight for JsDoc comments in my Javascript files. vim-javascript provides nice colors highlight but it conflict with all parentheses ...
1
vote
3answers
170 views

Syntax highlighting with multiple matches with `\zs`

The string that I have is this aaabbbb. aaa must become red, bbbb must become blue. I tried this: " here xB is not matched syntax match xA /^a\+/ syntax match xB /^a\+\zsb\+/ highlight xA ctermfg=...
1
vote
1answer
130 views

Concealment causes color highlighting to not apply

Following my previous question, I have the same string aaabbbb that I am colorizing in the same way, except with the addition that I am now also trying to conceal the as. Here is the best that I got ...
3
votes
1answer
136 views

Can't get textwidth for syntax highlighting working

I have a bunch of (spagetti) fortran code that is in fixed form, but without the line length restrictions. As such, it gets some odd highlighting: I've tried 3 different ways to get it to highlight ...
1
vote
1answer
200 views

Syntax folder under plugin/foo/syntax/foo.vim not automatically applied when filetype change?

I have a plugin under nvim/plugin/foo, but the syntax file nvim/plugin/foo/syntax/foo.vim is not automatically applied when the filetype change, but if I put it under nvim/syntax/foo.vim it works I'...
3
votes
1answer
170 views

Highlight syntax in start and end delimiters of region

I'm not sure I'm using the right tool for the job here, but I'm trying to embed Lua syntax highlighting inside a block syntax. The only way I can make this work is with a syn region. I can find the ...
6
votes
2answers
2k views

Why my vim doesn't support hex color code?

When I use the following command to set the color of my vim, :highlight Error ctermfg=#00afff it prompts E421: Color name or number not recognized: ctermfg=#00afff
2
votes
1answer
236 views

Syntax highlighting for objdump output

Currently I am working a lot with objdump output (arm / thumb instructions): The command (arm-none-eabi-objdump -h -S main.elf > main.lst) creates a mixture of assembly (with addresses and hex ...
1
vote
0answers
33 views

How to correctly add syntax highlighting to all c typedef [duplicate]

I saw that it's possible to manually add types to highlight, according to this post: https://stackoverflow.com/questions/20149478/how-can-i-teach-vim-about-additional-c-language-types-for-syntax-...
1
vote
2answers
96 views

vim highlighting doesn't set the right type for a new filetype

This is what I have in my /usr/share/vim/vim80/filetype.vim (the only mention of messages in the file) : " Messages (logs mostly) au BufNewFile,BufRead */logs/couchdb/{,.log}{,.[0-9]*,-[0-9]*} setf ...
1
vote
2answers
134 views

How to set LaTeX syntax to “ConTeXt” in vimrc

TL;DR: How do I permanently and persistently :set syntax=context for *.tex files? I've been using vim for a LaTeX project, with monokai-tasty as the colour scheme. The default syntax highlighting ...

1
2
3 4 5
9