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
4
votes
1answer
497 views

Highlighting Date in Vim

I have a file that has dates in this format: Fri Jun 05, 2015. It's essentially a diary. I have created the syntax keywords Day, Month, dateNum, and Year for the various components of the date but I ...
5
votes
1answer
606 views

Highlight double space in markdown

When writing markdown, a double space at the end of a line indicates a line break. Currently, neither single trailing whitespaces nor double-whitespaces are being highlighted. Is it possible to have ...
5
votes
4answers
5k views

Colorizing plain text

I love vim, i use it all the time for write codes, but now I want to write some personal notes. I'm trying vim-pandoc (with vim-pandoc-syntax) and it's nice to have 'rich text' features like titles, ...
11
votes
3answers
4k views

Vim slows down over time with syntax on

Is there anything I can do to keep syntax on when using Vim? As soon as I open anything substantial it becomes nearly impossible to edit after a while. Every keypress causes a delay. If I turn syntax ...
4
votes
1answer
2k views

Visual Differences between vim on virtualbox Ubuntu guest (through putty) OR gVim on Windows host

Ok, it's a curiosity more than a real question, I apologize in advance for long post: Usually I code with vim on a ubuntu headless, as a virtualbox guest on my stupid windows 7 host; I access linux ...
7
votes
1answer
3k views

Override cursorline background color by syntax highlighting

I've set the background color of the current line to light gray like this: hi CursorLine cterm=NONE ctermbg=253 (Note that my color scheme is black-on-white.) However, this way any background ...
2
votes
1answer
851 views

Syntax highlightning with custom runtime path

A server only has old versions of vim available in the repo, so I compile and run vim from my ~. Starting vim it complains line 2: E484: Can't open file /usr/local/share/vim/syntax/syntax.vim ...
1
vote
0answers
148 views

Vim-SyntaxHighlight: Custom Syntax Highlighting With Vim [closed]

I'm trying to make my own syntax highlighting for vim. I was following the instructions in here (first answer) but I need to set a group for import and pack, and another group for func, lib, group. ...
2
votes
1answer
66 views

Highlight word, depending on its prior use in the file

I try to color a word depending on its prior use. For example I have the following text file a : Type1 b : Type2 And now I will take about a and b So Ideally I would like to define Type1 within the ...
0
votes
1answer
887 views

Override highlight group settings with default values

I am writing a plugin that highlights buffer settings violations. I use matchadd() function. In addition I need to add patterns that are force ignored. In order to achieve that I use priorities in ...
4
votes
2answers
894 views

Highlight XML errors based on this XML file's XML Schema

I have an XML file that must conform to a particular XML Schema: <?xml version="1.0" encoding="UTF-8"?> <myroot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
3
votes
2answers
385 views

Highlight longest common subsequence between two files? line by line

I'm asking about some sort of specialized diff highlighting mode. I need to diff, line by line, files A and B, which look similar to this in vimdiff: A B repo/manipulate_1....
4
votes
2answers
567 views

How to jump to the end of quoted string, considering escaped delimiters

Assuming the following situation $someVar = "Some String with \"escaped\" inner delimiters"; with the cursor somewhere in the double-quote delimited string. What is the quickest way to jump to the ...
13
votes
1answer
15k views

How can I change the colour of the line highlighted with the 'cursorline' option?

I can highlight the current line like this :set cursorline, which underlines the current line. However I would like to highlight the entire line in a lighter color. How can I achieve this look?
5
votes
1answer
309 views

How can I make text formatting ignore concealed characters?

Question Working with text and various markup languages in Vim I have recently experimented with the conceal feature to hide some of the more verbose markup. I switch conceal off when writing and ...
5
votes
2answers
571 views

Entering search pattern with syntax highlighting?

A search pattern used with /, entered on the vim command line, can be very complex. But even for a normal regular expression pattern, syntax highlight of the expression syntax would be helpful. ...
5
votes
2answers
639 views

Vim `cpp` Syntax highlighter prematurely ends macros mid-word

NOTE: This question is a "manual migration" from here: https://superuser.com/q/875751/199803 My Vim syntax highlighter for ft=cpp is prematurely ending some macros mid-line. For example: (The ...
6
votes
2answers
514 views

How to create syntax folding for pascal

I mostly want it to automatically create folds for between a begin and an end, although if there's anything more advanced that would be welcome too. I've looked in the help for the pascal syntax and ...
6
votes
1answer
580 views

Why don't I get syntax highlighting when I open a file in an autocmd?

While trying to devise a solution to How do I make vim look in a set of directories for a file, if it doesn't exist in the current directory?, I have got so far using Python: function LookupFiles ...
13
votes
2answers
982 views

Auto Highlighting identical lines text

I saw a skilled vim ninja do this a while back but I have no idea were to start. A) Is there a way to set up vims background colour so that consecutive lines with identical content get highlighted. ...
5
votes
1answer
676 views

Why I am losing syntax highlighting when folding code within a <script> tag?

I am working with an HTML file and within a <script> tag specifically. I usually fold my code using the marker method. However an annoying behavior sometimes happens with my syntax highlighting ...
1
vote
1answer
989 views

How can I remove the red highlighting of ejs code braces?

I'm pretty new to vim and am working on a node.js project with ejs files. I have syntax highlighting turned on with syntax on in my .vimrc file. I also have an ejs file that contains JavaScript code ...
0
votes
1answer
195 views

Can I replace Vim's syntax highlighting with my own script?

Is there any way to replace Vim's syntax highlighting? For example, I now have this test script to make everything between quotes red: #!/usr/bin/env python import re, sys print(re.sub(r'"(.*?)"', r'...
3
votes
1answer
1k views

How can I get syntax highlighting to support multiline JavaScript strings?

Currently I have JavaScript (.js) files that contain multiline strings. Vim's syntax highlighting does not seem to support these, as seen in the image below: Anything below the first line is not ...
4
votes
1answer
96 views

Custom syntax file for FIX data doesn't work

I tried to create a custom syntax file to read FIX messages. Note: I am certain my custom files are being loaded by Vim. The file format is sequences of NUMBER=VALUE pairs separated by the ...
17
votes
2answers
2k views

Disable syntax highlighting depending on file size and type

I often have to edit various XML files with vim, which vary wildly in size - from configuration files containing a few hunded lines to production data files with sizes up to 2GB. Having syntax ...
8
votes
2answers
254 views

How can I get correct autocompletion for ambiguous file extensions?

I'm editing Prolog files as part of an exploratory project, and some of the files I'm working with have the extension .pl, which is shared by Perl files. Whenever I do work on a Prolog file named [...
10
votes
2answers
421 views

How can I add syntax highlighting to vim as I can do in gedit?

When I write a script in gedit, the commands, comments, variables etc... are given different colors. How do I setup vim to do the same?

1
5 6 7 8
9