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

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
1answer
7 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
25 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 ...
1
vote
1answer
30 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
15 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
38 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
26 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
32 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
46 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/...
0
votes
0answers
21 views

JavaScript comments are not highlighting

I can't seem to get syntax highlighting for JavaScript comments working. Here's my vimrc: https://gist.github.com/wamoyo/34405c4672c89dbfded62ea34134003b Update Turns out I had some custom stuff ...
3
votes
1answer
29 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
25 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 ...
0
votes
0answers
22 views

Syntax hightligh broken in html file after ^F [duplicate]

Expected behaviour Syntax highlight should work even after CTRL-F Actual behaviour Syntax hightlighting stops working after scrolling to next page Steps to reproduce using nvim -u NORC: nvim -u ...
3
votes
1answer
40 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
43 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
34 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
45 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 ...
1
vote
1answer
230 views

Syntax highlight works for gvim but not for terminal vim

I am new to vim and I want to code in vim. I have installed the necessary plugins for syntax highlighting JSX in TypeScript and everything works fine for GUI version of Vim but not for terminal-based ...
0
votes
2answers
58 views

Priority highlighting

In my code, something like #include <whatever> is highlighted: #include (which belongs to the group 'cInclude') in pink; and <whatever> (belonging to the group 'cIncluded') in red. (Edit:...
0
votes
0answers
132 views

Vim syntax highlighting not working for all keywords in python file

I have been using vim/neovim for python for quite some time now and for some reason the syntax coloring doesn't really highlight all the different variables/methods/function calls etc in the python ...
1
vote
2answers
51 views

How can I turn off syntax highlighting for one specific element?

I'm editing pandoc markdown text with inline math. Since that uses underscores, vim will helpfully highlight everything after the first underscore, but there will be no matching one. How can I turn ...
1
vote
0answers
25 views

Syntax highlighting in consecutive single-line comments

I'd like to have rich syntax highlighting (using, say, markdown syntax) inside (single-line) comments (as is done in Rust). For now, I'm using the following code, which is not satisfactory. syn ...
2
votes
1answer
28 views

Re-sync _folds_ from start

Vim has a handy feature in :syntax sync fromstart which allows me to fix syntax highlighting when it gets confused during an extended editing session. I map it to <leader>ss (reSync from Start) ...
1
vote
2answers
55 views

Installed and set colorscheme but method puts and print not working on ruby

Yesterday, I Installed vim and some colorscheme like gruvbox, monokai, molokai. I set it in ~/.vimrc and turned on the syntax highlight, everything work well on HTML but in ruby files (.rb) it still ...
0
votes
1answer
65 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
85 views

How to conceal Markdown syntax per-word, rather than per-paragraph?

I want to use Vim to write markdown in a sort-of-WYSIWYG manner (for use with an audience). For example, typing **Bold** should display Bold in bold font, with the asterisks automatically hidden as ...
0
votes
1answer
35 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
108 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
23 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 ...
2
votes
1answer
40 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
49 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
45 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
26 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
58 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
54 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
23 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
253 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
18 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 ...
2
votes
1answer
132 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
163 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
28 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
47 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
121 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
62 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
43 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
34 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
38 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
601 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
129 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
55 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\+'...