Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Syntax highlighting is changing the colours, size, typeface, or other text attributes to visually indicate it has a special meaning.

0
votes
1answer
30 views

How to apply a custom highlight file?

I'm playing with Vim highlight, so I made the following (syntax.vim): hi Comment ctermfg=DarkGray hi LineNR ctermfg=DarkGray hi CursorLineNR ctermfg=Red hi String ctermfg=Gray hi PreProc ctermfg=...
0
votes
1answer
33 views

How to change Operator highlight color in Vim?

I just switched to iTerm2 on macOS and found some of its options go to Vim as well. That's the case for fonts, I was able to select a Vim font that I like from iTerm options. It seems iTerm color ...
0
votes
0answers
19 views

tex.vim and syntax highlighting problem

I am having some trouble with the default syntax highlighting for .tex files. I am using the elflord color scheme, and whenever I use a \textit{} environment, the text between the braces is ...
1
vote
1answer
28 views

Avoid highlighting defined by 'matchadd' in comments

I want the piece of text std::string to be highlighted in vim according to the style defined in 'Type'. I can do that with :call matchadd('Type','std::string') It works. However, std::string is also ...
0
votes
0answers
24 views

Change color of character covered by cursor

I'm using xfce4-terminal and the cursor is green, which means that green text behind the cursor is not visible or is hard to see. Is there a way to force the etext behind the cursor to be some ...
0
votes
0answers
29 views

Why doesn't the `syntax match` command work when called from my .vimrc?

Suppose I want to show all instances of "epsilon" with "ε". So I make a .vimrc file with the following code set conceallevel=2 syntax match Entity "epsilon" conceal cchar=ε Unfortunately, this doesn'...
0
votes
0answers
22 views

Some words from ctags file are recognized but not highligted

How can I make vim highlight them? I have found that if i remove the white space between \^ and $/;" they do get highlighted. So words from lines on this form /^ void someFunction(int integer){$/;" ...
1
vote
1answer
39 views

vim word boundaries in syntax files

I have a syntax file with the following definitions: syn keyword pythonBuiltinFunc __import__ abs all any \ bin bool bytearray ...
1
vote
1answer
28 views

How to get 50 char long warning color highlight in vim gitcommit message without fugitive

I'm using vim-fugitive. However, I'm using a black and white colorscheme. So, I don't see any warning for the 50 char long subject line of git commit message. I want to know how I can add a highlight ...
0
votes
0answers
21 views

Fold on second line of a region possible?

I have the following snippet of lines output from a test program: [FATAL] No member name supplied Org::Members: 144 Org::Members::...
5
votes
2answers
104 views

How to copy text with syntax highlighting?

Want a simple way, like notepad++ plugin: NppExport - Export to RTF, to copy selected text with syntax highlighting. Notepad++, NppExport, Export to RTF example: Select text Copy RTF Paste ...
1
vote
0answers
15 views

Syntax - Match word based on a previous match

I want to highlight all words that have been matched in another syntax region. Using something similar to regex capture groups, for example given a file: {highlightme} asda asasd asd asd as ...
1
vote
1answer
71 views

clear all of the highlight groups manually

I know I can do :syn clear and clear all highlighting. But I want some of the highlights to stay. I have these lines in my vimrc hi clear Constant hi clear Function hi clear Identifier hi clear ...
6
votes
1answer
51 views

Setting syntax in ftplugin

I’m trying to set the syntax of Processing files (*.pde) to java with a ftplugin. .vim/ after/ ftdetect/ pde.vim ftplugin/ processing.vim In after/ftdetect/pde.vim I ...
2
votes
1answer
24 views

Highlight `SquishedCommas`, except at end of line

Following up on this question on how to highlight commas not followed by a space; the accepted answer provides a nice solution for problems like: func(a, b,c,d) But it also highlights commas at the ...
0
votes
0answers
18 views

How to highlight function like (req, res, next) -> in javascript/coffee

gvim 1-26/windows10 I'm trying some .coffee files and meet a lot with this kind of syntax (req, res, next) ->. As I know it's a call back function and I can't get it highlighted. The reason is ...
0
votes
1answer
45 views

Syntax highlight Markdown formulas using LaTeX highlighting

I often write non-trivial mathematical formulas inside Markdown documents, and having them syntax-highlighted would really help. In Markdown, LaTeX math formulae are denoted: $x^2$ and $$x^2$$, and ...
0
votes
0answers
42 views

Syntax highlighting for keyword followed by dot

I'm writing my own syntax file and I'm wondering if it possible to make it so that myKeyword.anything() (where anything is anything) is highlighted up until the parenthesis. Also, is it possible to ...
2
votes
1answer
33 views

Can't get syntax highlighting rule to work

I'm trying to add this rule: syn match Keyword /{+.*+}/ If I open a plain text file and run the above as a command, it works: stuff like {+ asdf +} gets highlighted as a keyword. However, if I add ...
1
vote
1answer
32 views

Color Stuff Inside Braces in a Desired Way With a Trigger

Suppose I have \frac{stuff}{matter} somewhere in a file I am editing. And I want to change stuff and matter. So at the trigger of a command, I'd like to see the following take place: stuff gets ...
0
votes
0answers
30 views

Highlight block of injected code [duplicate]

windows 10/ gvim 1-1802. I use Javascript and there are sometimes blocks of HTML code that need to be inside a particular region that can be indicated by """, for example . I have a similar ...
2
votes
0answers
35 views

Highlight arbitrary rectangular regions

Is it possible to highlight specific and arbitrary rectangles in a buffer? I want to implement a code scope highlight that groups code into a hierarchy of boxes. here is my mockup that I made: ...
1
vote
1answer
206 views

E518: Unknown option: termguicolors

This thing is driving me nuts I'm trying to setup vim on my co-workers computer, and this is my .vimrc file everytime I run vim I get this error Error detected while processing /Users/toters/.vimrc:...
-1
votes
1answer
56 views

Check a simple html file with ale

Install ale with pathogen. cd ~/.vim/bundle git clone https://github.com/w0rp/ale.git My setting for ale in .vimrc. let g:ale_sign_column_always = 1 let g:ale_set_highlights = 0 The target html ...
0
votes
1answer
52 views

Interactively check given string highlight group

We can get highlight group information by the following command :hi[ghlight] {group-name} But is it possible to get this information by given keyword? Something like this : syn match Integer '\d\+'...
-1
votes
1answer
34 views

hidden highlight selection when search with * or # is active [duplicate]

Using the * key searches for the word under the cursor. Use # to do the same, backwards. When search is active, all instances of word appears highlighted. I want to know if is possible to remove the ...
0
votes
0answers
32 views

ALE apply suggested syntax corrections

Is it possible to automatically correct, on command, the syntax errors/warnings suggested by the Asynchronous Lint Engine? Say, it suggests that at certain places semicolons are missing. Can I have ...
0
votes
0answers
49 views

vim: specify path to load color scheme from

I have multiple servers, and a network share. Every server should share the same vim config. So i put my .vimrc file on the share and load it via the -u option. However vim cannot find the color ...
1
vote
0answers
51 views

Disable vimdiff syntax highlighting

I have syntax off at the end of my nvim.init file, but no matter how hard I try there is always diffsplit coloring. I would like to disable it because I guess (Neo)vim is very slow with syntax ...
0
votes
1answer
34 views

How do I stop vim from higlighting uncessary words in PHP

I have this issue with my vim setup, where some words get highlighted unnecessarily. The image below shows an example. The words not and to where highlighted but there's no reason for them to be. How ...
3
votes
0answers
45 views

How can I make syntax highlighting files more readable and maintainable?

Vim uses regular expressions for syntax highlighting. Often maintaining these can become rather unwieldy. For example: syn match goVarAssign /\v[_.[:alnum:]]+(,\s*[_.[:alnum:]]+)*\ze(\s*([-^+|^\/%&...
2
votes
1answer
66 views

How to add a new colorscheme syntax keyword

I'm trying to create a new custom colorscheme and syntax highlighting. I have copied some examples into ~/.vim/colors/ and ~/.vim/syntax with new names inside for the scheme. All the basics work ...
0
votes
1answer
29 views

Isolate a matched virtual column ruler to the cursorline only?

I'd like to add ruler marks/virtual columns along the lines of matchadd('ColorColumn', '\%81v', 100) while restricting their display to the cursorline. Any ideas ?
2
votes
1answer
319 views

Highlight whole todo comment line

I'm still learning Vim and making small customizing on it. I'm struggling a bit to create a custom style/syntax highlight which would highlight the whole todo line. So in the picture instead of having ...
1
vote
1answer
91 views

Using set listchars, what are 'extends' and 'precedes'?

Searching for a solution to show hidden characters, I found the example, :set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:< :set list What are extends and precedes? I expected a ...
0
votes
1answer
75 views

concealing the start and end pattern in syntax region

I'm trying to learn multi line highlighting and have managed to get the following working syntax region myMinusStart start=/^\s\+zzzz / end=/^\s\+qqqq / concealends But the concealends is not hiding ...
0
votes
1answer
41 views

Is there a way to use cpp.doxygen syntax file and my own cpp.vim syntax file?

At the bottom of my file, I'd to have something like this: // vim: syntax=cpp.doxygen Only, when I do that, it breaks my auto-load of my own cpp.vim. au BufNewFile,BufReadPost *.cpp so $...
1
vote
1answer
43 views

Backreference for syntax region

I am trying to improve Vim's syntax highlighting for YAML files. YAML supports long string literals that begin with either a ">" or "|", like this: keyA: > A string literal that spans ...
3
votes
1answer
49 views

Use blank line as end for one region and as start of another

I want to syntax highlight a header region in custom style and a body region with the existing markdown style: Title: Test Note Id: 147648d8-8680-4847-8f50-dd4a67f870b5 Created-At: 2018-02-26 22:44:...
3
votes
1answer
26 views

How do I change the regex for a single syntax highlighting match?

When I'm writing Latex files in vim, the syntax highlighting recognizes \newcommand as the start of a new command environment, but not \newcommand*. Digging into the syntax file, it seems that to fix ...
1
vote
1answer
47 views

enabling syntax in vim creates lag

I was trying to learn javascript the other day and was using emacs as I have been trying to learn emacs as well. But after sometimes my left wrist started to hurt(as one's does) so I switched to ...
2
votes
1answer
156 views

How do I make vim highlight math properly in the align environment?

Sorry if this is the wrong place to ask this, I'm new to the site :/ I asked the same question in TeX StackExchange, and I was pointed here. My issue is this: when editing in vim, my syntax file ...
0
votes
1answer
25 views

How to affect the syntax highliting filetype from local vimrc?

I am editing a source code in language1. It doesn't have a built-in syntax highliting configuration into my vim. However, its syntax is very similar to language2, which has. I think, syntax ...
2
votes
0answers
33 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
1answer
166 views

Cursorline/Columnline slowdown

I have recently recompiled vim, and ever since, when I have a big file, the scrolling gets slow. cursorline seems to be the problem; it doesn't matter if I use any of my plugins, if I have cursorline ...
0
votes
1answer
104 views

Strange Highlighting during Git Commit

What can I do to have proper highlighting on a .git file? I chose Vim as my default editor when I commit files, the color scheme(Gruvbox) is applied, but I get strange colors as I start typing. I ...
1
vote
2answers
123 views

Syntax highlighting of underscores in LaTeX, even though they only appear in filenames

I'm using nvim and LaTeX together, and for the most part it's been great. However, nvim appears to be incorrectly highlighting underscores that appear in filenames I include as part of the subfiles ...
0
votes
1answer
108 views

How to only load a certain syntax file

Okay, so I have a syntax file asciidoc.vim in ~/.vim/syntax and this file is actually loaded, as I checked with scriptnames. But for some reason, it only works, if the builtin syntax files haven't ...
1
vote
1answer
52 views

Inverted syntax highlighting of multiline strings in Python

I'm editing a ~1000 line Python file containing long docstrings. Occasionally, when I'm in editing the middle of a file, the syntax highlighting will 'invert' so that everything outside the docstrings ...
0
votes
1answer
28 views

Vim highlights word “mktemp” in Bash script

I'm programming Bash scripts using Vim in Ubuntu 16.04 (on Windows Subsystem for Linux). The filename ends in .sh and the first line of the file is #!/bin/bash When I wrote this command rm -rf /...