Stack Exchange Network

Stack Exchange network consists of 175 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

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.

0
votes
2answers
25 views

Fade Rows Far From Center

I am currently using a vertical monitor for my vim setup. I absolutely love being able to view 100+ lines of code at once. My eyes can scan longer and more complicated blocks of code. However, I have ...
2
votes
1answer
51 views

How to stylize text between backticks ( ` ) to match text style between single/double quotes ( ' | " )?

In my vim, I'm using gruvbox. Syntax colorization is great for everything except text written between `backticks`. You'll note once backticks are used, all subsequent lines of text are green. I would ...
0
votes
0answers
19 views

Remove costum commands from vim-spell

I recently tryed following the answer to this question: vim-spell: exclude custom LaTeX commands. To remove spelling from the inside of certain commands, I ended up adding the following to after/...
1
vote
1answer
19 views

Python semantic linting [closed]

I'm currently using ALE (recently upgraded to this from syntastic) and YCM for code completion, highlighting syntax errors on-the-fly (rather than just at save time, like with syntastic), and it's ...
0
votes
1answer
23 views

How to edit the highlighting of the function names in c++ syntax

I want to change the highlighting of the function names inside a c++ file, here is an example As you can see in the previous picture functions names have their own color, parser(), parse(), ...
1
vote
1answer
65 views

vim python syntax not working (Partly)

Vim only seems to highlight comments, numbers, and imported modules. So function calls, attributes, etc are all non-highlighted. I have 'syntax on' and 'filetype plugin indent on' in my vimrc. syntax ...
0
votes
0answers
26 views

Use combining characters in concealment character

Are combining characters allowed in a concealment character? The following does not seem to work: syntax match underdot "a\." conceal cchar=ạ The underdot is U+0323. This syntax conceals a. simply ...
1
vote
1answer
31 views

How would one change the spell-checking style while preserving highlight color?

Currently when working with vim's spellcheck a word is highlighted a certain color based on the type of error it is. Instead of highlighting the erroneous word I'd like it to be underlined with the ...
0
votes
1answer
26 views

How to use vim as an error checker?

I'm transitioning to vim and I love the feature other IDEs provided in which when I wrote something with a syntax error it accuses me through a red underlining. I don't know what this type of feature ...
0
votes
1answer
15 views

markdown html-element syntax highlighting fails when line has leading spaces

For some reason, my html elements stop being highlighted when they are preceded by 4 or more spaces. I use spaces to do indentation for nested elements, so this is quite unfortunate. This only ...
1
vote
1answer
62 views

Change background color of git conflict marker sections

If git is performing a 3-way merge and has a conflict it can't resolve, it marks up that area of the file like this: No unresolvable conflicts here <<<<<<< HEAD xyz ||||||| ...
2
votes
1answer
48 views

How to highlight unused Python imports in VIM

I want to highlight unused Python imports as Python syntax errors. For example, I sometimes forget to remove some packages used for debugging such as time, ipdb. It would be great to see warnings or ...
0
votes
1answer
36 views

Command to list all customizable color highlights

A few days ago I found a command that allowed me to view all the syntax colors in a theme. I could then determine what highlight I needed to change in order to customize the theme. Can you help me ...
0
votes
1answer
40 views

How to selectively turn specific highlight group on and off from vim session?

I have in my .vimrc: hi SpellBad ctermfg=7 ctermbg=0* cterm=underline hi Nonascii ctermbg=Black ctermfg=Red cterm=none hi [...] Some config files I need to look at contains so many unknown words ...
0
votes
0answers
30 views

highlight link with condition file does not exist

For a wiki syntax plugin, i'd like to have two highlighting colors for links. Links already having a destination file should be green and links with no destination yet should be red. [[This file ...
1
vote
0answers
19 views

Enable syntax highlight between custom tags [duplicate]

When I work with ruby .erb files, vim correctly detect javascript blocks and highlights them accordingly: ... colored html ... <script> ... colored javascript ... </script> ... more ...
3
votes
1answer
24 views

Invalid syntax for a bash file called catalog

I have a file written in bash (with the she-bang) and called "catalog", and the syntax highlighting is incorrect. If I rename the file, the colors become correct. I have not configured anything in ...
1
vote
1answer
44 views

Is there a conflict between `syntax enable` and custom keywords?

I have the following minimal .vimrc file: " syntax enable syntax case match syntax keyword MyTodo TODO PENDING syntax keyword MyTodoIP IN PROGRESS syntax keyword MyTodoClosed CLOSED COMPLETE DONE ...
2
votes
2answers
85 views

Highlighting another syntax in a shell heredoc

I edited my original question and title to broaden its scope to any syntax - with SQL used as just an example. You can adapt the examples and the answer to other languages. By adding suitable ...
1
vote
2answers
131 views

Add keywords to a highlight group

Todo highlight group currently highlights TODO and FIXME keywords. What do I do to add NOTE, and possibley more keywords, to this existing highlight group, for all file types?
1
vote
2answers
172 views

How to use different colorscheme and syntax highlighting in vim?

Suppose I want to use this colorscheme: https://github.com/NLKNguyen/papercolor-theme I copied the PaperColor.vim file into .vim/colors and made my .vimrc: syntax on colorscheme PaperColor ...
1
vote
0answers
37 views

Ignore acronyms as spelling errors in TeX files

My LaTeX files contain lots of acronyms and they are often highlighted as spelling errors. I tried to ignore acronyms by adding syn match AcronymNoSpell '\<\(\u\|\d\)\{3,}s\?\>' contains=@...
0
votes
1answer
54 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 ...
1
vote
2answers
142 views

Syntax Highlighting a region inside the start match of another region

I have two syntax region defined as follows: syntax region xBCD start="b" end="d" hi def link xBCD Todo syntax region xBlock start="\z(abcde\)\zs::" end=";" hi def link xBlock Comment and a text ...
1
vote
0answers
28 views

custom syntax hilighting lost on single LaTeX file

I use vimtex plugin for writing tex documents in vim8. I added custom hilight for sections in my .vimrc like so: autocmd FileType tex :syntax match texSectioning "\\section.*" The texSectioning is ...
0
votes
1answer
69 views

Enable syntax highlighting in vim using colorschemes?

In my installation of vim 8.1 (compiled from source) syntax highlighting is not working. The runtime path ($VIMRUNTIME) is set to /XYZ/VIM8/installnew/share/vim/vim81 which contains (autoload, ...
3
votes
0answers
44 views

gVim - Use different fonts using :highlight

I want to set gVim font size for Comment highlight group. When I set it, it does not do anything (the font is still the same but color changes). My .gvimrc: se guifont=Fira\ Mono\ Regular\ 10 hi ...
2
votes
1answer
28 views

Pattern to match the label of a JavaScript object field when the colon is not followed by another colon or an equal sign

I wrote a syntax highlighting .vim file. One of the expressions is used to color the label in a JavaScript object declaration: name: 'value' ^^^^ I want to see the name in a different color. My ...
1
vote
0answers
20 views

My C like Comments include markdown, can I have vim highlight those in my JavaScript (Node.js) code? [duplicate]

I write a lot of C/C++ and get highlighting for my Doxygen docs in my comments. It's not perfect, but it sure helps avoiding many very simple mistakes on the spot. To handle that, I simply have the ...
0
votes
1answer
30 views

Is it possible to make a specific section have a different syntax? [duplicate]

I am working with markdown and writing snippets like: ```c int main() { return 0; } ``` It is highlighted as a code in vim. However would it possible for the c ...
0
votes
0answers
14 views

Why does second const VARNAME not have syntax highlighting?

I copied and pasted a .php file and edited it. It went from: <?php class Foo { const RESET = 'reset'; to <?php class Foo { const RESET = 'reset'; const ...
1
vote
1answer
220 views

Make Vim stop highlighting certain underscores in my Markdown as errors

I'm using Kramdown-flavored Markdown in several of my Jekyll websites. Vim highlights all the underscores in those documents as errors, coloring them (in my color scheme) with bright red backgrounds. ...
2
votes
1answer
67 views

How to know which highlighting group is used for the background of a word?

Vim highlights the background of certain words (e.g. when doing spellchecking) in a way that I would like to change (because the background and the word itself are almost of the same color, which ...
2
votes
1answer
50 views

Analog of mmm mode

Is there an analog of mmm mode for vim? This would allow me to have syntax highlighting of several modes in the same file.
1
vote
1answer
33 views

How do I make ftdetect rule recognize syntax statement at the end of a file?

I'm using a syntax highlight plugin for Nginx files. Its ftdetect looks like this: au BufRead,BufNewFile *.nginx set ft=nginx au BufRead,BufNewFile nginx*.conf set ft=nginx au BufRead,BufNewFile *...
0
votes
1answer
42 views

Vim: Is it possible to modify syntax rule of the Folded group?

Thank Vim's folding, I can hide irrelevant parts of code/document and work on a small spot of the file. More and more I organize the folded first lines as an outline of the whole file, in each level. ...
0
votes
1answer
144 views

Why doesn't undercurl use underline in my terminal?

:help undercurl states: "undercurl" is a curly underline. When "undercurl" is not possible then "underline" is used. In general "undercurl" and "strikethrough" is only available in the GUI. But if ...
0
votes
1answer
145 views

How to set a colorscheme that still shows spelling errors?

How to set a colorscheme that still shows spelling errors? I am looking for two combined effects that I can acquire separately but not yet together. Set Colorscheme alone: OK. If I want highlights ...
2
votes
1answer
63 views

How to change one syntax behaviour in vim

The shebang line has an annoying background color, how to change it to have the same color of comments. This is a Haskell file.
0
votes
1answer
36 views

Syntax highlighting (contains, contained) of only the first match

I think it is possible but can not figure how one can highlight only the first match of contained syntax? syn clear syntax cluster TitleParts contains=TitleNum,TitleType,TitleRest syntax match ...
0
votes
1answer
61 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-...
1
vote
2answers
47 views

Multiline regular expression excluding characters

I am designing a syntax rule (for R code) that highlights if I do not start a function with a curly all by itself. For example, A <- function(x, y){ would be match but I do ...
0
votes
1answer
75 views

Why do windows not have syntax after split?

I am trying to create my own C++ environment inside of VIM. So far, this is my setup when I run $ vim ~/shape.cpp: for example: As you can see, only NERDTree has full syntax highlighting (which isn'...
0
votes
1answer
155 views

Fixing pug syntax highlighting

Update I've managed to get the top part of the file fixed with syn region pugJavascriptLine start=/^\s*-/ end=/$/ contains=@htmlJavascript from this programmer: https://github.com/digitaltoad/vim-pug/...
3
votes
1answer
63 views

define two syntax regions with same pattern

I try to extend the cmake syntax highlighting by our in-house cmake functions. For this I drafted a file to be saved in ~/.vim/after/syntax/cmake.vim, such that one extends the default cmake syntax ...
0
votes
1answer
51 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 ...
3
votes
1answer
119 views

Syntax highlighting of key = value pairs

I "inherited" a custom syntax script and I want to update it since it's a little out of date. The text file for which the syntax highlighting is written contains several blocks like this: {Group1 ...
1
vote
1answer
80 views

Visual Select highlighting not working anymore

The issue My custom highlighting styles for Visual mode selection of text is not as it was. It use to be yellow background with black text. Now it is just underlined. Environment vim 8.0 term, not ...
0
votes
1answer
44 views

Disable highlighting for tex files with texvim

I want to use vimtex and enable highlighting for all filetypes, except tex files. For tex files I explicitly want to disable highlighting. How could I do that? Important: The solution should allow ...
1
vote
1answer
113 views

Does `hi link XXX Normal` provide any benefits?

Does hi link XXX Normal provide any benefits? For example the syntax file included by default syntax/vim.vim includes the line: hi def link vimUserFunc Normal This often conflicts with CursorLine ...