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
0
votes
0answers
13 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
23 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
38 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
34 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/...
1
vote
1answer
75 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
54 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
26 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?
3
votes
0answers
38 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, ...
0
votes
2answers
83 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 , ...
0
votes
1answer
30 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/...
4
votes
0answers
26 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
43 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 ...
2
votes
1answer
68 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
45 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. ...
2
votes
1answer
118 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
21 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
39 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
1answer
64 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 ...
1
vote
3answers
82 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=...
3
votes
1answer
59 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 ...
3
votes
1answer
73 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 ...
2
votes
0answers
56 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 ...
5
votes
2answers
1k 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
90 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
25 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
1answer
46 views

Highlight setext-style (asciidoctor/markdown) headers

Following naive snippet highlights such headers: syn match asciidoctorH1 "^\_s*\n\a.*\n====*" syn match asciidoctorH2 "^\_s*\n\a.*\n----*" hi link asciidoctorH1 Title hi link asciidoctorH2 Title ...
4
votes
1answer
116 views

Vim highlighting random indentations

As seen from the image, Vim decides to highlight those indentations for no reason. I've tried :noh and :set nolist (:set list seems to make it go away, but I don't want indentation marks) from a ...
1
vote
2answers
70 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 ...
0
votes
0answers
21 views

In GVim, preven ALE from changing syntax color, but still underlines errors

I am using gVim and Asynchronous Lint Engine (ALE) for linting Python scripts. I was capable to fully customize my own Python syntax highlighting, with one exception. I can't find a way to prevent ...
1
vote
1answer
28 views

Highlighting comments to EOL (terminal EOL, not buffer EOL)

One of my filetypes has a special comment format that has a background color, and it would be useful if I could extend the highlighting to extend that background to the terminal width, rather than ...
1
vote
2answers
124 views

How to force overwriting ALL syntax highlighting in Vim?

Recently, I have tried to create my own colorscheme in only one color and no text decoration. That means Normal, Comment, ToolbarLine, Tooltip... are the same; Visual, Cursor... are reversed, of ...
2
votes
0answers
98 views

How to fix this `Omni completion (^O^N^P) Pattern not found` error?

I am trying to set up syntax keyword based omnicompletion in vim. I have defined a few syntax keyword Constants in ~/.config/nvim/syntax/spl.vim They are correctly detected and highlighted. They are ...
1
vote
0answers
55 views

vim doesn't load syntax for a single file

I was toying around with my .vimrc editing it, and then checking in another file whether my changes worked or not. But now I ended up in a state where opening one file with vim file1.tex (this was ...
1
vote
0answers
37 views

How to make code-folding more efficient

I have a ruby file while is about 5K+ lines long. My current setup uses the vim-ruby plugin. With this, I enable code folding with let ruby_fold = 1 This opens my ruby files pre-folded. I can open ...
0
votes
0answers
26 views

Getting conflict when setting ft=txtfmt

I installed The Vim Highlighter plugin by Brett Stahlman. The plugin requires setting filetype=txtfmt. I set the option using :set ft=txtfmt but got conflicts like Level 1 map ambiguity:[bf already ...
2
votes
1answer
213 views

Efficient Syntax Highlighting

I am using VIM as a note taking application and have created syntax highlighting to assist with readability. See below or the repo for all the files. syntax match Timestamp /^\d\d:\d\d \d\d[/]\d\d[/]...
1
vote
0answers
62 views

Neovim highlight syntax region inside typescript tagged template literal

I am having trouble fixing a syntax plugin for Vim. I've found a bug in a plugin that has not been touched in a fair amount of time. I want to address it myself but I believe I am lacking in a lot of ...
2
votes
1answer
128 views

I can't escape square brackets for syntax matching

I have the following code in my ini.vim: augroup HiParens autocmd! autocmd Syntax c :syn match Parens /[(){}]/ autocmd Syntax c :syn match Bracks /[\[\]]/ augroup End And highlighting is ...
2
votes
0answers
33 views

How to set syntax keywords dynamically

I'm trying to highlight the keywords for my c++ project. So what I've done is to create a file here: ~/.vim/after/syntax/cpp.vim and put some custom configuration into it. For example, putting the ...
1
vote
2answers
436 views

How to highlight class name of c++

I'm trying to configure the highlight to highlight keywords of my C++ project. Here is the content of ~/.vim/syntax/cpp.vim: syn match cCustomParen "?=(" contains=cParen,cCppParen syn match ...
1
vote
2answers
68 views

Toggle between two most recent syntax highlighting settings

I often nest one programming language within another (e.g. HTML inside python). This can be done per-language, and written items in ~/.vim/after/syntax/ for that purpose, but I don't have the patience ...
1
vote
0answers
55 views

vim syntax highlight [closed]

Syntax highlighting just stopped working on my mac (v 10.14.6). I've been trying to get it back over the past 2 days with no success. I have neovim (v 0.3.8) and when I use :syntax, the command line ...
1
vote
0answers
45 views

Syntax highlighting shows a yellow bar on Windows 10

Good afternoon, I just started using the Ubuntu shell from Windows 10, and I copied my Mac .vimrc file. Everything seemed normal until these yellow bars started showing up at the end of some lines. ...
3
votes
1answer
212 views

Syntax-highlighting is getting screwed when loading long markdown files on Windows

Note: this may be a Windows-only problem. The symptom has been reproduced on multiple Windows 10 machines. I find my syntax-highlighting for Markdown files (ending in .md) will fail to rander when ...
2
votes
1answer
67 views

Different syntax highlighting in the same file for different languages

Is there a way to use more than one syntax highlighting schemes in one file? Specifically, I'm interested in having part of a LaTeX code highlighted according to my python syntax highlighting rules:...
1
vote
1answer
53 views

How to make vim syntax files look nice? [duplicate]

I often get really long lines, such as: syntax region SomeName start=/some_pattern/ end=/some other pattern/ contained contains=SomeOtherName,YetAnotherName,EvenMoreNames,More,MoreAgain,KeepsGoing,...
2
votes
1answer
40 views

Vim syntax match changes based on function type name keyword

I've written a C code syntax rule to highlight function names in function definitions as such: This is the syntax rule written in ~/.vim/syntax/c.vim: syntax match cCustomFunc /\w\+\s\+\zs\w\+(/he=e-...
1
vote
1answer
41 views

Mapping between Vim syntax highlighting and Emacs font-lock [duplicate]

I try to harmonize the colors of my Vim and Emacs. But I am not sure how to map some Emacs faces to Vim. Emacs distinguishes between keyword and builtin. In shell mode if and case are of the type ...
3
votes
1answer
217 views

Syntax highlighting region messed up by matching parentheses

For a new filetype, I was trying to make block comments in the syntax highlighting but they kept disappearing while I was moving around. I have managed to reduce it to the following. First, in the ...
1
vote
2answers
112 views

Linking a filetype to a syntax file of a different name

I’ve created a new filetype, “usenet,” for Usenet messages. I would like files with this filetype to be highlighted exactly as if they had the “mail” filetype. Is it possible to tell Vim that I want ...

1
2 3 4 5
8