海南省交通运输厅关于印发《公路水运建设项目评标...
Tagged with highlight regular-expression
14 questions
1
vote
1
answer
103
views
highlighting: match dot in group
I have several syntax match patterns, that logically belong together.
Currently I match them like this:
syntax match FOO /\v<(foo1|foo2|foo3)>/
What I actually want to match is .foo1, .foo2 and ....
0
votes
0
answers
202
views
Regex multiple lines search, matched, but highlighted only what initially is on screen
Let's say I have the following fantasy code
// a long definition of a structure
struct long_struct {
...
};
There are tons of multiple lines inside such block of code. It cannot be displayed ...
0
votes
1
answer
40
views
How to put sync region start=<this> into a variable?
I have the following code:
com! -nargs=* ShFoldFunctions <args> fold
ShFoldFunctions syn region shFunctionOne start="^\s*[A-Za-z_0-9:,][-a-zA-Z_0-9:]*\s*()\_s*{" end="}&...
2
votes
2
answers
620
views
Is there a way to use matchadd() to highlight multiple lines without highlighting newlines?
Suppose I have this in a text buffer (vim --clean mydoc.txt):
One
Two
Three
Four
I highlight all lines using :call matchadd('ErrorMsg', '.*'), resulting in:
Notice that the newline character on each ...
2
votes
1
answer
205
views
Can you call highlight more than once? Need different colors for different matches
I am working with text files and Goyo. I'd like to highlight two different kinds of notes delimited by brackets (one called "NOTE:" and the other "TODO:") in different colors.
I ...
5
votes
0
answers
201
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 ...
9
votes
2
answers
8k
views
Enable incremental search and highlight while typing a search term?
While I enter a regular expression on the vim command line, I would like to see what matches the partial expression I already wrote.
For example, while writing the command
:%s/regular
all words ...
0
votes
2
answers
1k
views
Highlighting a search capture group
By :set hl, the search result of a / expression is highlighted, for example:
And if one wants to replace one substring distinguished by its surrounding, one can do so elegantly using regex capture ...
1
vote
1
answer
91
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 ...
1
vote
1
answer
100
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
1
answer
243
views
Highlight lines above cursor
I was looking for a way to highlight lines above the cursor line to mark them as done, whatever that means in the context of what I'm doing.
I came up with this match Comment /\_.*\%#.*/ or, in words,...
2
votes
1
answer
1k
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 #.*$ ...
1
vote
2
answers
751
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,...
5
votes
3
answers
1k
views
Run a function once on every paragraph
I'm trying to write a plugin that highlights overused words.
After much effort I managed to write a function (and a command, :Ditto) that will highlight the most used word in the file or in a ...