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
21 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
21 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
9 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
43 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
45 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
24 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
21 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
52 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
31 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
13 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
34 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
73 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 ...
1
vote
1answer
18 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
22 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
26 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
31 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
107 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
29 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
73 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
37 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
138 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
53 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
28 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
35 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
52 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
46 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
41 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
45 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. ...
2
votes
0answers
23 views

In vim, is it possible to set a particular line text into a specific color without defining syntax? [duplicate]

Is it possible to get around syntax, and set text color directly in vim?
1
vote
1answer
35 views

Highlight search phrase within quickfix window listing

One can change the search color of search terms with the Search highlight scheme. Similarly one can change the color of a line in the quickfix window with QuickFixLine. However, how does one change ...
2
votes
1answer
39 views

Rules for 2-tier recursive syntaxes

I have matched parentheses, but highlighting failed as it transcends up the recursion stack. I just need to know if there is a solution to tracking pairs of delimiters during Vim highlight syntax of ...
1
vote
1answer
23 views

Highlight region with keyword in it

I have this file Another comment program start end This is a comment Anything after end or before program must be highlighted as a Comment. I've battled with vim for hours, what am I doing wrong? ...
0
votes
0answers
211 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
74 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
64 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
154 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
174 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
87 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
34 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
49 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, ...
1
vote
2answers
84 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
37 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
28 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
59 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
73 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
82 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
123 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
2 3 4 5
9