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
1
vote
1answer
14 views

syn-keyword with control characters?

(I know the goals are dumb, and I know I could set ffs=unix,dos to not see ^M; I'm just trying to understand more about vim). I was playing around with vim keywords, because I want to conceal certain ...
3
votes
1answer
55 views

First new line in multi-line vim commands has broken highlighting

In my init.vim I have the following command: nnoremap <Leader>s :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") \ . "> fg<&...
2
votes
1answer
34 views

Are opening and closing double quotes expected to be of different color in a bash script?

I've just noticed, after years using Vim, that the two double quote characters opening and closing a string in a bash script have different colors, which I can verify by simply writing var="var&...
2
votes
1answer
20 views

How can I have jinja2 indentation and syntax when keeping HTML filetype?

I have emmet installed and some more plugins that are usable on html filetypes, I would like to have syntax highlighting and have indentation for jinja2 while keeping the filetype HTML so my HTML ...
3
votes
1answer
35 views

How to get syntactic coloration for dist files

There is a standard for providing files that may have unversioned counterpart. That standard consists in suffixing the filename with .dist, so for example phpunit.xml becomes phpunit.xml.dist. How can ...
1
vote
1answer
58 views

Vim custom syntax highlighting: highlight “word=value” without spaces in between

I've asked this question on StackOverflow and they suggested to ask it here. I am trying to set a custom syntax highlighting for BSD rc.conf file which looks like: name=YES anothername=NO third="...
0
votes
1answer
42 views

Highlighting color strings with correspondent color

When tweaking color themes, one thing I really miss is a highlighting that would color the color strings with the corresponding color. Maybe this sounds confusing? An example: here is a fragment of a ...
2
votes
1answer
63 views

Conceal markdown links and extensions

I wish to fully conceal markdown links, even if they have extensions. For example: [Anchor text](http://whatever...) [Anchor text](http://whatever...){:rel="nofollow noopener noreferrer" ...
0
votes
1answer
32 views

Reloading syntax on vimrc change

My vimrc has a function that extends the default-provided syntax for C: function! Bx_c_syntax() "{{{ "A faked version of the real thing let b:match_words= \ '\<...
0
votes
1answer
39 views

How to Keep Syntax Color but Disable Highlighting in Vim?

I recently activated auto-complete using YouCompleteMe and syntax color in Vim. However, a red highlighting color appeared. I tried to disable syntax color with syntax off, but this highlighting ...
1
vote
1answer
39 views

Changing colour of pop-up coc.nvim lint warning in custom colourscheme

I'm using the colorscheme monokai and coc.nvim with pylint to lint Python code in Vim (terminal, not GUI, in terminal.app on macOS which I'm pretty sure has 256 colours). The linting pops up on a ...
0
votes
0answers
21 views

How to overwrite the conceal background color with line color?

I've started using coc for NeoVim and I've setup a highlight for a line with error using the following: hi CocErrorLine guibg=#ce2c28 However, when the error line has a concealed character, it has a ...
2
votes
0answers
16 views

custom syntax highlight doesn't match in parentheses

In a custom java syntax file (${HOME}/.vim/syntax/java.vim) I wrote syntax match CommonVar /ret/ highlight CommonVar cterm=bold with the intention display the word ret in bold. I tested it with this ...
1
vote
0answers
12 views

Doxygen LaTeX syntax

I am using doxygen to document my code and I like to have additional markdown files which include formulas by using \f$ Formula \f$. I know markdown syntax provided by the vim-markdown plugin supports ...
3
votes
1answer
44 views

How to re-enable syntax highlighting in Vim?

Vim language highlighting has quit working only for one specific file. I've been using Vim in WSL (Ubuntu) for several months now without problems. My PC is Windows 10 Professional. Strangely, Vim is ...
0
votes
0answers
35 views

Can't get custom syntax highlight to work

I can't get custom syntax highlight of the LaTeX \footnote command to work. I'm using nvim 0.4.3 through VimR. I put the following in ./.vim/after/syntax/tex.vim (Edit: my runtimepath is ./.vim/ ...
0
votes
0answers
13 views

Syntax profile close to dosini but with extra highlighting between quotes

Unfortunately I've to work with a custom and weird file format every day. To make my life in Vim easier, I've tried several syntax settings and 'dosini' comes very close. However, the text in between ...
2
votes
2answers
69 views

Shell syntax highlighting

I've noticed in bash/shell it highlights $(...) in red, for example: However, if I change the syntax from ft=sh to ft=bash, it does not do this: What's the reason for this? Am I doing something ...
3
votes
1answer
68 views

How to get highlighting group set by spell check

How do I get the highlighting group of a text when the group is defined by the command :spell? For example when a word is misspelled I want to get the highlighting group SpellBad. We have a question ...
1
vote
1answer
25 views

The line `eval local value=\“\${WORLD_$2[$1]}\”` breaks BASH syntax highlighting by inverting quote contents

So I have a BASH script I'm modifying and I've been noticing large blocks of script with broken syntax highlighting. They appear as though I have an unpaired double quote somewhere, despite all quotes ...
0
votes
0answers
24 views

How can I display text differently from how it is actually stored?

I am making a custom syntax partially based on Markdown. I want to display links differently from how they are stored in the file. For example, [About me](about.md) in the file should be displayed as ...
0
votes
0answers
12 views

Conceal but using a variable string that comes from a function

Vim has a conceal functionality that allows, for example, Markdown links [link-text](link-url) to be concealed as link-text. I'm trying to make the value of link-text come from a function instead. For ...
2
votes
2answers
46 views

Highlight Multiple Lines of Comments

I'm on Ubuntu 18.04, vim-gtk3 8.0. I'm trying to get gvim to highlight multiple lines of comment that starts with a particular word. For example, consider the word 'NOTE': // NOTE(Ryan): This would be ...
0
votes
1answer
56 views

Highlight Particular Words Within Comments

I'm on Ubuntu 18.04, vim-gtk3 8.0. I'm trying to get gvim to highlight particular words within a comment. For example, take the word 'NOTE'. In a '.c' file: // NOTE(Ryan): ... and a '.sh' file: # ...
3
votes
0answers
25 views

`local foo=\'` script syntax highlighting error? (slash tick)

Opening vi on a script file containing local varname=\' or local varname=$' seems to mess up the highlighting colors following the tick. Is there a way to avoid this? Here is a simplified example ...
1
vote
0answers
29 views

Conceal with the highlighting of matching begin/end latex environment

I want to use vim conceal feature with the highlighting of matching begin/end latex environment (vimtex plugin). When I use the following code syn match texStatement '\\begin{itemize}' contained ...
1
vote
1answer
69 views

Fortran Syntax Highlighting detecting apostrophes as Strings

I am using VIM 7.4 with syntax highlighting on some Fortran77 source code. One comment has a single apostrophe that never is repeated/closed (eg * Bert's bees), causing the remaining source code to ...
1
vote
1answer
40 views

undercurl not visible to me in gvim on WIndows 10

I like to use undercurl to highlight spelling mistakes in Vim. I believe it does this by default. This works fine in MacOS and Linux but it isn't visible for gvim on Windows 10. Originally, I ...
0
votes
0answers
14 views

Making language-specific markdown code blocks more distinguishable from normal text in conceal mode

I'm playing with markdown concealing mode provided by plasticboy/vim-markdown. But I found a problem with language-specific fenced code blocks which, if they're small so there's almost no highlighting ...
0
votes
0answers
36 views

vimscript: Efficient way to extract portion from line of text

I have a plugin that does syntax highlighting and folding for a kind of data file. The syntax and folding are both dependent on textual values in specific places (columns) of current line of text. ...
1
vote
0answers
14 views

Design guideline for doing both autocompletion and highlighting?

For Vim, are there any design guidelines for simultaneously doing autocompletion and syntax highlighting? For the NFTABLES command line (and file) syntaxes, I see lots of recurring but partial syntax ...
1
vote
2answers
146 views

neovim syntax highlight with large files issue

I use neovim 0.4.3. When I open a large xml file (about 130-140k lines) syntax highlighting switches off with a message: 'redrawtime' exceeded, syntax highlighting disabled If add this line to my ...
2
votes
1answer
27 views

Unwanted highlights on page scroll

I have a pretty similar problem as in this issue with some exceptions. Basically, after I scroll page down or up Ctrl+d / Ctrl+u all non-empty lines get highlight from the end of the line to the ...
0
votes
0answers
15 views

Stylizing a string that contains a regular expression

In textmate (and I assume every other editor), it has a nice feature where it colorizes a regular expression inside a string (r-string in python). For example here is how it looks in Texmate: Is ...
0
votes
1answer
25 views

Simplest way to add in a syntax rule

I would like to add in the following rule to my syntax to help with python files: :syn match pythonBoolean "\<self\ze\." :hi pythonBoolean cterm=bold It works when I type it in directly to the ...
0
votes
1answer
27 views

Set color of Comment only using .vimrc

I am using some preset colorthemes, but it seems that the types Identifier and Comment always use the same color -- which makes my .asm files basically just one color. I tried to change the color of ...
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
173 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
34 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 ...
2
votes
1answer
79 views

How to setup vim-clojure-highlight to work?

I've been trying to setup my Clojure dev environment with Vim, note that I'm still very new to vim but I've managed to know the basics. I've installed pathogen which has helped me get a bunch of ...
3
votes
0answers
39 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
2answers
330 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 ...
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
1answer
90 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 ...
0
votes
0answers
42 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
58 views

Concealing the code for `braket` package for LaTeX with vimtex + `tex-conceal`

I am using vimtex with latexmk and using conceal setting provided by vim and extending it with an additional plug-in : KeitaNakamura/tex-conceal.vim. Additionally, I use a package braket to encode \...
1
vote
1answer
96 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/...
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
1answer
77 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. ...

1
2 3 4 5
9