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
votes
1answer
520 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
146 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
45 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 ...
1
vote
0answers
101 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
38 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
54 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
249 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
38 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 ?
3
votes
1answer
2k 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 ...
3
votes
1answer
1k 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
327 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
123 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
132 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 ...
2
votes
1answer
75 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:...
2
votes
1answer
79 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
182 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
543 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
57 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
91 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
354 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
349 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
619 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
317 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 ...
2
votes
1answer
178 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
83 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 /...
1
vote
1answer
33 views

Contents are all selected by default

First, I don't know what happed, which means the cause may not as the title suggests. I was editing with vim. one or two mis-key strokes, now whenever I open file with vim. All the Contents are all ...
0
votes
1answer
274 views

How to highlight todo in a comment line?

I'll leave ? at the beginning of a commented line to mark a todo item. -- ? TODO ... This line will be marked as comment. How to highlight the ? and the remaining text by Todo color while keep the -- ...
2
votes
1answer
525 views

Why local syntax file is not working?

I've created a local syntax file def.vim and saved in ~/.vim/syntax. First it's working, but just after I closed gvim and several other windows, it stops working. First I checked :scriptnames. Local ...
1
vote
1answer
443 views

Syntax highlighting gone when using buffer

At work I usually keep only a few files in buffer, typically a Yang file, a Java file, and possibly something like a readme file. In such an environment, the Yang syntax highlighting does not work. ...
1
vote
2answers
60 views

Does exist BSD's make syntax file?

There are many make-variant, maybe the most popular is the GNU make. The vim package contains syntax/make.vim which related to GNU make. Many people use different make, for example FreeBSD's make ...
1
vote
1answer
291 views

How to edit all vim highlight groups?

I am going through the unfortunate process of making keybinds to change colorschemes, but different plugins have their own highlight groups which is making this difficult. Is there a way to set the ...
2
votes
1answer
361 views

CMake syntax highlighting not working as expected

For most files, Vim (terminal) is syntax highlighting properly without any issues. However, I am unable to get it to work for CMakeLists.txt: Neovim has no trouble with syntax highlighting, neither ...
1
vote
0answers
24 views

Determining syntax group type from output of 'syn list' (doesn't appear to work for regions)

Why does the output of syn list not include region in the syntax group definition line, like it does for 'match' type groups? What is the meaning of the xxx in that line? I've got a vim 8.0 function ...
0
votes
1answer
138 views

why I am losing syntax highlighting when vim is invoked within a script?

If I initiate vim from command line prompt, everything works as expected, but when it is initiated from a script, then syntax color highlighting is lost. The script can be as simple as the following, ...
3
votes
1answer
349 views

Get back regular vim colors

I just installed Linux Mint 18.3 and to my surprise colors in vim changed! Vim in the terminal on the left has the color scheme I've always seen and got used to. Vim in the terminal on the right has ...
3
votes
1answer
2k views

How to set value of cterm to both bold and underline?

Currently, my vimrc has set cursorline hi CursorLine cterm=underline ctermbg=none ctermfg=none I want to be set cterm to both underline and bold
0
votes
1answer
34 views

Do syntax patterns let you use very magic or not?

Quoting syn-pattern: See |pattern| for the explanation of what a pattern is. Syntax patterns are always interpreted like the 'magic' option is set, no matter what the actual value of 'magic' ...
3
votes
1answer
34 views

How to syntax highlight line with three parts?

I am trying to highlight lines like these: -> Some text without a domain -> Some other text with a domain (example.com) I would like: a) the leading "->" not to be highlighted; b) the text to ...
1
vote
1answer
388 views

Ignore pattern inside of a region

:h region bring me very little help. I need to exclude a pattern inside a region that should be ignored for example: don't apply match/highlight begin from # to the end of line $ I try to ignore #.*$ ...
15
votes
0answers
394 views

How does `\zs` interact with syntax matches?

Consider the text: foobarbaz First we highlight the regular expression /foobar/: :syntax match Special /foobar/ Next we highlight the regular expression /foobarbaz/: :syntax match Error /...
1
vote
2answers
377 views

Highlight exported Go functions

Golang uses naming convention to separate functions visibility: exported (public) starts with a capital letter, non-exported (private) with a lower letter. I would like to highlight exported functions,...
0
votes
1answer
380 views

Highlight function's keyword and parameters

Follow here @muru point out how to highlight keyword in a function and function name but I want also highlight parameters, for example: abc = myFunc(Green, Orange=Green, Green, abcd(Orange=Green), ...
1
vote
2answers
136 views

How to write a syntax file

This is an example of my file format basically it follows this layout: <word> <wordWithNumbers> <wraped text> Examples: sadfa 23eafa asdfasdf asdfdsf sflsdkjf ;lkja flksad ks ...
2
votes
0answers
67 views

vim cpp syntax contained region

I define four key words and two regions in vim scripts syn keyword KeywordA A nextgroup=rangeA skipwhite skipnl skipempty syn keyword KeywordB B contained containedin=rangeA nextgroup=rangeB ...
1
vote
0answers
50 views

Match through nested function

I have this sample: I expect arg3 to be colored green as arg1, arg2 and FunCall with my current setting: syn match pyFun "xxxx" contains=xxx syn region pyFunCall start="(" end=")" contained contains=...
1
vote
1answer
2k views

Vim in terminal is black-&-white but vim launched from dash shows colors

I am using Vim 7 on Ubuntu 16.04 (gnome) and the terminal emulator I am using is terminator. I really like the aristocrat/brogrammer colorscheme for Python and so I copy-pasted it in ~/.vim/colors/...
1
vote
1answer
98 views

Weird highlight behavior: Can't match pythonBuiltin

python builtin function like print, len, sum... i can match and highlight other function and its argument. but with builtin function i can't change color. my setup: syn keyword pythonStatement def ...
0
votes
1answer
423 views

how to get the color theme right with vi on java

I'm currently using zenburn on android studio (java) and it looks very colorful (note: I'm using iTerm2.. not sure if that changes anything) but if I add zenburn color to my vimrc, the same file ...
2
votes
1answer
957 views

How can I highlight variable/arguments inside method/function in Python files?

An expansion of this question: How can I highlight all function names in Python files? i have a sample: src_file = replacement_file.replace(header_dir, source_dir) here i need to match variable/...
5
votes
1answer
2k views

How can I highlight all function names in Python files?

I try to make python.vim color similar to material theme (sublime text 3), see pictures: https://imgur.com/a/wOgH7 expected is material theme and current is mine. You may noticed that all method, ...